Skip to content

Commit 7da4dde

Browse files
fix(nvca-operator): default image tag to chart version (#1190)
Signed-off-by: Kristina Pathak <kpathak@nvidia.com> Co-authored-by: vrv3814 <vemireddyv@nvidia.com>
1 parent 78c5e10 commit 7da4dde

5 files changed

Lines changed: 70 additions & 4 deletions

File tree

ai-tooling/dev/skills/nvca-values-customization/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The vendoring script already applies defaults such as:
4545

4646
- `ngcConfig.clusterSource = "self-managed"`
4747
- `ngcConfig.serviceKey = "dummy-api-key"`
48-
- `image.tag = "$NVCA_OPERATOR_VERSION"`
48+
- `image.tag` remains empty so templates use the published chart version
4949
- `selfManaged.nvcaVersion = "$NVCA_VERSION"`
5050
- `generateImagePullSecret = false`
5151
- `selfManaged.sharedStorage.imageTag = "$NVCA_SHARED_STORAGE_IMAGE_TAG"`

deploy/helm/nvca-operator/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ OCI_REGISTRY_NAMESPACE ?= <your-org>
4444
CHART_NAME := $(shell yq -r .name $(helm_dir)/Chart.yaml)
4545
CHART_VERSION := $(shell yq -r .version $(helm_dir)/Chart.yaml)
4646

47-
.PHONY: install uninstall status lint template validate clean package push-oci sync-chart check-synced-chart render-values-from-stack install-from-stack test-render-values test-build-release-assets test-release-image-manifest test-release-artifact-permissions test-package-release-assets test-attach-release-assets test-release-sbom-wrapper test-self-managed-nvca-image-reference test-image-pull-secret-defaults test-pod-disruption-budget
47+
.PHONY: install uninstall status lint template validate clean package push-oci sync-chart check-synced-chart render-values-from-stack install-from-stack test-render-values test-vendor-chart-image-tag test-build-release-assets test-release-image-manifest test-release-artifact-permissions test-package-release-assets test-attach-release-assets test-release-sbom-wrapper test-self-managed-nvca-image-reference test-image-pull-secret-defaults test-pod-disruption-budget
4848

4949
install:
5050
ifndef values
@@ -92,6 +92,9 @@ install-from-stack: render-values-from-stack
9292
test-render-values:
9393
@bash ./tests/render_values_from_stack_env_test.sh
9494

95+
test-vendor-chart-image-tag:
96+
@bash ./tests/vendor_chart_image_tag_test.sh
97+
9598
test-build-release-assets:
9699
@bash ./tests/build_release_assets_test.sh
97100

deploy/helm/nvca-operator/nvca-operator/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
## @param image.pullPolicy K8s ImagePullPolicy
2020
image:
2121
repository: ""
22-
tag: "3.0.4"
22+
tag: ""
2323
pullPolicy: IfNotPresent
2424
## @param nvcaImage.repositoryOverride (Optional) Full NVCA container registry path, without tag. Only set this if the default needs to be overridden, for example "stg.nvcr.io/nvidia/nvcf-byoc/nvca". The tag is set in the cluster config
2525
## @param nvcaImage.pullPolicy K8s ImagePullPolicy

deploy/helm/nvca-operator/scripts/ci_vendor_nvca_operator_chart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ main() {
207207
update_yaml_key ".agent.functionEnvOverrides.BYOO_OTEL_COLLECTOR_CONTAINER = \"${byoo_otel_collector_image}\"" "${TARGET_DIR}/values.yaml"
208208
update_yaml_key ".agent.taskEnvOverrides.BYOO_OTEL_COLLECTOR_CONTAINER = \"${byoo_otel_collector_image}\"" "${TARGET_DIR}/values.yaml"
209209
fi
210-
update_yaml_key ".image.tag = \"${NVCA_OPERATOR_VERSION:?"NVCA_OPERATOR_VERSION is not set"}\"" "${TARGET_DIR}/values.yaml"
210+
# Keep the source chart's empty tag so the templates fall back to the
211+
# published chart version. A literal default is retained by Helm
212+
# --reuse-values upgrades and pins the operator to an older image.
211213
update_yaml_key ".selfManaged.nvcaVersion = \"${NVCA_VERSION:?"NVCA_VERSION is not set"}\"" "${TARGET_DIR}/values.yaml"
212214
update_yaml_key ".selfManaged.icmsServiceURL = \"http://icms.example.invalid:8080\"" "${TARGET_DIR}/values.yaml"
213215
update_yaml_key ".selfManaged.revalServiceURL = \"http://reval.example.invalid:8080\"" "${TARGET_DIR}/values.yaml"
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env bash
2+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -euo pipefail
18+
19+
repo_root="$(cd "$(dirname "$0")/.." && pwd)"
20+
workspace_root="$(cd "${repo_root}/../../.." && pwd)"
21+
tmp_dir="$(mktemp -d)"
22+
fixture_root="${tmp_dir}/fixture"
23+
24+
cleanup() {
25+
rm -rf "${tmp_dir}"
26+
}
27+
trap cleanup EXIT
28+
29+
mkdir -p "${fixture_root}/deploy/helm"
30+
cp -R "${repo_root}" "${fixture_root}/deploy/helm/nvca-operator"
31+
mkdir -p "${fixture_root}/src/compute-plane-services/nvca/deployments"
32+
cp -R "${workspace_root}/src/compute-plane-services/nvca/deployments/nvca-operator" \
33+
"${fixture_root}/src/compute-plane-services/nvca/deployments/nvca-operator"
34+
35+
chart_root="${fixture_root}/deploy/helm/nvca-operator"
36+
NVCA_OPERATOR_VERSION="3.2.11" \
37+
NVCA_VERSION="3.2.11" \
38+
NVCA_SHARED_STORAGE_IMAGE_TAG="1.0.5" \
39+
"${chart_root}/scripts/ci_vendor_nvca_operator_chart" >/dev/null
40+
41+
actual_tag="$(yq -r '.image.tag' "${chart_root}/nvca-operator/values.yaml")"
42+
if [[ -n "${actual_tag}" ]]; then
43+
echo "expected vendored image.tag to remain empty, got ${actual_tag}" >&2
44+
exit 1
45+
fi
46+
47+
yq eval -i '.version = "3.2.11"' "${chart_root}/nvca-operator/Chart.yaml"
48+
manifest="${tmp_dir}/manifest.yaml"
49+
helm template nvca-operator "${chart_root}/nvca-operator" \
50+
--set-string image.repository=registry.example.test/nvca-operator \
51+
--set-string selfManaged.icmsServiceURL=http://icms.example.invalid:8080 \
52+
--set-string selfManaged.revalServiceURL=http://reval.example.invalid:8080 \
53+
--set-string selfManaged.natsURL=nats://nats.example.invalid:4222 \
54+
> "${manifest}"
55+
56+
if ! grep -Fq 'image: registry.example.test/nvca-operator:3.2.11' "${manifest}"; then
57+
echo "expected image.tag to fall back to the chart version" >&2
58+
exit 1
59+
fi
60+
61+
echo "vendor_chart_image_tag_test.sh keeps image.tag empty for chart-version fallback"

0 commit comments

Comments
 (0)