cloud-ark / kubeplus

Kubernetes Operator for multi-instance multi-tenancy
https://cloudark.io/
Apache License 2.0
662 stars 82 forks source link

Cleanup previous chart #1197

Closed devdattakulkarni closed 11 months ago

devdattakulkarni commented 11 months ago

Currently in helmer and kubeconfiggenerator, a Service's chart is untarred with a command like so: Inside untarChart.untar cmd:tar -xvzf wordpress-chart-0.0.1.tgz

This creates the chart in a folder named "wordpress-chart". The problem is, that if there is already a folder with that name, then the above operation will not overwrite that folder. Instead, the contents of the earlier folder will remain in-tact and the newly untarred folder contents will be added to it. This is problematic.

A better approach will be to untar each service's chart in a folder with that service name. The change would look like this: mkdir <service-name> && tar -xvzf wordpress-chart-0.0.1.tgz -C <service-name>

The subsequent steps in which we are using the chart-name in helm install will need to change to instead use the service-name used above in the helm install command.

devdattakulkarni commented 11 months ago

Another option is to keep the current implementation as it is and include "rm -rf " as a step before executing the tar command. This will ensure that when the tar command is executed a new folder with the chart name will get created.