don't return an error if the singleton rbac doesn't exist#2309
Merged
openshift-ci[bot] merged 1 commit intooperator-framework:masterfrom Jul 31, 2021
Merged
don't return an error if the singleton rbac doesn't exist#2309openshift-ci[bot] merged 1 commit intooperator-framework:masterfrom
openshift-ci[bot] merged 1 commit intooperator-framework:masterfrom
Conversation
Signed-off-by: Evan <cordell.evan@gmail.com>
Comment on lines
+491
to
+495
| if k8serrors.IsAlreadyExists(err) && ownerutil.IsOwnedByLabel(cr, csv) { | ||
| continue | ||
| } else { | ||
| return err | ||
| } |
Member
There was a problem hiding this comment.
nit:
Suggested change
| if k8serrors.IsAlreadyExists(err) && ownerutil.IsOwnedByLabel(cr, csv) { | |
| continue | |
| } else { | |
| return err | |
| } | |
| if k8serrors.IsAlreadyExists(err) && ownerutil.IsOwnedByLabel(cr, csv) { | |
| continue | |
| } | |
| return err |
Member
|
Nice 😎 /lgtm |
Member
|
This PR failed one e2e test |
njhale
approved these changes
Jul 31, 2021
Member
njhale
left a comment
There was a problem hiding this comment.
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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Member
|
/lgtm |
timflannagan
added a commit
to timflannagan/operator-lifecycle-manager
that referenced
this pull request
Sep 8, 2021
…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.
5 tasks
timflannagan
added a commit
to timflannagan/operator-lifecycle-manager
that referenced
this pull request
Sep 8, 2021
…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.
timflannagan
added a commit
to timflannagan/operator-lifecycle-manager
that referenced
this pull request
Sep 8, 2021
…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>
timflannagan
added a commit
to timflannagan/operator-lifecycle-manager
that referenced
this pull request
Sep 8, 2021
…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>
timflannagan
added a commit
to timflannagan/operator-lifecycle-manager
that referenced
this pull request
Sep 14, 2021
…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>
timflannagan
added a commit
to timflannagan/operator-lifecycle-manager
that referenced
this pull request
Sep 14, 2021
…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>
timflannagan
added a commit
to timflannagan/operator-lifecycle-manager
that referenced
this pull request
Sep 23, 2021
…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>
openshift-merge-robot
pushed a commit
that referenced
this pull request
Sep 23, 2021
…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>
njhale
added a commit
to njhale/operator-framework-olm
that referenced
this pull request
Nov 2, 2021
…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
njhale
added a commit
to njhale/operator-framework-olm
that referenced
this pull request
Nov 8, 2021
…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
timflannagan
added a commit
to njhale/operator-framework-olm
that referenced
this pull request
Nov 15, 2021
…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
timflannagan
added a commit
to njhale/operator-framework-olm
that referenced
this pull request
Nov 15, 2021
…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
perdasilva
pushed a commit
to perdasilva/operator-framework-olm
that referenced
this pull request
Mar 4, 2022
…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
perdasilva
pushed a commit
to perdasilva/operator-framework-olm
that referenced
this pull request
Mar 4, 2022
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the change:
Doesn't return an error from
ensureSingletonRBACif 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