From b9f45d1d1f6eb206f66242212305c84d8f6d401d Mon Sep 17 00:00:00 2001 From: Fabian Wiesel Date: Tue, 5 May 2026 11:08:48 +0200 Subject: [PATCH] Fix SSA for conditions The struct tags on the conditions like `patchStrategy:merge` are the used by the k8s server proper, but they have no effect in controller-runtime. The corresponding annotations have been set instead, and you can see the effect in the generated crd declaration. --- api/v1/eviction_types.go | 2 ++ api/v1/hypervisor_types.go | 4 +++- .../crds/kvm.cloud.sap_evictions.yaml | 3 +++ .../crds/kvm.cloud.sap_hypervisors.yaml | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/api/v1/eviction_types.go b/api/v1/eviction_types.go index 43ab0848..b96ad007 100644 --- a/api/v1/eviction_types.go +++ b/api/v1/eviction_types.go @@ -83,6 +83,8 @@ type EvictionStatus struct { OutstandingInstances []string `json:"outstandingInstances"` // Conditions is an array of current conditions + // +listType=map + // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty"` } diff --git a/api/v1/hypervisor_types.go b/api/v1/hypervisor_types.go index db269b7e..34f73b76 100644 --- a/api/v1/hypervisor_types.go +++ b/api/v1/hypervisor_types.go @@ -553,7 +553,9 @@ type HypervisorStatus struct { Evicted bool `json:"evicted,omitempty"` // Represents the Hypervisor node conditions. - Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty"` SpecHash string `json:"specHash,omitempty"` } diff --git a/charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_evictions.yaml b/charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_evictions.yaml index 36e0ab2d..a196abd7 100644 --- a/charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_evictions.yaml +++ b/charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_evictions.yaml @@ -129,6 +129,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map hypervisorServiceId: type: string outstandingInstances: diff --git a/charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_hypervisors.yaml b/charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_hypervisors.yaml index a5491426..ef2e9781 100644 --- a/charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_hypervisors.yaml +++ b/charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_hypervisors.yaml @@ -468,6 +468,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map domainCapabilities: description: |- Auto-discovered domain capabilities relevant to check if a VM