relatedImages
entry not populated in generated CSV when using Kustomize patches
#6931
Labels
language/go
Issue is related to a Go operator project
Bug Report
What did you do?
While generating the Operator bundle using
operator-sdk
(v1.35.0) with Kustomize andRELATED_IMAGE_*
environment variables set, I noticed that the generated ClusterServiceVersion (CSV) does not correctly resolve and populate therelatedImages
section unless I hardcode the image value directly in the manifest patch.This behavior breaks the expected design, where:
${RELATED_IMAGE_KUBE_RBAC_PROXY}
.relatedImages
block accordingly in the generatedbundle/manifests/*.clusterserviceversion.yaml
.However, unless the image is hardcoded in the patch file, the
relatedImages
array in the CSV is either missing or incomplete. This makes the usage of environment-variable-driven workflows brittle and defeats the purpose of using Kustomize + envs for reproducible builds.Reproduction Steps:
Define a patch with
${RELATED_IMAGE_KUBE_RBAC_PROXY}
in your Kustomize overlay (manager_auth_proxy_patch.yaml
).Set the env var before running:
export RELATED_IMAGE_KUBE_RBAC_PROXY=gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
Run:
Check the generated CSV under
bundle/manifests/*.clusterserviceversion.yaml
.Additional context:
The CSV does correctly reference the env var inside the
env
array (e.g.,value: ${RELATED_IMAGE_KUBE_RBAC_PROXY}
), but theimage
field itself does not seem to get substituted during CSV generation forrelatedImages
.What did you expect to see?
The
relatedImages
section should include:What did you see instead? Under which circumstances?
relatedImages
is either empty or not populated unless the image is hardcoded. So if I have:The
spec.relatedImages
field will have something like:How can we use variable substitution in this scenario?
Environment
v1.35.0
operator-sdk generate kustomize manifests
${RELATED_IMAGE_KUBE_RBAC_PROXY}
inside patch YAMLOperator type:
/language go
Kubernetes cluster type:
OpenShift
$ operator-sdk version
operator-sdk version: "v1.35.0", commit: "e95abdbd5ccb7ca0fd586e0c6f578e491b0a025b", kubernetes version: "1.28.0", go version: "go1.21.11", GOOS: "darwin", GOARCH: "arm64"
$ go version
(if language is Go)$ kubectl version
Possible Solution
Additional context
The text was updated successfully, but these errors were encountered: