zarf-dev / zarf

DevSecOps for Air Gap & Limited-Connection Systems. https://zarf.dev/
Apache License 2.0
1.34k stars 163 forks source link

`dev deploy` with `###ZARF_REGISTRY###` values in helm chart #2713

Open mjnagel opened 2 months ago

mjnagel commented 2 months ago

Is your feature request related to a problem? Please describe.

zarf dev deploy is useful for fast developer iterations on a package, leveraging "yolo" mode. However if a package uses the ###ZARF_REGISTRY### variable in its helm chart values a dev deploy will result in errors on the image name. While this is not often used, it is occasionally beneficial in some packages and probably should be supported in dev deploy.

Describe the solution you'd like

When I dev deploy a package Zarf should check the values files for ###ZARF_REGISTRY###. If present that should be modified to the registry for a matching image from the zarf.yaml list of images. This is the most "magical" solution.

Describe alternatives you've considered

  1. Zarf could provide a CLI flag to set a specific registry to swap for ###ZARF_REGISTRY### at dev deploy time. This would generally work well, but would not support the case of multiple ###ZARF_REGISTRY### usages tied to different registries.
  2. Zarf could provide a separate field in the zarf.yaml schema for "devDeployValues" that would override other values files. This would cover all cases, but put more responsibility on the end user to handle the dev deploy scenario.
  3. Zarf could provide CLI flag(s) and/or prompt the end user to fill in the image registry for each instance of ###ZARF_REGISTRY### identified in values.

Additional context

This is not a common scenario, but in uds-core we use the ###ZARF_REGISTRY### var to ensure that Istio proxy images are available in some edge cases.

AustinAbro321 commented 2 months ago

I think this is reasonable to do, and we do something similar with zarf dev find-images --registry-url flag