diff --git a/api/v1beta2/awsmanagedclustertemplate_types.go b/api/v1beta2/awsmanagedclustertemplate_types.go new file mode 100644 index 0000000000..0140d40675 --- /dev/null +++ b/api/v1beta2/awsmanagedclustertemplate_types.go @@ -0,0 +1,60 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AWSManagedClusterTemplateSpec defines the desired state of AWSManagedClusterTemplate. +type AWSManagedClusterTemplateSpec struct { + Template AWSManagedClusterTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsmanagedclustertemplates,scope=Namespaced,categories=cluster-api,shortName=amct +// +kubebuilder:storageversion + +// AWSManagedClusterTemplate is the Schema for the AWSManagedClusterTemplates API. +type AWSManagedClusterTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AWSManagedClusterTemplateSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// AWSManagedClusterTemplateList contains a list of AWSManagedClusterTemplates. +type AWSManagedClusterTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSManagedClusterTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AWSManagedClusterTemplate{}, &AWSManagedClusterTemplateList{}) +} + +// AWSManagedClusterTemplateResource describes the data needed to create an AWSManagedCluster from a template. +type AWSManagedClusterTemplateResource struct { + Spec AWSManagedClusterTemplateResourceSpec `json:"spec"` +} + +// AWSManagedClusterTemplateResourceSpec defines the desired state of an AWSManagedCluster. Note that +// this object is needed to satisfy the ClusterClass contract. +type AWSManagedClusterTemplateResourceSpec struct{} diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index c727483f6b..3e6b96d16c 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -1037,6 +1037,111 @@ func (in *AWSManagedClusterStatus) DeepCopy() *AWSManagedClusterStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSManagedClusterTemplate) DeepCopyInto(out *AWSManagedClusterTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedClusterTemplate. +func (in *AWSManagedClusterTemplate) DeepCopy() *AWSManagedClusterTemplate { + if in == nil { + return nil + } + out := new(AWSManagedClusterTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSManagedClusterTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSManagedClusterTemplateList) DeepCopyInto(out *AWSManagedClusterTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSManagedClusterTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedClusterTemplateList. +func (in *AWSManagedClusterTemplateList) DeepCopy() *AWSManagedClusterTemplateList { + if in == nil { + return nil + } + out := new(AWSManagedClusterTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSManagedClusterTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSManagedClusterTemplateResource) DeepCopyInto(out *AWSManagedClusterTemplateResource) { + *out = *in + out.Spec = in.Spec +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedClusterTemplateResource. +func (in *AWSManagedClusterTemplateResource) DeepCopy() *AWSManagedClusterTemplateResource { + if in == nil { + return nil + } + out := new(AWSManagedClusterTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSManagedClusterTemplateResourceSpec) DeepCopyInto(out *AWSManagedClusterTemplateResourceSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedClusterTemplateResourceSpec. +func (in *AWSManagedClusterTemplateResourceSpec) DeepCopy() *AWSManagedClusterTemplateResourceSpec { + if in == nil { + return nil + } + out := new(AWSManagedClusterTemplateResourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSManagedClusterTemplateSpec) DeepCopyInto(out *AWSManagedClusterTemplateSpec) { + *out = *in + out.Template = in.Template +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedClusterTemplateSpec. +func (in *AWSManagedClusterTemplateSpec) DeepCopy() *AWSManagedClusterTemplateSpec { + if in == nil { + return nil + } + out := new(AWSManagedClusterTemplateSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AWSResourceReference) DeepCopyInto(out *AWSResourceReference) { *out = *in diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedclustertemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedclustertemplates.yaml new file mode 100644 index 0000000000..323172df87 --- /dev/null +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedclustertemplates.yaml @@ -0,0 +1,65 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: awsmanagedclustertemplates.infrastructure.cluster.x-k8s.io +spec: + group: infrastructure.cluster.x-k8s.io + names: + categories: + - cluster-api + kind: AWSManagedClusterTemplate + listKind: AWSManagedClusterTemplateList + plural: awsmanagedclustertemplates + shortNames: + - amct + singular: awsmanagedclustertemplate + scope: Namespaced + versions: + - name: v1beta2 + schema: + openAPIV3Schema: + description: AWSManagedClusterTemplate is the Schema for the AWSManagedClusterTemplates + API. + 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 + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: AWSManagedClusterTemplateSpec defines the desired state of + AWSManagedClusterTemplate. + properties: + template: + description: AWSManagedClusterTemplateResource describes the data + needed to create an AWSManagedCluster from a template. + properties: + spec: + description: |- + AWSManagedClusterTemplateResourceSpec defines the desired state of an AWSManagedCluster. Note that + this object is needed to satisfy the ClusterClass contract. + type: object + required: + - spec + type: object + required: + - template + type: object + type: object + served: true + storage: true