Skip to content

Commit

Permalink
Remove kubebuilder annotations from local copy of CAPT APIs
Browse files Browse the repository at this point in the history
Signed-off-by: Rahul Ganesh <[email protected]>
  • Loading branch information
Rahul Ganesh committed Jan 2, 2025
1 parent 4783df3 commit d47d50c
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// +kubebuilder:object:generate=true
// +groupName=infrastructure.cluster.x-k8s.io

package v1beta1

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ type TinkerbellClusterSpec struct {
//
// See https://cluster-api.sigs.k8s.io/developer/architecture/controllers/cluster.html
// for more details.
//
// +optional
ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint,omitempty"`

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

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

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

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

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

// Ready denotes that the cluster (infrastructure) is ready.
// +optional
Ready bool `json:"ready"`
}

// +kubebuilder:subresource:status
// +kubebuilder:resource:path=tinkerbellclusters,scope=Namespaced,categories=cluster-api
// +kubebuilder:object:root=true
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this TinkerbellCluster belongs"
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="TinkerbellCluster ready status"

// TinkerbellCluster is the Schema for the tinkerbellclusters API.
type TinkerbellCluster struct {
metav1.TypeMeta `json:",inline"`
Expand All @@ -95,8 +80,6 @@ type TinkerbellCluster struct {
Status TinkerbellClusterStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// TinkerbellClusterList contains a list of TinkerbellCluster.
type TinkerbellClusterList struct {
metav1.TypeMeta `json:",inline"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ func (c *TinkerbellCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).For(c).Complete() //nolint:wrapcheck
}

// +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
// +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

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
func (c *TinkerbellCluster) ValidateCreate() (admission.Warnings, error) {
return nil, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,35 +45,28 @@ type TinkerbellMachineSpec struct {
// kubernetes/release: v1.13.0, v1.12.5-mybuild.1, or v1.17.3. For example, the default
// image format of {{.BaseRegistry}}/{{.OSDistro}}-{{.OSVersion}}:{{.KubernetesVersion}}.gz will
// attempt to pull the image from that location. See also: https://golang.org/pkg/text/template/
// +optional
ImageLookupFormat string `json:"imageLookupFormat,omitempty"`

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

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

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

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

// HardwareAffinity allows filtering for hardware.
// +optional
HardwareAffinity *HardwareAffinity `json:"hardwareAffinity,omitempty"`

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

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

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

// HardwareAffinity defines the required and preferred hardware affinities.
type HardwareAffinity struct {
// Required are the required hardware affinity terms. The terms are OR'd together, hardware must match one term to
// be considered.
// +optional
Required []HardwareAffinityTerm `json:"required,omitempty"`
// Preferred are the preferred hardware affinity terms. Hardware matching these terms are preferred according to the
// weights provided, but are not required.
// +optional
Preferred []WeightedHardwareAffinityTerm `json:"preferred,omitempty"`
}

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

// Ready is true when the provider resource is ready.
// +optional
Ready bool `json:"ready"`

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

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

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

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

// +kubebuilder:subresource:status
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=tinkerbellmachines,scope=Namespaced,categories=cluster-api
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this TinkerbellMachine belongs"
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.instanceState",description="Tinkerbell instance state"
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Machine ready status"
// +kubebuilder:printcolumn:name="InstanceID",type="string",JSONPath=".spec.providerID",description="Tinkerbell instance ID"
// +kubebuilder:printcolumn:name="Machine",type="string",JSONPath=".metadata.ownerReferences[?(@.kind==\"Machine\")].name",description="Machine object which owns with this TinkerbellMachine"

// TinkerbellMachine is the Schema for the tinkerbellmachines API.
type TinkerbellMachine struct {
metav1.TypeMeta `json:",inline"`
Expand All @@ -196,8 +167,6 @@ type TinkerbellMachine struct {
Status TinkerbellMachineStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// TinkerbellMachineList contains a list of TinkerbellMachine.
type TinkerbellMachineList struct {
metav1.TypeMeta `json:",inline"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ func (m *TinkerbellMachine) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).For(m).Complete() //nolint:wrapcheck
}

// +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

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
func (m *TinkerbellMachine) ValidateCreate() (admission.Warnings, error) {
allErrs := m.validateSpec()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ type TinkerbellMachineTemplateSpec struct {
Template TinkerbellMachineTemplateResource `json:"template"`
}

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=tinkerbellmachinetemplates,scope=Namespaced,categories=cluster-api
// +kubebuilder:storageversion

// TinkerbellMachineTemplate is the Schema for the tinkerbellmachinetemplates API.
type TinkerbellMachineTemplate struct {
metav1.TypeMeta `json:",inline"`
Expand All @@ -37,8 +33,6 @@ type TinkerbellMachineTemplate struct {
Spec TinkerbellMachineTemplateSpec `json:"spec,omitempty"`
}

// +kubebuilder:object:root=true

// TinkerbellMachineTemplateList contains a list of TinkerbellMachineTemplate.
type TinkerbellMachineTemplateList struct {
metav1.TypeMeta `json:",inline"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ func (m *TinkerbellMachineTemplate) SetupWebhookWithManager(mgr ctrl.Manager) er
return ctrl.NewWebhookManagedBy(mgr).For(m).Complete() //nolint:wrapcheck
}

// +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

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
func (m *TinkerbellMachineTemplate) ValidateCreate() (admission.Warnings, error) {
var allErrs field.ErrorList
Expand Down

0 comments on commit d47d50c

Please sign in to comment.