From dc4e22355a4652a0f34a19d2b4d62e6753f16bc4 Mon Sep 17 00:00:00 2001 From: cjschaef Date: Thu, 14 Mar 2024 12:42:01 -0500 Subject: [PATCH] VPC: Create basic types for VPC Create a basic VPC resource type that VPC definitions will use. --- api/v1beta2/types.go | 14 ++++++++++++++ api/v1beta2/zz_generated.deepcopy.go | 25 +++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/api/v1beta2/types.go b/api/v1beta2/types.go index bf3fd18d3..ec04f00e7 100644 --- a/api/v1beta2/types.go +++ b/api/v1beta2/types.go @@ -396,3 +396,17 @@ type VPCEndpoint struct { // +optional LBID *string `json:"loadBalancerIPID,omitempty"` } + +// VPCResource represents a specific VPC resource. +// +kubebuilder:validation:XValidation:rule="has(self.id) || has(self.name)",message="an id or name must be provided" +type VPCResource struct { + // id of the resource. + // +kubebuilder:validation:MinLength=1 + // +optional + ID *string `json:"id,omitempty"` + + // name of the resource. + // +kubebuilder:validation:MinLength=1 + // +optional + Name *string `json:"name,omitempty"` +} diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index e234e2bdf..94669e099 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -1635,6 +1635,31 @@ func (in *VPCLoadBalancerStatus) DeepCopy() *VPCLoadBalancerStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCResource) DeepCopyInto(out *VPCResource) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCResource. +func (in *VPCResource) DeepCopy() *VPCResource { + if in == nil { + return nil + } + out := new(VPCResource) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VPCResourceReference) DeepCopyInto(out *VPCResourceReference) { *out = *in