Skip to content

Commit bda0aab

Browse files
rahulbabu95Rahul Ganesh
and
Rahul Ganesh
authored
Remove kubebuilder annotations from local copy of CAPT APIs (#9121)
Signed-off-by: Rahul Ganesh <[email protected]> Co-authored-by: Rahul Ganesh <[email protected]>
1 parent 4783df3 commit bda0aab

7 files changed

+0
-64
lines changed

pkg/api/v1alpha1/thirdparty/tinkerbell/capt/v1beta1/groupversion_info.go

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
// +kubebuilder:object:generate=true
18-
// +groupName=infrastructure.cluster.x-k8s.io
19-
2017
package v1beta1
2118

2219
import (

pkg/api/v1alpha1/thirdparty/tinkerbell/capt/v1beta1/tinkerbellcluster_types.go

-17
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ type TinkerbellClusterSpec struct {
3333
//
3434
// See https://cluster-api.sigs.k8s.io/developer/architecture/controllers/cluster.html
3535
// for more details.
36-
//
37-
// +optional
3836
ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint,omitempty"`
3937

4038
// ImageLookupFormat is the URL naming format to use for machine images when
@@ -49,24 +47,18 @@ type TinkerbellClusterSpec struct {
4947
// kubernetes/release: v1.13.0, v1.12.5-mybuild.1, or v1.17.3. For example, the default
5048
// image format of {{.BaseRegistry}}/{{.OSDistro}}-{{.OSVersion}}:{{.KubernetesVersion}}.gz will
5149
// attempt to pull the image from that location. See also: https://golang.org/pkg/text/template/
52-
// +optional
5350
ImageLookupFormat string `json:"imageLookupFormat,omitempty"`
5451

5552
// ImageLookupBaseRegistry is the base Registry URL that is used for pulling images,
5653
// if not set, the default will be to use ghcr.io/tinkerbell/cluster-api-provider-tinkerbell.
57-
// +optional
58-
// +kubebuilder:default=ghcr.io/tinkerbell/cluster-api-provider-tinkerbell
5954
ImageLookupBaseRegistry string `json:"imageLookupBaseRegistry,omitempty"`
6055

6156
// ImageLookupOSDistro is the name of the OS distro to use when fetching machine images,
6257
// if not set it will default to ubuntu.
63-
// +optional
64-
// +kubebuilder:default=ubuntu
6558
ImageLookupOSDistro string `json:"imageLookupOSDistro,omitempty"`
6659

6760
// ImageLookupOSVersion is the version of the OS distribution to use when fetching machine
6861
// images. If not set it will default based on ImageLookupOSDistro.
69-
// +optional
7062
ImageLookupOSVersion string `json:"imageLookupOSVersion,omitempty"`
7163
}
7264

@@ -76,16 +68,9 @@ type TinkerbellClusterStatus struct {
7668
// Important: Run "make" to regenerate code after modifying this file.
7769

7870
// Ready denotes that the cluster (infrastructure) is ready.
79-
// +optional
8071
Ready bool `json:"ready"`
8172
}
8273

83-
// +kubebuilder:subresource:status
84-
// +kubebuilder:resource:path=tinkerbellclusters,scope=Namespaced,categories=cluster-api
85-
// +kubebuilder:object:root=true
86-
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this TinkerbellCluster belongs"
87-
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="TinkerbellCluster ready status"
88-
8974
// TinkerbellCluster is the Schema for the tinkerbellclusters API.
9075
type TinkerbellCluster struct {
9176
metav1.TypeMeta `json:",inline"`
@@ -95,8 +80,6 @@ type TinkerbellCluster struct {
9580
Status TinkerbellClusterStatus `json:"status,omitempty"`
9681
}
9782

98-
// +kubebuilder:object:root=true
99-
10083
// TinkerbellClusterList contains a list of TinkerbellCluster.
10184
type TinkerbellClusterList struct {
10285
metav1.TypeMeta `json:",inline"`

pkg/api/v1alpha1/thirdparty/tinkerbell/capt/v1beta1/tinkerbellcluster_webhook.go

-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ func (c *TinkerbellCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
3636
return ctrl.NewWebhookManagedBy(mgr).For(c).Complete() //nolint:wrapcheck
3737
}
3838

39-
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-tinkerbellcluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=tinkerbellclusters,versions=v1beta1,name=validation.tinkerbellcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
40-
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-tinkerbellcluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=tinkerbellclusters,versions=v1beta1,name=default.tinkerbellcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
41-
4239
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
4340
func (c *TinkerbellCluster) ValidateCreate() (admission.Warnings, error) {
4441
return nil, nil

pkg/api/v1alpha1/thirdparty/tinkerbell/capt/v1beta1/tinkerbellmachine_types.go

-31
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,28 @@ type TinkerbellMachineSpec struct {
4545
// kubernetes/release: v1.13.0, v1.12.5-mybuild.1, or v1.17.3. For example, the default
4646
// image format of {{.BaseRegistry}}/{{.OSDistro}}-{{.OSVersion}}:{{.KubernetesVersion}}.gz will
4747
// attempt to pull the image from that location. See also: https://golang.org/pkg/text/template/
48-
// +optional
4948
ImageLookupFormat string `json:"imageLookupFormat,omitempty"`
5049

5150
// ImageLookupBaseRegistry is the base Registry URL that is used for pulling images,
5251
// if not set, the default will be to use ghcr.io/tinkerbell/cluster-api-provider-tinkerbell.
53-
// +optional
5452
ImageLookupBaseRegistry string `json:"imageLookupBaseRegistry,omitempty"`
5553

5654
// ImageLookupOSDistro is the name of the OS distro to use when fetching machine images,
5755
// if not set it will default to ubuntu.
58-
// +optional
5956
ImageLookupOSDistro string `json:"imageLookupOSDistro,omitempty"`
6057

6158
// ImageLookupOSVersion is the version of the OS distribution to use when fetching machine
6259
// images. If not set it will default based on ImageLookupOSDistro.
63-
// +optional
6460
ImageLookupOSVersion string `json:"imageLookupOSVersion,omitempty"`
6561

6662
// TemplateOverride overrides the default Tinkerbell template used by CAPT.
6763
// You can learn more about Tinkerbell templates here: https://tinkerbell.org/docs/concepts/templates/
68-
// +optional
6964
TemplateOverride string `json:"templateOverride,omitempty"`
7065

7166
// HardwareAffinity allows filtering for hardware.
72-
// +optional
7367
HardwareAffinity *HardwareAffinity `json:"hardwareAffinity,omitempty"`
7468

7569
// BootOptions are options that control the booting of Hardware.
76-
// +optional
7770
BootOptions BootOptions `json:"bootOptions,omitempty"`
7871

7972
// Those fields are set programmatically, but they cannot be re-constructed from "state of the world", so
@@ -95,26 +88,20 @@ type BootOptions struct {
9588
// as this is where the ISO patching endpoint lives.
9689
// The ":macAddress" is a placeholder for the MAC address of the hardware and
9790
// should be provided exactly as is: ":macAddress".
98-
// +optional
99-
// +kubebuilder:validation:Format=url
10091
ISOURL string `json:"isoURL,omitempty"`
10192

10293
// BootMode is the type of booting that will be done.
10394
// Must be one of "none", "netboot", or "iso".
104-
// +optional
105-
// +kubebuilder:validation:Enum=none;netboot;iso
10695
BootMode BootMode `json:"bootMode,omitempty"`
10796
}
10897

10998
// HardwareAffinity defines the required and preferred hardware affinities.
11099
type HardwareAffinity struct {
111100
// Required are the required hardware affinity terms. The terms are OR'd together, hardware must match one term to
112101
// be considered.
113-
// +optional
114102
Required []HardwareAffinityTerm `json:"required,omitempty"`
115103
// Preferred are the preferred hardware affinity terms. Hardware matching these terms are preferred according to the
116104
// weights provided, but are not required.
117-
// +optional
118105
Preferred []WeightedHardwareAffinityTerm `json:"preferred,omitempty"`
119106
}
120107

@@ -128,8 +115,6 @@ type HardwareAffinityTerm struct {
128115
// WeightedHardwareAffinityTerm fields are added per-hardware to find the most preferred hardware.
129116
type WeightedHardwareAffinityTerm struct {
130117
// Weight associated with matching the corresponding hardwareAffinityTerm, in the range 1-100.
131-
// +kubebuilder:validation:Minimum=1
132-
// +kubebuilder:validation:Maximum=100
133118
Weight int32 `json:"weight"`
134119
// HardwareAffinityTerm is the term associated with the corresponding weight.
135120
HardwareAffinityTerm HardwareAffinityTerm `json:"hardwareAffinityTerm"`
@@ -141,20 +126,17 @@ type TinkerbellMachineStatus struct {
141126
// Important: Run "make" to regenerate code after modifying this file
142127

143128
// Ready is true when the provider resource is ready.
144-
// +optional
145129
Ready bool `json:"ready"`
146130

147131
// Addresses contains the Tinkerbell device associated addresses.
148132
Addresses []corev1.NodeAddress `json:"addresses,omitempty"`
149133

150134
// InstanceStatus is the status of the Tinkerbell device instance for this machine.
151-
// +optional
152135
InstanceStatus *TinkerbellResourceStatus `json:"instanceStatus,omitempty"`
153136

154137
// Any transient errors that occur during the reconciliation of Machines
155138
// can be added as events to the Machine object and/or logged in the
156139
// controller's output.
157-
// +optional
158140
ErrorReason *capierrors.MachineStatusError `json:"errorReason,omitempty"`
159141

160142
// ErrorMessage will be set in the event that there is a terminal problem
@@ -173,20 +155,9 @@ type TinkerbellMachineStatus struct {
173155
// Any transient errors that occur during the reconciliation of Machines
174156
// can be added as events to the Machine object and/or logged in the
175157
// controller's output.
176-
// +optional
177158
ErrorMessage *string `json:"errorMessage,omitempty"`
178159
}
179160

180-
// +kubebuilder:subresource:status
181-
// +kubebuilder:object:root=true
182-
// +kubebuilder:resource:path=tinkerbellmachines,scope=Namespaced,categories=cluster-api
183-
// +kubebuilder:storageversion
184-
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this TinkerbellMachine belongs"
185-
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.instanceState",description="Tinkerbell instance state"
186-
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Machine ready status"
187-
// +kubebuilder:printcolumn:name="InstanceID",type="string",JSONPath=".spec.providerID",description="Tinkerbell instance ID"
188-
// +kubebuilder:printcolumn:name="Machine",type="string",JSONPath=".metadata.ownerReferences[?(@.kind==\"Machine\")].name",description="Machine object which owns with this TinkerbellMachine"
189-
190161
// TinkerbellMachine is the Schema for the tinkerbellmachines API.
191162
type TinkerbellMachine struct {
192163
metav1.TypeMeta `json:",inline"`
@@ -196,8 +167,6 @@ type TinkerbellMachine struct {
196167
Status TinkerbellMachineStatus `json:"status,omitempty"`
197168
}
198169

199-
// +kubebuilder:object:root=true
200-
201170
// TinkerbellMachineList contains a list of TinkerbellMachine.
202171
type TinkerbellMachineList struct {
203172
metav1.TypeMeta `json:",inline"`

pkg/api/v1alpha1/thirdparty/tinkerbell/capt/v1beta1/tinkerbellmachine_webhook.go

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ func (m *TinkerbellMachine) SetupWebhookWithManager(mgr ctrl.Manager) error {
3030
return ctrl.NewWebhookManagedBy(mgr).For(m).Complete() //nolint:wrapcheck
3131
}
3232

33-
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-tinkerbellmachine,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=tinkerbellmachines,versions=v1beta1,name=validation.tinkerbellmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
34-
3533
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
3634
func (m *TinkerbellMachine) ValidateCreate() (admission.Warnings, error) {
3735
allErrs := m.validateSpec()

pkg/api/v1alpha1/thirdparty/tinkerbell/capt/v1beta1/tinkerbellmachinetemplate_types.go

-6
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ type TinkerbellMachineTemplateSpec struct {
2525
Template TinkerbellMachineTemplateResource `json:"template"`
2626
}
2727

28-
// +kubebuilder:object:root=true
29-
// +kubebuilder:resource:path=tinkerbellmachinetemplates,scope=Namespaced,categories=cluster-api
30-
// +kubebuilder:storageversion
31-
3228
// TinkerbellMachineTemplate is the Schema for the tinkerbellmachinetemplates API.
3329
type TinkerbellMachineTemplate struct {
3430
metav1.TypeMeta `json:",inline"`
@@ -37,8 +33,6 @@ type TinkerbellMachineTemplate struct {
3733
Spec TinkerbellMachineTemplateSpec `json:"spec,omitempty"`
3834
}
3935

40-
// +kubebuilder:object:root=true
41-
4236
// TinkerbellMachineTemplateList contains a list of TinkerbellMachineTemplate.
4337
type TinkerbellMachineTemplateList struct {
4438
metav1.TypeMeta `json:",inline"`

pkg/api/v1alpha1/thirdparty/tinkerbell/capt/v1beta1/tinkerbellmachinetemplate_webhook.go

-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ func (m *TinkerbellMachineTemplate) SetupWebhookWithManager(mgr ctrl.Manager) er
3333
return ctrl.NewWebhookManagedBy(mgr).For(m).Complete() //nolint:wrapcheck
3434
}
3535

36-
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-tinkerbellmachinetemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=tinkerbellmachinetemplates,versions=v1beta1,name=validation.tinkerbellmachinetemplate.infrastructure.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
37-
3836
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
3937
func (m *TinkerbellMachineTemplate) ValidateCreate() (admission.Warnings, error) {
4038
var allErrs field.ErrorList

0 commit comments

Comments
 (0)