Skip to content

Commit c57c5be

Browse files
fwieselnotandy
authored andcommitted
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.
1 parent 96167a3 commit c57c5be

4 files changed

Lines changed: 11 additions & 1 deletion

File tree

api/v1/eviction_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ type EvictionStatus struct {
8383
OutstandingInstances []string `json:"outstandingInstances"`
8484

8585
// Conditions is an array of current conditions
86+
// +listType=map
87+
// +listMapKey=type
8688
Conditions []metav1.Condition `json:"conditions,omitempty"`
8789
}
8890

api/v1/hypervisor_types.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,9 @@ type HypervisorStatus struct {
553553
Evicted bool `json:"evicted,omitempty"`
554554

555555
// Represents the Hypervisor node conditions.
556-
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
556+
// +listType=map
557+
// +listMapKey=type
558+
Conditions []metav1.Condition `json:"conditions,omitempty"`
557559

558560
SpecHash string `json:"specHash,omitempty"`
559561
}

charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_evictions.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ spec:
129129
- type
130130
type: object
131131
type: array
132+
x-kubernetes-list-map-keys:
133+
- type
134+
x-kubernetes-list-type: map
132135
hypervisorServiceId:
133136
type: string
134137
outstandingInstances:

charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_hypervisors.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,9 @@ spec:
468468
- type
469469
type: object
470470
type: array
471+
x-kubernetes-list-map-keys:
472+
- type
473+
x-kubernetes-list-type: map
471474
domainCapabilities:
472475
description: |-
473476
Auto-discovered domain capabilities relevant to check if a VM

0 commit comments

Comments
 (0)