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

Fix the nil pointing issue #239

Conversation

eshulman2
Copy link
Contributor

When a workflow is set without ExtraConfigMap in ansible controller the pod won't be able to start because the pointer won't be pointing at nothing. Changed the condition to allow avoiding this issue.

Jira: https://issues.redhat.com/browse/OSPRH-11191

@openshift-ci openshift-ci bot requested review from abays and evallesp November 5, 2024 06:58
@lpiwowar lpiwowar self-requested a review November 5, 2024 08:31
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/e5f9afcb28c94830a8dd64c14515de57

✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 21m 55s
podified-multinode-edpm-deployment-crc-test-operator TIMED_OUT in 3h 12m 36s

@eshulman2
Copy link
Contributor Author

recheck

@lpiwowar
Copy link
Collaborator

lpiwowar commented Nov 5, 2024

@eshulman2 here is the reason of the previous job failure (seems to be related to ansibletest):

bcd8-7ea01e973d76"}
2024-11-05T09:04:09Z	INFO	ansibletest-resource	default	{"name": "ansibletest"}
2024-11-05T09:04:09Z	INFO	ansibletest-resource	validate create	{"name": "ansibletest"}
2024-11-05T09:04:09Z	ERROR	Reconciler error	{"controller": "ansibletest", "controllerGroup": "test.openstack.org", "controllerKind": "AnsibleTest", "AnsibleTest": {"name":"ansibletest","namespace":"openstack"}, "namespace": "openstack", "name": "ansibletest", "reconcileID": "21130ce2-14ae-45c5-bf34-9510d62d4bef", "error": "PersistentVolumeClaim \"ansibletest-0-2727f\" not found"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:329
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227
2024-11-05T09:04:09Z	INFO	Controllers.AnsibleTest	Lock acquired	{"controller": "ansibletest", "controllerGroup": "test.openstack.org", "controllerKind": "AnsibleTest", "AnsibleTest": {"name":"ansibletest","namespace":"openstack"}, "namespace": "openstack", "name": "ansibletest", "reconcileID": "b3a7700d-3c4b-4902-9e86-9144d5651ee5"}
2024-11-05T09:04:10Z	INFO	Observed a panic in reconciler: runtime error: index out of range [0] with length 0	{"controller": "ansibletest", "controllerGroup": "test.openstack.org", "controllerKind": "AnsibleTest", "AnsibleTest": {"name":"ansibletest","namespace":"openstack"}, "namespace": "openstack", "name": "ansibletest", "reconcileID": "b3a7700d-3c4b-4902-9e86-9144d5651ee5"}
panic: runtime error: index out of range [0] with length 0 [recovered]
	panic: runtime error: index out of range [0] with length 0

goroutine 306 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:116 +0x1e5
panic({0x1a54700?, 0xc0009575f0?})
	/usr/lib/golang/src/runtime/panic.go:914 +0x21f
github.com/openstack-k8s-operators/test-operator/pkg/ansibletest.GetVolumeMounts(0x1, 0xc00115e000, 0x0)
	/remote-source/pkg/ansibletest/volumes.go:207 +0x8c5
github.com/openstack-k8s-operators/test-operator/pkg/ansibletest.Job(0xc00115e000, 0xc002c34120, {0xc0004ba210, 0xb}, {0xc000dbda58, 0x13}, 0x0?, 0x0?, 0x0?, 0x0, ...)
	/remote-source/pkg/ansibletest/job.go:65 +0x412
github.com/openstack-k8s-operators/test-operator/controllers.(*AnsibleTestReconciler).Reconcile(0xc000613380, {0x1e046c0?, 0xc00057cd80}, {{{0xc0004ba0b6?, 0x5?}, {0xc0004ba210?, 0xc000ee7d08?}}})
	/remote-source/controllers/ansibletest_controller.go:255 +0x1545
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x1e07a20?, {0x1e046c0?, 0xc00057cd80?}, {{{0xc0004ba0b6?, 0xb?}, {0xc0004ba210?, 0x0?}}})
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:119 +0xb7
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc000788280, {0x1e046f8, 0xc00050f8b0}, {0x19b8040?, 0xc0025d5dc0?})
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:316 +0x3cc
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc000788280, {0x1e046f8, 0xc00050f8b0})
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266 +0x1af
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227 +0x79
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 147
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:223 +0x565

https://logserver.rdoproject.org/39/239/25b0b1d0f4d1489f98cadebaeff90758da4cff0b/github-check/podified-multinode-edpm-deployment-crc-test-operator/e0dd021/controller/ci-framework-data/logs/openstack-k8s-operators-openstack-must-gather/namespaces/openstack/pods/test-operator-controller-manager-7548c44659-7zmb2/logs/manager-previous.log

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/b65214189a2946a9a4e95f85e7e94005

✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 22m 27s
podified-multinode-edpm-deployment-crc-test-operator TIMED_OUT in 3h 12m 31s

@eshulman2
Copy link
Contributor Author

@eshulman2 here is the reason of the previous job failure (seems to be related to ansibletest):

bcd8-7ea01e973d76"}
2024-11-05T09:04:09Z	INFO	ansibletest-resource	default	{"name": "ansibletest"}
2024-11-05T09:04:09Z	INFO	ansibletest-resource	validate create	{"name": "ansibletest"}
2024-11-05T09:04:09Z	ERROR	Reconciler error	{"controller": "ansibletest", "controllerGroup": "test.openstack.org", "controllerKind": "AnsibleTest", "AnsibleTest": {"name":"ansibletest","namespace":"openstack"}, "namespace": "openstack", "name": "ansibletest", "reconcileID": "21130ce2-14ae-45c5-bf34-9510d62d4bef", "error": "PersistentVolumeClaim \"ansibletest-0-2727f\" not found"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:329
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227
2024-11-05T09:04:09Z	INFO	Controllers.AnsibleTest	Lock acquired	{"controller": "ansibletest", "controllerGroup": "test.openstack.org", "controllerKind": "AnsibleTest", "AnsibleTest": {"name":"ansibletest","namespace":"openstack"}, "namespace": "openstack", "name": "ansibletest", "reconcileID": "b3a7700d-3c4b-4902-9e86-9144d5651ee5"}
2024-11-05T09:04:10Z	INFO	Observed a panic in reconciler: runtime error: index out of range [0] with length 0	{"controller": "ansibletest", "controllerGroup": "test.openstack.org", "controllerKind": "AnsibleTest", "AnsibleTest": {"name":"ansibletest","namespace":"openstack"}, "namespace": "openstack", "name": "ansibletest", "reconcileID": "b3a7700d-3c4b-4902-9e86-9144d5651ee5"}
panic: runtime error: index out of range [0] with length 0 [recovered]
	panic: runtime error: index out of range [0] with length 0

goroutine 306 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:116 +0x1e5
panic({0x1a54700?, 0xc0009575f0?})
	/usr/lib/golang/src/runtime/panic.go:914 +0x21f
github.com/openstack-k8s-operators/test-operator/pkg/ansibletest.GetVolumeMounts(0x1, 0xc00115e000, 0x0)
	/remote-source/pkg/ansibletest/volumes.go:207 +0x8c5
github.com/openstack-k8s-operators/test-operator/pkg/ansibletest.Job(0xc00115e000, 0xc002c34120, {0xc0004ba210, 0xb}, {0xc000dbda58, 0x13}, 0x0?, 0x0?, 0x0?, 0x0, ...)
	/remote-source/pkg/ansibletest/job.go:65 +0x412
github.com/openstack-k8s-operators/test-operator/controllers.(*AnsibleTestReconciler).Reconcile(0xc000613380, {0x1e046c0?, 0xc00057cd80}, {{{0xc0004ba0b6?, 0x5?}, {0xc0004ba210?, 0xc000ee7d08?}}})
	/remote-source/controllers/ansibletest_controller.go:255 +0x1545
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x1e07a20?, {0x1e046c0?, 0xc00057cd80?}, {{{0xc0004ba0b6?, 0xb?}, {0xc0004ba210?, 0x0?}}})
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:119 +0xb7
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc000788280, {0x1e046f8, 0xc00050f8b0}, {0x19b8040?, 0xc0025d5dc0?})
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:316 +0x3cc
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc000788280, {0x1e046f8, 0xc00050f8b0})
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266 +0x1af
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227 +0x79
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 147
	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:223 +0x565

https://logserver.rdoproject.org/39/239/25b0b1d0f4d1489f98cadebaeff90758da4cff0b/github-check/podified-multinode-edpm-deployment-crc-test-operator/e0dd021/controller/ci-framework-data/logs/openstack-k8s-operators-openstack-must-gather/namespaces/openstack/pods/test-operator-controller-manager-7548c44659-7zmb2/logs/manager-previous.log

yes I assumed it might cause an issue in the way it is defined right now, I'm waiting for a setup to work on this

@eshulman2 eshulman2 closed this Nov 6, 2024
@eshulman2 eshulman2 reopened this Nov 6, 2024
@eshulman2 eshulman2 force-pushed the fix_extraconfigmap_pointer_issue branch 2 times, most recently from 9ad0c7f to 98c3b0e Compare November 6, 2024 11:11
Copy link
Collaborator

@lpiwowar lpiwowar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Just one small thing. Nested if-statement is not needed. Go uses short circuit evaluation.

pkg/ansibletest/volumes.go Outdated Show resolved Hide resolved
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/177e3644b9a34f09a429b6c6ab658ee8

openstack-k8s-operators-content-provider RETRY_LIMIT in 3m 30s
⚠️ podified-multinode-edpm-deployment-crc-test-operator SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@eshulman2
Copy link
Contributor Author

Gates are broken until this patch is merged openstack-k8s-operators/ci-framework#2526 :(

@eshulman2
Copy link
Contributor Author

recheck

When a workflow is set without ExtraConfigMap in ansible controller the
pod won't be able to start because the pointer won't be pointing at
nothing. Changed the condition to allow avoiding this issue.

not tested, waiting for a test enviornment to work on this

Jira: https://issues.redhat.com/browse/OSPRH-11191
@eshulman2 eshulman2 force-pushed the fix_extraconfigmap_pointer_issue branch from bcf1fa1 to ec466fd Compare November 11, 2024 07:40
Copy link
Collaborator

@lpiwowar lpiwowar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! 👍

@lpiwowar
Copy link
Collaborator

/approve

Copy link

openshift-ci bot commented Nov 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eshulman2, lpiwowar

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lpiwowar
Copy link
Collaborator

/cherry-pick 18.0-fr1

@openshift-cherrypick-robot

@lpiwowar: once the present PR merges, I will cherry-pick it on top of 18.0-fr1 in a new PR and assign it to you.

In response to this:

/cherry-pick 18.0-fr1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-bot openshift-merge-bot bot merged commit 28d0922 into openstack-k8s-operators:main Nov 11, 2024
8 checks passed
@openshift-cherrypick-robot

@lpiwowar: new pull request created: #242

In response to this:

/cherry-pick 18.0-fr1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants