Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kubebuilder catagories for ProviderConfig and MyType #27

Merged
merged 3 commits into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apis/sample/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,managed,PROVIDER-NAME}
type MyType struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
3 changes: 2 additions & 1 deletion apis/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
6 changes: 5 additions & 1 deletion package/crds/sample.template.crossplane.io_mytypes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ metadata:
spec:
group: sample.template.crossplane.io
names:
categories:
- crossplane
- managed
- PROVIDER-NAME
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@negz @hasheddan It would be awkward if contributors copied this template and forgot to replace PROVIDER-NAME. So I wonder whether this PR is necessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, I think there's a bunch of places where we assume the provider name is template and that folks will change it so this shouldn't be too bad. 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found it useful to know which things I should change from the template. The string template is all over the place so it will be great to make it explicit that template means provider name.. which I am not 100% sure that it means that for every appearance of template. The same happens with sample in sample.template.crossplane.io

kind: MyType
listKind: MyTypeList
plural: mytypes
Expand All @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ metadata:
spec:
group: template.crossplane.io
names:
categories:
- crossplane
- provider
- PROVIDER-NAME
kind: ProviderConfigUsage
listKind: ProviderConfigUsageList
plural: providerconfigusages
Expand All @@ -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'
Expand Down