diff --git a/crd/clustersubnetstate/Makefile b/crd/clustersubnetstate/Makefile new file mode 100644 index 0000000000..2304a92f64 --- /dev/null +++ b/crd/clustersubnetstate/Makefile @@ -0,0 +1,20 @@ +.DEFAULT_GOAL = all + +REPO_ROOT = $(shell git rev-parse --show-toplevel) +TOOLS_DIR = $(REPO_ROOT)/build/tools +TOOLS_BIN_DIR = $(REPO_ROOT)/build/tools/bin +CONTROLLER_GEN = $(TOOLS_BIN_DIR)/controller-gen + +.PHONY: generate manifests + +all: generate manifests + +generate: $(CONTROLLER_GEN) + $(CONTROLLER_GEN) object paths="./..." + +manifests: $(CONTROLLER_GEN) + mkdir -p manifests + $(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=manifests/ + +$(CONTROLLER_GEN): + @make -C $(REPO_ROOT) $(CONTROLLER_GEN) diff --git a/crd/clustersubnetstate/api/v1alpha1/clustersubnetstate.go b/crd/clustersubnetstate/api/v1alpha1/clustersubnetstate.go new file mode 100644 index 0000000000..59210e835b --- /dev/null +++ b/crd/clustersubnetstate/api/v1alpha1/clustersubnetstate.go @@ -0,0 +1,49 @@ +//go:build !ignore_uncovered +// +build !ignore_uncovered + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// Important: Run "make" to regenerate code after modifying this file + +// +kubebuilder:object:root=true + +// ClusterSubnetState is the Schema for the ClusterSubnetState API +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Namespaced +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Timestamp",type=string,JSONPath=`.status.exhausted` +// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.spec.timestamp` +type ClusterSubnetState struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ClusterSubnetStateSpec `json:"spec,omitempty"` + Status ClusterSubnetStateStatus `json:"status,omitempty"` +} + +// ClusterSubnetStateSpec defines the desired state of ClusterSubnetState +type ClusterSubnetStateSpec struct { + Timestamp string `json:"Timestamp"` +} + +// ClusterSubnetStateStatus defines the observed state of ClusterSubnetState +type ClusterSubnetStateStatus struct { + Exhausted bool `json:"Exhausted"` +} + +// +kubebuilder:object:root=true + +// ClusterSubnetStateList contains a list of ClusterSubnetState +type ClusterSubnetStateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ClusterSubnetState `json:"items"` +} + +func init() { + SchemeBuilder.Register(&ClusterSubnetState{}, &ClusterSubnetStateList{}) +} diff --git a/crd/clustersubnetstate/api/v1alpha1/groupversion_info.go b/crd/clustersubnetstate/api/v1alpha1/groupversion_info.go new file mode 100644 index 0000000000..e00e625a54 --- /dev/null +++ b/crd/clustersubnetstate/api/v1alpha1/groupversion_info.go @@ -0,0 +1,23 @@ +//go:build !ignore_uncovered +// +build !ignore_uncovered + +// Package v1alpha contains API Schema definitions for the acn v1alpha API group +// +kubebuilder:object:generate=true +// +groupName=acn.azure.com +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "acn.azure.com", Version: "v1alpha1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/crd/clustersubnetstate/api/v1alpha1/zz_generated.deepcopy.go b/crd/clustersubnetstate/api/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..c59724acf9 --- /dev/null +++ b/crd/clustersubnetstate/api/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,99 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSubnetState) DeepCopyInto(out *ClusterSubnetState) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSubnetState. +func (in *ClusterSubnetState) DeepCopy() *ClusterSubnetState { + if in == nil { + return nil + } + out := new(ClusterSubnetState) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterSubnetState) 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 *ClusterSubnetStateList) DeepCopyInto(out *ClusterSubnetStateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterSubnetState, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSubnetStateList. +func (in *ClusterSubnetStateList) DeepCopy() *ClusterSubnetStateList { + if in == nil { + return nil + } + out := new(ClusterSubnetStateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterSubnetStateList) 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 *ClusterSubnetStateSpec) DeepCopyInto(out *ClusterSubnetStateSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSubnetStateSpec. +func (in *ClusterSubnetStateSpec) DeepCopy() *ClusterSubnetStateSpec { + if in == nil { + return nil + } + out := new(ClusterSubnetStateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSubnetStateStatus) DeepCopyInto(out *ClusterSubnetStateStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSubnetStateStatus. +func (in *ClusterSubnetStateStatus) DeepCopy() *ClusterSubnetStateStatus { + if in == nil { + return nil + } + out := new(ClusterSubnetStateStatus) + in.DeepCopyInto(out) + return out +} diff --git a/crd/clustersubnetstate/manifests/acn.azure.com_clustersubnetstates.yaml b/crd/clustersubnetstate/manifests/acn.azure.com_clustersubnetstates.yaml new file mode 100644 index 0000000000..f5fd45807e --- /dev/null +++ b/crd/clustersubnetstate/manifests/acn.azure.com_clustersubnetstates.yaml @@ -0,0 +1,62 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.9.0 + creationTimestamp: null + name: clustersubnetstates.acn.azure.com +spec: + group: acn.azure.com + names: + kind: ClusterSubnetState + listKind: ClusterSubnetStateList + plural: clustersubnetstates + singular: clustersubnetstate + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .status.exhausted + name: Timestamp + type: string + - jsonPath: .spec.timestamp + name: Status + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: ClusterSubnetState is the Schema for the ClusterSubnetState 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: ClusterSubnetStateSpec defines the desired state of ClusterSubnetState + properties: + Timestamp: + type: string + required: + - Timestamp + type: object + status: + description: ClusterSubnetStateStatus defines the observed state of ClusterSubnetState + properties: + Exhausted: + type: boolean + required: + - Exhausted + type: object + type: object + served: true + storage: true + subresources: + status: {}