Skip to content

Commit eec4098

Browse files
committed
fix(tests): keep two unit tests green after the release image restamp
The release build rewrites packages/*/values.yaml: the kube-ovn image tag becomes the Cozystack version (v1.7.0-rc.3, v1.7.0) and the traces collector becomes the first-party otelcol-tracing build. Two unit tests read exactly those fields, so every PR against release-1.7 has failed Unit & controller tests since the first rc: - hack/cni-plugins-staging-contract.bats compared the multus marker with the values.yaml tag. It now reads appVersion from the vendored kube-ovn chart, which is what packages/system/kubeovn/Makefile builds from and what a release build leaves alone. - vtraces_collector_test.yaml accepted only the upstream collector image name. The assertion is about the digest pin; it now accepts the first-party image name too. main is unaffected until its own release line is cut; the same patch applies there. Assisted-by: LLM Signed-off-by: Marian Koreniuk <[email protected]> (cherry picked from commit 5d70c35)
1 parent d32092a commit eec4098

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

‎hack/cni-plugins-staging-contract.bats‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ extract_has() {
2222
}
2323

2424
DOCKERFILE="$PWD/packages/system/multus/images/multus-cni/Dockerfile"
25-
KUBEOVN_VALUES="$PWD/packages/system/kubeovn/values.yaml"
25+
# The chart's appVersion, not the values.yaml image tag: a release build
26+
# restamps that tag to the Cozystack version (v1.7.0), the chart keeps the
27+
# kube-ovn release it vendors.
28+
KUBEOVN_CHART="$PWD/packages/system/kubeovn/charts/kube-ovn/Chart.yaml"
2629
DOC="$PWD/packages/system/multus/README.md"
2730
PLATFORM_VALUES="$PWD/packages/core/platform/values.yaml"
2831
TEMPLATE="$PWD/packages/system/multus/templates/multus-daemonset-thick.yml"
@@ -347,13 +350,12 @@ PATCHFILE="$PWD/packages/system/multus/patches/customize-deployment.patch"
347350
checked=$(sed -n 's|^# kube-ovn-cni-plugins-checked-against: *\([^ ]*\) *$|\1|p' "$DOCKERFILE")
348351
[ -n "$checked" ]
349352

350-
vendored=$(yq -r '.global.images.kubeovn.tag' "$KUBEOVN_VALUES" | sed 's|@.*||')
351-
[ -n "$vendored" ]
352-
[ "$vendored" != "null" ]
353+
vendored=$(awk '$1 == "appVersion:" {gsub(/"/, "", $2); print "v" $2}' "$KUBEOVN_CHART")
354+
[ "$vendored" != "v" ]
353355

354356
if [ "$checked" != "$vendored" ]; then
355357
echo "the multus CNI plugin pin was checked against kube-ovn $checked," >&2
356-
echo "but packages/system/kubeovn/values.yaml now vendors $vendored." >&2
358+
echo "but packages/system/kubeovn/charts/kube-ovn/Chart.yaml now vendors $vendored." >&2
357359
echo >&2
358360
echo "Read CNI_PLUGINS_VERSION in kube-ovn $vendored's base image" >&2
359361
echo "(dist/images/Dockerfile.base). If it still matches the" >&2

‎packages/system/monitoring/tests/vtraces_collector_test.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,4 +480,5 @@ tests:
480480
asserts:
481481
- matchRegex:
482482
path: spec.template.spec.containers[0].image
483-
pattern: "opentelemetry-collector-contrib:.*@sha256:"
483+
# A release build swaps the upstream image for the first-party otelcol-tracing one.
484+
pattern: "(opentelemetry-collector-contrib|otelcol-tracing):.*@sha256:"

0 commit comments

Comments
 (0)