Add ignore-already-exists flag to ignore chartmuseum's "already exists" error
Fixes #90
This PR adds the --ignore-already-exists to make helm-push ignore the chartmuseum's "already exists" error
Without the flag:
$ helm push mychart/ chartmuseum
Pushing mychart-0.1.0.tgz to chartmuseum...
Error: 409: mychart-0.1.0.tgz already exists
Usage:
helm push [flags]
[...]
With the flag:
$ helm push mychart/ chartmuseum --ignore-already-exists
Pushing mychart-0.1.0.tgz to chartmuseum...
Got the following error: 409: mychart-0.1.0.tgz already exists
Skipping.
I had an alternate idea (or extra step) too for this - instead of uploading the chart and letting server throw the error, first use HEAD request and get chart digest. This feature is not present in the server now. But after we get the digest, we can check the digest of the locally present chart and then if it's the same, mention that it's the same and not push it. But if it's not, we can push it with the client config (force etc) and let the server take care of it based on the config in the server (overwrite allowed etc).
Difference between the current implementation and the alternative is
- We have an extra step in this case. So, maybe not exactly an alternative, more like an extra step I guess
- We reduce network usage - uploading the chart, in case it's the exact same chart present in the server. But yeah, the network usage won't be that high, given it's all text content inside a tar ball. But still, this is one advantage
- One disadvantage is, we do an extra step / processing of calculating digest, instead of letting the server do all the work of checking if the chart already exists (no matter the content)
any plans on merging this?
Hi, can you guys merge this :smiley: We are so eager to use this feature because we are currently using bash scripts to avoid these errors.
@alexandrevilain appreciate if this can be merged.
Hello,
Eager to have this feature too, anyone can look at it with some luck? @alexandrevilain @pcperera
Or maybe @chathumal-nad can you share your workaround?
Thank you in advance.