From 92a4e158fc9597c7c5e3ab009eb01e692cbb2aa9 Mon Sep 17 00:00:00 2001 From: Xieql Date: Fri, 25 Aug 2023 11:13:13 +0800 Subject: [PATCH] API: update kubectl display printcolumn Signed-off-by: Xieql --- .../en/references/apps_v1alpha1_types.html | 21 ++++++++++++++++++- .../en/references/infra_v1alpha1_types.html | 4 +--- .../cluster.kurator.dev_attachedclusters.yaml | 2 +- ...cture.cluster.x-k8s.io_customclusters.yaml | 2 +- ...cture.cluster.x-k8s.io_custommachines.yaml | 10 ++++++--- pkg/apis/apps/v1alpha1/types.go | 2 +- .../v1alpha1/attached_cluster_types.go | 2 +- pkg/apis/infra/v1alpha1/cluster.go | 2 +- pkg/apis/infra/v1alpha1/machine.go | 3 +-- 9 files changed, 34 insertions(+), 14 deletions(-) diff --git a/docs/content/en/references/apps_v1alpha1_types.html b/docs/content/en/references/apps_v1alpha1_types.html index f322a8750..f3a5d72bf 100644 --- a/docs/content/en/references/apps_v1alpha1_types.html +++ b/docs/content/en/references/apps_v1alpha1_types.html @@ -7,7 +7,9 @@

apps.kurator.dev/v1alpha1

Package v1alpha1 contains API Schema definitions for the apps v1alpha1 API group

Resource Types: - +

Application

Application is the schema for the application’s API.

@@ -23,6 +25,23 @@

Application +apiVersion
+string + +apps.kurator.dev/v1alpha1 + + + + +kind
+string + + +Application + + + + metadata
diff --git a/docs/content/en/references/infra_v1alpha1_types.html b/docs/content/en/references/infra_v1alpha1_types.html index fd22685e3..b950923e3 100644 --- a/docs/content/en/references/infra_v1alpha1_types.html +++ b/docs/content/en/references/infra_v1alpha1_types.html @@ -528,9 +528,7 @@

CustomMach -

TODO: add state. -TODO: display with kubectl -Indicate whether the machines are ready.

+

Indicate whether the machines are ready.

diff --git a/manifests/charts/cluster-operator/crds/cluster.kurator.dev_attachedclusters.yaml b/manifests/charts/cluster-operator/crds/cluster.kurator.dev_attachedclusters.yaml index ad3c81a9a..32da751f1 100644 --- a/manifests/charts/cluster-operator/crds/cluster.kurator.dev_attachedclusters.yaml +++ b/manifests/charts/cluster-operator/crds/cluster.kurator.dev_attachedclusters.yaml @@ -18,7 +18,7 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: - - description: Indicates if the AttachedClusters are ready + - description: Indicates if the AttachedCluster is ready jsonPath: .status.ready name: Ready type: boolean diff --git a/manifests/charts/cluster-operator/crds/infrastructure.cluster.x-k8s.io_customclusters.yaml b/manifests/charts/cluster-operator/crds/infrastructure.cluster.x-k8s.io_customclusters.yaml index 124e87728..bbadef1a9 100644 --- a/manifests/charts/cluster-operator/crds/infrastructure.cluster.x-k8s.io_customclusters.yaml +++ b/manifests/charts/cluster-operator/crds/infrastructure.cluster.x-k8s.io_customclusters.yaml @@ -21,7 +21,7 @@ spec: - additionalPrinterColumns: - description: Represents the current phase of customCluster actuation. jsonPath: .status.phase - name: Ready + name: Phase type: string name: v1alpha1 schema: diff --git a/manifests/charts/cluster-operator/crds/infrastructure.cluster.x-k8s.io_custommachines.yaml b/manifests/charts/cluster-operator/crds/infrastructure.cluster.x-k8s.io_custommachines.yaml index fe532f6a2..24aadbd27 100644 --- a/manifests/charts/cluster-operator/crds/infrastructure.cluster.x-k8s.io_custommachines.yaml +++ b/manifests/charts/cluster-operator/crds/infrastructure.cluster.x-k8s.io_custommachines.yaml @@ -15,7 +15,12 @@ spec: singular: custommachine scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: Indicates if the CustomMachine is ready. + jsonPath: .status.ready + name: Ready + type: boolean + name: v1alpha1 schema: openAPIV3Schema: description: CustomMachine is the schema for kubernetes nodes. @@ -182,8 +187,7 @@ spec: description: Current status of the machine. properties: ready: - description: 'TODO: add state. TODO: display with kubectl Indicate - whether the machines are ready.' + description: Indicate whether the machines are ready. type: boolean type: object type: object diff --git a/pkg/apis/apps/v1alpha1/types.go b/pkg/apis/apps/v1alpha1/types.go index 7d09edc2f..8f4123711 100644 --- a/pkg/apis/apps/v1alpha1/types.go +++ b/pkg/apis/apps/v1alpha1/types.go @@ -28,7 +28,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Namespaced,categories=kurator-dev // +kubebuilder:subresource:status -// + // Application is the schema for the application's API. type Application struct { metav1.TypeMeta `json:",inline"` diff --git a/pkg/apis/cluster/v1alpha1/attached_cluster_types.go b/pkg/apis/cluster/v1alpha1/attached_cluster_types.go index c9d8245e3..a2559434a 100644 --- a/pkg/apis/cluster/v1alpha1/attached_cluster_types.go +++ b/pkg/apis/cluster/v1alpha1/attached_cluster_types.go @@ -26,7 +26,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Namespaced,categories=kurator-dev // +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Ready",type="boolean",JSONPath=".status.ready",description="Indicates if the AttachedClusters are ready" +// +kubebuilder:printcolumn:name="Ready",type="boolean",JSONPath=".status.ready",description="Indicates if the AttachedCluster is ready" // AttachedCluster is the schema for the external cluster that are not created by kurator. type AttachedCluster struct { diff --git a/pkg/apis/infra/v1alpha1/cluster.go b/pkg/apis/infra/v1alpha1/cluster.go index f093bdbc1..e53e6a7c8 100644 --- a/pkg/apis/infra/v1alpha1/cluster.go +++ b/pkg/apis/infra/v1alpha1/cluster.go @@ -27,7 +27,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:path=customclusters,shortName=cc // +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.phase",description="Represents the current phase of customCluster actuation." +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Represents the current phase of customCluster actuation." // CustomCluster represents the parameters for a cluster in supplement of Cluster API. type CustomCluster struct { diff --git a/pkg/apis/infra/v1alpha1/machine.go b/pkg/apis/infra/v1alpha1/machine.go index abd565c64..eac00f6c8 100644 --- a/pkg/apis/infra/v1alpha1/machine.go +++ b/pkg/apis/infra/v1alpha1/machine.go @@ -26,6 +26,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:path=custommachines // +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="boolean",JSONPath=".status.ready",description="Indicates if the CustomMachine is ready." // CustomMachine is the schema for kubernetes nodes. type CustomMachine struct { @@ -49,8 +50,6 @@ type CustomMachineSpec struct { // CustomMachineStatus represents the current status of the machine. type CustomMachineStatus struct { - // TODO: add state. - // TODO: display with kubectl // Indicate whether the machines are ready. Ready *bool `json:"ready,omitempty"` }