Environment
- Camel K version:
2.11.0-nightly (pkg/util/defaults/defaults.go)
This is a question to confirm intended behavior before anything is changed. It concerns how the operator resolves its own image in the v2.11.0-nightly codebase.
Summary
The operator resolves its own image purely from the CONTAINER_IMAGE env var:
pkg/cmd/operator/operator.go:273-274 — getOperatorImage() → os.Getenv("CONTAINER_IMAGE")
pkg/cmd/operator/operator.go:159 — platform.OperatorImage = getOperatorImage()
That value is populated only by a Kustomize replacements block that copies the Deployment's image: field into the env var:
install/base/config/manager/operator-deployment.yaml:81-82 ships CONTAINER_IMAGE: "" (placeholder)
install/base/config/manager/kustomization.yaml:32-40 copies spec…containers[camel-k-operator].image → env[CONTAINER_IMAGE].value
The concern: the Helm chart never sets CONTAINER_IMAGE (helm/camel-k/templates/operator-deployment.yaml declares WATCH_NAMESPACE, LOG_LEVEL, OPERATOR_NAME, REGISTRY_ADDRESS, POD_NAME, NAMESPACE, OPERATOR_ID — no CONTAINER_IMAGE). Any install that doesn't run the Kustomize replacements step (Helm, or applying the base manifest directly) leaves platform.OperatorImage == "".
That value flows into the builder pod image with no fallback:
pkg/controller/integration/build.go:128 and pkg/controller/integrationkit/build.go:153 — buildConfig.ToolImage = platform.OperatorImage
pkg/controller/build/build_pod.go:207 — Image: build.BuilderConfiguration().ToolImage
So with the pod build strategy and an empty CONTAINER_IMAGE, the builder pod is created with an empty container image. (The routine strategy is unaffected since it builds in-process.)
Questions
- Is relying solely on the injected
CONTAINER_IMAGE env var intended, given the Helm chart does not set it in v2.11.0-nightly?
- Should the operator fall back to resolving its own image from its Pod spec (it already has
POD_NAME / NAMESPACE) when CONTAINER_IMAGE is empty, and/or should the Helm chart set CONTAINER_IMAGE?
Environment
2.11.0-nightly(pkg/util/defaults/defaults.go)This is a question to confirm intended behavior before anything is changed. It concerns how the operator resolves its own image in the v2.11.0-nightly codebase.
Summary
The operator resolves its own image purely from the
CONTAINER_IMAGEenv var:pkg/cmd/operator/operator.go:273-274—getOperatorImage()→os.Getenv("CONTAINER_IMAGE")pkg/cmd/operator/operator.go:159—platform.OperatorImage = getOperatorImage()That value is populated only by a Kustomize
replacementsblock that copies the Deployment'simage:field into the env var:install/base/config/manager/operator-deployment.yaml:81-82shipsCONTAINER_IMAGE: ""(placeholder)install/base/config/manager/kustomization.yaml:32-40copiesspec…containers[camel-k-operator].image→env[CONTAINER_IMAGE].valueThe concern: the Helm chart never sets
CONTAINER_IMAGE(helm/camel-k/templates/operator-deployment.yamldeclaresWATCH_NAMESPACE,LOG_LEVEL,OPERATOR_NAME,REGISTRY_ADDRESS,POD_NAME,NAMESPACE,OPERATOR_ID— noCONTAINER_IMAGE). Any install that doesn't run the Kustomizereplacementsstep (Helm, or applying the base manifest directly) leavesplatform.OperatorImage == "".That value flows into the builder pod image with no fallback:
pkg/controller/integration/build.go:128andpkg/controller/integrationkit/build.go:153—buildConfig.ToolImage = platform.OperatorImagepkg/controller/build/build_pod.go:207—Image: build.BuilderConfiguration().ToolImageSo with the
podbuild strategy and an emptyCONTAINER_IMAGE, the builder pod is created with an empty container image. (Theroutinestrategy is unaffected since it builds in-process.)Questions
CONTAINER_IMAGEenv var intended, given the Helm chart does not set it in v2.11.0-nightly?POD_NAME/NAMESPACE) whenCONTAINER_IMAGEis empty, and/or should the Helm chart setCONTAINER_IMAGE?