Skip to content

feat(api): Make ControlPlaneEndpoint optional and remove mutating webhooks#114

Merged
hrak merged 1 commit intodevelopfrom
feat/optional-control-plane-endpoint
Apr 7, 2026
Merged

feat(api): Make ControlPlaneEndpoint optional and remove mutating webhooks#114
hrak merged 1 commit intodevelopfrom
feat/optional-control-plane-endpoint

Conversation

@hrak
Copy link
Copy Markdown
Member

@hrak hrak commented Apr 7, 2026

This PR addresses a change suggested in the CAPI 1.11 -> 1.12 notes

Summary

  • Make ControlPlaneEndpoint optional on CloudStackCluster and CloudStackIsolatedNetwork, allowing endpoint to be populated dynamically during reconciliation
  • Remove mutating (defaulting) webhooks for CloudStackCluster and CloudStackClusterTemplate
  • Move port defaulting (6443) from webhook into the isolated network controller's reconcile loop

Changes

  • API types: Add +optional marker and omitempty to ControlPlaneEndpoint field
  • Webhooks: Remove Default() methods, CustomDefaulter interfaces, and MutatingWebhookConfiguration
  • CRDs: Remove controlPlaneEndpoint from required fields
  • Controller: Add getAPIServerPort() helper with default port 6443 fallback
  • Tests: Add unit tests for getAPIServerPort() covering empty, partial, and fully set endpoints

Test plan

  • Unit tests for getAPIServerPort() pass (empty, host-only, port-only, fully set)
  • Existing webhook validation tests still pass
  • Integration tests for isolated network controller pass
  • Verify clusters with ControlPlaneEndpoint set continue to work
  • Verify clusters without ControlPlaneEndpoint get port defaulted to 6443

🤖 Generated with Claude Code

…hooks

Make ControlPlaneEndpoint optional on CloudStackCluster and
CloudStackIsolatedNetwork, allowing the endpoint to be populated
dynamically during reconciliation rather than requiring it at creation
time. Move port defaulting (6443) from the mutating webhook into the
isolated network controller's reconcile loop.

Remove mutating webhooks for CloudStackCluster and
CloudStackClusterTemplate as they are no longer needed.

CC-1861

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@hrak hrak force-pushed the feat/optional-control-plane-endpoint branch from 635c48e to fa7c12a Compare April 7, 2026 14:13
@hrak hrak merged commit f721f95 into develop Apr 7, 2026
3 checks passed
@hrak hrak deleted the feat/optional-control-plane-endpoint branch April 7, 2026 14:18
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.

2 participants