diff --git a/apis/kube/v1alpha1/zz_cluster_types.go b/apis/kube/v1alpha1/zz_cluster_types.go index 40e650f..7ea91fa 100755 --- a/apis/kube/v1alpha1/zz_cluster_types.go +++ b/apis/kube/v1alpha1/zz_cluster_types.go @@ -65,8 +65,6 @@ type ClusterInitParameters struct { PrivateNetworkConfiguration []PrivateNetworkConfigurationInitParameters `json:"privateNetworkConfiguration,omitempty" tf:"private_network_configuration,omitempty"` - PrivateNetworkID *string `json:"privateNetworkId,omitempty" tf:"private_network_id,omitempty"` - Region *string `json:"region,omitempty" tf:"region,omitempty"` ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` @@ -134,9 +132,18 @@ type ClusterParameters struct { // +kubebuilder:validation:Optional PrivateNetworkConfiguration []PrivateNetworkConfigurationParameters `json:"privateNetworkConfiguration,omitempty" tf:"private_network_configuration,omitempty"` + // +crossplane:generate:reference:type=github.com/edixos/provider-ovh/apis/network/v1alpha1.PrivateNetwork // +kubebuilder:validation:Optional PrivateNetworkID *string `json:"privateNetworkId,omitempty" tf:"private_network_id,omitempty"` + // Reference to a PrivateNetwork in network to populate privateNetworkId. + // +kubebuilder:validation:Optional + PrivateNetworkIDRef *v1.Reference `json:"privateNetworkIdRef,omitempty" tf:"-"` + + // Selector for a PrivateNetwork in network to populate privateNetworkId. + // +kubebuilder:validation:Optional + PrivateNetworkIDSelector *v1.Selector `json:"privateNetworkIdSelector,omitempty" tf:"-"` + // +kubebuilder:validation:Optional Region *string `json:"region,omitempty" tf:"region,omitempty"` diff --git a/apis/kube/v1alpha1/zz_generated.deepcopy.go b/apis/kube/v1alpha1/zz_generated.deepcopy.go index 2c4a5de..ad183a4 100644 --- a/apis/kube/v1alpha1/zz_generated.deepcopy.go +++ b/apis/kube/v1alpha1/zz_generated.deepcopy.go @@ -258,11 +258,6 @@ func (in *ClusterInitParameters) DeepCopyInto(out *ClusterInitParameters) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.PrivateNetworkID != nil { - in, out := &in.PrivateNetworkID, &out.PrivateNetworkID - *out = new(string) - **out = **in - } if in.Region != nil { in, out := &in.Region, &out.Region *out = new(string) @@ -492,6 +487,16 @@ func (in *ClusterParameters) DeepCopyInto(out *ClusterParameters) { *out = new(string) **out = **in } + if in.PrivateNetworkIDRef != nil { + in, out := &in.PrivateNetworkIDRef, &out.PrivateNetworkIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.PrivateNetworkIDSelector != nil { + in, out := &in.PrivateNetworkIDSelector, &out.PrivateNetworkIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Region != nil { in, out := &in.Region, &out.Region *out = new(string) diff --git a/apis/kube/v1alpha1/zz_generated.resolvers.go b/apis/kube/v1alpha1/zz_generated.resolvers.go index 81380e3..da6e689 100644 --- a/apis/kube/v1alpha1/zz_generated.resolvers.go +++ b/apis/kube/v1alpha1/zz_generated.resolvers.go @@ -8,10 +8,37 @@ package v1alpha1 import ( "context" reference "github.com/crossplane/crossplane-runtime/pkg/reference" + v1alpha1 "github.com/edixos/provider-ovh/apis/network/v1alpha1" errors "github.com/pkg/errors" client "sigs.k8s.io/controller-runtime/pkg/client" ) +// ResolveReferences of this Cluster. +func (mg *Cluster) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.PrivateNetworkID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.PrivateNetworkIDRef, + Selector: mg.Spec.ForProvider.PrivateNetworkIDSelector, + To: reference.To{ + List: &v1alpha1.PrivateNetworkList{}, + Managed: &v1alpha1.PrivateNetwork{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.PrivateNetworkID") + } + mg.Spec.ForProvider.PrivateNetworkID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.PrivateNetworkIDRef = rsp.ResolvedReference + + return nil +} + // ResolveReferences of this IpRestriction. func (mg *IpRestriction) ResolveReferences(ctx context.Context, c client.Reader) error { r := reference.NewAPIResolver(c, mg) diff --git a/apis/pcn/v1alpha1/zz_generated.deepcopy.go b/apis/network/v1alpha1/zz_generated.deepcopy.go similarity index 78% rename from apis/pcn/v1alpha1/zz_generated.deepcopy.go rename to apis/network/v1alpha1/zz_generated.deepcopy.go index cce0d75..98bbeb6 100644 --- a/apis/pcn/v1alpha1/zz_generated.deepcopy.go +++ b/apis/network/v1alpha1/zz_generated.deepcopy.go @@ -9,6 +9,7 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -83,7 +84,7 @@ func (in *IPPoolsParameters) DeepCopy() *IPPoolsParameters { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivate) DeepCopyInto(out *ProjectNetworkPrivate) { +func (in *PrivateNetwork) DeepCopyInto(out *PrivateNetwork) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -91,18 +92,18 @@ func (in *ProjectNetworkPrivate) DeepCopyInto(out *ProjectNetworkPrivate) { in.Status.DeepCopyInto(&out.Status) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivate. -func (in *ProjectNetworkPrivate) DeepCopy() *ProjectNetworkPrivate { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateNetwork. +func (in *PrivateNetwork) DeepCopy() *PrivateNetwork { if in == nil { return nil } - out := new(ProjectNetworkPrivate) + out := new(PrivateNetwork) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectNetworkPrivate) DeepCopyObject() runtime.Object { +func (in *PrivateNetwork) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -110,8 +111,13 @@ func (in *ProjectNetworkPrivate) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivateInitParameters) DeepCopyInto(out *ProjectNetworkPrivateInitParameters) { +func (in *PrivateNetworkInitParameters) DeepCopyInto(out *PrivateNetworkInitParameters) { *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } if in.Regions != nil { in, out := &in.Regions, &out.Regions *out = make([]*string, len(*in)) @@ -135,42 +141,42 @@ func (in *ProjectNetworkPrivateInitParameters) DeepCopyInto(out *ProjectNetworkP } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivateInitParameters. -func (in *ProjectNetworkPrivateInitParameters) DeepCopy() *ProjectNetworkPrivateInitParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateNetworkInitParameters. +func (in *PrivateNetworkInitParameters) DeepCopy() *PrivateNetworkInitParameters { if in == nil { return nil } - out := new(ProjectNetworkPrivateInitParameters) + out := new(PrivateNetworkInitParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivateList) DeepCopyInto(out *ProjectNetworkPrivateList) { +func (in *PrivateNetworkList) DeepCopyInto(out *PrivateNetworkList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]ProjectNetworkPrivate, len(*in)) + *out = make([]PrivateNetwork, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivateList. -func (in *ProjectNetworkPrivateList) DeepCopy() *ProjectNetworkPrivateList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateNetworkList. +func (in *PrivateNetworkList) DeepCopy() *PrivateNetworkList { if in == nil { return nil } - out := new(ProjectNetworkPrivateList) + out := new(PrivateNetworkList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectNetworkPrivateList) DeepCopyObject() runtime.Object { +func (in *PrivateNetworkList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -178,13 +184,18 @@ func (in *ProjectNetworkPrivateList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivateObservation) DeepCopyInto(out *ProjectNetworkPrivateObservation) { +func (in *PrivateNetworkObservation) DeepCopyInto(out *PrivateNetworkObservation) { *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 + } if in.Regions != nil { in, out := &in.Regions, &out.Regions *out = make([]*string, len(*in)) @@ -232,19 +243,24 @@ func (in *ProjectNetworkPrivateObservation) DeepCopyInto(out *ProjectNetworkPriv } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivateObservation. -func (in *ProjectNetworkPrivateObservation) DeepCopy() *ProjectNetworkPrivateObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateNetworkObservation. +func (in *PrivateNetworkObservation) DeepCopy() *PrivateNetworkObservation { if in == nil { return nil } - out := new(ProjectNetworkPrivateObservation) + out := new(PrivateNetworkObservation) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivateParameters) DeepCopyInto(out *ProjectNetworkPrivateParameters) { +func (in *PrivateNetworkParameters) DeepCopyInto(out *PrivateNetworkParameters) { *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } if in.Regions != nil { in, out := &in.Regions, &out.Regions *out = make([]*string, len(*in)) @@ -268,53 +284,168 @@ func (in *ProjectNetworkPrivateParameters) DeepCopyInto(out *ProjectNetworkPriva } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivateParameters. -func (in *ProjectNetworkPrivateParameters) DeepCopy() *ProjectNetworkPrivateParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateNetworkParameters. +func (in *PrivateNetworkParameters) DeepCopy() *PrivateNetworkParameters { if in == nil { return nil } - out := new(ProjectNetworkPrivateParameters) + out := new(PrivateNetworkParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivateSpec) DeepCopyInto(out *ProjectNetworkPrivateSpec) { +func (in *PrivateNetworkSpec) DeepCopyInto(out *PrivateNetworkSpec) { *out = *in in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) in.InitProvider.DeepCopyInto(&out.InitProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivateSpec. -func (in *ProjectNetworkPrivateSpec) DeepCopy() *ProjectNetworkPrivateSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateNetworkSpec. +func (in *PrivateNetworkSpec) DeepCopy() *PrivateNetworkSpec { if in == nil { return nil } - out := new(ProjectNetworkPrivateSpec) + out := new(PrivateNetworkSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivateStatus) DeepCopyInto(out *ProjectNetworkPrivateStatus) { +func (in *PrivateNetworkStatus) DeepCopyInto(out *PrivateNetworkStatus) { *out = *in in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) in.AtProvider.DeepCopyInto(&out.AtProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivateStatus. -func (in *ProjectNetworkPrivateStatus) DeepCopy() *ProjectNetworkPrivateStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateNetworkStatus. +func (in *PrivateNetworkStatus) DeepCopy() *PrivateNetworkStatus { + if in == nil { + return nil + } + out := new(PrivateNetworkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegionsAttributesInitParameters) DeepCopyInto(out *RegionsAttributesInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionsAttributesInitParameters. +func (in *RegionsAttributesInitParameters) DeepCopy() *RegionsAttributesInitParameters { + if in == nil { + return nil + } + out := new(RegionsAttributesInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegionsAttributesObservation) DeepCopyInto(out *RegionsAttributesObservation) { + *out = *in + if in.Openstackid != nil { + in, out := &in.Openstackid, &out.Openstackid + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionsAttributesObservation. +func (in *RegionsAttributesObservation) DeepCopy() *RegionsAttributesObservation { + if in == nil { + return nil + } + out := new(RegionsAttributesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegionsAttributesParameters) DeepCopyInto(out *RegionsAttributesParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionsAttributesParameters. +func (in *RegionsAttributesParameters) DeepCopy() *RegionsAttributesParameters { + if in == nil { + return nil + } + out := new(RegionsAttributesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegionsStatusInitParameters) DeepCopyInto(out *RegionsStatusInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionsStatusInitParameters. +func (in *RegionsStatusInitParameters) DeepCopy() *RegionsStatusInitParameters { + if in == nil { + return nil + } + out := new(RegionsStatusInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegionsStatusObservation) DeepCopyInto(out *RegionsStatusObservation) { + *out = *in + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionsStatusObservation. +func (in *RegionsStatusObservation) DeepCopy() *RegionsStatusObservation { + if in == nil { + return nil + } + out := new(RegionsStatusObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegionsStatusParameters) DeepCopyInto(out *RegionsStatusParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionsStatusParameters. +func (in *RegionsStatusParameters) DeepCopy() *RegionsStatusParameters { if in == nil { return nil } - out := new(ProjectNetworkPrivateStatus) + out := new(RegionsStatusParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivateSubnet) DeepCopyInto(out *ProjectNetworkPrivateSubnet) { +func (in *Subnet) DeepCopyInto(out *Subnet) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -322,18 +453,18 @@ func (in *ProjectNetworkPrivateSubnet) DeepCopyInto(out *ProjectNetworkPrivateSu in.Status.DeepCopyInto(&out.Status) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivateSubnet. -func (in *ProjectNetworkPrivateSubnet) DeepCopy() *ProjectNetworkPrivateSubnet { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnet. +func (in *Subnet) DeepCopy() *Subnet { if in == nil { return nil } - out := new(ProjectNetworkPrivateSubnet) + out := new(Subnet) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectNetworkPrivateSubnet) DeepCopyObject() runtime.Object { +func (in *Subnet) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -341,7 +472,7 @@ func (in *ProjectNetworkPrivateSubnet) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivateSubnetInitParameters) DeepCopyInto(out *ProjectNetworkPrivateSubnetInitParameters) { +func (in *SubnetInitParameters) DeepCopyInto(out *SubnetInitParameters) { *out = *in if in.DHCP != nil { in, out := &in.DHCP, &out.DHCP @@ -358,11 +489,6 @@ func (in *ProjectNetworkPrivateSubnetInitParameters) DeepCopyInto(out *ProjectNe *out = new(string) **out = **in } - if in.NetworkID != nil { - in, out := &in.NetworkID, &out.NetworkID - *out = new(string) - **out = **in - } if in.NoGateway != nil { in, out := &in.NoGateway, &out.NoGateway *out = new(bool) @@ -385,42 +511,42 @@ func (in *ProjectNetworkPrivateSubnetInitParameters) DeepCopyInto(out *ProjectNe } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivateSubnetInitParameters. -func (in *ProjectNetworkPrivateSubnetInitParameters) DeepCopy() *ProjectNetworkPrivateSubnetInitParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetInitParameters. +func (in *SubnetInitParameters) DeepCopy() *SubnetInitParameters { if in == nil { return nil } - out := new(ProjectNetworkPrivateSubnetInitParameters) + out := new(SubnetInitParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivateSubnetList) DeepCopyInto(out *ProjectNetworkPrivateSubnetList) { +func (in *SubnetList) DeepCopyInto(out *SubnetList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]ProjectNetworkPrivateSubnet, len(*in)) + *out = make([]Subnet, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivateSubnetList. -func (in *ProjectNetworkPrivateSubnetList) DeepCopy() *ProjectNetworkPrivateSubnetList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetList. +func (in *SubnetList) DeepCopy() *SubnetList { if in == nil { return nil } - out := new(ProjectNetworkPrivateSubnetList) + out := new(SubnetList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectNetworkPrivateSubnetList) DeepCopyObject() runtime.Object { +func (in *SubnetList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -428,7 +554,7 @@ func (in *ProjectNetworkPrivateSubnetList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivateSubnetObservation) DeepCopyInto(out *ProjectNetworkPrivateSubnetObservation) { +func (in *SubnetObservation) DeepCopyInto(out *SubnetObservation) { *out = *in if in.Cidr != nil { in, out := &in.Cidr, &out.Cidr @@ -494,18 +620,18 @@ func (in *ProjectNetworkPrivateSubnetObservation) DeepCopyInto(out *ProjectNetwo } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivateSubnetObservation. -func (in *ProjectNetworkPrivateSubnetObservation) DeepCopy() *ProjectNetworkPrivateSubnetObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetObservation. +func (in *SubnetObservation) DeepCopy() *SubnetObservation { if in == nil { return nil } - out := new(ProjectNetworkPrivateSubnetObservation) + out := new(SubnetObservation) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivateSubnetParameters) DeepCopyInto(out *ProjectNetworkPrivateSubnetParameters) { +func (in *SubnetParameters) DeepCopyInto(out *SubnetParameters) { *out = *in if in.DHCP != nil { in, out := &in.DHCP, &out.DHCP @@ -527,6 +653,16 @@ func (in *ProjectNetworkPrivateSubnetParameters) DeepCopyInto(out *ProjectNetwor *out = new(string) **out = **in } + if in.NetworkIDRef != nil { + in, out := &in.NetworkIDRef, &out.NetworkIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NetworkIDSelector != nil { + in, out := &in.NetworkIDSelector, &out.NetworkIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.NoGateway != nil { in, out := &in.NoGateway, &out.NoGateway *out = new(bool) @@ -549,162 +685,47 @@ func (in *ProjectNetworkPrivateSubnetParameters) DeepCopyInto(out *ProjectNetwor } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivateSubnetParameters. -func (in *ProjectNetworkPrivateSubnetParameters) DeepCopy() *ProjectNetworkPrivateSubnetParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetParameters. +func (in *SubnetParameters) DeepCopy() *SubnetParameters { if in == nil { return nil } - out := new(ProjectNetworkPrivateSubnetParameters) + out := new(SubnetParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivateSubnetSpec) DeepCopyInto(out *ProjectNetworkPrivateSubnetSpec) { +func (in *SubnetSpec) DeepCopyInto(out *SubnetSpec) { *out = *in in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) in.InitProvider.DeepCopyInto(&out.InitProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivateSubnetSpec. -func (in *ProjectNetworkPrivateSubnetSpec) DeepCopy() *ProjectNetworkPrivateSubnetSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetSpec. +func (in *SubnetSpec) DeepCopy() *SubnetSpec { if in == nil { return nil } - out := new(ProjectNetworkPrivateSubnetSpec) + out := new(SubnetSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPrivateSubnetStatus) DeepCopyInto(out *ProjectNetworkPrivateSubnetStatus) { +func (in *SubnetStatus) DeepCopyInto(out *SubnetStatus) { *out = *in in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) in.AtProvider.DeepCopyInto(&out.AtProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPrivateSubnetStatus. -func (in *ProjectNetworkPrivateSubnetStatus) DeepCopy() *ProjectNetworkPrivateSubnetStatus { - if in == nil { - return nil - } - out := new(ProjectNetworkPrivateSubnetStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegionsAttributesInitParameters) DeepCopyInto(out *RegionsAttributesInitParameters) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionsAttributesInitParameters. -func (in *RegionsAttributesInitParameters) DeepCopy() *RegionsAttributesInitParameters { - if in == nil { - return nil - } - out := new(RegionsAttributesInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegionsAttributesObservation) DeepCopyInto(out *RegionsAttributesObservation) { - *out = *in - if in.Openstackid != nil { - in, out := &in.Openstackid, &out.Openstackid - *out = new(string) - **out = **in - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionsAttributesObservation. -func (in *RegionsAttributesObservation) DeepCopy() *RegionsAttributesObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetStatus. +func (in *SubnetStatus) DeepCopy() *SubnetStatus { if in == nil { return nil } - out := new(RegionsAttributesObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegionsAttributesParameters) DeepCopyInto(out *RegionsAttributesParameters) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionsAttributesParameters. -func (in *RegionsAttributesParameters) DeepCopy() *RegionsAttributesParameters { - if in == nil { - return nil - } - out := new(RegionsAttributesParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegionsStatusInitParameters) DeepCopyInto(out *RegionsStatusInitParameters) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionsStatusInitParameters. -func (in *RegionsStatusInitParameters) DeepCopy() *RegionsStatusInitParameters { - if in == nil { - return nil - } - out := new(RegionsStatusInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegionsStatusObservation) DeepCopyInto(out *RegionsStatusObservation) { - *out = *in - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionsStatusObservation. -func (in *RegionsStatusObservation) DeepCopy() *RegionsStatusObservation { - if in == nil { - return nil - } - out := new(RegionsStatusObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegionsStatusParameters) DeepCopyInto(out *RegionsStatusParameters) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionsStatusParameters. -func (in *RegionsStatusParameters) DeepCopy() *RegionsStatusParameters { - if in == nil { - return nil - } - out := new(RegionsStatusParameters) + out := new(SubnetStatus) in.DeepCopyInto(out) return out } diff --git a/apis/network/v1alpha1/zz_generated.managed.go b/apis/network/v1alpha1/zz_generated.managed.go new file mode 100644 index 0000000..2c0c7e1 --- /dev/null +++ b/apis/network/v1alpha1/zz_generated.managed.go @@ -0,0 +1,128 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + +// GetCondition of this PrivateNetwork. +func (mg *PrivateNetwork) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this PrivateNetwork. +func (mg *PrivateNetwork) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this PrivateNetwork. +func (mg *PrivateNetwork) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this PrivateNetwork. +func (mg *PrivateNetwork) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this PrivateNetwork. +func (mg *PrivateNetwork) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this PrivateNetwork. +func (mg *PrivateNetwork) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this PrivateNetwork. +func (mg *PrivateNetwork) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this PrivateNetwork. +func (mg *PrivateNetwork) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this PrivateNetwork. +func (mg *PrivateNetwork) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this PrivateNetwork. +func (mg *PrivateNetwork) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this PrivateNetwork. +func (mg *PrivateNetwork) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this PrivateNetwork. +func (mg *PrivateNetwork) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this Subnet. +func (mg *Subnet) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Subnet. +func (mg *Subnet) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this Subnet. +func (mg *Subnet) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this Subnet. +func (mg *Subnet) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this Subnet. +func (mg *Subnet) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Subnet. +func (mg *Subnet) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Subnet. +func (mg *Subnet) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Subnet. +func (mg *Subnet) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this Subnet. +func (mg *Subnet) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this Subnet. +func (mg *Subnet) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this Subnet. +func (mg *Subnet) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Subnet. +func (mg *Subnet) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/pcn/v1alpha1/zz_generated.managedlist.go b/apis/network/v1alpha1/zz_generated.managedlist.go similarity index 62% rename from apis/pcn/v1alpha1/zz_generated.managedlist.go rename to apis/network/v1alpha1/zz_generated.managedlist.go index 8fbff4a..af166d2 100644 --- a/apis/pcn/v1alpha1/zz_generated.managedlist.go +++ b/apis/network/v1alpha1/zz_generated.managedlist.go @@ -7,8 +7,8 @@ package v1alpha1 import resource "github.com/crossplane/crossplane-runtime/pkg/resource" -// GetItems of this ProjectNetworkPrivateList. -func (l *ProjectNetworkPrivateList) GetItems() []resource.Managed { +// GetItems of this PrivateNetworkList. +func (l *PrivateNetworkList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) for i := range l.Items { items[i] = &l.Items[i] @@ -16,8 +16,8 @@ func (l *ProjectNetworkPrivateList) GetItems() []resource.Managed { return items } -// GetItems of this ProjectNetworkPrivateSubnetList. -func (l *ProjectNetworkPrivateSubnetList) GetItems() []resource.Managed { +// GetItems of this SubnetList. +func (l *SubnetList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) for i := range l.Items { items[i] = &l.Items[i] diff --git a/apis/network/v1alpha1/zz_generated.resolvers.go b/apis/network/v1alpha1/zz_generated.resolvers.go new file mode 100644 index 0000000..0c88ba8 --- /dev/null +++ b/apis/network/v1alpha1/zz_generated.resolvers.go @@ -0,0 +1,39 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this Subnet. +func (mg *Subnet) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.NetworkID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.NetworkIDRef, + Selector: mg.Spec.ForProvider.NetworkIDSelector, + To: reference.To{ + List: &PrivateNetworkList{}, + Managed: &PrivateNetwork{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.NetworkID") + } + mg.Spec.ForProvider.NetworkID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.NetworkIDRef = rsp.ResolvedReference + + return nil +} diff --git a/apis/pcn/v1alpha1/zz_generated_terraformed.go b/apis/network/v1alpha1/zz_generated_terraformed.go similarity index 56% rename from apis/pcn/v1alpha1/zz_generated_terraformed.go rename to apis/network/v1alpha1/zz_generated_terraformed.go index 9550194..6309bb4 100755 --- a/apis/pcn/v1alpha1/zz_generated_terraformed.go +++ b/apis/network/v1alpha1/zz_generated_terraformed.go @@ -17,18 +17,18 @@ import ( "github.com/crossplane/upjet/pkg/resource/json" ) -// GetTerraformResourceType returns Terraform resource type for this ProjectNetworkPrivate -func (mg *ProjectNetworkPrivate) GetTerraformResourceType() string { +// GetTerraformResourceType returns Terraform resource type for this PrivateNetwork +func (mg *PrivateNetwork) GetTerraformResourceType() string { return "ovh_cloud_project_network_private" } -// GetConnectionDetailsMapping for this ProjectNetworkPrivate -func (tr *ProjectNetworkPrivate) GetConnectionDetailsMapping() map[string]string { +// GetConnectionDetailsMapping for this PrivateNetwork +func (tr *PrivateNetwork) GetConnectionDetailsMapping() map[string]string { return nil } -// GetObservation of this ProjectNetworkPrivate -func (tr *ProjectNetworkPrivate) GetObservation() (map[string]any, error) { +// GetObservation of this PrivateNetwork +func (tr *PrivateNetwork) GetObservation() (map[string]any, error) { o, err := json.TFParser.Marshal(tr.Status.AtProvider) if err != nil { return nil, err @@ -37,8 +37,8 @@ func (tr *ProjectNetworkPrivate) GetObservation() (map[string]any, error) { return base, json.TFParser.Unmarshal(o, &base) } -// SetObservation for this ProjectNetworkPrivate -func (tr *ProjectNetworkPrivate) SetObservation(obs map[string]any) error { +// SetObservation for this PrivateNetwork +func (tr *PrivateNetwork) SetObservation(obs map[string]any) error { p, err := json.TFParser.Marshal(obs) if err != nil { return err @@ -46,16 +46,16 @@ func (tr *ProjectNetworkPrivate) SetObservation(obs map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) } -// GetID returns ID of underlying Terraform resource of this ProjectNetworkPrivate -func (tr *ProjectNetworkPrivate) GetID() string { +// GetID returns ID of underlying Terraform resource of this PrivateNetwork +func (tr *PrivateNetwork) GetID() string { if tr.Status.AtProvider.ID == nil { return "" } return *tr.Status.AtProvider.ID } -// GetParameters of this ProjectNetworkPrivate -func (tr *ProjectNetworkPrivate) GetParameters() (map[string]any, error) { +// GetParameters of this PrivateNetwork +func (tr *PrivateNetwork) GetParameters() (map[string]any, error) { p, err := json.TFParser.Marshal(tr.Spec.ForProvider) if err != nil { return nil, err @@ -64,8 +64,8 @@ func (tr *ProjectNetworkPrivate) GetParameters() (map[string]any, error) { return base, json.TFParser.Unmarshal(p, &base) } -// SetParameters for this ProjectNetworkPrivate -func (tr *ProjectNetworkPrivate) SetParameters(params map[string]any) error { +// SetParameters for this PrivateNetwork +func (tr *PrivateNetwork) SetParameters(params map[string]any) error { p, err := json.TFParser.Marshal(params) if err != nil { return err @@ -73,8 +73,8 @@ func (tr *ProjectNetworkPrivate) SetParameters(params map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } -// GetInitParameters of this ProjectNetworkPrivate -func (tr *ProjectNetworkPrivate) GetInitParameters() (map[string]any, error) { +// GetInitParameters of this PrivateNetwork +func (tr *PrivateNetwork) GetInitParameters() (map[string]any, error) { p, err := json.TFParser.Marshal(tr.Spec.InitProvider) if err != nil { return nil, err @@ -83,10 +83,10 @@ func (tr *ProjectNetworkPrivate) GetInitParameters() (map[string]any, error) { return base, json.TFParser.Unmarshal(p, &base) } -// LateInitialize this ProjectNetworkPrivate using its observed tfState. +// LateInitialize this PrivateNetwork using its observed tfState. // returns True if there are any spec changes for the resource. -func (tr *ProjectNetworkPrivate) LateInitialize(attrs []byte) (bool, error) { - params := &ProjectNetworkPrivateParameters{} +func (tr *PrivateNetwork) LateInitialize(attrs []byte) (bool, error) { + params := &PrivateNetworkParameters{} if err := json.TFParser.Unmarshal(attrs, params); err != nil { return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") } @@ -97,22 +97,22 @@ func (tr *ProjectNetworkPrivate) LateInitialize(attrs []byte) (bool, error) { } // GetTerraformSchemaVersion returns the associated Terraform schema version -func (tr *ProjectNetworkPrivate) GetTerraformSchemaVersion() int { +func (tr *PrivateNetwork) GetTerraformSchemaVersion() int { return 0 } -// GetTerraformResourceType returns Terraform resource type for this ProjectNetworkPrivateSubnet -func (mg *ProjectNetworkPrivateSubnet) GetTerraformResourceType() string { +// GetTerraformResourceType returns Terraform resource type for this Subnet +func (mg *Subnet) GetTerraformResourceType() string { return "ovh_cloud_project_network_private_subnet" } -// GetConnectionDetailsMapping for this ProjectNetworkPrivateSubnet -func (tr *ProjectNetworkPrivateSubnet) GetConnectionDetailsMapping() map[string]string { +// GetConnectionDetailsMapping for this Subnet +func (tr *Subnet) GetConnectionDetailsMapping() map[string]string { return nil } -// GetObservation of this ProjectNetworkPrivateSubnet -func (tr *ProjectNetworkPrivateSubnet) GetObservation() (map[string]any, error) { +// GetObservation of this Subnet +func (tr *Subnet) GetObservation() (map[string]any, error) { o, err := json.TFParser.Marshal(tr.Status.AtProvider) if err != nil { return nil, err @@ -121,8 +121,8 @@ func (tr *ProjectNetworkPrivateSubnet) GetObservation() (map[string]any, error) return base, json.TFParser.Unmarshal(o, &base) } -// SetObservation for this ProjectNetworkPrivateSubnet -func (tr *ProjectNetworkPrivateSubnet) SetObservation(obs map[string]any) error { +// SetObservation for this Subnet +func (tr *Subnet) SetObservation(obs map[string]any) error { p, err := json.TFParser.Marshal(obs) if err != nil { return err @@ -130,16 +130,16 @@ func (tr *ProjectNetworkPrivateSubnet) SetObservation(obs map[string]any) error return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) } -// GetID returns ID of underlying Terraform resource of this ProjectNetworkPrivateSubnet -func (tr *ProjectNetworkPrivateSubnet) GetID() string { +// GetID returns ID of underlying Terraform resource of this Subnet +func (tr *Subnet) GetID() string { if tr.Status.AtProvider.ID == nil { return "" } return *tr.Status.AtProvider.ID } -// GetParameters of this ProjectNetworkPrivateSubnet -func (tr *ProjectNetworkPrivateSubnet) GetParameters() (map[string]any, error) { +// GetParameters of this Subnet +func (tr *Subnet) GetParameters() (map[string]any, error) { p, err := json.TFParser.Marshal(tr.Spec.ForProvider) if err != nil { return nil, err @@ -148,8 +148,8 @@ func (tr *ProjectNetworkPrivateSubnet) GetParameters() (map[string]any, error) { return base, json.TFParser.Unmarshal(p, &base) } -// SetParameters for this ProjectNetworkPrivateSubnet -func (tr *ProjectNetworkPrivateSubnet) SetParameters(params map[string]any) error { +// SetParameters for this Subnet +func (tr *Subnet) SetParameters(params map[string]any) error { p, err := json.TFParser.Marshal(params) if err != nil { return err @@ -157,8 +157,8 @@ func (tr *ProjectNetworkPrivateSubnet) SetParameters(params map[string]any) erro return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } -// GetInitParameters of this ProjectNetworkPrivateSubnet -func (tr *ProjectNetworkPrivateSubnet) GetInitParameters() (map[string]any, error) { +// GetInitParameters of this Subnet +func (tr *Subnet) GetInitParameters() (map[string]any, error) { p, err := json.TFParser.Marshal(tr.Spec.InitProvider) if err != nil { return nil, err @@ -167,10 +167,10 @@ func (tr *ProjectNetworkPrivateSubnet) GetInitParameters() (map[string]any, erro return base, json.TFParser.Unmarshal(p, &base) } -// LateInitialize this ProjectNetworkPrivateSubnet using its observed tfState. +// LateInitialize this Subnet using its observed tfState. // returns True if there are any spec changes for the resource. -func (tr *ProjectNetworkPrivateSubnet) LateInitialize(attrs []byte) (bool, error) { - params := &ProjectNetworkPrivateSubnetParameters{} +func (tr *Subnet) LateInitialize(attrs []byte) (bool, error) { + params := &SubnetParameters{} if err := json.TFParser.Unmarshal(attrs, params); err != nil { return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") } @@ -181,6 +181,6 @@ func (tr *ProjectNetworkPrivateSubnet) LateInitialize(attrs []byte) (bool, error } // GetTerraformSchemaVersion returns the associated Terraform schema version -func (tr *ProjectNetworkPrivateSubnet) GetTerraformSchemaVersion() int { +func (tr *Subnet) GetTerraformSchemaVersion() int { return 0 } diff --git a/apis/pcn/v1alpha1/zz_groupversion_info.go b/apis/network/v1alpha1/zz_groupversion_info.go similarity index 92% rename from apis/pcn/v1alpha1/zz_groupversion_info.go rename to apis/network/v1alpha1/zz_groupversion_info.go index 2b1dcd3..bd498f0 100755 --- a/apis/pcn/v1alpha1/zz_groupversion_info.go +++ b/apis/network/v1alpha1/zz_groupversion_info.go @@ -9,7 +9,7 @@ Copyright 2022 Upbound Inc. // Code generated by upjet. DO NOT EDIT. // +kubebuilder:object:generate=true -// +groupName=pcn.ovh.edixos.io +// +groupName=network.ovh.edixos.io // +versionName=v1alpha1 package v1alpha1 @@ -20,7 +20,7 @@ import ( // Package type metadata. const ( - CRDGroup = "pcn.ovh.edixos.io" + CRDGroup = "network.ovh.edixos.io" CRDVersion = "v1alpha1" ) diff --git a/apis/pcn/v1alpha1/zz_projectnetworkprivate_types.go b/apis/network/v1alpha1/zz_privatenetwork_types.go similarity index 70% rename from apis/pcn/v1alpha1/zz_projectnetworkprivate_types.go rename to apis/network/v1alpha1/zz_privatenetwork_types.go index 4ed3253..821646d 100755 --- a/apis/pcn/v1alpha1/zz_projectnetworkprivate_types.go +++ b/apis/network/v1alpha1/zz_privatenetwork_types.go @@ -17,7 +17,9 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) -type ProjectNetworkPrivateInitParameters struct { +type PrivateNetworkInitParameters struct { + Name *string `json:"name,omitempty" tf:"name,omitempty"` + Regions []*string `json:"regions,omitempty" tf:"regions,omitempty"` // Service name of the resource representing the id of the cloud project. @@ -26,9 +28,11 @@ type ProjectNetworkPrivateInitParameters struct { VlanID *float64 `json:"vlanId,omitempty" tf:"vlan_id,omitempty"` } -type ProjectNetworkPrivateObservation struct { +type PrivateNetworkObservation struct { ID *string `json:"id,omitempty" tf:"id,omitempty"` + Name *string `json:"name,omitempty" tf:"name,omitempty"` + Regions []*string `json:"regions,omitempty" tf:"regions,omitempty"` RegionsAttributes []RegionsAttributesObservation `json:"regionsAttributes,omitempty" tf:"regions_attributes,omitempty"` @@ -45,7 +49,10 @@ type ProjectNetworkPrivateObservation struct { VlanID *float64 `json:"vlanId,omitempty" tf:"vlan_id,omitempty"` } -type ProjectNetworkPrivateParameters struct { +type PrivateNetworkParameters struct { + + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` // +kubebuilder:validation:Optional Regions []*string `json:"regions,omitempty" tf:"regions,omitempty"` @@ -84,10 +91,10 @@ type RegionsStatusObservation struct { type RegionsStatusParameters struct { } -// ProjectNetworkPrivateSpec defines the desired state of ProjectNetworkPrivate -type ProjectNetworkPrivateSpec struct { +// PrivateNetworkSpec defines the desired state of PrivateNetwork +type PrivateNetworkSpec struct { v1.ResourceSpec `json:",inline"` - ForProvider ProjectNetworkPrivateParameters `json:"forProvider"` + ForProvider PrivateNetworkParameters `json:"forProvider"` // THIS IS A BETA FIELD. It will be honored // unless the Management Policies feature flag is disabled. // InitProvider holds the same fields as ForProvider, with the exception @@ -98,49 +105,50 @@ type ProjectNetworkPrivateSpec struct { // required on creation, but we do not desire to update them after creation, // for example because of an external controller is managing them, like an // autoscaler. - InitProvider ProjectNetworkPrivateInitParameters `json:"initProvider,omitempty"` + InitProvider PrivateNetworkInitParameters `json:"initProvider,omitempty"` } -// ProjectNetworkPrivateStatus defines the observed state of ProjectNetworkPrivate. -type ProjectNetworkPrivateStatus struct { +// PrivateNetworkStatus defines the observed state of PrivateNetwork. +type PrivateNetworkStatus struct { v1.ResourceStatus `json:",inline"` - AtProvider ProjectNetworkPrivateObservation `json:"atProvider,omitempty"` + AtProvider PrivateNetworkObservation `json:"atProvider,omitempty"` } // +kubebuilder:object:root=true -// ProjectNetworkPrivate is the Schema for the ProjectNetworkPrivates API. +// PrivateNetwork is the Schema for the PrivateNetworks API. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" // +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" // +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,ovh} -type ProjectNetworkPrivate struct { +type PrivateNetwork struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.serviceName) || (has(self.initProvider) && has(self.initProvider.serviceName))",message="spec.forProvider.serviceName is a required parameter" - Spec ProjectNetworkPrivateSpec `json:"spec"` - Status ProjectNetworkPrivateStatus `json:"status,omitempty"` + Spec PrivateNetworkSpec `json:"spec"` + Status PrivateNetworkStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true -// ProjectNetworkPrivateList contains a list of ProjectNetworkPrivates -type ProjectNetworkPrivateList struct { +// PrivateNetworkList contains a list of PrivateNetworks +type PrivateNetworkList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ProjectNetworkPrivate `json:"items"` + Items []PrivateNetwork `json:"items"` } // Repository type metadata. var ( - ProjectNetworkPrivate_Kind = "ProjectNetworkPrivate" - ProjectNetworkPrivate_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ProjectNetworkPrivate_Kind}.String() - ProjectNetworkPrivate_KindAPIVersion = ProjectNetworkPrivate_Kind + "." + CRDGroupVersion.String() - ProjectNetworkPrivate_GroupVersionKind = CRDGroupVersion.WithKind(ProjectNetworkPrivate_Kind) + PrivateNetwork_Kind = "PrivateNetwork" + PrivateNetwork_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: PrivateNetwork_Kind}.String() + PrivateNetwork_KindAPIVersion = PrivateNetwork_Kind + "." + CRDGroupVersion.String() + PrivateNetwork_GroupVersionKind = CRDGroupVersion.WithKind(PrivateNetwork_Kind) ) func init() { - SchemeBuilder.Register(&ProjectNetworkPrivate{}, &ProjectNetworkPrivateList{}) + SchemeBuilder.Register(&PrivateNetwork{}, &PrivateNetworkList{}) } diff --git a/apis/pcn/v1alpha1/zz_projectnetworkprivatesubnet_types.go b/apis/network/v1alpha1/zz_subnet_types.go similarity index 75% rename from apis/pcn/v1alpha1/zz_projectnetworkprivatesubnet_types.go rename to apis/network/v1alpha1/zz_subnet_types.go index a661df7..a5ddc82 100755 --- a/apis/pcn/v1alpha1/zz_projectnetworkprivatesubnet_types.go +++ b/apis/network/v1alpha1/zz_subnet_types.go @@ -35,15 +35,13 @@ type IPPoolsObservation struct { type IPPoolsParameters struct { } -type ProjectNetworkPrivateSubnetInitParameters struct { +type SubnetInitParameters struct { DHCP *bool `json:"dhcp,omitempty" tf:"dhcp,omitempty"` End *string `json:"end,omitempty" tf:"end,omitempty"` Network *string `json:"network,omitempty" tf:"network,omitempty"` - NetworkID *string `json:"networkId,omitempty" tf:"network_id,omitempty"` - NoGateway *bool `json:"noGateway,omitempty" tf:"no_gateway,omitempty"` Region *string `json:"region,omitempty" tf:"region,omitempty"` @@ -54,7 +52,7 @@ type ProjectNetworkPrivateSubnetInitParameters struct { Start *string `json:"start,omitempty" tf:"start,omitempty"` } -type ProjectNetworkPrivateSubnetObservation struct { +type SubnetObservation struct { Cidr *string `json:"cidr,omitempty" tf:"cidr,omitempty"` DHCP *bool `json:"dhcp,omitempty" tf:"dhcp,omitempty"` @@ -81,7 +79,7 @@ type ProjectNetworkPrivateSubnetObservation struct { Start *string `json:"start,omitempty" tf:"start,omitempty"` } -type ProjectNetworkPrivateSubnetParameters struct { +type SubnetParameters struct { // +kubebuilder:validation:Optional DHCP *bool `json:"dhcp,omitempty" tf:"dhcp,omitempty"` @@ -92,9 +90,18 @@ type ProjectNetworkPrivateSubnetParameters struct { // +kubebuilder:validation:Optional Network *string `json:"network,omitempty" tf:"network,omitempty"` + // +crossplane:generate:reference:type=github.com/edixos/provider-ovh/apis/network/v1alpha1.PrivateNetwork // +kubebuilder:validation:Optional NetworkID *string `json:"networkId,omitempty" tf:"network_id,omitempty"` + // Reference to a PrivateNetwork in network to populate networkId. + // +kubebuilder:validation:Optional + NetworkIDRef *v1.Reference `json:"networkIdRef,omitempty" tf:"-"` + + // Selector for a PrivateNetwork in network to populate networkId. + // +kubebuilder:validation:Optional + NetworkIDSelector *v1.Selector `json:"networkIdSelector,omitempty" tf:"-"` + // +kubebuilder:validation:Optional NoGateway *bool `json:"noGateway,omitempty" tf:"no_gateway,omitempty"` @@ -109,10 +116,10 @@ type ProjectNetworkPrivateSubnetParameters struct { Start *string `json:"start,omitempty" tf:"start,omitempty"` } -// ProjectNetworkPrivateSubnetSpec defines the desired state of ProjectNetworkPrivateSubnet -type ProjectNetworkPrivateSubnetSpec struct { +// SubnetSpec defines the desired state of Subnet +type SubnetSpec struct { v1.ResourceSpec `json:",inline"` - ForProvider ProjectNetworkPrivateSubnetParameters `json:"forProvider"` + ForProvider SubnetParameters `json:"forProvider"` // THIS IS A BETA FIELD. It will be honored // unless the Management Policies feature flag is disabled. // InitProvider holds the same fields as ForProvider, with the exception @@ -123,54 +130,53 @@ type ProjectNetworkPrivateSubnetSpec struct { // required on creation, but we do not desire to update them after creation, // for example because of an external controller is managing them, like an // autoscaler. - InitProvider ProjectNetworkPrivateSubnetInitParameters `json:"initProvider,omitempty"` + InitProvider SubnetInitParameters `json:"initProvider,omitempty"` } -// ProjectNetworkPrivateSubnetStatus defines the observed state of ProjectNetworkPrivateSubnet. -type ProjectNetworkPrivateSubnetStatus struct { +// SubnetStatus defines the observed state of Subnet. +type SubnetStatus struct { v1.ResourceStatus `json:",inline"` - AtProvider ProjectNetworkPrivateSubnetObservation `json:"atProvider,omitempty"` + AtProvider SubnetObservation `json:"atProvider,omitempty"` } // +kubebuilder:object:root=true -// ProjectNetworkPrivateSubnet is the Schema for the ProjectNetworkPrivateSubnets API. +// Subnet is the Schema for the Subnets API. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" // +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" // +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,ovh} -type ProjectNetworkPrivateSubnet struct { +type Subnet struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.end) || (has(self.initProvider) && has(self.initProvider.end))",message="spec.forProvider.end is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.network) || (has(self.initProvider) && has(self.initProvider.network))",message="spec.forProvider.network is a required parameter" - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.networkId) || (has(self.initProvider) && has(self.initProvider.networkId))",message="spec.forProvider.networkId is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.region) || (has(self.initProvider) && has(self.initProvider.region))",message="spec.forProvider.region is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.serviceName) || (has(self.initProvider) && has(self.initProvider.serviceName))",message="spec.forProvider.serviceName is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.start) || (has(self.initProvider) && has(self.initProvider.start))",message="spec.forProvider.start is a required parameter" - Spec ProjectNetworkPrivateSubnetSpec `json:"spec"` - Status ProjectNetworkPrivateSubnetStatus `json:"status,omitempty"` + Spec SubnetSpec `json:"spec"` + Status SubnetStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true -// ProjectNetworkPrivateSubnetList contains a list of ProjectNetworkPrivateSubnets -type ProjectNetworkPrivateSubnetList struct { +// SubnetList contains a list of Subnets +type SubnetList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ProjectNetworkPrivateSubnet `json:"items"` + Items []Subnet `json:"items"` } // Repository type metadata. var ( - ProjectNetworkPrivateSubnet_Kind = "ProjectNetworkPrivateSubnet" - ProjectNetworkPrivateSubnet_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ProjectNetworkPrivateSubnet_Kind}.String() - ProjectNetworkPrivateSubnet_KindAPIVersion = ProjectNetworkPrivateSubnet_Kind + "." + CRDGroupVersion.String() - ProjectNetworkPrivateSubnet_GroupVersionKind = CRDGroupVersion.WithKind(ProjectNetworkPrivateSubnet_Kind) + Subnet_Kind = "Subnet" + Subnet_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Subnet_Kind}.String() + Subnet_KindAPIVersion = Subnet_Kind + "." + CRDGroupVersion.String() + Subnet_GroupVersionKind = CRDGroupVersion.WithKind(Subnet_Kind) ) func init() { - SchemeBuilder.Register(&ProjectNetworkPrivateSubnet{}, &ProjectNetworkPrivateSubnetList{}) + SchemeBuilder.Register(&Subnet{}, &SubnetList{}) } diff --git a/apis/pcn/v1alpha1/zz_generated.managed.go b/apis/pcn/v1alpha1/zz_generated.managed.go deleted file mode 100644 index 15b1d98..0000000 --- a/apis/pcn/v1alpha1/zz_generated.managed.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - -// GetCondition of this ProjectNetworkPrivate. -func (mg *ProjectNetworkPrivate) GetCondition(ct xpv1.ConditionType) xpv1.Condition { - return mg.Status.GetCondition(ct) -} - -// GetDeletionPolicy of this ProjectNetworkPrivate. -func (mg *ProjectNetworkPrivate) GetDeletionPolicy() xpv1.DeletionPolicy { - return mg.Spec.DeletionPolicy -} - -// GetManagementPolicies of this ProjectNetworkPrivate. -func (mg *ProjectNetworkPrivate) GetManagementPolicies() xpv1.ManagementPolicies { - return mg.Spec.ManagementPolicies -} - -// GetProviderConfigReference of this ProjectNetworkPrivate. -func (mg *ProjectNetworkPrivate) GetProviderConfigReference() *xpv1.Reference { - return mg.Spec.ProviderConfigReference -} - -// GetPublishConnectionDetailsTo of this ProjectNetworkPrivate. -func (mg *ProjectNetworkPrivate) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { - return mg.Spec.PublishConnectionDetailsTo -} - -// GetWriteConnectionSecretToReference of this ProjectNetworkPrivate. -func (mg *ProjectNetworkPrivate) GetWriteConnectionSecretToReference() *xpv1.SecretReference { - return mg.Spec.WriteConnectionSecretToReference -} - -// SetConditions of this ProjectNetworkPrivate. -func (mg *ProjectNetworkPrivate) SetConditions(c ...xpv1.Condition) { - mg.Status.SetConditions(c...) -} - -// SetDeletionPolicy of this ProjectNetworkPrivate. -func (mg *ProjectNetworkPrivate) SetDeletionPolicy(r xpv1.DeletionPolicy) { - mg.Spec.DeletionPolicy = r -} - -// SetManagementPolicies of this ProjectNetworkPrivate. -func (mg *ProjectNetworkPrivate) SetManagementPolicies(r xpv1.ManagementPolicies) { - mg.Spec.ManagementPolicies = r -} - -// SetProviderConfigReference of this ProjectNetworkPrivate. -func (mg *ProjectNetworkPrivate) SetProviderConfigReference(r *xpv1.Reference) { - mg.Spec.ProviderConfigReference = r -} - -// SetPublishConnectionDetailsTo of this ProjectNetworkPrivate. -func (mg *ProjectNetworkPrivate) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { - mg.Spec.PublishConnectionDetailsTo = r -} - -// SetWriteConnectionSecretToReference of this ProjectNetworkPrivate. -func (mg *ProjectNetworkPrivate) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { - mg.Spec.WriteConnectionSecretToReference = r -} - -// GetCondition of this ProjectNetworkPrivateSubnet. -func (mg *ProjectNetworkPrivateSubnet) GetCondition(ct xpv1.ConditionType) xpv1.Condition { - return mg.Status.GetCondition(ct) -} - -// GetDeletionPolicy of this ProjectNetworkPrivateSubnet. -func (mg *ProjectNetworkPrivateSubnet) GetDeletionPolicy() xpv1.DeletionPolicy { - return mg.Spec.DeletionPolicy -} - -// GetManagementPolicies of this ProjectNetworkPrivateSubnet. -func (mg *ProjectNetworkPrivateSubnet) GetManagementPolicies() xpv1.ManagementPolicies { - return mg.Spec.ManagementPolicies -} - -// GetProviderConfigReference of this ProjectNetworkPrivateSubnet. -func (mg *ProjectNetworkPrivateSubnet) GetProviderConfigReference() *xpv1.Reference { - return mg.Spec.ProviderConfigReference -} - -// GetPublishConnectionDetailsTo of this ProjectNetworkPrivateSubnet. -func (mg *ProjectNetworkPrivateSubnet) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { - return mg.Spec.PublishConnectionDetailsTo -} - -// GetWriteConnectionSecretToReference of this ProjectNetworkPrivateSubnet. -func (mg *ProjectNetworkPrivateSubnet) GetWriteConnectionSecretToReference() *xpv1.SecretReference { - return mg.Spec.WriteConnectionSecretToReference -} - -// SetConditions of this ProjectNetworkPrivateSubnet. -func (mg *ProjectNetworkPrivateSubnet) SetConditions(c ...xpv1.Condition) { - mg.Status.SetConditions(c...) -} - -// SetDeletionPolicy of this ProjectNetworkPrivateSubnet. -func (mg *ProjectNetworkPrivateSubnet) SetDeletionPolicy(r xpv1.DeletionPolicy) { - mg.Spec.DeletionPolicy = r -} - -// SetManagementPolicies of this ProjectNetworkPrivateSubnet. -func (mg *ProjectNetworkPrivateSubnet) SetManagementPolicies(r xpv1.ManagementPolicies) { - mg.Spec.ManagementPolicies = r -} - -// SetProviderConfigReference of this ProjectNetworkPrivateSubnet. -func (mg *ProjectNetworkPrivateSubnet) SetProviderConfigReference(r *xpv1.Reference) { - mg.Spec.ProviderConfigReference = r -} - -// SetPublishConnectionDetailsTo of this ProjectNetworkPrivateSubnet. -func (mg *ProjectNetworkPrivateSubnet) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { - mg.Spec.PublishConnectionDetailsTo = r -} - -// SetWriteConnectionSecretToReference of this ProjectNetworkPrivateSubnet. -func (mg *ProjectNetworkPrivateSubnet) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { - mg.Spec.WriteConnectionSecretToReference = r -} diff --git a/apis/zz_register.go b/apis/zz_register.go index 2795730..efc154e 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -26,7 +26,7 @@ import ( v1alpha1logs "github.com/edixos/provider-ovh/apis/logs/v1alpha1" v1alpha1me "github.com/edixos/provider-ovh/apis/me/v1alpha1" v1alpha1nas "github.com/edixos/provider-ovh/apis/nas/v1alpha1" - v1alpha1pcn "github.com/edixos/provider-ovh/apis/pcn/v1alpha1" + v1alpha1network "github.com/edixos/provider-ovh/apis/network/v1alpha1" v1alpha1privatesql "github.com/edixos/provider-ovh/apis/privatesql/v1alpha1" v1alpha1registry "github.com/edixos/provider-ovh/apis/registry/v1alpha1" v1alpha1storage "github.com/edixos/provider-ovh/apis/storage/v1alpha1" @@ -51,7 +51,7 @@ func init() { v1alpha1logs.SchemeBuilder.AddToScheme, v1alpha1me.SchemeBuilder.AddToScheme, v1alpha1nas.SchemeBuilder.AddToScheme, - v1alpha1pcn.SchemeBuilder.AddToScheme, + v1alpha1network.SchemeBuilder.AddToScheme, v1alpha1privatesql.SchemeBuilder.AddToScheme, v1alpha1registry.SchemeBuilder.AddToScheme, v1alpha1storage.SchemeBuilder.AddToScheme, diff --git a/config/external_name.go b/config/external_name.go index 2926199..ff2cd41 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -72,8 +72,8 @@ var kubeIdentifierFromProvider = config.ExternalName{ // provider. var ExternalNameConfigs = map[string]config.ExternalName{ // Import requires using a randomly generated ID from provider: nl-2e21sda - "ovh_cloud_project_network_private": config.NameAsIdentifier, - "ovh_cloud_project_network_private_subnet": config.NameAsIdentifier, + "ovh_cloud_project_network_private": config.IdentifierFromProvider, + "ovh_cloud_project_network_private_subnet": config.IdentifierFromProvider, "ovh_cloud_project_workflow_backup": config.NameAsIdentifier, "ovh_cloud_project": config.IdentifierFromProvider, "ovh_cloud_project_user": config.IdentifierFromProvider, diff --git a/config/kube/config.go b/config/kube/config.go index 611033b..1053187 100644 --- a/config/kube/config.go +++ b/config/kube/config.go @@ -12,6 +12,9 @@ func Configure(p *config.Provider) { r.ShortGroup = shortGroup r.UseAsync = true r.Kind = "Cluster" + r.References["private_network_id"] = config.Reference{ + Type: "github.com/edixos/provider-ovh/apis/network/v1alpha1.PrivateNetwork", + } }) p.AddResourceConfigurator("ovh_cloud_project_kube_iprestrictions", func(r *config.Resource) { r.ShortGroup = shortGroup diff --git a/config/public_cloud_network/config.go b/config/public_cloud_network/config.go index 0a49982..6844790 100644 --- a/config/public_cloud_network/config.go +++ b/config/public_cloud_network/config.go @@ -3,15 +3,20 @@ package public_cloud_network import "github.com/crossplane/upjet/pkg/config" const ( - shortGroup = "pcn" + shortGroup = "network" ) // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { p.AddResourceConfigurator("ovh_cloud_project_network_private", func(r *config.Resource) { r.ShortGroup = shortGroup + r.Kind = "PrivateNetwork" }) p.AddResourceConfigurator("ovh_cloud_project_network_private_subnet", func(r *config.Resource) { r.ShortGroup = shortGroup + r.Kind = "Subnet" + r.References["network_id"] = config.Reference{ + Type: "github.com/edixos/provider-ovh/apis/network/v1alpha1.PrivateNetwork", + } }) } diff --git a/examples/kubernetes/cluster.yaml b/examples/kubernetes/cluster.yaml index 68d52c1..3b7b036 100644 --- a/examples/kubernetes/cluster.yaml +++ b/examples/kubernetes/cluster.yaml @@ -7,6 +7,12 @@ spec: name: default forProvider: name: "hello-edixos" + # privateNetworkId: "71a4376a-6e79-46b5-8476-8f9eb53f9783" + # This configuration will not work since the privateNetworkId must be the openstackId + # of the network for the chosen region. Need to find out how to extract this information from the + # status.atProvider.regionsAttributes[].openstackid + # privateNetworkIdRef: + # name: sample-1 region: DE1 serviceName: 980cbcf06e6a4e6e8a91a7d125b26bba version: "1.28" \ No newline at end of file diff --git a/examples/projectnetworkprivate/projectnetworkprivate.yaml b/examples/network/privatenetwork.yaml similarity index 70% rename from examples/projectnetworkprivate/projectnetworkprivate.yaml rename to examples/network/privatenetwork.yaml index ed52a1d..38372cc 100644 --- a/examples/projectnetworkprivate/projectnetworkprivate.yaml +++ b/examples/network/privatenetwork.yaml @@ -1,5 +1,5 @@ -apiVersion: publiccloudnetwork.edixos.io/v1alpha1 -kind: ProjectNetworkPrivate +apiVersion: network.ovh.edixos.io/v1alpha1 +kind: PrivateNetwork metadata: name: sample-1 labels: @@ -8,6 +8,7 @@ spec: providerConfigRef: name: default forProvider: + name: sample-1 serviceName: 980cbcf06e6a4e6e8a91a7d125b26bba regions: - DE1 diff --git a/examples/network/subnet.yaml b/examples/network/subnet.yaml new file mode 100644 index 0000000..075f5ed --- /dev/null +++ b/examples/network/subnet.yaml @@ -0,0 +1,19 @@ +apiVersion: network.ovh.edixos.io/v1alpha1 +kind: Subnet +metadata: + name: subnet-1 + labels: + managed-by: crossplane +spec: + providerConfigRef: + name: default + forProvider: + serviceName: 980cbcf06e6a4e6e8a91a7d125b26bba + networkIdRef: + name: sample-1 + region: DE1 + start: 192.168.168.100 + end: 192.168.168.200 + network: 192.168.168.0/24 + dhcp: true + noGateway: false \ No newline at end of file diff --git a/internal/controller/pcn/projectnetworkprivate/zz_controller.go b/internal/controller/network/privatenetwork/zz_controller.go similarity index 80% rename from internal/controller/pcn/projectnetworkprivate/zz_controller.go rename to internal/controller/network/privatenetwork/zz_controller.go index 9ae23a2..d6422a8 100755 --- a/internal/controller/pcn/projectnetworkprivate/zz_controller.go +++ b/internal/controller/network/privatenetwork/zz_controller.go @@ -8,7 +8,7 @@ Copyright 2022 Upbound Inc. // Code generated by upjet. DO NOT EDIT. -package projectnetworkprivate +package privatenetwork import ( "time" @@ -23,21 +23,20 @@ import ( "github.com/crossplane/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/edixos/provider-ovh/apis/pcn/v1alpha1" + v1alpha1 "github.com/edixos/provider-ovh/apis/network/v1alpha1" features "github.com/edixos/provider-ovh/internal/features" ) -// Setup adds a controller that reconciles ProjectNetworkPrivate managed resources. +// Setup adds a controller that reconciles PrivateNetwork managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1alpha1.ProjectNetworkPrivate_GroupVersionKind.String()) + name := managed.ControllerName(v1alpha1.PrivateNetwork_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } - eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.ProjectNetworkPrivate_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.ProjectNetworkPrivate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.PrivateNetwork_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.PrivateNetwork_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["ovh_cloud_project_network_private"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), tjcontroller.WithCallbackProvider(ac), @@ -56,12 +55,12 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.ProjectNetworkPrivate_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.PrivateNetwork_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1alpha1.ProjectNetworkPrivate{}, eventHandler). + Watches(&v1alpha1.PrivateNetwork{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/pcn/projectnetworkprivatesubnet/zz_controller.go b/internal/controller/network/subnet/zz_controller.go similarity index 79% rename from internal/controller/pcn/projectnetworkprivatesubnet/zz_controller.go rename to internal/controller/network/subnet/zz_controller.go index 228b46f..251a003 100755 --- a/internal/controller/pcn/projectnetworkprivatesubnet/zz_controller.go +++ b/internal/controller/network/subnet/zz_controller.go @@ -8,7 +8,7 @@ Copyright 2022 Upbound Inc. // Code generated by upjet. DO NOT EDIT. -package projectnetworkprivatesubnet +package subnet import ( "time" @@ -23,21 +23,20 @@ import ( "github.com/crossplane/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/edixos/provider-ovh/apis/pcn/v1alpha1" + v1alpha1 "github.com/edixos/provider-ovh/apis/network/v1alpha1" features "github.com/edixos/provider-ovh/internal/features" ) -// Setup adds a controller that reconciles ProjectNetworkPrivateSubnet managed resources. +// Setup adds a controller that reconciles Subnet managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1alpha1.ProjectNetworkPrivateSubnet_GroupVersionKind.String()) + name := managed.ControllerName(v1alpha1.Subnet_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } - eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.ProjectNetworkPrivateSubnet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.ProjectNetworkPrivateSubnet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.Subnet_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Subnet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["ovh_cloud_project_network_private_subnet"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), tjcontroller.WithCallbackProvider(ac), @@ -56,12 +55,12 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.ProjectNetworkPrivateSubnet_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Subnet_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1alpha1.ProjectNetworkPrivateSubnet{}, eventHandler). + Watches(&v1alpha1.Subnet{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 1b58baf..d7087a2 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -70,8 +70,8 @@ import ( nashapartition "github.com/edixos/provider-ovh/internal/controller/nas/nashapartition" nashapartitionaccess "github.com/edixos/provider-ovh/internal/controller/nas/nashapartitionaccess" nashapartitionsnapshot "github.com/edixos/provider-ovh/internal/controller/nas/nashapartitionsnapshot" - projectnetworkprivate "github.com/edixos/provider-ovh/internal/controller/pcn/projectnetworkprivate" - projectnetworkprivatesubnet "github.com/edixos/provider-ovh/internal/controller/pcn/projectnetworkprivatesubnet" + privatenetwork "github.com/edixos/provider-ovh/internal/controller/network/privatenetwork" + subnet "github.com/edixos/provider-ovh/internal/controller/network/subnet" privatedatabase "github.com/edixos/provider-ovh/internal/controller/privatesql/privatedatabase" privatedatabasedatabase "github.com/edixos/provider-ovh/internal/controller/privatesql/privatedatabasedatabase" privatedatabaseuser "github.com/edixos/provider-ovh/internal/controller/privatesql/privatedatabaseuser" @@ -156,8 +156,8 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { nashapartition.Setup, nashapartitionaccess.Setup, nashapartitionsnapshot.Setup, - projectnetworkprivate.Setup, - projectnetworkprivatesubnet.Setup, + privatenetwork.Setup, + subnet.Setup, privatedatabase.Setup, privatedatabasedatabase.Setup, privatedatabaseuser.Setup, diff --git a/package/crds/kube.ovh.edixos.io_clusters.yaml b/package/crds/kube.ovh.edixos.io_clusters.yaml index cf4e309..8caa631 100644 --- a/package/crds/kube.ovh.edixos.io_clusters.yaml +++ b/package/crds/kube.ovh.edixos.io_clusters.yaml @@ -159,6 +159,81 @@ spec: type: array privateNetworkId: type: string + privateNetworkIdRef: + description: Reference to a PrivateNetwork in network to populate + privateNetworkId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + privateNetworkIdSelector: + description: Selector for a PrivateNetwork in network to populate + privateNetworkId. + properties: + matchControllerRef: + description: MatchControllerRef ensures an object with the + same controller reference as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object region: type: string serviceName: @@ -271,8 +346,6 @@ spec: type: boolean type: object type: array - privateNetworkId: - type: string region: type: string serviceName: diff --git a/package/crds/pcn.ovh.edixos.io_projectnetworkprivates.yaml b/package/crds/network.ovh.edixos.io_privatenetworks.yaml similarity index 94% rename from package/crds/pcn.ovh.edixos.io_projectnetworkprivates.yaml rename to package/crds/network.ovh.edixos.io_privatenetworks.yaml index 71160f1..a56ad55 100644 --- a/package/crds/pcn.ovh.edixos.io_projectnetworkprivates.yaml +++ b/package/crds/network.ovh.edixos.io_privatenetworks.yaml @@ -4,18 +4,18 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.13.0 - name: projectnetworkprivates.pcn.ovh.edixos.io + name: privatenetworks.network.ovh.edixos.io spec: - group: pcn.ovh.edixos.io + group: network.ovh.edixos.io names: categories: - crossplane - managed - ovh - kind: ProjectNetworkPrivate - listKind: ProjectNetworkPrivateList - plural: projectnetworkprivates - singular: projectnetworkprivate + kind: PrivateNetwork + listKind: PrivateNetworkList + plural: privatenetworks + singular: privatenetwork scope: Cluster versions: - additionalPrinterColumns: @@ -34,8 +34,8 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: ProjectNetworkPrivate is the Schema for the ProjectNetworkPrivates - API. + description: PrivateNetwork is the Schema for the PrivateNetworks API. properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation @@ -50,7 +50,7 @@ spec: metadata: type: object spec: - description: ProjectNetworkPrivateSpec defines the desired state of ProjectNetworkPrivate + description: PrivateNetworkSpec defines the desired state of PrivateNetwork properties: deletionPolicy: default: Delete @@ -67,6 +67,8 @@ spec: type: string forProvider: properties: + name: + type: string regions: items: type: string @@ -90,6 +92,8 @@ spec: for example because of an external controller is managing them, like an autoscaler. properties: + name: + type: string regions: items: type: string @@ -262,18 +266,23 @@ spec: - forProvider type: object x-kubernetes-validations: + - message: spec.forProvider.name is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.name) + || (has(self.initProvider) && has(self.initProvider.name))' - message: spec.forProvider.serviceName is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.serviceName) || (has(self.initProvider) && has(self.initProvider.serviceName))' status: - description: ProjectNetworkPrivateStatus defines the observed state of - ProjectNetworkPrivate. + description: PrivateNetworkStatus defines the observed state of PrivateNetwork. properties: atProvider: properties: id: type: string + name: + type: string regions: items: type: string diff --git a/package/crds/pcn.ovh.edixos.io_projectnetworkprivatesubnets.yaml b/package/crds/network.ovh.edixos.io_subnets.yaml similarity index 80% rename from package/crds/pcn.ovh.edixos.io_projectnetworkprivatesubnets.yaml rename to package/crds/network.ovh.edixos.io_subnets.yaml index bff584d..a60d6d4 100644 --- a/package/crds/pcn.ovh.edixos.io_projectnetworkprivatesubnets.yaml +++ b/package/crds/network.ovh.edixos.io_subnets.yaml @@ -4,18 +4,18 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.13.0 - name: projectnetworkprivatesubnets.pcn.ovh.edixos.io + name: subnets.network.ovh.edixos.io spec: - group: pcn.ovh.edixos.io + group: network.ovh.edixos.io names: categories: - crossplane - managed - ovh - kind: ProjectNetworkPrivateSubnet - listKind: ProjectNetworkPrivateSubnetList - plural: projectnetworkprivatesubnets - singular: projectnetworkprivatesubnet + kind: Subnet + listKind: SubnetList + plural: subnets + singular: subnet scope: Cluster versions: - additionalPrinterColumns: @@ -34,8 +34,7 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: ProjectNetworkPrivateSubnet is the Schema for the ProjectNetworkPrivateSubnets - API. + description: Subnet is the Schema for the Subnets API. properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation @@ -50,8 +49,7 @@ spec: metadata: type: object spec: - description: ProjectNetworkPrivateSubnetSpec defines the desired state - of ProjectNetworkPrivateSubnet + description: SubnetSpec defines the desired state of Subnet properties: deletionPolicy: default: Delete @@ -76,6 +74,81 @@ spec: type: string networkId: type: string + networkIdRef: + description: Reference to a PrivateNetwork in network to populate + networkId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + networkIdSelector: + description: Selector for a PrivateNetwork in network to populate + networkId. + properties: + matchControllerRef: + description: MatchControllerRef ensures an object with the + same controller reference as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object noGateway: type: boolean region: @@ -105,8 +178,6 @@ spec: type: string network: type: string - networkId: - type: string noGateway: type: boolean region: @@ -287,10 +358,6 @@ spec: rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.network) || (has(self.initProvider) && has(self.initProvider.network))' - - message: spec.forProvider.networkId is a required parameter - rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies - || ''Update'' in self.managementPolicies) || has(self.forProvider.networkId) - || (has(self.initProvider) && has(self.initProvider.networkId))' - message: spec.forProvider.region is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.region) @@ -304,8 +371,7 @@ spec: || ''Update'' in self.managementPolicies) || has(self.forProvider.start) || (has(self.initProvider) && has(self.initProvider.start))' status: - description: ProjectNetworkPrivateSubnetStatus defines the observed state - of ProjectNetworkPrivateSubnet. + description: SubnetStatus defines the observed state of Subnet. properties: atProvider: properties: