From 45e43314f05a34d106d6eb8fdb678ba67b02aee0 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Wed, 8 Jan 2020 15:00:25 +0100 Subject: [PATCH 1/2] pkg/operator: version the osImageURL CM This patch also guards against unversioned osImageURL config maps in the future. Signed-off-by: Antonio Murdaca --- install/0000_80_machine-config-operator_05_osimageurl.yaml | 1 + pkg/operator/sync.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/install/0000_80_machine-config-operator_05_osimageurl.yaml b/install/0000_80_machine-config-operator_05_osimageurl.yaml index 45e282383b..3bc124b6ee 100644 --- a/install/0000_80_machine-config-operator_05_osimageurl.yaml +++ b/install/0000_80_machine-config-operator_05_osimageurl.yaml @@ -4,6 +4,7 @@ metadata: name: machine-config-osimageurl namespace: openshift-machine-config-operator data: + releaseVersion: 0.0.1-snapshot # The OS payload, managed by the daemon + pivot + rpm-ostree # https://github.com/openshift/machine-config-operator/issues/183 osImageURL: "registry.svc.ci.openshift.org/openshift:machine-os-content" diff --git a/pkg/operator/sync.go b/pkg/operator/sync.go index 0b47600ab7..576f01b8a0 100644 --- a/pkg/operator/sync.go +++ b/pkg/operator/sync.go @@ -685,6 +685,11 @@ func (optr *Operator) getOsImageURL(namespace string) (string, error) { if err != nil { return "", err } + releaseVersion := cm.Data["releaseVersion"] + optrVersion, _ := optr.vStore.Get("operator") + if releaseVersion != optrVersion { + return "", fmt.Errorf("refusing to read osImageURL version %q, operator version %q", releaseVersion, optrVersion) + } return cm.Data["osImageURL"], nil } From 109eb3b36f95cdd73289c3cfb9bd7f957fa4e457 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Thu, 9 Jan 2020 13:25:45 +0100 Subject: [PATCH 2/2] install: move mco service to 0000_80 Signed-off-by: Antonio Murdaca --- ...rvice.yaml => 0000_80_machine-config-operator_00_service.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename install/{0001_00_machine-config-operator_00_service.yaml => 0000_80_machine-config-operator_00_service.yaml} (100%) diff --git a/install/0001_00_machine-config-operator_00_service.yaml b/install/0000_80_machine-config-operator_00_service.yaml similarity index 100% rename from install/0001_00_machine-config-operator_00_service.yaml rename to install/0000_80_machine-config-operator_00_service.yaml