Skip to content

🐛 panic in topology migration - fixed by adding nil check#2

Merged
srm6867 merged 2 commits intov1.9.5-pf9from
fix/nil-ref-fix-for-migration
Apr 16, 2026
Merged

🐛 panic in topology migration - fixed by adding nil check#2
srm6867 merged 2 commits intov1.9.5-pf9from
fix/nil-ref-fix-for-migration

Conversation

@srm6867
Copy link
Copy Markdown
Collaborator

@srm6867 srm6867 commented Apr 16, 2026

What this PR does / why we need it:

Why this PR :

When we migrate existing cluster to use topology, the defaulting webhook panics with error -

Error from server: admission webhook "default.cluster.cluster.x-k8s.io" denied the request: panic: runtime error: invalid memory address or nil pointer dereference [recovered]

What this PR does :

Added a nil check for spec.topology

Unit Test:

go test ./internal/webhooks/ -run TestClusterDefaultAndValidateVariables_OldClusterWithoutTopology
ok      sigs.k8s.io/cluster-api/internal/webhooks       0.156s

@srm6867 srm6867 changed the title fix: topology migration - add nil check Patch fix: 🐛 panic in topology migration - fixed by adding nil check Apr 16, 2026
@srm6867 srm6867 changed the title Patch fix: 🐛 panic in topology migration - fixed by adding nil check Patch fix: 🐛 (:bug:) panic in topology migration - fixed by adding nil check Apr 16, 2026
@srm6867 srm6867 changed the title Patch fix: 🐛 (:bug:) panic in topology migration - fixed by adding nil check 🐛 panic in topology migration - fixed by adding nil check Apr 16, 2026
Copy link
Copy Markdown

@mridulgain mridulgain left a comment

Choose a reason for hiding this comment

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

lgtm

Comment thread internal/webhooks/cluster_test.go
@srm6867 srm6867 merged commit 209051d into v1.9.5-pf9 Apr 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants