charts-syncer icon indicating copy to clipboard operation
charts-syncer copied to clipboard

How to disable container sync

Open antonincms opened this issue 1 year ago • 6 comments

I have a project where I am syncing helm charts from bitnami to our own registry for policy purposes.

Since v2, it seems that if the chart has image annotations chart syncer automatically sync the containers (annotation that the bitnami charts have) and the field relocateContainerImages at the root of the config disappeared. I also tried setting containerPlatforms to [] without success.

Is there a way to disable container syncing ?

antonincms avatar May 28 '24 16:05 antonincms

Hi,

Charts syncer v2 uses Helm distribution plugin https://github.com/vmware-labs/distribution-tooling-for-helm. You can use helm dt for relocating the helm charts and not pushing the images.

$ helm pull oci://docker.io/bitnamicharts/wordpress
$ tar -xzf wordpress-22.4.0.tgz && cd wordpress
$ helm dt charts relocate .  <your-registry-and-location-path>

You can check all the Chart.yaml and values.yaml from the chart and subcharts have been modified properly. Then you can package & push the Helm chart to your registry.

I hope it helps.

beltran-rubo avatar May 28 '24 17:05 beltran-rubo

Oh, I looked a bit into chart-syncer and dt and got that.

From what I read about the relocate command, it does the relocation in the values, which is not what I need, we don't use either the image relocation or the image sync (and ideally I would like to disable both) so sadly no that does not helps, but thanks !

A workaround I though I could use would be to customize the AnnotationsKey, but that is not available from chart-syncer. Could chart-syncer use helm pull / push instead of wrap/unwrap if that old field was false ?

antonincms avatar May 28 '24 23:05 antonincms

I have the same question is it possible disable container sync?

arturzielinskicard avatar Jun 28 '24 17:06 arturzielinskicard

I actually have a custom patch that adds two options, one to not update the values file and another to not sync the images. I was getting ready to merge it with the latest version and create a PR.

gregsidelinger avatar Jul 01 '24 17:07 gregsidelinger

@gregsidelinger When the PR will be ready?

arturzielinskicard avatar Jul 03 '24 05:07 arturzielinskicard

@gregsidelinger When the PR will be ready?

My initial patch was for v1 as I wrote it last year and never got around to opening a PR. So I had to start over. I opened up PR https://github.com/vmware-labs/distribution-tooling-for-helm/pull/76 to add options to distribution-tooling-for-helm since that is where all that magic looks to happen now. Assuming that gets merged it will be pretty quick to make a PR for chart-syncer to use the new options.

gregsidelinger avatar Jul 07 '24 19:07 gregsidelinger

Closing this as #218 fixed my issue.

antonincms avatar Apr 14 '25 09:04 antonincms