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

🐛 capd: fix nil pointer in dockermachinepool controller #10876

Conversation

chrischdi
Copy link
Member

What this PR does / why we need it:

Fixes nil pointer which occurred e.g. here:

{"ts":1720949295165.3877,"caller":"controller/controller.go:110","msg":"Observed a panic in reconciler: assignment to entry in nil map","controller":"dockermachinepool","controllerGroup":"infrastructure.cluster.x-k8s.io","controllerKind":"DockerMachinePool","DockerMachinePool":{"name":"autoscaler-qynhbr-mp-0-4hrqc","namespace":"autoscaler-wh9wa3"},"namespace":"autoscaler-wh9wa3","name":"autoscaler-qynhbr-mp-0-4hrqc","reconcileID":"5982a440-3d63-4817-b8fa-549b825f7753","v":0}
panic: assignment to entry in nil map [recovered]
	panic: assignment to entry in nil map

goroutine 325 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
	sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:111 +0x1e5
panic({0x1d48ca0?, 0x2370970?})
	runtime/panic.go:770 +0x132
sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/internal/controllers.(*DockerMachinePoolReconciler).propagateMachineDeleteAnnotation(0xc0004fa8c0, {0x23955e0, 0xc00062fb00}, 0xc000fd8290)
	sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/internal/controllers/dockermachinepool_controller_phases.go:326 +0x253
sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/internal/controllers.(*DockerMachinePoolReconciler).reconcileDockerMachines(0xc0004fa8c0, {0x23955e0, 0xc00062fb00}, 0xc0012041a0, 0xc000418848, 0xc001716c40)
	sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/internal/controllers/dockermachinepool_controller_phases.go:190 +0x112c
sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/internal/controllers.(*DockerMachinePoolReconciler).reconcileNormal(0xc0004fa8c0, {0x23955e0, 0xc00062fb00}, 0xc0012041a0, 0xc000418848, 0xc001716c40)
	sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/internal/controllers/dockermachinepool_controller.go:288 +0x13e
sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/internal/controllers.(*DockerMachinePoolReconciler).Reconcile(0xc0004fa8c0, {0x23955e0, 0xc00062f6e0}, {{{0xc0010b1410?, 0x3?}, {0xc0000585c0?, 0xc000accd10?}}})
	sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/internal/controllers/dockermachinepool_controller.go:157 +0x8b0
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x239c460?, {0x23955e0?, 0xc00062f6e0?}, {{{0xc0010b1410?, 0xb?}, {0xc0000585c0?, 0x0?}}})
	sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:114 +0xb7
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc000330840, {0x2395618, 0xc0004df950}, {0x1e0ab60, 0xc001935920})
	sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:311 +0x3bc
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc000330840, {0x2395618, 0xc0004df950})
	sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:261 +0x1be
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
	sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:222 +0x79
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 102
	sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:218 +0x486

triage link

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

/area provider/infrastructure-docker

@k8s-ci-robot k8s-ci-robot added area/provider/infrastructure-docker Issues or PRs related to the docker infrastructure provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 16, 2024
@chrischdi chrischdi changed the title capd: fix nil pointer in dockermachinepool controller 🐛 capd: fix nil pointer in dockermachinepool controller Jul 16, 2024
@chrischdi
Copy link
Member Author

/cherry-pick release-1.7
/cherry-pick release-1.6

@k8s-infra-cherrypick-robot

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

In response to this:

/cherry-pick release-1.7
/cherry-pick release-1.6

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.

@chrischdi
Copy link
Member Author

/cherry-pick release-1.6

@k8s-infra-cherrypick-robot

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

In response to this:

/cherry-pick release-1.6

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.

@sbueringer
Copy link
Member

Thx!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 16, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 634832ef6359ebd07dd24c747886fe5518b290f7

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 16, 2024
@k8s-ci-robot k8s-ci-robot merged commit b962bff into kubernetes-sigs:main Jul 16, 2024
26 of 27 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.8 milestone Jul 16, 2024
@k8s-infra-cherrypick-robot

@chrischdi: new pull request created: #10877

In response to this:

/cherry-pick release-1.7
/cherry-pick release-1.6

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.

@k8s-infra-cherrypick-robot

@chrischdi: new pull request created: #10878

In response to this:

/cherry-pick release-1.6

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
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/infrastructure-docker Issues or PRs related to the docker infrastructure provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants