Skip to content

Commit d462f36

Browse files
committed
[update] Skip customContainerImages webhook validation in CI
Starting with openstack-operator FR4 (openstack-k8s-operators/openstack-operator#1569, merged Oct 2025), the `OpenStackVersion` admission webhook rejects `targetVersion` changes when `spec.customContainerImages` are identical to those tracked for the previously deployed version. In CI, the greenfield deployment and the simulated version bump share the same delorean hash, so `customContainerImages` are legitimately identical across versions -- there are no new container builds to reference. Retagging is a no-op. Add the operator-provided `skip-custom-images-validation` annotation before patching `targetVersion` in both update scripts. This annotation is the intended escape hatch for automation where the images are intentionally unchanged (see `ValidateUpdate` in `openstackversion_webhook.go`). The intermediate `openstackversionpatch.yaml` file is no longer generated; the patch is passed inline instead. Assisted-by: Cursor (claude-4.6-opus-high) Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
1 parent bc37770 commit d462f36

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

scripts/openstack-update-services.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,17 @@ oc wait $OPENSTACK_VERSION_CR --for=jsonpath='{.status.availableVersion}'=$OPENS
6262

6363
OPENSTACK_DEPLOYED_VERSION=$(oc get $OPENSTACK_VERSION_CR --template={{.status.deployedVersion}})
6464

65-
cat <<EOF >openstackversionpatch.yaml
66-
"spec": {
67-
"targetVersion": "$OPENSTACK_VERSION"
68-
}
69-
EOF
70-
7165
update_event Patching the Openstack Version
7266

73-
oc patch $OPENSTACK_VERSION_CR --type=merge --patch-file openstackversionpatch.yaml
67+
# In CI the same container images are used for both the initial deployment and
68+
# the simulated version bump, so customContainerImages are identical across
69+
# versions. The admission webhook (FR4+, upstream PR #1569) rejects
70+
# targetVersion changes in that case. The operator provides this annotation
71+
# to skip the check when the images are intentionally unchanged.
72+
oc annotate $OPENSTACK_VERSION_CR \
73+
core.openstack.org/skip-custom-images-validation="" --overwrite
74+
75+
oc patch $OPENSTACK_VERSION_CR --type=merge -p '{"spec":{"targetVersion":"'"$OPENSTACK_VERSION"'"}}'
7476

7577
# wait for ovn update on control plane
7678
oc wait $OPENSTACK_VERSION_CR --for=condition=MinorUpdateOVNControlplane --timeout=$TIMEOUT

scripts/openstack-update.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,17 @@ oc wait $OPENSTACK_VERSION_CR --for=jsonpath='{.status.availableVersion}'=$OPENS
7474

7575
OPENSTACK_DEPLOYED_VERSION=$(oc get $OPENSTACK_VERSION_CR --template={{.spec.targetVersion}})
7676

77-
cat <<EOF >openstackversionpatch.yaml
78-
"spec": {
79-
"targetVersion": "$OPENSTACK_VERSION"
80-
}
81-
EOF
82-
8377
update_event Patching the Openstack Version
8478

85-
oc patch $OPENSTACK_VERSION_CR --type=merge --patch-file openstackversionpatch.yaml
79+
# In CI the same container images are used for both the initial deployment and
80+
# the simulated version bump, so customContainerImages are identical across
81+
# versions. The admission webhook (FR4+, upstream PR #1569) rejects
82+
# targetVersion changes in that case. The operator provides this annotation
83+
# to skip the check when the images are intentionally unchanged.
84+
oc annotate $OPENSTACK_VERSION_CR \
85+
core.openstack.org/skip-custom-images-validation="" --overwrite
86+
87+
oc patch $OPENSTACK_VERSION_CR --type=merge -p '{"spec":{"targetVersion":"'"$OPENSTACK_VERSION"'"}}'
8688

8789
# wait for ovn update on control plane
8890
oc wait $OPENSTACK_VERSION_CR --for=condition=MinorUpdateOVNControlplane --timeout=$TIMEOUT

0 commit comments

Comments
 (0)