Skip to content

Commit 6c309bf

Browse files
committed
pkg/operator/status: Block ClusterVersion updates until multi-arch transitions complete
By setting a new 'operator-image' entry in the ClusterOperator status.versions manifest, so the cluster-version operator will wait for the in-cluster status to have both [1]: * The 'operator' value we already declare, so the CVO waits for us to hit the target version. * The 'operator-image' value I'm adding in this commit, to help distinguish between single-arch and multi-arch targets which share the same version string (but have unique release and MCO pullspecs). Without this change, the CVO immediately thinks the MCO has completed its update ("'operator' matches 4.13.0, and that's all I've been asked to match!") while the MCO is still working to pivot to the new, multi-arch component. Folks who try to take advantage of the new multi-arch functionality at this point might be surprised to have ClusterVersion claiming the update to multi-arch is complete, even though the MCO is still only part way through that transition, and has not yet positioned itself to point at the multi-arch RHCOS image when new Machines try to come up [2]. [1]: https://github.com/openshift/cluster-version-operator/blob/e546515213c8681ca44c52f178401cd47ad07d11/pkg/cvo/internal/operatorstatus.go#L174-L176 [2]: https://issues.redhat.com/browse/OCPBUGS-10300
1 parent adb91c6 commit 6c309bf

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

cmd/machine-config-operator/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var (
2222
func init() {
2323
rootCmd.PersistentFlags().AddGoFlagSet(flag.CommandLine)
2424
rootCmd.PersistentFlags().StringVar(&version.ReleaseVersion, "payload-version", version.ReleaseVersion, "Version of the openshift release")
25+
rootCmd.PersistentFlags().StringVar(&version.OperatorImage, "operator-image", version.OperatorImage, "Image pullspec for the current machine-config operator")
2526
}
2627

2728
func main() {

install/0000_80_machine-config_04_deployment.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ spec:
3131
- "start"
3232
- "--images-json=/etc/mco/images/images.json"
3333
- "--payload-version=0.0.1-snapshot"
34+
- "--operator-image=placeholder.url.oc.will.replace.this.org/placeholdernamespace:machine-config-operator"
3435
resources:
3536
requests:
3637
cpu: 20m

install/0000_80_machine-config_06_clusteroperator.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ status:
1111
versions:
1212
- name: operator
1313
version: "0.0.1-snapshot"
14+
- name: operator-image
15+
version: placeholder.url.oc.will.replace.this.org/placeholdernamespace:machine-config-operator
1416
relatedObjects:
1517
- group: ""
1618
name: openshift-machine-config-operator

pkg/operator/operator.go

+1
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ func New(
314314
optr.apiserverListerSynced = apiserverInformer.Informer().HasSynced
315315

316316
optr.vStore.Set("operator", version.ReleaseVersion)
317+
optr.vStore.Set("operator-image", version.OperatorImage)
317318

318319
return optr
319320
}

pkg/version/version.go

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ var (
1414
// This will be injected by the payload build process.
1515
ReleaseVersion = "0.0.1-snapshot"
1616

17+
// OperatorImage is the image pullspec for the current machine-config operator.
18+
// This will be injected by the payload build process.
19+
OperatorImage = "placeholder.url.oc.will.replace.this.org/placeholdernamespace:was-not-built-properly"
20+
1721
// Raw is the string representation of the version. This will be replaced
1822
// with the calculated version at build time.
1923
Raw = "v0.0.0-was-not-built-properly"

0 commit comments

Comments
 (0)