From 0c675cfc3a6dd8c3b8485a048e980468f7f4bbb4 Mon Sep 17 00:00:00 2001 From: ryskn Date: Fri, 3 Jul 2026 10:45:23 +0900 Subject: [PATCH] fix(srv6): materialize the OnUnavailable=Drop default in the CRD The documented default 'Drop' lived only in agent code (onUnavailableDrop treats empty as Drop), so a stored EgressPolicy kept onUnavailable="" and any other reader saw no default. Add +kubebuilder:default=Drop and the matching 'default: Drop' in the generated CRD so the API server defaults the field server-side, removing the split-brain. --- srv6egress/apis/v1/types.go | 1 + .../config/crd/bases/srv6egress.ryskn.io_egresspolicies.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/srv6egress/apis/v1/types.go b/srv6egress/apis/v1/types.go index 01a7c623..52586168 100644 --- a/srv6egress/apis/v1/types.go +++ b/srv6egress/apis/v1/types.go @@ -88,6 +88,7 @@ type EgressSpec struct { // steering so traffic uses the node default egress (fail-open). Defaults to // "Drop". // +kubebuilder:validation:Enum=Drop;Fallback + // +kubebuilder:default=Drop // +optional OnUnavailable string `json:"onUnavailable,omitempty"` } diff --git a/srv6egress/config/crd/bases/srv6egress.ryskn.io_egresspolicies.yaml b/srv6egress/config/crd/bases/srv6egress.ryskn.io_egresspolicies.yaml index 0e22cfcb..6679ef1a 100644 --- a/srv6egress/config/crd/bases/srv6egress.ryskn.io_egresspolicies.yaml +++ b/srv6egress/config/crd/bases/srv6egress.ryskn.io_egresspolicies.yaml @@ -173,6 +173,7 @@ spec: the steering so traffic uses the node default egress (fail-open). Defaults to "Drop". type: string + default: Drop enum: [Drop, Fallback] status: type: object