Tar Path Format Issue

I haven’t noticed the path format when I created tarball, this time the format issue plays as a major blocker.

We use a module tar file to deploy Zen in ICP4D cluster, when I use my customized tar file, I get:

1
2
3
4
5
6
7
8
9
Loading images
/xxx/InstallPackage/modules/./xxx-iisee-zen:1.0.0//images
Loaded Images [==============================================================================] 7m29s (35/35) done
Pushed Images [==============================================================================] 15m17s (35/35) done
Deploying the chart as name xxx-iisee-zen100
Running command: /xxx/InstallPackage/components/dpctl --config /xxx/InstallPackage/components/install.yaml helm rewriteChart -i /xxx/InstallPackage/modules/./xxx-iisee-zen:1.0.0//charts/*.tgz -o /xxx/InstallPackage/modules/./xxx-iisee-zen:1.0.0//charts/updated_xxx-iisee-zen100.tgz
Running command: /xxx/InstallPackage/components/dpctl --config /xxx/InstallPackage/components/install.yaml helm installChart -f /xxx/InstallPackage/components/global.yaml -r zen-xxx-iisee-zen100 -n zen -c /xxx/InstallPackage/modules/./xxx-iisee-zen:1.0.0//charts/updated_xxx-iisee-zen100.tgz
Starting the installation ...
There was a problem installing /xxx/InstallPackage/modules/xxx-iisee-zen:1.0.0/charts/updated_xxx-iisee-zen100.tgz chart. Reason: chart metadata (Chart.yaml) missing

Let’s highlight the command:

1
Running command: /xxx/InstallPackage/components/dpctl --config /xxx/InstallPackage/components/install.yaml helm rewriteChart -i /xxx/InstallPackage/modules/./xxx-iisee-zen:1.0.0//charts/*.tgz -o /xxx/InstallPackage/modules/./xxx-iisee-zen:1.0.0//charts/updated_xxx-iisee-zen100.tgz

Look carefully there is a ./ in path /xxx/InstallPackage/modules/./xxx-iisee-zen:1.0.0/...., this is because I create tarball use:

1
tar cf xxx-iisee-zen-1.0.0.tar ./xxx-iisee-zen:1.0.0

the ./ will be put in the extract path! which is the trouble maker.

Correct way:

1
2
cd <xxx-iisee-zen:1.0.0 parent folder>
tar cf xxx-iisee-zen-1.0.0.tar xxx-iisee-zen:1.0.0

If we list the tarball contents, no prefix in the file structure:

1
2
3
4
5
6
7
8
tar tvf xxx-iisee-zen-1.0.0.tar

drwxr-xr-x 1001/docker 0 1969-12-31 16:00 xxx-iisee-zen:1.0.0/
drwxr-xr-x 1001/docker 0 2019-07-02 15:13 xxx-iisee-zen:1.0.0/charts/
-rw-r--r-- root/root 245868 2019-07-02 15:12 xxx-iisee-zen:1.0.0/charts/xxx-iisee-zen-1.0.1.tgz
-rw------- 1001/docker 4758 1969-12-31 16:00 xxx-iisee-zen:1.0.0/manifest.yaml
drwxr-xr-x 1001/docker 0 1969-12-31 16:00 xxx-iisee-zen:1.0.0/LICENSES/
...

For more information about tar commands, I have a blob about it already <<Tar Command Daily Work Summary>>

0%