-
Notifications
You must be signed in to change notification settings - Fork 562
Block OpenShift upgrades while incompatible operators are installed #2081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block OpenShift upgrades while incompatible operators are installed #2081
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: njhale The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
e663cae
to
bc7b3f0
Compare
7fe816e
to
99531be
Compare
99531be
to
2106b69
Compare
*ReconcilerConfig | ||
|
||
delayRequeue reconcile.Result | ||
mutate MutateFunc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mutate MutateFunc | |
mutate Mutator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
type skews []skew | ||
|
||
func (s skews) String() string { | ||
// TODO: Use a string builder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that works too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return nil, err | ||
} | ||
|
||
// Take the highest semver if there's more than one max version specified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be a safer choice to go with the lowest version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going at this from the perspective that folks would always make a conscious decision to add the property, but over several releases may forget to remove older ones.
return nil, err | ||
} | ||
|
||
// TODO: Is there a better way to filter (server-side maybe)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be an olm.copiedFrom
label on copied CSVs. I've had this thought too, and I'm not sure why there are no examples of a CSV label selector referencing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a label selector.
LastTransitionTime: r.Now(), | ||
} | ||
|
||
if r.syncTracker.SuccessfulSyncs() > 0 && reflect.DeepEqual(co.Status.Versions, r.TargetVersions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine, but do we need to lean on reflection? Since OperandVersion is struct{Name,Version string}
it would be a tiny loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can do an ElementsMatch
type thing easily enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and made this change.
- Refactor OpenShift ClusterOperator monitoring for olm-operator into an independent controller - Set the OLM operator's ClusterOperator to upgradeable=false whenever incompatible operators, installed by OLM, exist on cluster; effectively blocking OpenShift upgrades Signed-off-by: Nick Hale <[email protected]>
Bump controller-runtime dependency to include a fix for the Channel Source which was preventing events from being enqueued. (see kubernetes-sigs/controller-runtime#1343) Signed-off-by: Nick Hale <[email protected]>
Signed-off-by: Nick Hale <[email protected]>
Signed-off-by: Nick Hale <[email protected]>
Signed-off-by: Nick Hale <[email protected]>
Signed-off-by: Nick Hale <[email protected]>
bea36e4
to
8d0e190
Compare
Signed-off-by: Nick Hale <[email protected]>
8d0e190
to
ecac3be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nit
/lgtm
/hold
/hold cancel |
Description of the change:
Set OLM's
ClusterOperator
resource to Upgradeable=false when any OLM managed operator on the cluster has a maxOpenShiftVersion property less than the next minor OCP release.Implements OLM-2074.
I decided to implement this as a new controller so we could more easily interleave new and preexisting ClusterOperator behavior.