Skip to content
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

Flake: TestSyncOperatorGroups/AllNamespaces/CSVPresent/InstallModeNotSupported #2091

Closed
benluddy opened this issue Apr 8, 2021 · 3 comments · Fixed by #2309 or #2349
Closed

Flake: TestSyncOperatorGroups/AllNamespaces/CSVPresent/InstallModeNotSupported #2091

benluddy opened this issue Apr 8, 2021 · 3 comments · Fixed by #2309 or #2349
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/flake Categorizes issue or PR as related to a flaky test.
Milestone

Comments

@benluddy
Copy link
Contributor

benluddy commented Apr 8, 2021

INFO[2021-04-08T19:18:51Z]     --- FAIL: TestSyncOperatorGroups/AllNamespaces/CSVPresent/InstallModeNotSupported (0.17s) 
INFO[2021-04-08T19:18:51Z]         operator_test.go:4477:               
INFO[2021-04-08T19:18:51Z]             	Error Trace:	operator_test.go:4477 
INFO[2021-04-08T19:18:51Z]             	Error:      	Received unexpected error: 
INFO[2021-04-08T19:18:51Z]             	            	clusterroles.rbac.authorization.k8s.io "csv-role" already exists 
INFO[2021-04-08T19:18:51Z]             	Test:       	TestSyncOperatorGroups/AllNamespaces/CSVPresent/InstallModeNotSupported

Seen this a couple times now, most recently in https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/operator-framework_operator-lifecycle-manager/2090/pull-ci-operator-framework-operator-lifecycle-manager-master-unit/1380237274532286464#1:build-log.txt%3A969.

@benluddy benluddy added the kind/bug Categorizes issue or PR as related to a bug. label Apr 8, 2021
@exdx exdx added the kind/flake Categorizes issue or PR as related to a flaky test. label Apr 15, 2021
@exdx exdx added this to the 0.19.0 milestone Apr 15, 2021
@benluddy
Copy link
Contributor Author

benluddy commented Aug 4, 2021

Saw a new failure in https://github.com/operator-framework/operator-lifecycle-manager/runs/3243630835?check_suite_focus=true#step:5:1356:

--- FAIL: TestSyncOperatorGroups (1.42s)
    --- FAIL: TestSyncOperatorGroups/AllNamespaces/CSVPresent/InstallModeNotSupported (0.13s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1161519]

goroutine 16056 [running]:
testing.tRunner.func1.2(0x2dd0640, 0x469f240)
	/opt/hostedtoolcache/go/1.16.6/x64/src/testing/testing.go:1143 +0x49f
testing.tRunner.func1(0xc003491380)
	/opt/hostedtoolcache/go/1.16.6/x64/src/testing/testing.go:1146 +0x695
panic(0x2dd0640, 0x469f240)
	/opt/hostedtoolcache/go/1.16.6/x64/src/runtime/panic.go:971 +0x499
k8s.io/api/rbac/v1.(*ClusterRole).GetLabels(0x0, 0x15)
	<autogenerated>:1 +0x39
github.com/operator-framework/operator-lifecycle-manager/pkg/lib/ownerutil.IsOwnedByKindLabel(0x376d558, 0x0, 0x30c6aa7, 0x15, 0x15)
	/home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/lib/ownerutil/util.go:241 +0x43
github.com/operator-framework/operator-lifecycle-manager/pkg/lib/ownerutil.GetOwnerByKindLabel(0x376d558, 0x0, 0x30c6aa7, 0x15, 0x8, 0x30c6aa7, 0x15, 0x0, 0x0)
	/home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/lib/ownerutil/util.go:82 +0x65
github.com/operator-framework/operator-lifecycle-manager/pkg/lib/ownerutil.IsOwnedByLabel(0x376d558, 0x0, 0x376e858, 0xc004c22000, 0xc00142fc20)
	/home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/lib/ownerutil/util.go:51 +0xcf
github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/olm.(*Operator).ensureSingletonRBAC(0xc0040ea000, 0x30b7b3e, 0xb, 0xc004c22000, 0x1, 0x0)
	/home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/controller/operators/olm/operatorgroup.go:537 +0x82a
github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/olm.(*Operator).ensureRBACInTargetNamespace(0xc0040ea000, 0xc004c22000, 0xc00493f1e0, 0xc00493f1e0, 0x1d)
	/home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/controller/operators/olm/operatorgroup.go:495 +0x925
github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/olm.(*Operator).syncClusterServiceVersion(0xc0040ea000, 0x3090a80, 0xc004c22000, 0x0, 0x0)
	/home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/controller/operators/olm/operator.go:1185 +0x778
github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/olm.TestSyncOperatorGroups.func1(0xc003491380)
	/home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/controller/operators/olm/operator_test.go:4495 +0xb33
testing.tRunner(0xc003491380, 0xc002ff6a80)
	/opt/hostedtoolcache/go/1.16.6/x64/src/testing/testing.go:1193 +0x203
created by testing.(*T).Run
	/opt/hostedtoolcache/go/1.16.6/x64/src/testing/testing.go:1238 +0x5d8

@benluddy benluddy reopened this Aug 4, 2021
@dinhxuanvu dinhxuanvu modified the milestones: 0.19.0, 0.20.0 Aug 19, 2021
timflannagan added a commit to timflannagan/operator-lifecycle-manager that referenced this issue 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 issue 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 issue 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 issue 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>
@joelanford joelanford modified the milestones: 0.20.0, 0.19.0 Sep 10, 2021
timflannagan added a commit to timflannagan/operator-lifecycle-manager that referenced this issue 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 issue 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>
@dinhxuanvu dinhxuanvu modified the milestones: 0.19.0, 0.20.0 Sep 16, 2021
timflannagan added a commit to timflannagan/operator-lifecycle-manager that referenced this issue 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 issue 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 issue 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 issue 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 issue 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 issue 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 issue 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 issue 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/flake Categorizes issue or PR as related to a flaky test.
Projects
None yet
4 participants