From 75324947f6758815e4c5a341c827efd624e51cda Mon Sep 17 00:00:00 2001 From: ISMAIL KABOUBI Date: Wed, 3 Jan 2024 20:04:20 +0100 Subject: [PATCH] feat(apis): update pcn shortgroup --- apis/nas/v1alpha1/zz_generated.deepcopy.go | 620 ++++++++++++++++++ apis/nas/v1alpha1/zz_generated.managed.go | 188 ++++++ apis/nas/v1alpha1/zz_generated.managedlist.go | 35 + apis/nas/v1alpha1/zz_generated_terraformed.go | 270 ++++++++ .../v1alpha1/zz_groupversion_info.go | 4 +- apis/nas/v1alpha1/zz_nashapartition_types.go | 122 ++++ .../v1alpha1/zz_nashapartitionaccess_types.go | 118 ++++ .../zz_nashapartitionsnapshot_types.go | 111 ++++ .../v1alpha1/zz_generated.deepcopy.go | 0 .../v1alpha1/zz_generated.managed.go | 0 .../v1alpha1/zz_generated.managedlist.go | 0 .../v1alpha1/zz_generated_terraformed.go | 0 apis/pcn/v1alpha1/zz_groupversion_info.go | 36 + .../zz_projectnetworkprivate_types.go | 0 .../zz_projectnetworkprivatesubnet_types.go | 0 apis/zz_register.go | 6 +- config/provider.go | 1 + config/public_cloud_network/config.go | 8 +- .../nas/nashapartition/zz_controller.go | 67 ++ .../nas/nashapartitionaccess/zz_controller.go | 67 ++ .../nashapartitionsnapshot/zz_controller.go | 67 ++ .../projectnetworkprivate/zz_controller.go | 2 +- .../zz_controller.go | 2 +- internal/controller/zz_setup.go | 12 +- ....ovh.edixos.io_nashapartitionaccesses.yaml | 333 ++++++++++ .../nas.ovh.edixos.io_nashapartitions.yaml | 336 ++++++++++ ...ovh.edixos.io_nashapartitionsnapshots.yaml | 327 +++++++++ ...ovh.edixos.io_projectnetworkprivates.yaml} | 4 +- ...ixos.io_projectnetworkprivatesubnets.yaml} | 4 +- 29 files changed, 2725 insertions(+), 15 deletions(-) create mode 100644 apis/nas/v1alpha1/zz_generated.deepcopy.go create mode 100644 apis/nas/v1alpha1/zz_generated.managed.go create mode 100644 apis/nas/v1alpha1/zz_generated.managedlist.go create mode 100755 apis/nas/v1alpha1/zz_generated_terraformed.go rename apis/{publiccloudnetwork => nas}/v1alpha1/zz_groupversion_info.go (89%) create mode 100755 apis/nas/v1alpha1/zz_nashapartition_types.go create mode 100755 apis/nas/v1alpha1/zz_nashapartitionaccess_types.go create mode 100755 apis/nas/v1alpha1/zz_nashapartitionsnapshot_types.go rename apis/{publiccloudnetwork => pcn}/v1alpha1/zz_generated.deepcopy.go (100%) rename apis/{publiccloudnetwork => pcn}/v1alpha1/zz_generated.managed.go (100%) rename apis/{publiccloudnetwork => pcn}/v1alpha1/zz_generated.managedlist.go (100%) rename apis/{publiccloudnetwork => pcn}/v1alpha1/zz_generated_terraformed.go (100%) create mode 100755 apis/pcn/v1alpha1/zz_groupversion_info.go rename apis/{publiccloudnetwork => pcn}/v1alpha1/zz_projectnetworkprivate_types.go (100%) rename apis/{publiccloudnetwork => pcn}/v1alpha1/zz_projectnetworkprivatesubnet_types.go (100%) create mode 100755 internal/controller/nas/nashapartition/zz_controller.go create mode 100755 internal/controller/nas/nashapartitionaccess/zz_controller.go create mode 100755 internal/controller/nas/nashapartitionsnapshot/zz_controller.go rename internal/controller/{publiccloudnetwork => pcn}/projectnetworkprivate/zz_controller.go (97%) rename internal/controller/{publiccloudnetwork => pcn}/projectnetworkprivatesubnet/zz_controller.go (97%) create mode 100644 package/crds/nas.ovh.edixos.io_nashapartitionaccesses.yaml create mode 100644 package/crds/nas.ovh.edixos.io_nashapartitions.yaml create mode 100644 package/crds/nas.ovh.edixos.io_nashapartitionsnapshots.yaml rename package/crds/{publiccloudnetwork.ovh.edixos.io_projectnetworkprivates.yaml => pcn.ovh.edixos.io_projectnetworkprivates.yaml} (99%) rename package/crds/{publiccloudnetwork.ovh.edixos.io_projectnetworkprivatesubnets.yaml => pcn.ovh.edixos.io_projectnetworkprivatesubnets.yaml} (99%) diff --git a/apis/nas/v1alpha1/zz_generated.deepcopy.go b/apis/nas/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..25da123 --- /dev/null +++ b/apis/nas/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,620 @@ +//go:build !ignore_autogenerated + +/* +Copyright 2022 Upbound Inc. +*/ + +// 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 *NashaPartition) DeepCopyInto(out *NashaPartition) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartition. +func (in *NashaPartition) DeepCopy() *NashaPartition { + if in == nil { + return nil + } + out := new(NashaPartition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NashaPartition) 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 *NashaPartitionAccess) DeepCopyInto(out *NashaPartitionAccess) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionAccess. +func (in *NashaPartitionAccess) DeepCopy() *NashaPartitionAccess { + if in == nil { + return nil + } + out := new(NashaPartitionAccess) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NashaPartitionAccess) 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 *NashaPartitionAccessInitParameters) DeepCopyInto(out *NashaPartitionAccessInitParameters) { + *out = *in + if in.IP != nil { + in, out := &in.IP, &out.IP + *out = new(string) + **out = **in + } + if in.PartitionName != nil { + in, out := &in.PartitionName, &out.PartitionName + *out = new(string) + **out = **in + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionAccessInitParameters. +func (in *NashaPartitionAccessInitParameters) DeepCopy() *NashaPartitionAccessInitParameters { + if in == nil { + return nil + } + out := new(NashaPartitionAccessInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionAccessList) DeepCopyInto(out *NashaPartitionAccessList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NashaPartitionAccess, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionAccessList. +func (in *NashaPartitionAccessList) DeepCopy() *NashaPartitionAccessList { + if in == nil { + return nil + } + out := new(NashaPartitionAccessList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NashaPartitionAccessList) 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 *NashaPartitionAccessObservation) DeepCopyInto(out *NashaPartitionAccessObservation) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.IP != nil { + in, out := &in.IP, &out.IP + *out = new(string) + **out = **in + } + if in.PartitionName != nil { + in, out := &in.PartitionName, &out.PartitionName + *out = new(string) + **out = **in + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionAccessObservation. +func (in *NashaPartitionAccessObservation) DeepCopy() *NashaPartitionAccessObservation { + if in == nil { + return nil + } + out := new(NashaPartitionAccessObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionAccessParameters) DeepCopyInto(out *NashaPartitionAccessParameters) { + *out = *in + if in.IP != nil { + in, out := &in.IP, &out.IP + *out = new(string) + **out = **in + } + if in.PartitionName != nil { + in, out := &in.PartitionName, &out.PartitionName + *out = new(string) + **out = **in + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionAccessParameters. +func (in *NashaPartitionAccessParameters) DeepCopy() *NashaPartitionAccessParameters { + if in == nil { + return nil + } + out := new(NashaPartitionAccessParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionAccessSpec) DeepCopyInto(out *NashaPartitionAccessSpec) { + *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 NashaPartitionAccessSpec. +func (in *NashaPartitionAccessSpec) DeepCopy() *NashaPartitionAccessSpec { + if in == nil { + return nil + } + out := new(NashaPartitionAccessSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionAccessStatus) DeepCopyInto(out *NashaPartitionAccessStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionAccessStatus. +func (in *NashaPartitionAccessStatus) DeepCopy() *NashaPartitionAccessStatus { + if in == nil { + return nil + } + out := new(NashaPartitionAccessStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionInitParameters) DeepCopyInto(out *NashaPartitionInitParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = new(string) + **out = **in + } + if in.Size != nil { + in, out := &in.Size, &out.Size + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionInitParameters. +func (in *NashaPartitionInitParameters) DeepCopy() *NashaPartitionInitParameters { + if in == nil { + return nil + } + out := new(NashaPartitionInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionList) DeepCopyInto(out *NashaPartitionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NashaPartition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionList. +func (in *NashaPartitionList) DeepCopy() *NashaPartitionList { + if in == nil { + return nil + } + out := new(NashaPartitionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NashaPartitionList) 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 *NashaPartitionObservation) DeepCopyInto(out *NashaPartitionObservation) { + *out = *in + if in.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = new(float64) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = new(string) + **out = **in + } + if in.Size != nil { + in, out := &in.Size, &out.Size + *out = new(float64) + **out = **in + } + if in.UsedBySnapshots != nil { + in, out := &in.UsedBySnapshots, &out.UsedBySnapshots + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionObservation. +func (in *NashaPartitionObservation) DeepCopy() *NashaPartitionObservation { + if in == nil { + return nil + } + out := new(NashaPartitionObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionParameters) DeepCopyInto(out *NashaPartitionParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = new(string) + **out = **in + } + if in.Size != nil { + in, out := &in.Size, &out.Size + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionParameters. +func (in *NashaPartitionParameters) DeepCopy() *NashaPartitionParameters { + if in == nil { + return nil + } + out := new(NashaPartitionParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionSnapshot) DeepCopyInto(out *NashaPartitionSnapshot) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionSnapshot. +func (in *NashaPartitionSnapshot) DeepCopy() *NashaPartitionSnapshot { + if in == nil { + return nil + } + out := new(NashaPartitionSnapshot) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NashaPartitionSnapshot) 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 *NashaPartitionSnapshotInitParameters) DeepCopyInto(out *NashaPartitionSnapshotInitParameters) { + *out = *in + if in.PartitionName != nil { + in, out := &in.PartitionName, &out.PartitionName + *out = new(string) + **out = **in + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionSnapshotInitParameters. +func (in *NashaPartitionSnapshotInitParameters) DeepCopy() *NashaPartitionSnapshotInitParameters { + if in == nil { + return nil + } + out := new(NashaPartitionSnapshotInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionSnapshotList) DeepCopyInto(out *NashaPartitionSnapshotList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NashaPartitionSnapshot, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionSnapshotList. +func (in *NashaPartitionSnapshotList) DeepCopy() *NashaPartitionSnapshotList { + if in == nil { + return nil + } + out := new(NashaPartitionSnapshotList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NashaPartitionSnapshotList) 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 *NashaPartitionSnapshotObservation) DeepCopyInto(out *NashaPartitionSnapshotObservation) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.PartitionName != nil { + in, out := &in.PartitionName, &out.PartitionName + *out = new(string) + **out = **in + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionSnapshotObservation. +func (in *NashaPartitionSnapshotObservation) DeepCopy() *NashaPartitionSnapshotObservation { + if in == nil { + return nil + } + out := new(NashaPartitionSnapshotObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionSnapshotParameters) DeepCopyInto(out *NashaPartitionSnapshotParameters) { + *out = *in + if in.PartitionName != nil { + in, out := &in.PartitionName, &out.PartitionName + *out = new(string) + **out = **in + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionSnapshotParameters. +func (in *NashaPartitionSnapshotParameters) DeepCopy() *NashaPartitionSnapshotParameters { + if in == nil { + return nil + } + out := new(NashaPartitionSnapshotParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionSnapshotSpec) DeepCopyInto(out *NashaPartitionSnapshotSpec) { + *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 NashaPartitionSnapshotSpec. +func (in *NashaPartitionSnapshotSpec) DeepCopy() *NashaPartitionSnapshotSpec { + if in == nil { + return nil + } + out := new(NashaPartitionSnapshotSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionSnapshotStatus) DeepCopyInto(out *NashaPartitionSnapshotStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionSnapshotStatus. +func (in *NashaPartitionSnapshotStatus) DeepCopy() *NashaPartitionSnapshotStatus { + if in == nil { + return nil + } + out := new(NashaPartitionSnapshotStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionSpec) DeepCopyInto(out *NashaPartitionSpec) { + *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 NashaPartitionSpec. +func (in *NashaPartitionSpec) DeepCopy() *NashaPartitionSpec { + if in == nil { + return nil + } + out := new(NashaPartitionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NashaPartitionStatus) DeepCopyInto(out *NashaPartitionStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NashaPartitionStatus. +func (in *NashaPartitionStatus) DeepCopy() *NashaPartitionStatus { + if in == nil { + return nil + } + out := new(NashaPartitionStatus) + in.DeepCopyInto(out) + return out +} diff --git a/apis/nas/v1alpha1/zz_generated.managed.go b/apis/nas/v1alpha1/zz_generated.managed.go new file mode 100644 index 0000000..22fda3e --- /dev/null +++ b/apis/nas/v1alpha1/zz_generated.managed.go @@ -0,0 +1,188 @@ +/* +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 NashaPartition. +func (mg *NashaPartition) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this NashaPartition. +func (mg *NashaPartition) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this NashaPartition. +func (mg *NashaPartition) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this NashaPartition. +func (mg *NashaPartition) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this NashaPartition. +func (mg *NashaPartition) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this NashaPartition. +func (mg *NashaPartition) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this NashaPartition. +func (mg *NashaPartition) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this NashaPartition. +func (mg *NashaPartition) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this NashaPartition. +func (mg *NashaPartition) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this NashaPartition. +func (mg *NashaPartition) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this NashaPartition. +func (mg *NashaPartition) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this NashaPartition. +func (mg *NashaPartition) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this NashaPartitionAccess. +func (mg *NashaPartitionAccess) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this NashaPartitionAccess. +func (mg *NashaPartitionAccess) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this NashaPartitionAccess. +func (mg *NashaPartitionAccess) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this NashaPartitionAccess. +func (mg *NashaPartitionAccess) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this NashaPartitionAccess. +func (mg *NashaPartitionAccess) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this NashaPartitionAccess. +func (mg *NashaPartitionAccess) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this NashaPartitionAccess. +func (mg *NashaPartitionAccess) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this NashaPartitionAccess. +func (mg *NashaPartitionAccess) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this NashaPartitionAccess. +func (mg *NashaPartitionAccess) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this NashaPartitionAccess. +func (mg *NashaPartitionAccess) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this NashaPartitionAccess. +func (mg *NashaPartitionAccess) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this NashaPartitionAccess. +func (mg *NashaPartitionAccess) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this NashaPartitionSnapshot. +func (mg *NashaPartitionSnapshot) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this NashaPartitionSnapshot. +func (mg *NashaPartitionSnapshot) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this NashaPartitionSnapshot. +func (mg *NashaPartitionSnapshot) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this NashaPartitionSnapshot. +func (mg *NashaPartitionSnapshot) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this NashaPartitionSnapshot. +func (mg *NashaPartitionSnapshot) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this NashaPartitionSnapshot. +func (mg *NashaPartitionSnapshot) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this NashaPartitionSnapshot. +func (mg *NashaPartitionSnapshot) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this NashaPartitionSnapshot. +func (mg *NashaPartitionSnapshot) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this NashaPartitionSnapshot. +func (mg *NashaPartitionSnapshot) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this NashaPartitionSnapshot. +func (mg *NashaPartitionSnapshot) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this NashaPartitionSnapshot. +func (mg *NashaPartitionSnapshot) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this NashaPartitionSnapshot. +func (mg *NashaPartitionSnapshot) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/nas/v1alpha1/zz_generated.managedlist.go b/apis/nas/v1alpha1/zz_generated.managedlist.go new file mode 100644 index 0000000..38b317c --- /dev/null +++ b/apis/nas/v1alpha1/zz_generated.managedlist.go @@ -0,0 +1,35 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import resource "github.com/crossplane/crossplane-runtime/pkg/resource" + +// GetItems of this NashaPartitionAccessList. +func (l *NashaPartitionAccessList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + +// GetItems of this NashaPartitionList. +func (l *NashaPartitionList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + +// GetItems of this NashaPartitionSnapshotList. +func (l *NashaPartitionSnapshotList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} diff --git a/apis/nas/v1alpha1/zz_generated_terraformed.go b/apis/nas/v1alpha1/zz_generated_terraformed.go new file mode 100755 index 0000000..f09442f --- /dev/null +++ b/apis/nas/v1alpha1/zz_generated_terraformed.go @@ -0,0 +1,270 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this NashaPartition +func (mg *NashaPartition) GetTerraformResourceType() string { + return "ovh_dedicated_nasha_partition" +} + +// GetConnectionDetailsMapping for this NashaPartition +func (tr *NashaPartition) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this NashaPartition +func (tr *NashaPartition) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this NashaPartition +func (tr *NashaPartition) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this NashaPartition +func (tr *NashaPartition) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this NashaPartition +func (tr *NashaPartition) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this NashaPartition +func (tr *NashaPartition) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this NashaPartition +func (tr *NashaPartition) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// LateInitialize this NashaPartition using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *NashaPartition) LateInitialize(attrs []byte) (bool, error) { + params := &NashaPartitionParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *NashaPartition) GetTerraformSchemaVersion() int { + return 0 +} + +// GetTerraformResourceType returns Terraform resource type for this NashaPartitionAccess +func (mg *NashaPartitionAccess) GetTerraformResourceType() string { + return "ovh_dedicated_nasha_partition_access" +} + +// GetConnectionDetailsMapping for this NashaPartitionAccess +func (tr *NashaPartitionAccess) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this NashaPartitionAccess +func (tr *NashaPartitionAccess) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this NashaPartitionAccess +func (tr *NashaPartitionAccess) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this NashaPartitionAccess +func (tr *NashaPartitionAccess) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this NashaPartitionAccess +func (tr *NashaPartitionAccess) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this NashaPartitionAccess +func (tr *NashaPartitionAccess) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this NashaPartitionAccess +func (tr *NashaPartitionAccess) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// LateInitialize this NashaPartitionAccess using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *NashaPartitionAccess) LateInitialize(attrs []byte) (bool, error) { + params := &NashaPartitionAccessParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *NashaPartitionAccess) GetTerraformSchemaVersion() int { + return 0 +} + +// GetTerraformResourceType returns Terraform resource type for this NashaPartitionSnapshot +func (mg *NashaPartitionSnapshot) GetTerraformResourceType() string { + return "ovh_dedicated_nasha_partition_snapshot" +} + +// GetConnectionDetailsMapping for this NashaPartitionSnapshot +func (tr *NashaPartitionSnapshot) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this NashaPartitionSnapshot +func (tr *NashaPartitionSnapshot) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this NashaPartitionSnapshot +func (tr *NashaPartitionSnapshot) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this NashaPartitionSnapshot +func (tr *NashaPartitionSnapshot) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this NashaPartitionSnapshot +func (tr *NashaPartitionSnapshot) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this NashaPartitionSnapshot +func (tr *NashaPartitionSnapshot) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this NashaPartitionSnapshot +func (tr *NashaPartitionSnapshot) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// LateInitialize this NashaPartitionSnapshot using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *NashaPartitionSnapshot) LateInitialize(attrs []byte) (bool, error) { + params := &NashaPartitionSnapshotParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *NashaPartitionSnapshot) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/publiccloudnetwork/v1alpha1/zz_groupversion_info.go b/apis/nas/v1alpha1/zz_groupversion_info.go similarity index 89% rename from apis/publiccloudnetwork/v1alpha1/zz_groupversion_info.go rename to apis/nas/v1alpha1/zz_groupversion_info.go index 30ee5f4..72c813a 100755 --- a/apis/publiccloudnetwork/v1alpha1/zz_groupversion_info.go +++ b/apis/nas/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=publiccloudnetwork.ovh.edixos.io +// +groupName=nas.ovh.edixos.io // +versionName=v1alpha1 package v1alpha1 @@ -20,7 +20,7 @@ import ( // Package type metadata. const ( - CRDGroup = "publiccloudnetwork.ovh.edixos.io" + CRDGroup = "nas.ovh.edixos.io" CRDVersion = "v1alpha1" ) diff --git a/apis/nas/v1alpha1/zz_nashapartition_types.go b/apis/nas/v1alpha1/zz_nashapartition_types.go new file mode 100755 index 0000000..48c7b0b --- /dev/null +++ b/apis/nas/v1alpha1/zz_nashapartition_types.go @@ -0,0 +1,122 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type NashaPartitionInitParameters struct { + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` + + Size *float64 `json:"size,omitempty" tf:"size,omitempty"` +} + +type NashaPartitionObservation struct { + Capacity *float64 `json:"capacity,omitempty" tf:"capacity,omitempty"` + + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` + + Size *float64 `json:"size,omitempty" tf:"size,omitempty"` + + UsedBySnapshots *float64 `json:"usedBySnapshots,omitempty" tf:"used_by_snapshots,omitempty"` +} + +type NashaPartitionParameters struct { + + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // +kubebuilder:validation:Optional + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // +kubebuilder:validation:Optional + ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` + + // +kubebuilder:validation:Optional + Size *float64 `json:"size,omitempty" tf:"size,omitempty"` +} + +// NashaPartitionSpec defines the desired state of NashaPartition +type NashaPartitionSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider NashaPartitionParameters `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 + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // 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 NashaPartitionInitParameters `json:"initProvider,omitempty"` +} + +// NashaPartitionStatus defines the observed state of NashaPartition. +type NashaPartitionStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider NashaPartitionObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// NashaPartition is the Schema for the NashaPartitions 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 NashaPartition 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.protocol) || (has(self.initProvider) && has(self.initProvider.protocol))",message="spec.forProvider.protocol 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.size) || (has(self.initProvider) && has(self.initProvider.size))",message="spec.forProvider.size is a required parameter" + Spec NashaPartitionSpec `json:"spec"` + Status NashaPartitionStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// NashaPartitionList contains a list of NashaPartitions +type NashaPartitionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NashaPartition `json:"items"` +} + +// Repository type metadata. +var ( + NashaPartition_Kind = "NashaPartition" + NashaPartition_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: NashaPartition_Kind}.String() + NashaPartition_KindAPIVersion = NashaPartition_Kind + "." + CRDGroupVersion.String() + NashaPartition_GroupVersionKind = CRDGroupVersion.WithKind(NashaPartition_Kind) +) + +func init() { + SchemeBuilder.Register(&NashaPartition{}, &NashaPartitionList{}) +} diff --git a/apis/nas/v1alpha1/zz_nashapartitionaccess_types.go b/apis/nas/v1alpha1/zz_nashapartitionaccess_types.go new file mode 100755 index 0000000..2099872 --- /dev/null +++ b/apis/nas/v1alpha1/zz_nashapartitionaccess_types.go @@ -0,0 +1,118 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type NashaPartitionAccessInitParameters struct { + IP *string `json:"ip,omitempty" tf:"ip,omitempty"` + + PartitionName *string `json:"partitionName,omitempty" tf:"partition_name,omitempty"` + + ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` + + Type *string `json:"type,omitempty" tf:"type,omitempty"` +} + +type NashaPartitionAccessObservation struct { + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + IP *string `json:"ip,omitempty" tf:"ip,omitempty"` + + PartitionName *string `json:"partitionName,omitempty" tf:"partition_name,omitempty"` + + ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` + + Type *string `json:"type,omitempty" tf:"type,omitempty"` +} + +type NashaPartitionAccessParameters struct { + + // +kubebuilder:validation:Optional + IP *string `json:"ip,omitempty" tf:"ip,omitempty"` + + // +kubebuilder:validation:Optional + PartitionName *string `json:"partitionName,omitempty" tf:"partition_name,omitempty"` + + // +kubebuilder:validation:Optional + ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` + + // +kubebuilder:validation:Optional + Type *string `json:"type,omitempty" tf:"type,omitempty"` +} + +// NashaPartitionAccessSpec defines the desired state of NashaPartitionAccess +type NashaPartitionAccessSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider NashaPartitionAccessParameters `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 + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // 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 NashaPartitionAccessInitParameters `json:"initProvider,omitempty"` +} + +// NashaPartitionAccessStatus defines the observed state of NashaPartitionAccess. +type NashaPartitionAccessStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider NashaPartitionAccessObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// NashaPartitionAccess is the Schema for the NashaPartitionAccesss 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 NashaPartitionAccess 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.ip) || (has(self.initProvider) && has(self.initProvider.ip))",message="spec.forProvider.ip is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.partitionName) || (has(self.initProvider) && has(self.initProvider.partitionName))",message="spec.forProvider.partitionName 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 NashaPartitionAccessSpec `json:"spec"` + Status NashaPartitionAccessStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// NashaPartitionAccessList contains a list of NashaPartitionAccesss +type NashaPartitionAccessList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NashaPartitionAccess `json:"items"` +} + +// Repository type metadata. +var ( + NashaPartitionAccess_Kind = "NashaPartitionAccess" + NashaPartitionAccess_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: NashaPartitionAccess_Kind}.String() + NashaPartitionAccess_KindAPIVersion = NashaPartitionAccess_Kind + "." + CRDGroupVersion.String() + NashaPartitionAccess_GroupVersionKind = CRDGroupVersion.WithKind(NashaPartitionAccess_Kind) +) + +func init() { + SchemeBuilder.Register(&NashaPartitionAccess{}, &NashaPartitionAccessList{}) +} diff --git a/apis/nas/v1alpha1/zz_nashapartitionsnapshot_types.go b/apis/nas/v1alpha1/zz_nashapartitionsnapshot_types.go new file mode 100755 index 0000000..848e739 --- /dev/null +++ b/apis/nas/v1alpha1/zz_nashapartitionsnapshot_types.go @@ -0,0 +1,111 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type NashaPartitionSnapshotInitParameters struct { + PartitionName *string `json:"partitionName,omitempty" tf:"partition_name,omitempty"` + + ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` + + Type *string `json:"type,omitempty" tf:"type,omitempty"` +} + +type NashaPartitionSnapshotObservation struct { + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + PartitionName *string `json:"partitionName,omitempty" tf:"partition_name,omitempty"` + + ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` + + Type *string `json:"type,omitempty" tf:"type,omitempty"` +} + +type NashaPartitionSnapshotParameters struct { + + // +kubebuilder:validation:Optional + PartitionName *string `json:"partitionName,omitempty" tf:"partition_name,omitempty"` + + // +kubebuilder:validation:Optional + ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` + + // +kubebuilder:validation:Optional + Type *string `json:"type,omitempty" tf:"type,omitempty"` +} + +// NashaPartitionSnapshotSpec defines the desired state of NashaPartitionSnapshot +type NashaPartitionSnapshotSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider NashaPartitionSnapshotParameters `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 + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // 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 NashaPartitionSnapshotInitParameters `json:"initProvider,omitempty"` +} + +// NashaPartitionSnapshotStatus defines the observed state of NashaPartitionSnapshot. +type NashaPartitionSnapshotStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider NashaPartitionSnapshotObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// NashaPartitionSnapshot is the Schema for the NashaPartitionSnapshots 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 NashaPartitionSnapshot 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.partitionName) || (has(self.initProvider) && has(self.initProvider.partitionName))",message="spec.forProvider.partitionName 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.type) || (has(self.initProvider) && has(self.initProvider.type))",message="spec.forProvider.type is a required parameter" + Spec NashaPartitionSnapshotSpec `json:"spec"` + Status NashaPartitionSnapshotStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// NashaPartitionSnapshotList contains a list of NashaPartitionSnapshots +type NashaPartitionSnapshotList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NashaPartitionSnapshot `json:"items"` +} + +// Repository type metadata. +var ( + NashaPartitionSnapshot_Kind = "NashaPartitionSnapshot" + NashaPartitionSnapshot_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: NashaPartitionSnapshot_Kind}.String() + NashaPartitionSnapshot_KindAPIVersion = NashaPartitionSnapshot_Kind + "." + CRDGroupVersion.String() + NashaPartitionSnapshot_GroupVersionKind = CRDGroupVersion.WithKind(NashaPartitionSnapshot_Kind) +) + +func init() { + SchemeBuilder.Register(&NashaPartitionSnapshot{}, &NashaPartitionSnapshotList{}) +} diff --git a/apis/publiccloudnetwork/v1alpha1/zz_generated.deepcopy.go b/apis/pcn/v1alpha1/zz_generated.deepcopy.go similarity index 100% rename from apis/publiccloudnetwork/v1alpha1/zz_generated.deepcopy.go rename to apis/pcn/v1alpha1/zz_generated.deepcopy.go diff --git a/apis/publiccloudnetwork/v1alpha1/zz_generated.managed.go b/apis/pcn/v1alpha1/zz_generated.managed.go similarity index 100% rename from apis/publiccloudnetwork/v1alpha1/zz_generated.managed.go rename to apis/pcn/v1alpha1/zz_generated.managed.go diff --git a/apis/publiccloudnetwork/v1alpha1/zz_generated.managedlist.go b/apis/pcn/v1alpha1/zz_generated.managedlist.go similarity index 100% rename from apis/publiccloudnetwork/v1alpha1/zz_generated.managedlist.go rename to apis/pcn/v1alpha1/zz_generated.managedlist.go diff --git a/apis/publiccloudnetwork/v1alpha1/zz_generated_terraformed.go b/apis/pcn/v1alpha1/zz_generated_terraformed.go similarity index 100% rename from apis/publiccloudnetwork/v1alpha1/zz_generated_terraformed.go rename to apis/pcn/v1alpha1/zz_generated_terraformed.go diff --git a/apis/pcn/v1alpha1/zz_groupversion_info.go b/apis/pcn/v1alpha1/zz_groupversion_info.go new file mode 100755 index 0000000..2b1dcd3 --- /dev/null +++ b/apis/pcn/v1alpha1/zz_groupversion_info.go @@ -0,0 +1,36 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +// +kubebuilder:object:generate=true +// +groupName=pcn.ovh.edixos.io +// +versionName=v1alpha1 +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +// Package type metadata. +const ( + CRDGroup = "pcn.ovh.edixos.io" + CRDVersion = "v1alpha1" +) + +var ( + // CRDGroupVersion is the API Group Version used to register the objects + CRDGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: CRDGroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/apis/publiccloudnetwork/v1alpha1/zz_projectnetworkprivate_types.go b/apis/pcn/v1alpha1/zz_projectnetworkprivate_types.go similarity index 100% rename from apis/publiccloudnetwork/v1alpha1/zz_projectnetworkprivate_types.go rename to apis/pcn/v1alpha1/zz_projectnetworkprivate_types.go diff --git a/apis/publiccloudnetwork/v1alpha1/zz_projectnetworkprivatesubnet_types.go b/apis/pcn/v1alpha1/zz_projectnetworkprivatesubnet_types.go similarity index 100% rename from apis/publiccloudnetwork/v1alpha1/zz_projectnetworkprivatesubnet_types.go rename to apis/pcn/v1alpha1/zz_projectnetworkprivatesubnet_types.go diff --git a/apis/zz_register.go b/apis/zz_register.go index 059167d..1311b72 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -23,7 +23,8 @@ import ( v1alpha1kube "github.com/edixos/provider-ovh/apis/kube/v1alpha1" v1alpha1lb "github.com/edixos/provider-ovh/apis/lb/v1alpha1" v1alpha1logs "github.com/edixos/provider-ovh/apis/logs/v1alpha1" - v1alpha1publiccloudnetwork "github.com/edixos/provider-ovh/apis/publiccloudnetwork/v1alpha1" + v1alpha1nas "github.com/edixos/provider-ovh/apis/nas/v1alpha1" + v1alpha1pcn "github.com/edixos/provider-ovh/apis/pcn/v1alpha1" v1alpha1registry "github.com/edixos/provider-ovh/apis/registry/v1alpha1" v1alpha1apis "github.com/edixos/provider-ovh/apis/v1alpha1" v1beta1 "github.com/edixos/provider-ovh/apis/v1beta1" @@ -42,7 +43,8 @@ func init() { v1alpha1kube.SchemeBuilder.AddToScheme, v1alpha1lb.SchemeBuilder.AddToScheme, v1alpha1logs.SchemeBuilder.AddToScheme, - v1alpha1publiccloudnetwork.SchemeBuilder.AddToScheme, + v1alpha1nas.SchemeBuilder.AddToScheme, + v1alpha1pcn.SchemeBuilder.AddToScheme, v1alpha1registry.SchemeBuilder.AddToScheme, v1alpha1apis.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme, diff --git a/config/provider.go b/config/provider.go index 90e4e23..8b229a3 100644 --- a/config/provider.go +++ b/config/provider.go @@ -7,6 +7,7 @@ package config import ( // Note(turkenh): we are importing this to embed provider schema document _ "embed" + "github.com/edixos/provider-ovh/config/nas" "github.com/edixos/provider-ovh/config/registry" diff --git a/config/public_cloud_network/config.go b/config/public_cloud_network/config.go index 3374e5d..0a49982 100644 --- a/config/public_cloud_network/config.go +++ b/config/public_cloud_network/config.go @@ -2,12 +2,16 @@ package public_cloud_network import "github.com/crossplane/upjet/pkg/config" +const ( + shortGroup = "pcn" +) + // 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 = "publiccloudnetwork" + r.ShortGroup = shortGroup }) p.AddResourceConfigurator("ovh_cloud_project_network_private_subnet", func(r *config.Resource) { - r.ShortGroup = "publiccloudnetwork" + r.ShortGroup = shortGroup }) } diff --git a/internal/controller/nas/nashapartition/zz_controller.go b/internal/controller/nas/nashapartition/zz_controller.go new file mode 100755 index 0000000..0949587 --- /dev/null +++ b/internal/controller/nas/nashapartition/zz_controller.go @@ -0,0 +1,67 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package nashapartition + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/edixos/provider-ovh/apis/nas/v1alpha1" + features "github.com/edixos/provider-ovh/internal/features" +) + +// Setup adds a controller that reconciles NashaPartition managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.NashaPartition_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.NashaPartition_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.NashaPartition_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["ovh_dedicated_nasha_partition"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.NashaPartition_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.NashaPartition{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/nas/nashapartitionaccess/zz_controller.go b/internal/controller/nas/nashapartitionaccess/zz_controller.go new file mode 100755 index 0000000..518420f --- /dev/null +++ b/internal/controller/nas/nashapartitionaccess/zz_controller.go @@ -0,0 +1,67 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package nashapartitionaccess + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/edixos/provider-ovh/apis/nas/v1alpha1" + features "github.com/edixos/provider-ovh/internal/features" +) + +// Setup adds a controller that reconciles NashaPartitionAccess managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.NashaPartitionAccess_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.NashaPartitionAccess_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.NashaPartitionAccess_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["ovh_dedicated_nasha_partition_access"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.NashaPartitionAccess_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.NashaPartitionAccess{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/nas/nashapartitionsnapshot/zz_controller.go b/internal/controller/nas/nashapartitionsnapshot/zz_controller.go new file mode 100755 index 0000000..dba0597 --- /dev/null +++ b/internal/controller/nas/nashapartitionsnapshot/zz_controller.go @@ -0,0 +1,67 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package nashapartitionsnapshot + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/edixos/provider-ovh/apis/nas/v1alpha1" + features "github.com/edixos/provider-ovh/internal/features" +) + +// Setup adds a controller that reconciles NashaPartitionSnapshot managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.NashaPartitionSnapshot_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.NashaPartitionSnapshot_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.NashaPartitionSnapshot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["ovh_dedicated_nasha_partition_snapshot"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.NashaPartitionSnapshot_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.NashaPartitionSnapshot{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/publiccloudnetwork/projectnetworkprivate/zz_controller.go b/internal/controller/pcn/projectnetworkprivate/zz_controller.go similarity index 97% rename from internal/controller/publiccloudnetwork/projectnetworkprivate/zz_controller.go rename to internal/controller/pcn/projectnetworkprivate/zz_controller.go index bcb06bb..9ae23a2 100755 --- a/internal/controller/publiccloudnetwork/projectnetworkprivate/zz_controller.go +++ b/internal/controller/pcn/projectnetworkprivate/zz_controller.go @@ -23,7 +23,7 @@ import ( "github.com/crossplane/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/edixos/provider-ovh/apis/publiccloudnetwork/v1alpha1" + v1alpha1 "github.com/edixos/provider-ovh/apis/pcn/v1alpha1" features "github.com/edixos/provider-ovh/internal/features" ) diff --git a/internal/controller/publiccloudnetwork/projectnetworkprivatesubnet/zz_controller.go b/internal/controller/pcn/projectnetworkprivatesubnet/zz_controller.go similarity index 97% rename from internal/controller/publiccloudnetwork/projectnetworkprivatesubnet/zz_controller.go rename to internal/controller/pcn/projectnetworkprivatesubnet/zz_controller.go index 6e8ceb7..228b46f 100755 --- a/internal/controller/publiccloudnetwork/projectnetworkprivatesubnet/zz_controller.go +++ b/internal/controller/pcn/projectnetworkprivatesubnet/zz_controller.go @@ -23,7 +23,7 @@ import ( "github.com/crossplane/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/edixos/provider-ovh/apis/publiccloudnetwork/v1alpha1" + v1alpha1 "github.com/edixos/provider-ovh/apis/pcn/v1alpha1" features "github.com/edixos/provider-ovh/internal/features" ) diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 3c19c33..ac10a0c 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -67,9 +67,12 @@ import ( vracknetwork "github.com/edixos/provider-ovh/internal/controller/lb/vracknetwork" logscluster "github.com/edixos/provider-ovh/internal/controller/logs/logscluster" logsinput "github.com/edixos/provider-ovh/internal/controller/logs/logsinput" + 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" providerconfig "github.com/edixos/provider-ovh/internal/controller/providerconfig" - projectnetworkprivate "github.com/edixos/provider-ovh/internal/controller/publiccloudnetwork/projectnetworkprivate" - projectnetworkprivatesubnet "github.com/edixos/provider-ovh/internal/controller/publiccloudnetwork/projectnetworkprivatesubnet" projectcontainerregistry "github.com/edixos/provider-ovh/internal/controller/registry/projectcontainerregistry" projectcontainerregistryoidc "github.com/edixos/provider-ovh/internal/controller/registry/projectcontainerregistryoidc" projectcontainerregistryuser "github.com/edixos/provider-ovh/internal/controller/registry/projectcontainerregistryuser" @@ -138,9 +141,12 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { vracknetwork.Setup, logscluster.Setup, logsinput.Setup, - providerconfig.Setup, + nashapartition.Setup, + nashapartitionaccess.Setup, + nashapartitionsnapshot.Setup, projectnetworkprivate.Setup, projectnetworkprivatesubnet.Setup, + providerconfig.Setup, projectcontainerregistry.Setup, projectcontainerregistryoidc.Setup, projectcontainerregistryuser.Setup, diff --git a/package/crds/nas.ovh.edixos.io_nashapartitionaccesses.yaml b/package/crds/nas.ovh.edixos.io_nashapartitionaccesses.yaml new file mode 100644 index 0000000..e7a1287 --- /dev/null +++ b/package/crds/nas.ovh.edixos.io_nashapartitionaccesses.yaml @@ -0,0 +1,333 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: nashapartitionaccesses.nas.ovh.edixos.io +spec: + group: nas.ovh.edixos.io + names: + categories: + - crossplane + - managed + - ovh + kind: NashaPartitionAccess + listKind: NashaPartitionAccessList + plural: nashapartitionaccesses + singular: nashapartitionaccess + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: NashaPartitionAccess is the Schema for the NashaPartitionAccesss + 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: NashaPartitionAccessSpec defines the desired state of NashaPartitionAccess + properties: + deletionPolicy: + default: Delete + description: 'DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. This field is planned to be deprecated + in favor of the ManagementPolicies field in a future release. Currently, + both could be set independently and non-default values would be + honored if the feature flag is enabled. See the design doc for more + information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223' + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + ip: + type: string + partitionName: + type: string + serviceName: + type: string + type: + type: string + type: object + initProvider: + description: 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 of Identifier and other resource + reference fields. The fields that are in InitProvider are merged + into ForProvider when the resource is created. The same fields are + also added to the terraform ignore_changes hook, to avoid updating + them after creation. This is useful for fields that are 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. + properties: + ip: + type: string + partitionName: + type: string + serviceName: + type: string + type: + type: string + type: object + managementPolicies: + default: + - '*' + description: 'THIS IS A BETA FIELD. It is on by default but can be + opted out through a Crossplane feature flag. ManagementPolicies + specify the array of actions Crossplane is allowed to take on the + managed and external resources. This field is planned to replace + the DeletionPolicy field in a future release. Currently, both could + be set independently and non-default values would be honored if + the feature flag is enabled. If both are custom, the DeletionPolicy + field will be ignored. See the design doc for more information: + https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md' + items: + description: A ManagementAction represents an action that the Crossplane + controllers can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + 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 + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + 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 + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.ip is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.ip) + || (has(self.initProvider) && has(self.initProvider.ip))' + - message: spec.forProvider.partitionName is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.partitionName) + || (has(self.initProvider) && has(self.initProvider.partitionName))' + - 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: NashaPartitionAccessStatus defines the observed state of + NashaPartitionAccess. + properties: + atProvider: + properties: + id: + type: string + ip: + type: string + partitionName: + type: string + serviceName: + type: string + type: + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/nas.ovh.edixos.io_nashapartitions.yaml b/package/crds/nas.ovh.edixos.io_nashapartitions.yaml new file mode 100644 index 0000000..690c2aa --- /dev/null +++ b/package/crds/nas.ovh.edixos.io_nashapartitions.yaml @@ -0,0 +1,336 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: nashapartitions.nas.ovh.edixos.io +spec: + group: nas.ovh.edixos.io + names: + categories: + - crossplane + - managed + - ovh + kind: NashaPartition + listKind: NashaPartitionList + plural: nashapartitions + singular: nashapartition + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: NashaPartition is the Schema for the NashaPartitions 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: NashaPartitionSpec defines the desired state of NashaPartition + properties: + deletionPolicy: + default: Delete + description: 'DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. This field is planned to be deprecated + in favor of the ManagementPolicies field in a future release. Currently, + both could be set independently and non-default values would be + honored if the feature flag is enabled. See the design doc for more + information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223' + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + description: + type: string + protocol: + type: string + serviceName: + type: string + size: + type: number + type: object + initProvider: + description: 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 of Identifier and other resource + reference fields. The fields that are in InitProvider are merged + into ForProvider when the resource is created. The same fields are + also added to the terraform ignore_changes hook, to avoid updating + them after creation. This is useful for fields that are 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. + properties: + description: + type: string + protocol: + type: string + serviceName: + type: string + size: + type: number + type: object + managementPolicies: + default: + - '*' + description: 'THIS IS A BETA FIELD. It is on by default but can be + opted out through a Crossplane feature flag. ManagementPolicies + specify the array of actions Crossplane is allowed to take on the + managed and external resources. This field is planned to replace + the DeletionPolicy field in a future release. Currently, both could + be set independently and non-default values would be honored if + the feature flag is enabled. If both are custom, the DeletionPolicy + field will be ignored. See the design doc for more information: + https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md' + items: + description: A ManagementAction represents an action that the Crossplane + controllers can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + 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 + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + 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 + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.protocol is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.protocol) + || (has(self.initProvider) && has(self.initProvider.protocol))' + - 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))' + - message: spec.forProvider.size is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.size) + || (has(self.initProvider) && has(self.initProvider.size))' + status: + description: NashaPartitionStatus defines the observed state of NashaPartition. + properties: + atProvider: + properties: + capacity: + type: number + description: + type: string + id: + type: string + protocol: + type: string + serviceName: + type: string + size: + type: number + usedBySnapshots: + type: number + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/nas.ovh.edixos.io_nashapartitionsnapshots.yaml b/package/crds/nas.ovh.edixos.io_nashapartitionsnapshots.yaml new file mode 100644 index 0000000..9b95b88 --- /dev/null +++ b/package/crds/nas.ovh.edixos.io_nashapartitionsnapshots.yaml @@ -0,0 +1,327 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: nashapartitionsnapshots.nas.ovh.edixos.io +spec: + group: nas.ovh.edixos.io + names: + categories: + - crossplane + - managed + - ovh + kind: NashaPartitionSnapshot + listKind: NashaPartitionSnapshotList + plural: nashapartitionsnapshots + singular: nashapartitionsnapshot + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: NashaPartitionSnapshot is the Schema for the NashaPartitionSnapshots + 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: NashaPartitionSnapshotSpec defines the desired state of NashaPartitionSnapshot + properties: + deletionPolicy: + default: Delete + description: 'DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. This field is planned to be deprecated + in favor of the ManagementPolicies field in a future release. Currently, + both could be set independently and non-default values would be + honored if the feature flag is enabled. See the design doc for more + information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223' + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + partitionName: + type: string + serviceName: + type: string + type: + type: string + type: object + initProvider: + description: 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 of Identifier and other resource + reference fields. The fields that are in InitProvider are merged + into ForProvider when the resource is created. The same fields are + also added to the terraform ignore_changes hook, to avoid updating + them after creation. This is useful for fields that are 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. + properties: + partitionName: + type: string + serviceName: + type: string + type: + type: string + type: object + managementPolicies: + default: + - '*' + description: 'THIS IS A BETA FIELD. It is on by default but can be + opted out through a Crossplane feature flag. ManagementPolicies + specify the array of actions Crossplane is allowed to take on the + managed and external resources. This field is planned to replace + the DeletionPolicy field in a future release. Currently, both could + be set independently and non-default values would be honored if + the feature flag is enabled. If both are custom, the DeletionPolicy + field will be ignored. See the design doc for more information: + https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md' + items: + description: A ManagementAction represents an action that the Crossplane + controllers can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + 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 + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + 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 + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.partitionName is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.partitionName) + || (has(self.initProvider) && has(self.initProvider.partitionName))' + - 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))' + - message: spec.forProvider.type is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.type) + || (has(self.initProvider) && has(self.initProvider.type))' + status: + description: NashaPartitionSnapshotStatus defines the observed state of + NashaPartitionSnapshot. + properties: + atProvider: + properties: + id: + type: string + partitionName: + type: string + serviceName: + type: string + type: + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/publiccloudnetwork.ovh.edixos.io_projectnetworkprivates.yaml b/package/crds/pcn.ovh.edixos.io_projectnetworkprivates.yaml similarity index 99% rename from package/crds/publiccloudnetwork.ovh.edixos.io_projectnetworkprivates.yaml rename to package/crds/pcn.ovh.edixos.io_projectnetworkprivates.yaml index 2e0813e..71160f1 100644 --- a/package/crds/publiccloudnetwork.ovh.edixos.io_projectnetworkprivates.yaml +++ b/package/crds/pcn.ovh.edixos.io_projectnetworkprivates.yaml @@ -4,9 +4,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.13.0 - name: projectnetworkprivates.publiccloudnetwork.ovh.edixos.io + name: projectnetworkprivates.pcn.ovh.edixos.io spec: - group: publiccloudnetwork.ovh.edixos.io + group: pcn.ovh.edixos.io names: categories: - crossplane diff --git a/package/crds/publiccloudnetwork.ovh.edixos.io_projectnetworkprivatesubnets.yaml b/package/crds/pcn.ovh.edixos.io_projectnetworkprivatesubnets.yaml similarity index 99% rename from package/crds/publiccloudnetwork.ovh.edixos.io_projectnetworkprivatesubnets.yaml rename to package/crds/pcn.ovh.edixos.io_projectnetworkprivatesubnets.yaml index 51eaaab..bff584d 100644 --- a/package/crds/publiccloudnetwork.ovh.edixos.io_projectnetworkprivatesubnets.yaml +++ b/package/crds/pcn.ovh.edixos.io_projectnetworkprivatesubnets.yaml @@ -4,9 +4,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.13.0 - name: projectnetworkprivatesubnets.publiccloudnetwork.ovh.edixos.io + name: projectnetworkprivatesubnets.pcn.ovh.edixos.io spec: - group: publiccloudnetwork.ovh.edixos.io + group: pcn.ovh.edixos.io names: categories: - crossplane