Conversation
…here-syncer Versions of CSI sidecars are now discovered from oss.yaml directly: for every entry that declares versions[].condition.k8s, .werf/images.yaml builds a per-id <k8s>-> <component_version> map and exposes them as $.k8sVersions. Per-image werf.inc.yaml templates iterate (index $.k8sVersions $.ImageName) without any need for a hand-maintained registry of components in .werf/. Adding a new sidecar now requires only an images/<id>/ folder and a matching oss.yaml entry; no changes to .werf/ are needed. snapshot-controller switched from the literal "snapshot-controller" id to $.ImageName as well, in line with the same convention. csi-vsphere-syncer is removed: its build path was already dead code (no matching oss.yaml entry, no $components mapping, so $value.csi.vsphere was always nil and the image was never produced). Side effect: $.SVACE_ENABLED is now correctly resolved from the root context inside the sidecar werf.inc.yaml templates. Previously, .SVACE_ENABLED inside range $key, $value := .k8s silently looked up the field on the iteration value (a map without that key) and always returned nil, so the conditional unconditionally picked builder/golang-alt-svace + apt-get even when SVACE_ENABLED=false. With $.SVACE_ENABLED, default builds correctly use builder/golang-alpine + apk, and SVACE-enabled builds keep using builder/golang-alt-svace + apt-get as intended.
krpsh123
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refactor the build to make
.werf/fully agnostic of the OSS components list..werf/images.yamlno longer hard-codes a$componentsmapping. It scansoss.yamlfor every entry that declaresversions[].condition.k8s, builds a per-id map<k8s_version> -> <component_version>via theget_oss_version_map_by_id_and_condition_keyhelper from.werf/defines/oss-yaml.tmpl, and exposes the result as$.k8sVersions["<id>"].werf.inc.yaml(csi-external-attacher,csi-external-provisioner,csi-external-resizer,csi-external-snapshotter,csi-livenessprobe,csi-node-driver-registrar) now iteratesindex $.k8sVersions $.ImageNameinstead ofrange .k8s+if $value.csi.<short>. The convention is: image folder name ==idinoss.yaml.snapshot-controller/werf.inc.yamlswitched from the literal id"snapshot-controller"to$.ImageNamefor the same reason.images/csi-vsphere-syncer/is removed entirely. Its build path was already dead code onmain:oss.yamlhas nocsi-vsphere*entry and.werf/images.yamldid not listvspherein$components, so$value.csi.vspherewas alwaysniland the image was never produced.Net diff:
+98 / -1166(mostly the dropped vsphere-syncer patch).Side effect (latent bug fix):
$.SVACE_ENABLEDis now correctly resolved from the root context inside sidecar templates. Previously.SVACE_ENABLEDinsiderange $key, $value := .k8slooked up the field on the iteration value (a map without that key), silently returnednil, and the conditionaleq .SVACE_ENABLED "false"always evaluated tofalseonmain. As a result, every sidecar artifact was unconditionally built withbuilder/golang-alt-svace+apt-get, even whenSVACE_ENABLED=false. With$.SVACE_ENABLED, default builds correctly pickbuilder/golang-alpine+apk add, and SVACE-enabled builds keepbuilder/golang-alt-svace+apt-getas originally intended.Why do we need it, and what problem does it solve?
images/<id>/werf.inc.yaml, a new entry inoss.yaml, and a new line in the$componentslist in.werf/images.yaml. The third step is a pure boilerplate / source of drift, and is what allowedcsi-vsphere-syncerto silently rot onmain(image folder existed, nooss.yamlentry, no$componentsline, no error -- just a missing build).oss.yaml. Drop a folder underimages/<id>/, add anoss.yamlentry withversions[].condition.k8s, done. If the folder name does not match anoss.yamlid, the helper now fails loudly during render rather than producing a no-op build.oss.yamlvia the standard helpers, with no parallel registry maintained by hand.SVACE_ENABLEDenv var as it was originally written.What is the expected result?
werf config render(werf v2, as installed bywerf/actions/install@v2in CI) renders successfully and the resulting build graph is identical tomain's for the seven kept images, except for:csi-vsphere-syncerblock;SVACE_ENABLED=falsebuilds:fromImage: builder/golang-alpine(wasbuilder/golang-alt-svace) andapk addinstead ofapt-get install-- this is the SVACE conditional finally working as designed;.werf/images.yaml.images/<id>/+ anoss.yamlentry;.werf/does not need to be touched.oss.yaml(or vice-versa) now surfaces as a render-time error from the helper rather than as a silent dead build.Checklist