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 panic on failed secret update on hash migration #84

Merged
merged 1 commit into from
Jul 28, 2021

Conversation

MartinWeindel
Copy link
Member

What this PR does / why we need it:
If during certificate hash migration the update of a secret fails, a panic occurs because of overwritten variable obj.

Observed a panic: &runtime.TypeAssertionError{_interface:(*runtime._type)(0x1908a00), concrete:(*runtime._type)(0x1968260), asserted:(*runtime._type)(0x194ff00), missingMethod:""} (interface conversion: abstract.ObjectData is *v1.Secret, not *v1alpha1.Certificate)
...
github.com/gardener/cert-management/pkg/controller/issuer/certificate.(*certReconciler).failed(...)
	/build/pkg/controller/issuer/certificate/reconciler.go:1034
github.com/gardener/cert-management/pkg/controller/issuer/certificate.(*certReconciler).migrateSpecHash(0xc000012380, 0x1bd9d40, 0xc0000a89b0, 0x1bec938, 0xc00068c900, 0xc001100400, 0x38, 0xc001100480, 0x38, 0xc0011004c0, ...)
	/build/pkg/controller/issuer/certificate/reconciler.go:945 +0x60a

As update failure can only result in a new certificate request, this fix does not fail the migration anymore.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

fix TypeAssertionError panic on failed secret update on hash migration

@MartinWeindel MartinWeindel requested a review from a team as a code owner July 28, 2021 10:04
@gardener-robot gardener-robot added needs/review Needs review size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 28, 2021
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jul 28, 2021
@gardener-robot-ci-3 gardener-robot-ci-3 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jul 28, 2021
@MartinWeindel MartinWeindel merged commit 8f6d7b6 into master Jul 28, 2021
@MartinWeindel MartinWeindel deleted the fix-panic-migrate-secret-update branch July 28, 2021 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review 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.

None yet

4 participants