From 556219a5ed963082e91c5d82ff047174741511e5 Mon Sep 17 00:00:00 2001 From: yuswift Date: Tue, 20 Apr 2021 20:42:33 +0800 Subject: [PATCH] fix crd update error Signed-off-by: yuswiftli --- ...ubesphere.io_namespacenetworkpolicies.yaml | 1 + ...kubesphere.io_provisionercapabilities.yaml | 26 +++++++++++--- ...ubesphere.io_storageclasscapabilities.yaml | 35 ++++++++++++++++--- pkg/apis/storage/v1alpha1/capability_types.go | 11 ++++++ 4 files changed, 63 insertions(+), 10 deletions(-) diff --git a/config/crds/network.kubesphere.io_namespacenetworkpolicies.yaml b/config/crds/network.kubesphere.io_namespacenetworkpolicies.yaml index 53dedfc4d..2c26756b1 100644 --- a/config/crds/network.kubesphere.io_namespacenetworkpolicies.yaml +++ b/config/crds/network.kubesphere.io_namespacenetworkpolicies.yaml @@ -19,6 +19,7 @@ spec: - nsnp singular: namespacenetworkpolicy scope: Namespaced + preserveUnknownFields: false versions: - name: v1alpha1 schema: diff --git a/config/crds/storage.kubesphere.io_provisionercapabilities.yaml b/config/crds/storage.kubesphere.io_provisionercapabilities.yaml index 4f9d4123e..83aabb924 100644 --- a/config/crds/storage.kubesphere.io_provisionercapabilities.yaml +++ b/config/crds/storage.kubesphere.io_provisionercapabilities.yaml @@ -14,18 +14,33 @@ spec: listKind: ProvisionerCapabilityList plural: provisionercapabilities singular: provisionercapability - scope: Namespaced + scope: Cluster versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .spec.pluginInfo.name + name: Provisioner + type: string + - jsonPath: .spec.features.volume.expandMode + name: Expand + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: - description: ProvisionerCapability is the schema for the provisionercapability API + description: ProvisionerCapability is the schema for the provisionercapability + API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object @@ -96,6 +111,7 @@ spec: type: object served: true storage: true + subresources: {} status: acceptedNames: kind: "" diff --git a/config/crds/storage.kubesphere.io_storageclasscapabilities.yaml b/config/crds/storage.kubesphere.io_storageclasscapabilities.yaml index 98c5a0a9b..907b5c43a 100644 --- a/config/crds/storage.kubesphere.io_storageclasscapabilities.yaml +++ b/config/crds/storage.kubesphere.io_storageclasscapabilities.yaml @@ -14,18 +14,42 @@ spec: listKind: StorageClassCapabilityList plural: storageclasscapabilities singular: storageclasscapability - scope: Namespaced + scope: Cluster versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .spec.provisioner + name: Provisioner + type: string + - jsonPath: .spec.features.volume.create + name: Volume + type: boolean + - jsonPath: .spec.features.volume.expandMode + name: Expand + type: string + - jsonPath: .spec.features.volume.clone + name: Clone + type: boolean + - jsonPath: .spec.features.snapshot.create + name: Snapshot + type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: - description: StorageClassCapability is the Schema for the storage class capability API + description: StorageClassCapability is the Schema for the storage class capability + API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object @@ -87,6 +111,7 @@ spec: type: object served: true storage: true + subresources: {} status: acceptedNames: kind: "" diff --git a/pkg/apis/storage/v1alpha1/capability_types.go b/pkg/apis/storage/v1alpha1/capability_types.go index 25f57ce42..46dc0d746 100644 --- a/pkg/apis/storage/v1alpha1/capability_types.go +++ b/pkg/apis/storage/v1alpha1/capability_types.go @@ -61,6 +61,13 @@ type PluginInfo struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient:noStatus // +genclient:nonNamespaced +// +kubebuilder:printcolumn:name="Provisioner",type="string",JSONPath=".spec.provisioner" +// +kubebuilder:printcolumn:name="Volume",type="boolean",JSONPath=".spec.features.volume.create" +// +kubebuilder:printcolumn:name="Expand",type="string",JSONPath=".spec.features.volume.expandMode" +// +kubebuilder:printcolumn:name="Clone",type="boolean",JSONPath=".spec.features.volume.clone" +// +kubebuilder:printcolumn:name="Snapshot",type="boolean",JSONPath=".spec.features.snapshot.create" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope="Cluster" // StorageClassCapability is the Schema for the storage class capability API // +k8s:openapi-gen=true @@ -91,6 +98,10 @@ type StorageClassCapabilityList struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient:noStatus // +genclient:nonNamespaced +// +kubebuilder:printcolumn:name="Provisioner",type="string",JSONPath=".spec.pluginInfo.name" +// +kubebuilder:printcolumn:name="Expand",type="string",JSONPath=".spec.features.volume.expandMode" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope="Cluster" // ProvisionerCapability is the schema for the provisionercapability API // +k8s:openapi-gen=true