From 415627d12515f8b87e2fd8f8c10c60f7d3ae36d5 Mon Sep 17 00:00:00 2001 From: Claudio Netto Date: Tue, 23 May 2023 11:42:58 -0300 Subject: [PATCH] feat(api): defaulting suspend field to false and adding it on print column --- api/v1alpha1/rpaasinstance_types.go | 2 ++ config/crd/bases/extensions.tsuru.io_rpaasflavors.yaml | 1 + config/crd/bases/extensions.tsuru.io_rpaasinstances.yaml | 7 ++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/api/v1alpha1/rpaasinstance_types.go b/api/v1alpha1/rpaasinstance_types.go index 7582f82b3..1d45da610 100644 --- a/api/v1alpha1/rpaasinstance_types.go +++ b/api/v1alpha1/rpaasinstance_types.go @@ -131,6 +131,7 @@ type RpaasInstanceSpec struct { // Suspend flag tells whether controller should suspend any further // modifications on this resource. Defaults to false. // +optional + // +kubebuilder:default:=false Suspend *bool `json:"suspend,omitempty"` } @@ -316,6 +317,7 @@ type RpaasInstanceStatus struct { // +kubebuilder:resource:shortName=rpaas // +kubebuilder:subresource:status // +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.currentReplicas,selectorpath=.status.podSelector +// +kubebuilder:printcolumn:name="Suspended",type=boolean,JSONPath=`.spec.suspend` // RpaasInstance is the Schema for the rpaasinstances API type RpaasInstance struct { diff --git a/config/crd/bases/extensions.tsuru.io_rpaasflavors.yaml b/config/crd/bases/extensions.tsuru.io_rpaasflavors.yaml index 71266b01e..5f53b6f49 100644 --- a/config/crd/bases/extensions.tsuru.io_rpaasflavors.yaml +++ b/config/crd/bases/extensions.tsuru.io_rpaasflavors.yaml @@ -6057,6 +6057,7 @@ spec: type: boolean type: object suspend: + default: false description: Suspend flag tells whether controller should suspend any further modifications on this resource. Defaults to false. type: boolean diff --git a/config/crd/bases/extensions.tsuru.io_rpaasinstances.yaml b/config/crd/bases/extensions.tsuru.io_rpaasinstances.yaml index 681c93d91..34de4d4fb 100644 --- a/config/crd/bases/extensions.tsuru.io_rpaasinstances.yaml +++ b/config/crd/bases/extensions.tsuru.io_rpaasinstances.yaml @@ -18,7 +18,11 @@ spec: singular: rpaasinstance scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .spec.suspend + name: Suspended + type: boolean + name: v1alpha1 schema: openAPIV3Schema: description: RpaasInstance is the Schema for the rpaasinstances API @@ -5818,6 +5822,7 @@ spec: type: boolean type: object suspend: + default: false description: Suspend flag tells whether controller should suspend any further modifications on this resource. Defaults to false. type: boolean