Skip to content

Conversation

@jakefhyde
Copy link
Contributor

@jakefhyde jakefhyde commented Sep 18, 2025

Issue: rancher/rancher#51980

Problem

#410 introduced data directory validation to the webhook, designed to prevent users from changing data directories once the cluster has been created. Harvester leverages rancherd, which is effectively a self-bootstrapping mechanism for creating the Rancher local cluster. Part of this bootstrapping involves patching the local cluster to set the rkeConfig: {}, which result in Rancher reconciling it like any other normal CAPI cluster.

Previously, the webhook did not come up quick enough in the rancherd process, but now the webhook and it's related validatingwebhookconfiguration exists before the cluster can be patched. The data directory validation causes the webhook to panic (and reject the request), as it was not expected that a cluster would go from an rkeConfig with a nil value, to one without one.

Solution

if oldCluster.Spec.RKEConfig == nil, accept the request.

CheckList

  • Test
  • Docs

@jakefhyde jakefhyde requested review from a team and snasovich September 18, 2025 21:58
@jakefhyde jakefhyde requested a review from a team as a code owner September 18, 2025 21:58
@thatmidwesterncoder thatmidwesterncoder requested a review from a team September 19, 2025 00:09
@jakefhyde jakefhyde merged commit e7e6e8d into rancher:release/v0.8 Sep 19, 2025
2 checks passed
jakefhyde added a commit to jakefhyde/webhook that referenced this pull request Sep 19, 2025
Fix crash when rancherd patches local cluster
jakefhyde added a commit that referenced this pull request Sep 19, 2025
Fix crash when rancherd patches local cluster
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