From 3304ae3ab2246dcfbb8c5da0fb159bf2b9524d18 Mon Sep 17 00:00:00 2001 From: Zheng Xi Zhou Date: Tue, 6 Apr 2021 11:42:19 +0800 Subject: [PATCH 1/3] Add kubebuilder catagories for ProviderConfig and MyType Added kubebuilder catagories {crossplane,provider,PROVIDER-NAME} in the template. Signed-off-by: Zheng Xi Zhou --- apis/sample/v1alpha1/types.go | 5 +++-- apis/v1alpha1/types.go | 3 ++- package/crds/sample.template.crossplane.io_mytypes.yaml | 6 +++++- .../crds/template.crossplane.io_providerconfigusages.yaml | 6 +++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/apis/sample/v1alpha1/types.go b/apis/sample/v1alpha1/types.go index c27ca61..977e016 100644 --- a/apis/sample/v1alpha1/types.go +++ b/apis/sample/v1alpha1/types.go @@ -46,13 +46,14 @@ type MyTypeStatus struct { // +kubebuilder:object:root=true -// A MyType is an example API type +// A MyType is an example API type. // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="STATUS",type="string",JSONPath=".status.bindingPhase" // +kubebuilder:printcolumn:name="STATE",type="string",JSONPath=".status.atProvider.state" // +kubebuilder:printcolumn:name="CLASS",type="string",JSONPath=".spec.classRef.name" // +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" -// +kubebuilder:resource:scope=Cluster +// Please replace `PROVIDER-NAME` with your actual provider name, like `aws`, `azure`, `gcp`, `alibaba` +// +kubebuilder:resource:scope=Cluster,categories={crossplane,provider,PROVIDER-NAME} type MyType struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/apis/v1alpha1/types.go b/apis/v1alpha1/types.go index 22a5202..5b5e81f 100644 --- a/apis/v1alpha1/types.go +++ b/apis/v1alpha1/types.go @@ -73,7 +73,8 @@ type ProviderConfigList struct { // +kubebuilder:printcolumn:name="CONFIG-NAME",type="string",JSONPath=".providerConfigRef.name" // +kubebuilder:printcolumn:name="RESOURCE-KIND",type="string",JSONPath=".resourceRef.kind" // +kubebuilder:printcolumn:name="RESOURCE-NAME",type="string",JSONPath=".resourceRef.name" -// +kubebuilder:resource:scope=Cluster +// Please replace `PROVIDER-NAME` with your actual provider name, like `aws`, `azure`, `gcp`, `alibaba` +// +kubebuilder:resource:scope=Cluster,categories={crossplane,provider,PROVIDER-NAME} type ProviderConfigUsage struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/package/crds/sample.template.crossplane.io_mytypes.yaml b/package/crds/sample.template.crossplane.io_mytypes.yaml index 3f80df0..5106432 100644 --- a/package/crds/sample.template.crossplane.io_mytypes.yaml +++ b/package/crds/sample.template.crossplane.io_mytypes.yaml @@ -8,6 +8,10 @@ metadata: spec: group: sample.template.crossplane.io names: + categories: + - crossplane + - provider + - PROVIDER-NAME kind: MyType listKind: MyTypeList plural: mytypes @@ -30,7 +34,7 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: A MyType is an example API type + description: A MyType is an example API type Please replace `PROVIDER-NAME` with your actual provider name, like `aws`, `azure`, `gcp`, `alibaba` 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' diff --git a/package/crds/template.crossplane.io_providerconfigusages.yaml b/package/crds/template.crossplane.io_providerconfigusages.yaml index e16df1b..460c560 100644 --- a/package/crds/template.crossplane.io_providerconfigusages.yaml +++ b/package/crds/template.crossplane.io_providerconfigusages.yaml @@ -8,6 +8,10 @@ metadata: spec: group: template.crossplane.io names: + categories: + - crossplane + - provider + - PROVIDER-NAME kind: ProviderConfigUsage listKind: ProviderConfigUsageList plural: providerconfigusages @@ -30,7 +34,7 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: A ProviderConfigUsage indicates that a resource is using a ProviderConfig. + description: A ProviderConfigUsage indicates that a resource is using a ProviderConfig. Please replace `PROVIDER-NAME` with your actual provider name, like `aws`, `azure`, `gcp`, `alibaba` 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' From 40d758e1bb34bb1616c4e53fce1f481c41433501 Mon Sep 17 00:00:00 2001 From: Zheng Xi Zhou Date: Wed, 7 Apr 2021 11:45:53 +0800 Subject: [PATCH 2/3] Update apis/sample/v1alpha1/types.go Co-authored-by: Nic Cope Signed-off-by: Zheng Xi Zhou --- apis/sample/v1alpha1/types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis/sample/v1alpha1/types.go b/apis/sample/v1alpha1/types.go index 977e016..526f761 100644 --- a/apis/sample/v1alpha1/types.go +++ b/apis/sample/v1alpha1/types.go @@ -53,7 +53,7 @@ type MyTypeStatus struct { // +kubebuilder:printcolumn:name="CLASS",type="string",JSONPath=".spec.classRef.name" // +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" // Please replace `PROVIDER-NAME` with your actual provider name, like `aws`, `azure`, `gcp`, `alibaba` -// +kubebuilder:resource:scope=Cluster,categories={crossplane,provider,PROVIDER-NAME} +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,PROVIDER-NAME} type MyType struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` From 9269825e2f2bb3bd58491334a7a13995c4c3e82b Mon Sep 17 00:00:00 2001 From: Zheng Xi Zhou Date: Wed, 7 Apr 2021 11:49:49 +0800 Subject: [PATCH 3/3] Regenerate manifests after merge co-author's commit Signed-off-by: Zheng Xi Zhou --- package/crds/sample.template.crossplane.io_mytypes.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/crds/sample.template.crossplane.io_mytypes.yaml b/package/crds/sample.template.crossplane.io_mytypes.yaml index 5106432..5506092 100644 --- a/package/crds/sample.template.crossplane.io_mytypes.yaml +++ b/package/crds/sample.template.crossplane.io_mytypes.yaml @@ -10,7 +10,7 @@ spec: names: categories: - crossplane - - provider + - managed - PROVIDER-NAME kind: MyType listKind: MyTypeList @@ -34,7 +34,7 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: A MyType is an example API type Please replace `PROVIDER-NAME` with your actual provider name, like `aws`, `azure`, `gcp`, `alibaba` + description: A MyType is an example API type. Please replace `PROVIDER-NAME` with your actual provider name, like `aws`, `azure`, `gcp`, `alibaba` 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'