Skip to content

Commit

Permalink
Merge pull request #1359 from runcom/osimageurl-race-43
Browse files Browse the repository at this point in the history
Bug 1786993: [release-4.3] Fix osImageURL upgrade race
  • Loading branch information
openshift-merge-robot authored Jan 13, 2020
2 parents 311a01e + 109eb3b commit 25bb6ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions install/0000_80_machine-config-operator_05_osimageurl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
5 changes: 5 additions & 0 deletions pkg/operator/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 25bb6ae

Please sign in to comment.