-
Notifications
You must be signed in to change notification settings - Fork 551
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
Allow users to toggle off csv copying for AllNamespace mode operators #2466
Allow users to toggle off csv copying for AllNamespace mode operators #2466
Conversation
Skipping CI for Draft Pull Request. |
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.
Looks great! Just a couple of nits.
50c5709
to
d7f6a83
Compare
Relies on operator-framework/api#198 |
ba40d6d
to
888b9f6
Compare
condition.Message = "At least one CSV had an unexpected number of copied CSVs" | ||
condition.Status = metav1.ConditionFalse | ||
defer func() { | ||
a.olmConfigQueue.AddAfter(olmConfig, time.Second*5) |
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.
The AddRateLimited option was not correctly incrementing the number of failures and would spam the API server. Planning to look at this tomorrow.
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.
Could also be done by triggering a watch on copied csvs.
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 need a watch/sync on copied CSVs if, for some reason, a copied csv gets created after the feature has been disabled; an edge case that might happen on upgrade or due to a bad actor (e.g. me).
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.
or due to a bad actor (e.g. me).
I don't know why your stage performance should influence this PR, but I agree that this controller should watch/sync on copied csvs ;)
994fa1d
to
8887105
Compare
cf0126a
to
98a066b
Compare
conditions: | ||
type: array | ||
items: | ||
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" |
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.
Looks like the boilerplate description made it through code review. Let's override the Foo
example when we get the chance.
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.
Is there a way to override the description of a structure not owned by your package?
condition.Message = "At least one CSV had an unexpected number of copied CSVs" | ||
condition.Status = metav1.ConditionFalse | ||
defer func() { | ||
a.olmConfigQueue.AddAfter(olmConfig, time.Second*5) |
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 need a watch/sync on copied CSVs if, for some reason, a copied csv gets created after the feature has been disabled; an edge case that might happen on upgrade or due to a bad actor (e.g. me).
34850b6
to
b9b3170
Compare
2fa650f
to
6192ee0
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.
/lgtm
|
||
olmConfig.Spec = operatorsv1.OLMConfigSpec{ | ||
Features: &operatorsv1.Features{ | ||
DisableCopiedCSVs: getPointer(true), |
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.
If the number of occurrences is few, you could also invoke an anonymous function:
DisableCopiedCSVs: func() *bool {
b := true
return &b
}(),
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: awgreene, 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 |
6192ee0
to
3b10eee
Compare
1cf4355
to
f7876cf
Compare
/lgtm |
f7876cf
to
332b6cc
Compare
/lgtm |
332b6cc
to
7dd1541
Compare
This commit introduces a controller for the olmConfig CRD. The olmConfig CRD will be used to configure olm's behavior on cluster. As of today, this CRD introduces the ability for customer to disable copied csvs for operators installed in allNamespace mode. When copied csv are disabled, an event will be created in the operators namespace signaling that it has no copied csvs and that users on the cluster may have difficulty identifying which operators are available in a given namespace. Signed-off-by: Alexander Greene <[email protected]>
7dd1541
to
c0b6e95
Compare
/lgtm |
No description provided.