From 982d43a4fc6ff4373246e94d3a7bd21a2f2141c5 Mon Sep 17 00:00:00 2001 From: Marc Sluiter Date: Wed, 12 Apr 2023 14:20:14 +0200 Subject: [PATCH] Don't have mandatory fields in status Signed-off-by: Marc Sluiter --- api/v1alpha1/nodehealthcheck_types.go | 8 ++++---- .../remediation.medik8s.io_nodehealthchecks.yaml | 5 ----- .../bases/remediation.medik8s.io_nodehealthchecks.yaml | 5 ----- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/api/v1alpha1/nodehealthcheck_types.go b/api/v1alpha1/nodehealthcheck_types.go index 5876f660..4ce798c2 100644 --- a/api/v1alpha1/nodehealthcheck_types.go +++ b/api/v1alpha1/nodehealthcheck_types.go @@ -120,13 +120,13 @@ type UnhealthyCondition struct { type NodeHealthCheckStatus struct { // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="observedNodes",xDescriptors="urn:alm:descriptor:com.tectonic.ui:observedNodes" //ObservedNodes specified the number of nodes observed by using the NHC spec.selector - // +kubebuilder:default:=0 - ObservedNodes int `json:"observedNodes"` + //+optional + ObservedNodes int `json:"observedNodes,omitempty"` // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="healthynodes",xDescriptors="urn:alm:descriptor:com.tectonic.ui:healthyNodes" //HealthyNodes specified the number of healthy nodes observed - // +kubebuilder:default:=0 - HealthyNodes int `json:"healthyNodes"` + //+optional + HealthyNodes int `json:"healthyNodes,omitempty"` // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="inFlightRemediations",xDescriptors="urn:alm:descriptor:com.tectonic.ui:inFlightRemediations" //InFlightRemediations records the timestamp when remediation triggered per node diff --git a/bundle/manifests/remediation.medik8s.io_nodehealthchecks.yaml b/bundle/manifests/remediation.medik8s.io_nodehealthchecks.yaml index 446d3eb0..5e130108 100644 --- a/bundle/manifests/remediation.medik8s.io_nodehealthchecks.yaml +++ b/bundle/manifests/remediation.medik8s.io_nodehealthchecks.yaml @@ -262,7 +262,6 @@ spec: - type x-kubernetes-list-type: map healthyNodes: - default: 0 description: HealthyNodes specified the number of healthy nodes observed type: integer inFlightRemediations: @@ -273,7 +272,6 @@ spec: triggered per node type: object observedNodes: - default: 0 description: ObservedNodes specified the number of nodes observed by using the NHC spec.selector type: integer @@ -286,9 +284,6 @@ spec: reason: description: Reason explains the current phase in more detail. type: string - required: - - healthyNodes - - observedNodes type: object type: object served: true diff --git a/config/crd/bases/remediation.medik8s.io_nodehealthchecks.yaml b/config/crd/bases/remediation.medik8s.io_nodehealthchecks.yaml index 5972c148..a12b151f 100644 --- a/config/crd/bases/remediation.medik8s.io_nodehealthchecks.yaml +++ b/config/crd/bases/remediation.medik8s.io_nodehealthchecks.yaml @@ -261,7 +261,6 @@ spec: - type x-kubernetes-list-type: map healthyNodes: - default: 0 description: HealthyNodes specified the number of healthy nodes observed type: integer inFlightRemediations: @@ -272,7 +271,6 @@ spec: triggered per node type: object observedNodes: - default: 0 description: ObservedNodes specified the number of nodes observed by using the NHC spec.selector type: integer @@ -285,9 +283,6 @@ spec: reason: description: Reason explains the current phase in more detail. type: string - required: - - healthyNodes - - observedNodes type: object type: object served: true