Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Add kubebuilder markers to CRDs for status and namespace #117

Merged
merged 1 commit into from
Aug 13, 2019
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
3 changes: 3 additions & 0 deletions api/v1alpha2/kubeadmbootstrapconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ type KubeadmConfigStatus struct {
}

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=kubeadmconfigs,scope=Namespaced
Copy link
Contributor

Choose a reason for hiding this comment

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

namespaced is the default if I'm reading https://book.kubebuilder.io/reference/markers/crd.html correctly. I don't really know what this is doing otherwise. Why do we need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's actually not, it'll default to empty

Copy link
Contributor

Choose a reason for hiding this comment

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

oh that's fun

// +kubebuilder:storageversion
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have conversion enabled?

what does this do when conversion is not enabled?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think setting it proactively will help when we do enable conversions in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The storageversion serves for conversion and for future version iterations. Other CAP* projects specify this field as well

// +kubebuilder:subresource:status

// KubeadmConfig is the Schema for the kubeadmconfigs API
type KubeadmConfig struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ spec:
names:
kind: KubeadmConfig
plural: kubeadmconfigs
scope: ""
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: KubeadmConfig is the Schema for the kubeadmconfigs API
Expand Down