-
Notifications
You must be signed in to change notification settings - Fork 545
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
don't return an error if the singleton rbac doesn't exist #2309
Conversation
Signed-off-by: Evan <cordell.evan@gmail.com>
if k8serrors.IsAlreadyExists(err) && ownerutil.IsOwnedByLabel(cr, csv) { | ||
continue | ||
} else { | ||
return err | ||
} |
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.
nit:
if k8serrors.IsAlreadyExists(err) && ownerutil.IsOwnedByLabel(cr, csv) { | |
continue | |
} else { | |
return err | |
} | |
if k8serrors.IsAlreadyExists(err) && ownerutil.IsOwnedByLabel(cr, csv) { | |
continue | |
} | |
return err |
Nice 😎 /lgtm |
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
This PR failed one e2e test |
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 think it's also time to resurrect the flake analyzer
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dinhxuanvu, ecordell, 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 |
/lgtm |
…troller Fixes [operator-framework#2091](operator-framework#2091). This is a follow-up to [operator-framework#2309](operator-framework#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to instead use the static type instead to avoid a panic.
…troller Fixes [operator-framework#2091](operator-framework#2091). This is a follow-up to [operator-framework#2309](operator-framework#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to instead use the static type instead to avoid a panic.
…troller Fixes [operator-framework#2091](operator-framework#2091). This is a follow-up to [operator-framework#2309](operator-framework#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to instead use the static type instead to avoid a panic. Signed-off-by: timflannagan <timflannagan@gmail.com>
…troller Fixes [operator-framework#2091](operator-framework#2091). This is a follow-up to [operator-framework#2309](operator-framework#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to instead use the static type instead to avoid a panic. Signed-off-by: timflannagan <timflannagan@gmail.com>
…troller Fixes [operator-framework#2091](operator-framework#2091). This is a follow-up to [operator-framework#2309](operator-framework#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to verify that the cr/crb variables are not nil before attempting to access those object's labels. The testing fake client may need to be updated in the future to handle returning these resources properly. Signed-off-by: timflannagan <timflannagan@gmail.com>
…troller Fixes [operator-framework#2091](operator-framework#2091). This is a follow-up to [operator-framework#2309](operator-framework#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to verify that the cr/crb variables are not nil before attempting to access those object's labels. The testing fake client may need to be updated in the future to handle returning these resources properly. Signed-off-by: timflannagan <timflannagan@gmail.com>
…troller Fixes [operator-framework#2091](operator-framework#2091). This is a follow-up to [operator-framework#2309](operator-framework#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to verify that the cr/crb variables are not nil before attempting to access those object's labels. The testing fake client may need to be updated in the future to handle returning these resources properly. Signed-off-by: timflannagan <timflannagan@gmail.com>
…troller (#2349) * pkg/controller: Fix panic when creating cluster-scoped RBAC in OG controller Fixes [#2091](#2091). This is a follow-up to [#2309](#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to verify that the cr/crb variables are not nil before attempting to access those object's labels. The testing fake client may need to be updated in the future to handle returning these resources properly. Signed-off-by: timflannagan <timflannagan@gmail.com> * test(og): de-flake sync unit tests Co-authored-by: Nick Hale <njohnhale@gmail.com>
…troller (#2349) * pkg/controller: Fix panic when creating cluster-scoped RBAC in OG controller Fixes [#2091](operator-framework/operator-lifecycle-manager#2091). This is a follow-up to [#2309](operator-framework/operator-lifecycle-manager#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to verify that the cr/crb variables are not nil before attempting to access those object's labels. The testing fake client may need to be updated in the future to handle returning these resources properly. Signed-off-by: timflannagan <timflannagan@gmail.com> * test(og): de-flake sync unit tests Co-authored-by: Nick Hale <njohnhale@gmail.com> Upstream-repository: operator-lifecycle-manager Upstream-commit: 188ee1ae265f0a79d90b4cce52d97a26f16afe5a
…troller (#2349) * pkg/controller: Fix panic when creating cluster-scoped RBAC in OG controller Fixes [#2091](operator-framework/operator-lifecycle-manager#2091). This is a follow-up to [#2309](operator-framework/operator-lifecycle-manager#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to verify that the cr/crb variables are not nil before attempting to access those object's labels. The testing fake client may need to be updated in the future to handle returning these resources properly. Signed-off-by: timflannagan <timflannagan@gmail.com> * test(og): de-flake sync unit tests Co-authored-by: Nick Hale <njohnhale@gmail.com> Upstream-repository: operator-lifecycle-manager Upstream-commit: 188ee1ae265f0a79d90b4cce52d97a26f16afe5a
…troller (#2349) * pkg/controller: Fix panic when creating cluster-scoped RBAC in OG controller Fixes [#2091](operator-framework/operator-lifecycle-manager#2091). This is a follow-up to [#2309](operator-framework/operator-lifecycle-manager#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to verify that the cr/crb variables are not nil before attempting to access those object's labels. The testing fake client may need to be updated in the future to handle returning these resources properly. Signed-off-by: timflannagan <timflannagan@gmail.com> * test(og): de-flake sync unit tests Co-authored-by: Nick Hale <njohnhale@gmail.com> Upstream-repository: operator-lifecycle-manager Upstream-commit: 188ee1ae265f0a79d90b4cce52d97a26f16afe5a
…troller (#2349) * pkg/controller: Fix panic when creating cluster-scoped RBAC in OG controller Fixes [#2091](operator-framework/operator-lifecycle-manager#2091). This is a follow-up to [#2309](operator-framework/operator-lifecycle-manager#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to verify that the cr/crb variables are not nil before attempting to access those object's labels. The testing fake client may need to be updated in the future to handle returning these resources properly. Signed-off-by: timflannagan <timflannagan@gmail.com> * test(og): de-flake sync unit tests Co-authored-by: Nick Hale <njohnhale@gmail.com> Upstream-repository: operator-lifecycle-manager Upstream-commit: 188ee1ae265f0a79d90b4cce52d97a26f16afe5a
…troller (#2349) * pkg/controller: Fix panic when creating cluster-scoped RBAC in OG controller Fixes [#2091](operator-framework/operator-lifecycle-manager#2091). This is a follow-up to [#2309](operator-framework/operator-lifecycle-manager#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to verify that the cr/crb variables are not nil before attempting to access those object's labels. The testing fake client may need to be updated in the future to handle returning these resources properly. Signed-off-by: timflannagan <timflannagan@gmail.com> * test(og): de-flake sync unit tests Co-authored-by: Nick Hale <njohnhale@gmail.com> Upstream-repository: operator-lifecycle-manager Upstream-commit: 188ee1ae265f0a79d90b4cce52d97a26f16afe5a
…troller (#2349) * pkg/controller: Fix panic when creating cluster-scoped RBAC in OG controller Fixes [#2091](operator-framework/operator-lifecycle-manager#2091). This is a follow-up to [#2309](operator-framework/operator-lifecycle-manager#2309) that attempted to fix the original issue. When checking whether the ClusterRole/ClusterRoleBinding resources already exist, we're also checking whether the existing labels are owned by the CSV we're currently handling. When accessing the "cr" or "crb" variables that the Create calls output, a panic is produced as we're attempting to access the meta.Labels key from those resources, except those resources themselves are nil. Update the check to verify that the cr/crb variables are not nil before attempting to access those object's labels. The testing fake client may need to be updated in the future to handle returning these resources properly. Signed-off-by: timflannagan <timflannagan@gmail.com> * test(og): de-flake sync unit tests Co-authored-by: Nick Hale <njohnhale@gmail.com> Upstream-repository: operator-lifecycle-manager Upstream-commit: 188ee1ae265f0a79d90b4cce52d97a26f16afe5a
Description of the change:
Doesn't return an error from
ensureSingletonRBAC
if we can detect that the cache is just a bit behindMotivation for the change:
Fixes #2091
prior to this change, I could reproduce with:
after this change, I couldn't reproduce with:
Reviewer Checklist
/doc