From 432f44b713f4f04e46a31e18844c98c863e82703 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Tue, 23 Apr 2024 15:08:50 +0530 Subject: [PATCH] fix for redis cluster --- .../v1beta1/zz_generated.conversion_hubs.go | 3 + .../v1beta1/zz_generated.deepcopy.go | 699 +++++++++++++- .../v1beta1/zz_generated.managed.go | 60 ++ .../v1beta1/zz_generated.managedlist.go | 9 + .../v1beta1/zz_generated.resolvers.go | 74 +- .../zz_serviceconnectionpolicy_terraformed.go | 129 +++ .../zz_serviceconnectionpolicy_types.go | 337 +++++++ apis/redis/v1beta1/zz_cluster_terraformed.go | 129 +++ apis/redis/v1beta1/zz_cluster_types.go | 340 +++++++ apis/redis/v1beta1/zz_generated.deepcopy.go | 660 +++++++++++++ apis/redis/v1beta1/zz_generated.managed.go | 60 ++ .../redis/v1beta1/zz_generated.managedlist.go | 9 + apis/redis/v1beta1/zz_generated.resolvers.go | 57 +- config/networkconnectivity/config.go | 30 + config/rediscluster/config.go | 25 + .../v1beta1/serviceconnectionpolicy.yaml | 52 ++ examples-generated/redis/v1beta1/cluster.yaml | 73 ++ ....upbound.io_serviceconnectionpolicies.yaml | 866 ++++++++++++++++++ .../crds/redis.gcp.upbound.io_clusters.yaml | 698 ++++++++++++++ 19 files changed, 4305 insertions(+), 5 deletions(-) create mode 100755 apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_terraformed.go create mode 100755 apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_types.go create mode 100755 apis/redis/v1beta1/zz_cluster_terraformed.go create mode 100755 apis/redis/v1beta1/zz_cluster_types.go create mode 100644 config/networkconnectivity/config.go create mode 100644 config/rediscluster/config.go create mode 100644 examples-generated/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml create mode 100644 examples-generated/redis/v1beta1/cluster.yaml create mode 100644 package/crds/networkconnectivity.gcp.upbound.io_serviceconnectionpolicies.yaml create mode 100644 package/crds/redis.gcp.upbound.io_clusters.yaml diff --git a/apis/networkconnectivity/v1beta1/zz_generated.conversion_hubs.go b/apis/networkconnectivity/v1beta1/zz_generated.conversion_hubs.go index c5932a46e..4f67b8200 100755 --- a/apis/networkconnectivity/v1beta1/zz_generated.conversion_hubs.go +++ b/apis/networkconnectivity/v1beta1/zz_generated.conversion_hubs.go @@ -9,5 +9,8 @@ package v1beta1 // Hub marks this type as a conversion hub. func (tr *Hub) Hub() {} +// Hub marks this type as a conversion hub. +func (tr *ServiceConnectionPolicy) Hub() {} + // Hub marks this type as a conversion hub. func (tr *Spoke) Hub() {} diff --git a/apis/networkconnectivity/v1beta1/zz_generated.deepcopy.go b/apis/networkconnectivity/v1beta1/zz_generated.deepcopy.go index 58dabf376..b93ff7c37 100644 --- a/apis/networkconnectivity/v1beta1/zz_generated.deepcopy.go +++ b/apis/networkconnectivity/v1beta1/zz_generated.deepcopy.go @@ -9,10 +9,158 @@ package v1beta1 import ( - "github.com/crossplane/crossplane-runtime/apis/common/v1" + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" 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 *ErrorInfoInitParameters) DeepCopyInto(out *ErrorInfoInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorInfoInitParameters. +func (in *ErrorInfoInitParameters) DeepCopy() *ErrorInfoInitParameters { + if in == nil { + return nil + } + out := new(ErrorInfoInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorInfoObservation) DeepCopyInto(out *ErrorInfoObservation) { + *out = *in + if in.Domain != nil { + in, out := &in.Domain, &out.Domain + *out = new(string) + **out = **in + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Reason != nil { + in, out := &in.Reason, &out.Reason + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorInfoObservation. +func (in *ErrorInfoObservation) DeepCopy() *ErrorInfoObservation { + if in == nil { + return nil + } + out := new(ErrorInfoObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorInfoParameters) DeepCopyInto(out *ErrorInfoParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorInfoParameters. +func (in *ErrorInfoParameters) DeepCopy() *ErrorInfoParameters { + if in == nil { + return nil + } + out := new(ErrorInfoParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorInitParameters) DeepCopyInto(out *ErrorInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorInitParameters. +func (in *ErrorInitParameters) DeepCopy() *ErrorInitParameters { + if in == nil { + return nil + } + out := new(ErrorInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorObservation) DeepCopyInto(out *ErrorObservation) { + *out = *in + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(float64) + **out = **in + } + if in.Details != nil { + in, out := &in.Details, &out.Details + *out = make([]map[string]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + } + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorObservation. +func (in *ErrorObservation) DeepCopy() *ErrorObservation { + if in == nil { + return nil + } + out := new(ErrorObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorParameters) DeepCopyInto(out *ErrorParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorParameters. +func (in *ErrorParameters) DeepCopy() *ErrorParameters { + if in == nil { + return nil + } + out := new(ErrorParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Hub) DeepCopyInto(out *Hub) { *out = *in @@ -784,6 +932,193 @@ func (in *LinkedVPNTunnelsParameters) DeepCopy() *LinkedVPNTunnelsParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConfigInitParameters) DeepCopyInto(out *PscConfigInitParameters) { + *out = *in + if in.Limit != nil { + in, out := &in.Limit, &out.Limit + *out = new(string) + **out = **in + } + if in.Subnetworks != nil { + in, out := &in.Subnetworks, &out.Subnetworks + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigInitParameters. +func (in *PscConfigInitParameters) DeepCopy() *PscConfigInitParameters { + if in == nil { + return nil + } + out := new(PscConfigInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConfigObservation) DeepCopyInto(out *PscConfigObservation) { + *out = *in + if in.Limit != nil { + in, out := &in.Limit, &out.Limit + *out = new(string) + **out = **in + } + if in.Subnetworks != nil { + in, out := &in.Subnetworks, &out.Subnetworks + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigObservation. +func (in *PscConfigObservation) DeepCopy() *PscConfigObservation { + if in == nil { + return nil + } + out := new(PscConfigObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConfigParameters) DeepCopyInto(out *PscConfigParameters) { + *out = *in + if in.Limit != nil { + in, out := &in.Limit, &out.Limit + *out = new(string) + **out = **in + } + if in.Subnetworks != nil { + in, out := &in.Subnetworks, &out.Subnetworks + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigParameters. +func (in *PscConfigParameters) DeepCopy() *PscConfigParameters { + if in == nil { + return nil + } + out := new(PscConfigParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConnectionsInitParameters) DeepCopyInto(out *PscConnectionsInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnectionsInitParameters. +func (in *PscConnectionsInitParameters) DeepCopy() *PscConnectionsInitParameters { + if in == nil { + return nil + } + out := new(PscConnectionsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConnectionsObservation) DeepCopyInto(out *PscConnectionsObservation) { + *out = *in + if in.ConsumerAddress != nil { + in, out := &in.ConsumerAddress, &out.ConsumerAddress + *out = new(string) + **out = **in + } + if in.ConsumerForwardingRule != nil { + in, out := &in.ConsumerForwardingRule, &out.ConsumerForwardingRule + *out = new(string) + **out = **in + } + if in.ConsumerTargetProject != nil { + in, out := &in.ConsumerTargetProject, &out.ConsumerTargetProject + *out = new(string) + **out = **in + } + if in.Error != nil { + in, out := &in.Error, &out.Error + *out = make([]ErrorObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ErrorInfo != nil { + in, out := &in.ErrorInfo, &out.ErrorInfo + *out = make([]ErrorInfoObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ErrorType != nil { + in, out := &in.ErrorType, &out.ErrorType + *out = new(string) + **out = **in + } + if in.GceOperation != nil { + in, out := &in.GceOperation, &out.GceOperation + *out = new(string) + **out = **in + } + if in.PscConnectionID != nil { + in, out := &in.PscConnectionID, &out.PscConnectionID + *out = new(string) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnectionsObservation. +func (in *PscConnectionsObservation) DeepCopy() *PscConnectionsObservation { + if in == nil { + return nil + } + out := new(PscConnectionsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConnectionsParameters) DeepCopyInto(out *PscConnectionsParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnectionsParameters. +func (in *PscConnectionsParameters) DeepCopy() *PscConnectionsParameters { + if in == nil { + return nil + } + out := new(PscConnectionsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RoutingVpcsInitParameters) DeepCopyInto(out *RoutingVpcsInitParameters) { *out = *in @@ -834,6 +1169,368 @@ func (in *RoutingVpcsParameters) DeepCopy() *RoutingVpcsParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionPolicy) DeepCopyInto(out *ServiceConnectionPolicy) { + *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 ServiceConnectionPolicy. +func (in *ServiceConnectionPolicy) DeepCopy() *ServiceConnectionPolicy { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceConnectionPolicy) 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 *ServiceConnectionPolicyInitParameters) DeepCopyInto(out *ServiceConnectionPolicyInitParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.NetworkRef != nil { + in, out := &in.NetworkRef, &out.NetworkRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NetworkSelector != nil { + in, out := &in.NetworkSelector, &out.NetworkSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.PscConfig != nil { + in, out := &in.PscConfig, &out.PscConfig + *out = make([]PscConfigInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ServiceClass != nil { + in, out := &in.ServiceClass, &out.ServiceClass + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionPolicyInitParameters. +func (in *ServiceConnectionPolicyInitParameters) DeepCopy() *ServiceConnectionPolicyInitParameters { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicyInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionPolicyList) DeepCopyInto(out *ServiceConnectionPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceConnectionPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionPolicyList. +func (in *ServiceConnectionPolicyList) DeepCopy() *ServiceConnectionPolicyList { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceConnectionPolicyList) 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 *ServiceConnectionPolicyObservation) DeepCopyInto(out *ServiceConnectionPolicyObservation) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.EffectiveLabels != nil { + in, out := &in.EffectiveLabels, &out.EffectiveLabels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Infrastructure != nil { + in, out := &in.Infrastructure, &out.Infrastructure + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.PscConfig != nil { + in, out := &in.PscConfig, &out.PscConfig + *out = make([]PscConfigObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PscConnections != nil { + in, out := &in.PscConnections, &out.PscConnections + *out = make([]PscConnectionsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ServiceClass != nil { + in, out := &in.ServiceClass, &out.ServiceClass + *out = new(string) + **out = **in + } + if in.TerraformLabels != nil { + in, out := &in.TerraformLabels, &out.TerraformLabels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionPolicyObservation. +func (in *ServiceConnectionPolicyObservation) DeepCopy() *ServiceConnectionPolicyObservation { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicyObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionPolicyParameters) DeepCopyInto(out *ServiceConnectionPolicyParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.NetworkRef != nil { + in, out := &in.NetworkRef, &out.NetworkRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NetworkSelector != nil { + in, out := &in.NetworkSelector, &out.NetworkSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.PscConfig != nil { + in, out := &in.PscConfig, &out.PscConfig + *out = make([]PscConfigParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ServiceClass != nil { + in, out := &in.ServiceClass, &out.ServiceClass + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionPolicyParameters. +func (in *ServiceConnectionPolicyParameters) DeepCopy() *ServiceConnectionPolicyParameters { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicyParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionPolicySpec) DeepCopyInto(out *ServiceConnectionPolicySpec) { + *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 ServiceConnectionPolicySpec. +func (in *ServiceConnectionPolicySpec) DeepCopy() *ServiceConnectionPolicySpec { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionPolicyStatus) DeepCopyInto(out *ServiceConnectionPolicyStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionPolicyStatus. +func (in *ServiceConnectionPolicyStatus) DeepCopy() *ServiceConnectionPolicyStatus { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicyStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Spoke) DeepCopyInto(out *Spoke) { *out = *in diff --git a/apis/networkconnectivity/v1beta1/zz_generated.managed.go b/apis/networkconnectivity/v1beta1/zz_generated.managed.go index c7c0c4555..efb952b6e 100644 --- a/apis/networkconnectivity/v1beta1/zz_generated.managed.go +++ b/apis/networkconnectivity/v1beta1/zz_generated.managed.go @@ -67,6 +67,66 @@ func (mg *Hub) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } +// GetCondition of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this Spoke. func (mg *Spoke) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/networkconnectivity/v1beta1/zz_generated.managedlist.go b/apis/networkconnectivity/v1beta1/zz_generated.managedlist.go index 2c4966994..37a910f89 100644 --- a/apis/networkconnectivity/v1beta1/zz_generated.managedlist.go +++ b/apis/networkconnectivity/v1beta1/zz_generated.managedlist.go @@ -16,6 +16,15 @@ func (l *HubList) GetItems() []resource.Managed { return items } +// GetItems of this ServiceConnectionPolicyList. +func (l *ServiceConnectionPolicyList) 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 SpokeList. func (l *SpokeList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/networkconnectivity/v1beta1/zz_generated.resolvers.go b/apis/networkconnectivity/v1beta1/zz_generated.resolvers.go index a21218ee1..9c381a574 100644 --- a/apis/networkconnectivity/v1beta1/zz_generated.resolvers.go +++ b/apis/networkconnectivity/v1beta1/zz_generated.resolvers.go @@ -13,12 +13,80 @@ import ( errors "github.com/pkg/errors" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - client "sigs.k8s.io/controller-runtime/pkg/client" - - // ResolveReferences of this Spoke. apisresolver "github.com/upbound/provider-gcp/internal/apis" + client "sigs.k8s.io/controller-runtime/pkg/client" ) +func (mg *ServiceConnectionPolicy) ResolveReferences( // ResolveReferences of this ServiceConnectionPolicy. + ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + var mrsp reference.MultiResolutionResponse + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Network", "NetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Network), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.NetworkRef, + Selector: mg.Spec.ForProvider.NetworkSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Network") + } + mg.Spec.ForProvider.Network = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.NetworkRef = rsp.ResolvedReference + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Network", "NetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.Network), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.NetworkRef, + Selector: mg.Spec.InitProvider.NetworkSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Network") + } + mg.Spec.InitProvider.Network = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.NetworkRef = rsp.ResolvedReference + for i3 := 0; i3 < len(mg.Spec.ForProvider.PscConfig); i3++ { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Subnetwork", "SubnetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.PscConfig[i3].Subnetworks), + Extract: reference.ExternalName(), + References: mg.Spec.InitProvider.PscConfig[i3].SubnetworkRef, + Selector: mg.Spec.ForProvider.PscConfig[i3].SubnetworkSelector, + To: reference.To{List: l, Managed: m}, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.PscConfig.Subnetwork") + } + mg.Spec.InitProvider.PscConfig[i3].Subnetworks = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.PscConfig[i3].SubnetworkRef = mrsp.ResolvedReferences + } + return nil +} + + +// ResolveReferences of this Spoke. func (mg *Spoke) ResolveReferences(ctx context.Context, c client.Reader) error { var m xpresource.Managed var l xpresource.ManagedList diff --git a/apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_terraformed.go b/apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_terraformed.go new file mode 100755 index 000000000..9f3513341 --- /dev/null +++ b/apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this ServiceConnectionPolicy +func (mg *ServiceConnectionPolicy) GetTerraformResourceType() string { + return "google_network_connectivity_service_connection_policy" +} + +// GetConnectionDetailsMapping for this ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) 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 ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) 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 ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) 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 ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) 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 ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) 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) +} + +// GetInitParameters of this ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this ServiceConnectionPolicy using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *ServiceConnectionPolicy) LateInitialize(attrs []byte) (bool, error) { + params := &ServiceConnectionPolicyParameters{} + 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 *ServiceConnectionPolicy) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_types.go b/apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_types.go new file mode 100755 index 000000000..9d19f4ae2 --- /dev/null +++ b/apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_types.go @@ -0,0 +1,337 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +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 ErrorInfoInitParameters struct { +} + +type ErrorInfoObservation struct { + + // The logical grouping to which the "reason" belongs. + Domain *string `json:"domain,omitempty" tf:"domain,omitempty"` + + // Additional structured details about this error. + // +mapType=granular + Metadata map[string]*string `json:"metadata,omitempty" tf:"metadata,omitempty"` + + // The reason of the error. + Reason *string `json:"reason,omitempty" tf:"reason,omitempty"` +} + +type ErrorInfoParameters struct { +} + +type ErrorInitParameters struct { +} + +type ErrorObservation struct { + + // The status code, which should be an enum value of [google.rpc.Code][]. + Code *float64 `json:"code,omitempty" tf:"code,omitempty"` + + // (Output) + // A list of messages that carry the error details. + Details []map[string]*string `json:"details,omitempty" tf:"details,omitempty"` + + // A developer-facing error message. + Message *string `json:"message,omitempty" tf:"message,omitempty"` +} + +type ErrorParameters struct { +} + +type PscConfigInitParameters struct { + + // Max number of PSC connections for this policy. + Limit *string `json:"limit,omitempty" tf:"limit,omitempty"` + + // IDs of the subnetworks or fully qualified identifiers for the subnetworks + Subnetworks []*string `json:"subnetworks,omitempty" tf:"subnetworks,omitempty"` + + // Reference to a Subnetwork in compute to populate subnetwork. + // +kubebuilder:validation:Optional + SubnetworkRef []v1.Reference `json:"subnetworkRef,omitempty" tf:"-"` + + // Selector for a Subnetwork in compute to populate subnetwork. + // +kubebuilder:validation:Optional + SubnetworkSelector *v1.Selector `json:"subnetworkSelector,omitempty" tf:"-"` + +} + +type PscConfigObservation struct { + + // Max number of PSC connections for this policy. + Limit *string `json:"limit,omitempty" tf:"limit,omitempty"` + + // IDs of the subnetworks or fully qualified identifiers for the subnetworks + Subnetworks []*string `json:"subnetworks,omitempty" tf:"subnetworks,omitempty"` +} + +type PscConfigParameters struct { + + // Max number of PSC connections for this policy. + // +kubebuilder:validation:Optional + Limit *string `json:"limit,omitempty" tf:"limit,omitempty"` + + // IDs of the subnetworks or fully qualified identifiers for the subnetworks + // +kubebuilder:validation:Optional + Subnetworks []*string `json:"subnetworks" tf:"subnetworks,omitempty"` + // Reference to a Subnetwork in compute to populate subnetwork. + // +kubebuilder:validation:Optional + SubnetworkRef []v1.Reference `json:"subnetworkRef,omitempty" tf:"-"` + + // Selector for a Subnetwork in compute to populate subnetwork. + // +kubebuilder:validation:Optional + SubnetworkSelector *v1.Selector `json:"subnetworkSelector,omitempty" tf:"-"` + +} + +type PscConnectionsInitParameters struct { +} + +type PscConnectionsObservation struct { + + // The resource reference of the consumer address. + ConsumerAddress *string `json:"consumerAddress,omitempty" tf:"consumer_address,omitempty"` + + // The resource reference of the PSC Forwarding Rule within the consumer VPC. + ConsumerForwardingRule *string `json:"consumerForwardingRule,omitempty" tf:"consumer_forwarding_rule,omitempty"` + + // The project where the PSC connection is created. + ConsumerTargetProject *string `json:"consumerTargetProject,omitempty" tf:"consumer_target_project,omitempty"` + + // The most recent error during operating this connection. + // Structure is documented below. + Error []ErrorObservation `json:"error,omitempty" tf:"error,omitempty"` + + // The error info for the latest error during operating this connection. + // Structure is documented below. + ErrorInfo []ErrorInfoObservation `json:"errorInfo,omitempty" tf:"error_info,omitempty"` + + // The error type indicates whether the error is consumer facing, producer + // facing or system internal. + // Possible values are: CONNECTION_ERROR_TYPE_UNSPECIFIED, ERROR_INTERNAL, ERROR_CONSUMER_SIDE, ERROR_PRODUCER_SIDE. + ErrorType *string `json:"errorType,omitempty" tf:"error_type,omitempty"` + + // The last Compute Engine operation to setup PSC connection. + GceOperation *string `json:"gceOperation,omitempty" tf:"gce_operation,omitempty"` + + // The PSC connection id of the PSC forwarding rule. + PscConnectionID *string `json:"pscConnectionId,omitempty" tf:"psc_connection_id,omitempty"` + + // The state of the PSC connection. + // Possible values are: STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING, FAILED. + State *string `json:"state,omitempty" tf:"state,omitempty"` +} + +type PscConnectionsParameters struct { +} + +type ServiceConnectionPolicyInitParameters struct { + + // Free-text description of the resource. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // User-defined labels. + // +mapType=granular + Labels map[string]*string `json:"labels,omitempty" tf:"labels,omitempty"` + + // The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Network + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + Network *string `json:"network,omitempty" tf:"network,omitempty"` + + // Reference to a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkRef *v1.Reference `json:"networkRef,omitempty" tf:"-"` + + // Selector for a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkSelector *v1.Selector `json:"networkSelector,omitempty" tf:"-"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + // Structure is documented below. + PscConfig []PscConfigInitParameters `json:"pscConfig,omitempty" tf:"psc_config,omitempty"` + + // The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. + // It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + ServiceClass *string `json:"serviceClass,omitempty" tf:"service_class,omitempty"` +} + +type ServiceConnectionPolicyObservation struct { + + // The timestamp when the resource was created. + CreateTime *string `json:"createTime,omitempty" tf:"create_time,omitempty"` + + // Free-text description of the resource. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // for all of the labels present on the resource. + // +mapType=granular + EffectiveLabels map[string]*string `json:"effectiveLabels,omitempty" tf:"effective_labels,omitempty"` + + // The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. + Etag *string `json:"etag,omitempty" tf:"etag,omitempty"` + + // an identifier for the resource with format projects/{{project}}/locations/{{location}}/serviceConnectionPolicies/{{name}} + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The type of underlying resources used to create the connection. + Infrastructure *string `json:"infrastructure,omitempty" tf:"infrastructure,omitempty"` + + // User-defined labels. + // +mapType=granular + Labels map[string]*string `json:"labels,omitempty" tf:"labels,omitempty"` + + // The location of the ServiceConnectionPolicy. + Location *string `json:"location,omitempty" tf:"location,omitempty"` + + // The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}. + Network *string `json:"network,omitempty" tf:"network,omitempty"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + // Structure is documented below. + PscConfig []PscConfigObservation `json:"pscConfig,omitempty" tf:"psc_config,omitempty"` + + // Information about each Private Service Connect connection. + // Structure is documented below. + PscConnections []PscConnectionsObservation `json:"pscConnections,omitempty" tf:"psc_connections,omitempty"` + + // The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. + // It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + ServiceClass *string `json:"serviceClass,omitempty" tf:"service_class,omitempty"` + + // The combination of labels configured directly on the resource + // and default labels configured on the provider. + // +mapType=granular + TerraformLabels map[string]*string `json:"terraformLabels,omitempty" tf:"terraform_labels,omitempty"` + + // The timestamp when the resource was updated. + UpdateTime *string `json:"updateTime,omitempty" tf:"update_time,omitempty"` +} + +type ServiceConnectionPolicyParameters struct { + + // Free-text description of the resource. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // User-defined labels. + // +kubebuilder:validation:Optional + // +mapType=granular + Labels map[string]*string `json:"labels,omitempty" tf:"labels,omitempty"` + + // The location of the ServiceConnectionPolicy. + // +kubebuilder:validation:Required + Location *string `json:"location" tf:"location,omitempty"` + + // The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Network + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + Network *string `json:"network,omitempty" tf:"network,omitempty"` + + // Reference to a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkRef *v1.Reference `json:"networkRef,omitempty" tf:"-"` + + // Selector for a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkSelector *v1.Selector `json:"networkSelector,omitempty" tf:"-"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + // +kubebuilder:validation:Optional + Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + // Structure is documented below. + // +kubebuilder:validation:Optional + PscConfig []PscConfigParameters `json:"pscConfig,omitempty" tf:"psc_config,omitempty"` + + // The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. + // It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + // +kubebuilder:validation:Optional + ServiceClass *string `json:"serviceClass,omitempty" tf:"service_class,omitempty"` +} + +// ServiceConnectionPolicySpec defines the desired state of ServiceConnectionPolicy +type ServiceConnectionPolicySpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider ServiceConnectionPolicyParameters `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 ServiceConnectionPolicyInitParameters `json:"initProvider,omitempty"` +} + +// ServiceConnectionPolicyStatus defines the observed state of ServiceConnectionPolicy. +type ServiceConnectionPolicyStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider ServiceConnectionPolicyObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// ServiceConnectionPolicy is the Schema for the ServiceConnectionPolicys API. Manage Service Connection Policies. +// +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:resource:scope=Cluster,categories={crossplane,managed,gcp} +type ServiceConnectionPolicy 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.serviceClass) || (has(self.initProvider) && has(self.initProvider.serviceClass))",message="spec.forProvider.serviceClass is a required parameter" + Spec ServiceConnectionPolicySpec `json:"spec"` + Status ServiceConnectionPolicyStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// ServiceConnectionPolicyList contains a list of ServiceConnectionPolicys +type ServiceConnectionPolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ServiceConnectionPolicy `json:"items"` +} + +// Repository type metadata. +var ( + ServiceConnectionPolicy_Kind = "ServiceConnectionPolicy" + ServiceConnectionPolicy_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ServiceConnectionPolicy_Kind}.String() + ServiceConnectionPolicy_KindAPIVersion = ServiceConnectionPolicy_Kind + "." + CRDGroupVersion.String() + ServiceConnectionPolicy_GroupVersionKind = CRDGroupVersion.WithKind(ServiceConnectionPolicy_Kind) +) + +func init() { + SchemeBuilder.Register(&ServiceConnectionPolicy{}, &ServiceConnectionPolicyList{}) +} diff --git a/apis/redis/v1beta1/zz_cluster_terraformed.go b/apis/redis/v1beta1/zz_cluster_terraformed.go new file mode 100755 index 000000000..32ceb38a7 --- /dev/null +++ b/apis/redis/v1beta1/zz_cluster_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this Cluster +func (mg *Cluster) GetTerraformResourceType() string { + return "google_redis_cluster" +} + +// GetConnectionDetailsMapping for this Cluster +func (tr *Cluster) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Cluster +func (tr *Cluster) 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 Cluster +func (tr *Cluster) 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 Cluster +func (tr *Cluster) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Cluster +func (tr *Cluster) 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 Cluster +func (tr *Cluster) 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 Cluster +func (tr *Cluster) 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) +} + +// GetInitParameters of this Cluster +func (tr *Cluster) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this Cluster using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Cluster) LateInitialize(attrs []byte) (bool, error) { + params := &ClusterParameters{} + 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 *Cluster) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/redis/v1beta1/zz_cluster_types.go b/apis/redis/v1beta1/zz_cluster_types.go new file mode 100755 index 000000000..a0df55207 --- /dev/null +++ b/apis/redis/v1beta1/zz_cluster_types.go @@ -0,0 +1,340 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +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 ClusterInitParameters struct { + + // Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. + // Default value is AUTH_MODE_DISABLED. + // Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED. + AuthorizationMode *string `json:"authorizationMode,omitempty" tf:"authorization_mode,omitempty"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Required. Each PscConfig configures the consumer network where two + // network addresses will be designated to the cluster for client access. + // Currently, only one PscConfig is supported. + // Structure is documented below. + PscConfigs []PscConfigsInitParameters `json:"pscConfigs,omitempty" tf:"psc_configs,omitempty"` + + // Optional. The number of replica nodes per shard. + ReplicaCount *float64 `json:"replicaCount,omitempty" tf:"replica_count,omitempty"` + + // Required. Number of shards for the Redis cluster. + ShardCount *float64 `json:"shardCount,omitempty" tf:"shard_count,omitempty"` + + // Optional. The in-transit encryption for the Redis cluster. + // If not provided, encryption is disabled for the cluster. + // Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. + // Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION. + TransitEncryptionMode *string `json:"transitEncryptionMode,omitempty" tf:"transit_encryption_mode,omitempty"` +} + +type ClusterObservation struct { + + // Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. + // Default value is AUTH_MODE_DISABLED. + // Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED. + AuthorizationMode *string `json:"authorizationMode,omitempty" tf:"authorization_mode,omitempty"` + + // The timestamp associated with the cluster creation request. A timestamp in + // RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional + // digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". + CreateTime *string `json:"createTime,omitempty" tf:"create_time,omitempty"` + + // Output only. Endpoints created on each given network, + // for Redis clients to connect to the cluster. + // Currently only one endpoint is supported. + // Structure is documented below. + DiscoveryEndpoints []DiscoveryEndpointsObservation `json:"discoveryEndpoints,omitempty" tf:"discovery_endpoints,omitempty"` + + // an identifier for the resource with format projects/{{project}}/locations/{{region}}/clusters/{{name}} + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Required. Each PscConfig configures the consumer network where two + // network addresses will be designated to the cluster for client access. + // Currently, only one PscConfig is supported. + // Structure is documented below. + PscConfigs []PscConfigsObservation `json:"pscConfigs,omitempty" tf:"psc_configs,omitempty"` + + // Output only. PSC connections for discovery of the cluster topology and accessing the cluster. + // Structure is documented below. + PscConnections []PscConnectionsObservation `json:"pscConnections,omitempty" tf:"psc_connections,omitempty"` + + // The name of the region of the Redis cluster. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Optional. The number of replica nodes per shard. + ReplicaCount *float64 `json:"replicaCount,omitempty" tf:"replica_count,omitempty"` + + // Required. Number of shards for the Redis cluster. + ShardCount *float64 `json:"shardCount,omitempty" tf:"shard_count,omitempty"` + + // Output only. Redis memory size in GB for the entire cluster. + SizeGb *float64 `json:"sizeGb,omitempty" tf:"size_gb,omitempty"` + + // The current state of this cluster. Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + State *string `json:"state,omitempty" tf:"state,omitempty"` + + // Output only. Additional information about the current state of the cluster. + // Structure is documented below. + StateInfo []StateInfoObservation `json:"stateInfo,omitempty" tf:"state_info,omitempty"` + + // Optional. The in-transit encryption for the Redis cluster. + // If not provided, encryption is disabled for the cluster. + // Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. + // Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION. + TransitEncryptionMode *string `json:"transitEncryptionMode,omitempty" tf:"transit_encryption_mode,omitempty"` + + // System assigned, unique identifier for the cluster. + UID *string `json:"uid,omitempty" tf:"uid,omitempty"` +} + +type ClusterParameters struct { + + // Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. + // Default value is AUTH_MODE_DISABLED. + // Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED. + // +kubebuilder:validation:Optional + AuthorizationMode *string `json:"authorizationMode,omitempty" tf:"authorization_mode,omitempty"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + // +kubebuilder:validation:Optional + Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Required. Each PscConfig configures the consumer network where two + // network addresses will be designated to the cluster for client access. + // Currently, only one PscConfig is supported. + // Structure is documented below. + // +kubebuilder:validation:Optional + PscConfigs []PscConfigsParameters `json:"pscConfigs,omitempty" tf:"psc_configs,omitempty"` + + // The name of the region of the Redis cluster. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Optional. The number of replica nodes per shard. + // +kubebuilder:validation:Optional + ReplicaCount *float64 `json:"replicaCount,omitempty" tf:"replica_count,omitempty"` + + // Required. Number of shards for the Redis cluster. + // +kubebuilder:validation:Optional + ShardCount *float64 `json:"shardCount,omitempty" tf:"shard_count,omitempty"` + + // Optional. The in-transit encryption for the Redis cluster. + // If not provided, encryption is disabled for the cluster. + // Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. + // Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION. + // +kubebuilder:validation:Optional + TransitEncryptionMode *string `json:"transitEncryptionMode,omitempty" tf:"transit_encryption_mode,omitempty"` +} + +type DiscoveryEndpointsInitParameters struct { +} + +type DiscoveryEndpointsObservation struct { + + // Output only. Network address of the exposed Redis endpoint used by clients to connect to the service. + Address *string `json:"address,omitempty" tf:"address,omitempty"` + + // Output only. The port number of the exposed Redis endpoint. + Port *float64 `json:"port,omitempty" tf:"port,omitempty"` + + // Output only. Customer configuration for where the endpoint + // is created and accessed from. + // Structure is documented below. + PscConfig []PscConfigObservation `json:"pscConfig,omitempty" tf:"psc_config,omitempty"` +} + +type DiscoveryEndpointsParameters struct { +} + +type PscConfigInitParameters struct { +} + +type PscConfigObservation struct { + + // The consumer network where the IP address resides, in the form of projects/{projectId}/global/networks/{network_id}. + Network *string `json:"network,omitempty" tf:"network,omitempty"` +} + +type PscConfigParameters struct { +} + +type PscConfigsInitParameters struct { + + // Required. The consumer network where the network address of + // the discovery endpoint will be reserved, in the form of + // projects/{network_project_id_or_number}/global/networks/{network_id}. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Network + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + Network *string `json:"network,omitempty" tf:"network,omitempty"` + + // Reference to a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkRef *v1.Reference `json:"networkRef,omitempty" tf:"-"` + + // Selector for a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkSelector *v1.Selector `json:"networkSelector,omitempty" tf:"-"` +} + +type PscConfigsObservation struct { + + // Required. The consumer network where the network address of + // the discovery endpoint will be reserved, in the form of + // projects/{network_project_id_or_number}/global/networks/{network_id}. + Network *string `json:"network,omitempty" tf:"network,omitempty"` +} + +type PscConfigsParameters struct { + + // Required. The consumer network where the network address of + // the discovery endpoint will be reserved, in the form of + // projects/{network_project_id_or_number}/global/networks/{network_id}. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Network + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + Network *string `json:"network,omitempty" tf:"network,omitempty"` + + // Reference to a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkRef *v1.Reference `json:"networkRef,omitempty" tf:"-"` + + // Selector for a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkSelector *v1.Selector `json:"networkSelector,omitempty" tf:"-"` +} + +type PscConnectionsInitParameters struct { +} + +type PscConnectionsObservation struct { + + // Output only. The IP allocated on the consumer network for the PSC forwarding rule. + Address *string `json:"address,omitempty" tf:"address,omitempty"` + + // Output only. The URI of the consumer side forwarding rule. Example: projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. + ForwardingRule *string `json:"forwardingRule,omitempty" tf:"forwarding_rule,omitempty"` + + // The consumer network where the IP address resides, in the form of projects/{projectId}/global/networks/{network_id}. + Network *string `json:"network,omitempty" tf:"network,omitempty"` + + // Output only. The consumer projectId where the forwarding rule is created from. + ProjectID *string `json:"projectId,omitempty" tf:"project_id,omitempty"` + + // Output only. The PSC connection id of the forwarding rule connected to the service attachment. + PscConnectionID *string `json:"pscConnectionId,omitempty" tf:"psc_connection_id,omitempty"` +} + +type PscConnectionsParameters struct { +} + +type StateInfoInitParameters struct { +} + +type StateInfoObservation struct { + + // A nested object resource + // Structure is documented below. + UpdateInfo []UpdateInfoObservation `json:"updateInfo,omitempty" tf:"update_info,omitempty"` +} + +type StateInfoParameters struct { +} + +type UpdateInfoInitParameters struct { +} + +type UpdateInfoObservation struct { + + // Target number of replica nodes per shard. + TargetReplicaCount *float64 `json:"targetReplicaCount,omitempty" tf:"target_replica_count,omitempty"` + + // Target number of shards for redis cluster. + TargetShardCount *float64 `json:"targetShardCount,omitempty" tf:"target_shard_count,omitempty"` +} + +type UpdateInfoParameters struct { +} + +// ClusterSpec defines the desired state of Cluster +type ClusterSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider ClusterParameters `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 ClusterInitParameters `json:"initProvider,omitempty"` +} + +// ClusterStatus defines the observed state of Cluster. +type ClusterStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider ClusterObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// Cluster is the Schema for the Clusters API. A Google Cloud Redis Cluster instance. +// +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:resource:scope=Cluster,categories={crossplane,managed,gcp} +type Cluster 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.pscConfigs) || (has(self.initProvider) && has(self.initProvider.pscConfigs))",message="spec.forProvider.pscConfigs is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.shardCount) || (has(self.initProvider) && has(self.initProvider.shardCount))",message="spec.forProvider.shardCount is a required parameter" + Spec ClusterSpec `json:"spec"` + Status ClusterStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// ClusterList contains a list of Clusters +type ClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Cluster `json:"items"` +} + +// Repository type metadata. +var ( + Cluster_Kind = "Cluster" + Cluster_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Cluster_Kind}.String() + Cluster_KindAPIVersion = Cluster_Kind + "." + CRDGroupVersion.String() + Cluster_GroupVersionKind = CRDGroupVersion.WithKind(Cluster_Kind) +) + +func init() { + SchemeBuilder.Register(&Cluster{}, &ClusterList{}) +} diff --git a/apis/redis/v1beta1/zz_generated.deepcopy.go b/apis/redis/v1beta1/zz_generated.deepcopy.go index f9639f28d..c2d97deaa 100644 --- a/apis/redis/v1beta1/zz_generated.deepcopy.go +++ b/apis/redis/v1beta1/zz_generated.deepcopy.go @@ -13,6 +13,359 @@ 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 *Cluster) DeepCopyInto(out *Cluster) { + *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 Cluster. +func (in *Cluster) DeepCopy() *Cluster { + if in == nil { + return nil + } + out := new(Cluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Cluster) 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 *ClusterInitParameters) DeepCopyInto(out *ClusterInitParameters) { + *out = *in + if in.AuthorizationMode != nil { + in, out := &in.AuthorizationMode, &out.AuthorizationMode + *out = new(string) + **out = **in + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.PscConfigs != nil { + in, out := &in.PscConfigs, &out.PscConfigs + *out = make([]PscConfigsInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ReplicaCount != nil { + in, out := &in.ReplicaCount, &out.ReplicaCount + *out = new(float64) + **out = **in + } + if in.ShardCount != nil { + in, out := &in.ShardCount, &out.ShardCount + *out = new(float64) + **out = **in + } + if in.TransitEncryptionMode != nil { + in, out := &in.TransitEncryptionMode, &out.TransitEncryptionMode + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterInitParameters. +func (in *ClusterInitParameters) DeepCopy() *ClusterInitParameters { + if in == nil { + return nil + } + out := new(ClusterInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterList) DeepCopyInto(out *ClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Cluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. +func (in *ClusterList) DeepCopy() *ClusterList { + if in == nil { + return nil + } + out := new(ClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterList) 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 *ClusterObservation) DeepCopyInto(out *ClusterObservation) { + *out = *in + if in.AuthorizationMode != nil { + in, out := &in.AuthorizationMode, &out.AuthorizationMode + *out = new(string) + **out = **in + } + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.DiscoveryEndpoints != nil { + in, out := &in.DiscoveryEndpoints, &out.DiscoveryEndpoints + *out = make([]DiscoveryEndpointsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.PscConfigs != nil { + in, out := &in.PscConfigs, &out.PscConfigs + *out = make([]PscConfigsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PscConnections != nil { + in, out := &in.PscConnections, &out.PscConnections + *out = make([]PscConnectionsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ReplicaCount != nil { + in, out := &in.ReplicaCount, &out.ReplicaCount + *out = new(float64) + **out = **in + } + if in.ShardCount != nil { + in, out := &in.ShardCount, &out.ShardCount + *out = new(float64) + **out = **in + } + if in.SizeGb != nil { + in, out := &in.SizeGb, &out.SizeGb + *out = new(float64) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } + if in.StateInfo != nil { + in, out := &in.StateInfo, &out.StateInfo + *out = make([]StateInfoObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TransitEncryptionMode != nil { + in, out := &in.TransitEncryptionMode, &out.TransitEncryptionMode + *out = new(string) + **out = **in + } + if in.UID != nil { + in, out := &in.UID, &out.UID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterObservation. +func (in *ClusterObservation) DeepCopy() *ClusterObservation { + if in == nil { + return nil + } + out := new(ClusterObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterParameters) DeepCopyInto(out *ClusterParameters) { + *out = *in + if in.AuthorizationMode != nil { + in, out := &in.AuthorizationMode, &out.AuthorizationMode + *out = new(string) + **out = **in + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.PscConfigs != nil { + in, out := &in.PscConfigs, &out.PscConfigs + *out = make([]PscConfigsParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ReplicaCount != nil { + in, out := &in.ReplicaCount, &out.ReplicaCount + *out = new(float64) + **out = **in + } + if in.ShardCount != nil { + in, out := &in.ShardCount, &out.ShardCount + *out = new(float64) + **out = **in + } + if in.TransitEncryptionMode != nil { + in, out := &in.TransitEncryptionMode, &out.TransitEncryptionMode + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterParameters. +func (in *ClusterParameters) DeepCopy() *ClusterParameters { + if in == nil { + return nil + } + out := new(ClusterParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { + *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 ClusterSpec. +func (in *ClusterSpec) DeepCopy() *ClusterSpec { + if in == nil { + return nil + } + out := new(ClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. +func (in *ClusterStatus) DeepCopy() *ClusterStatus { + if in == nil { + return nil + } + out := new(ClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DiscoveryEndpointsInitParameters) DeepCopyInto(out *DiscoveryEndpointsInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveryEndpointsInitParameters. +func (in *DiscoveryEndpointsInitParameters) DeepCopy() *DiscoveryEndpointsInitParameters { + if in == nil { + return nil + } + out := new(DiscoveryEndpointsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DiscoveryEndpointsObservation) DeepCopyInto(out *DiscoveryEndpointsObservation) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.PscConfig != nil { + in, out := &in.PscConfig, &out.PscConfig + *out = make([]PscConfigObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveryEndpointsObservation. +func (in *DiscoveryEndpointsObservation) DeepCopy() *DiscoveryEndpointsObservation { + if in == nil { + return nil + } + out := new(DiscoveryEndpointsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DiscoveryEndpointsParameters) DeepCopyInto(out *DiscoveryEndpointsParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveryEndpointsParameters. +func (in *DiscoveryEndpointsParameters) DeepCopy() *DiscoveryEndpointsParameters { + if in == nil { + return nil + } + out := new(DiscoveryEndpointsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Instance) DeepCopyInto(out *Instance) { *out = *in @@ -974,6 +1327,206 @@ func (in *PersistenceConfigParameters) DeepCopy() *PersistenceConfigParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConfigInitParameters) DeepCopyInto(out *PscConfigInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigInitParameters. +func (in *PscConfigInitParameters) DeepCopy() *PscConfigInitParameters { + if in == nil { + return nil + } + out := new(PscConfigInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConfigObservation) DeepCopyInto(out *PscConfigObservation) { + *out = *in + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigObservation. +func (in *PscConfigObservation) DeepCopy() *PscConfigObservation { + if in == nil { + return nil + } + out := new(PscConfigObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConfigParameters) DeepCopyInto(out *PscConfigParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigParameters. +func (in *PscConfigParameters) DeepCopy() *PscConfigParameters { + if in == nil { + return nil + } + out := new(PscConfigParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConfigsInitParameters) DeepCopyInto(out *PscConfigsInitParameters) { + *out = *in + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.NetworkRef != nil { + in, out := &in.NetworkRef, &out.NetworkRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NetworkSelector != nil { + in, out := &in.NetworkSelector, &out.NetworkSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigsInitParameters. +func (in *PscConfigsInitParameters) DeepCopy() *PscConfigsInitParameters { + if in == nil { + return nil + } + out := new(PscConfigsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConfigsObservation) DeepCopyInto(out *PscConfigsObservation) { + *out = *in + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigsObservation. +func (in *PscConfigsObservation) DeepCopy() *PscConfigsObservation { + if in == nil { + return nil + } + out := new(PscConfigsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConfigsParameters) DeepCopyInto(out *PscConfigsParameters) { + *out = *in + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.NetworkRef != nil { + in, out := &in.NetworkRef, &out.NetworkRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NetworkSelector != nil { + in, out := &in.NetworkSelector, &out.NetworkSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigsParameters. +func (in *PscConfigsParameters) DeepCopy() *PscConfigsParameters { + if in == nil { + return nil + } + out := new(PscConfigsParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConnectionsInitParameters) DeepCopyInto(out *PscConnectionsInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnectionsInitParameters. +func (in *PscConnectionsInitParameters) DeepCopy() *PscConnectionsInitParameters { + if in == nil { + return nil + } + out := new(PscConnectionsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConnectionsObservation) DeepCopyInto(out *PscConnectionsObservation) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.ForwardingRule != nil { + in, out := &in.ForwardingRule, &out.ForwardingRule + *out = new(string) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.ProjectID != nil { + in, out := &in.ProjectID, &out.ProjectID + *out = new(string) + **out = **in + } + if in.PscConnectionID != nil { + in, out := &in.PscConnectionID, &out.PscConnectionID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnectionsObservation. +func (in *PscConnectionsObservation) DeepCopy() *PscConnectionsObservation { + if in == nil { + return nil + } + out := new(PscConnectionsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConnectionsParameters) DeepCopyInto(out *PscConnectionsParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnectionsParameters. +func (in *PscConnectionsParameters) DeepCopy() *PscConnectionsParameters { + if in == nil { + return nil + } + out := new(PscConnectionsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ServerCACertsInitParameters) DeepCopyInto(out *ServerCACertsInitParameters) { *out = *in @@ -1149,6 +1702,113 @@ func (in *StartTimeParameters) DeepCopy() *StartTimeParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StateInfoInitParameters) DeepCopyInto(out *StateInfoInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StateInfoInitParameters. +func (in *StateInfoInitParameters) DeepCopy() *StateInfoInitParameters { + if in == nil { + return nil + } + out := new(StateInfoInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StateInfoObservation) DeepCopyInto(out *StateInfoObservation) { + *out = *in + if in.UpdateInfo != nil { + in, out := &in.UpdateInfo, &out.UpdateInfo + *out = make([]UpdateInfoObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StateInfoObservation. +func (in *StateInfoObservation) DeepCopy() *StateInfoObservation { + if in == nil { + return nil + } + out := new(StateInfoObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StateInfoParameters) DeepCopyInto(out *StateInfoParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StateInfoParameters. +func (in *StateInfoParameters) DeepCopy() *StateInfoParameters { + if in == nil { + return nil + } + out := new(StateInfoParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpdateInfoInitParameters) DeepCopyInto(out *UpdateInfoInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateInfoInitParameters. +func (in *UpdateInfoInitParameters) DeepCopy() *UpdateInfoInitParameters { + if in == nil { + return nil + } + out := new(UpdateInfoInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpdateInfoObservation) DeepCopyInto(out *UpdateInfoObservation) { + *out = *in + if in.TargetReplicaCount != nil { + in, out := &in.TargetReplicaCount, &out.TargetReplicaCount + *out = new(float64) + **out = **in + } + if in.TargetShardCount != nil { + in, out := &in.TargetShardCount, &out.TargetShardCount + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateInfoObservation. +func (in *UpdateInfoObservation) DeepCopy() *UpdateInfoObservation { + if in == nil { + return nil + } + out := new(UpdateInfoObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpdateInfoParameters) DeepCopyInto(out *UpdateInfoParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateInfoParameters. +func (in *UpdateInfoParameters) DeepCopy() *UpdateInfoParameters { + if in == nil { + return nil + } + out := new(UpdateInfoParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *WeeklyMaintenanceWindowInitParameters) DeepCopyInto(out *WeeklyMaintenanceWindowInitParameters) { *out = *in diff --git a/apis/redis/v1beta1/zz_generated.managed.go b/apis/redis/v1beta1/zz_generated.managed.go index ed6281bb9..fcfa1b12b 100644 --- a/apis/redis/v1beta1/zz_generated.managed.go +++ b/apis/redis/v1beta1/zz_generated.managed.go @@ -7,6 +7,66 @@ package v1beta1 import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +// GetCondition of this Cluster. +func (mg *Cluster) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Cluster. +func (mg *Cluster) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this Cluster. +func (mg *Cluster) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this Cluster. +func (mg *Cluster) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this Cluster. +func (mg *Cluster) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Cluster. +func (mg *Cluster) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Cluster. +func (mg *Cluster) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Cluster. +func (mg *Cluster) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this Cluster. +func (mg *Cluster) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this Cluster. +func (mg *Cluster) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this Cluster. +func (mg *Cluster) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Cluster. +func (mg *Cluster) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this Instance. func (mg *Instance) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/redis/v1beta1/zz_generated.managedlist.go b/apis/redis/v1beta1/zz_generated.managedlist.go index 4d2d3e8ad..ba3cdbc11 100644 --- a/apis/redis/v1beta1/zz_generated.managedlist.go +++ b/apis/redis/v1beta1/zz_generated.managedlist.go @@ -7,6 +7,15 @@ package v1beta1 import resource "github.com/crossplane/crossplane-runtime/pkg/resource" +// GetItems of this ClusterList. +func (l *ClusterList) 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 InstanceList. func (l *InstanceList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/redis/v1beta1/zz_generated.resolvers.go b/apis/redis/v1beta1/zz_generated.resolvers.go index 84a0b3716..580b88472 100644 --- a/apis/redis/v1beta1/zz_generated.resolvers.go +++ b/apis/redis/v1beta1/zz_generated.resolvers.go @@ -15,10 +15,65 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" client "sigs.k8s.io/controller-runtime/pkg/client" - // ResolveReferences of this Instance. + // ResolveReferences of this Cluster. apisresolver "github.com/upbound/provider-gcp/internal/apis" ) +func (mg *Cluster) ResolveReferences(ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + for i3 := 0; i3 < len(mg.Spec.ForProvider.PscConfigs); i3++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Network", "NetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.PscConfigs[i3].Network), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.PscConfigs[i3].NetworkRef, + Selector: mg.Spec.ForProvider.PscConfigs[i3].NetworkSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.PscConfigs[i3].Network") + } + mg.Spec.ForProvider.PscConfigs[i3].Network = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.PscConfigs[i3].NetworkRef = rsp.ResolvedReference + + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.PscConfigs); i3++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Network", "NetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.PscConfigs[i3].Network), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.PscConfigs[i3].NetworkRef, + Selector: mg.Spec.InitProvider.PscConfigs[i3].NetworkSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.PscConfigs[i3].Network") + } + mg.Spec.InitProvider.PscConfigs[i3].Network = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.PscConfigs[i3].NetworkRef = rsp.ResolvedReference + + } + + return nil +} + +// ResolveReferences of this Instance. func (mg *Instance) ResolveReferences(ctx context.Context, c client.Reader) error { var m xpresource.Managed var l xpresource.ManagedList diff --git a/config/networkconnectivity/config.go b/config/networkconnectivity/config.go new file mode 100644 index 000000000..b237b0bb6 --- /dev/null +++ b/config/networkconnectivity/config.go @@ -0,0 +1,30 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: CC0-1.0 + +package networkconnectivity + +import ( + "github.com/crossplane/upjet/pkg/config" + + "github.com/upbound/provider-gcp/config/common" +) + +// Configure configures individual resources by adding custom +// ResourceConfigurators. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("google_network_connectivity_service_connection_policy", func(r *config.Resource) { + config.MarkAsRequired(r.TerraformResource, "name") + config.MarkAsRequired(r.TerraformResource, "service_class") + config.MarkAsRequired(r.TerraformResource, "network") + config.MarkAsRequired(r.TerraformResource, "location") + r.References["psc_config.subnets"] = config.Reference{ + TerraformName: "google_compute_subnetwork", + SelectorFieldName: "SubnetSelector", + RefFieldName: "SubnetRefs", + Type: "github.com/upbound/provider-gcp/apis/compute/v1beta1.Subnetwork", + Extractor: common.ExtractResourceIDFuncPath, + } + r.UseAsync = true + }) +} diff --git a/config/rediscluster/config.go b/config/rediscluster/config.go new file mode 100644 index 000000000..39a5fbeb0 --- /dev/null +++ b/config/rediscluster/config.go @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: CC0-1.0 + +package rediscluster + +import "github.com/crossplane/upjet/pkg/config" + +// Configure configures individual resources by adding custom +// ResourceConfigurators. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("google_redis_cluster", func(r *config.Resource) { + config.MarkAsRequired(r.TerraformResource, "psc_configs") + config.MarkAsRequired(r.TerraformResource, "shard_count") + config.MarkAsRequired(r.TerraformResource, "name") + r.Sensitive.AdditionalConnectionDetailsFn = func(attr map[string]any) (map[string][]byte, error) { + conn := map[string][]byte{} + if a, ok := attr["address"].(string); ok { + conn["address"] = []byte(a) + } + return conn, nil + } + r.UseAsync = true + }) +} diff --git a/examples-generated/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml b/examples-generated/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml new file mode 100644 index 000000000..748fc0ff2 --- /dev/null +++ b/examples-generated/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml @@ -0,0 +1,52 @@ +apiVersion: networkconnectivity.gcp.upbound.io/v1beta1 +kind: ServiceConnectionPolicy +metadata: + annotations: + meta.upbound.io/example-id: networkconnectivity/v1beta1/serviceconnectionpolicy + labels: + testing.upbound.io/example-name: default + name: default +spec: + forProvider: + description: my basic service connection policy + location: us-central1 + networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + pscConfig: + - limit: 2 + subnetworks: + - ${google_compute_subnetwork.producer_subnet.id} + serviceClass: my-basic-service-class + +--- + +apiVersion: compute.gcp.upbound.io/v1beta1 +kind: Network +metadata: + annotations: + meta.upbound.io/example-id: networkconnectivity/v1beta1/serviceconnectionpolicy + labels: + testing.upbound.io/example-name: producer_net + name: producer-net +spec: + forProvider: + autoCreateSubnetworks: false + +--- + +apiVersion: compute.gcp.upbound.io/v1beta1 +kind: Subnetwork +metadata: + annotations: + meta.upbound.io/example-id: networkconnectivity/v1beta1/serviceconnectionpolicy + labels: + testing.upbound.io/example-name: producer_subnet + name: producer-subnet +spec: + forProvider: + ipCidrRange: 10.0.0.0/16 + networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + region: us-central1 diff --git a/examples-generated/redis/v1beta1/cluster.yaml b/examples-generated/redis/v1beta1/cluster.yaml new file mode 100644 index 000000000..31cf82085 --- /dev/null +++ b/examples-generated/redis/v1beta1/cluster.yaml @@ -0,0 +1,73 @@ +apiVersion: redis.gcp.upbound.io/v1beta1 +kind: Cluster +metadata: + annotations: + meta.upbound.io/example-id: redis/v1beta1/cluster + labels: + testing.upbound.io/example-name: cluster-ha + name: cluster-ha +spec: + forProvider: + authorizationMode: AUTH_MODE_DISABLED + pscConfigs: + - networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + region: us-central1 + replicaCount: 1 + shardCount: 3 + transitEncryptionMode: TRANSIT_ENCRYPTION_MODE_DISABLED + +--- + +apiVersion: compute.gcp.upbound.io/v1beta1 +kind: Network +metadata: + annotations: + meta.upbound.io/example-id: redis/v1beta1/cluster + labels: + testing.upbound.io/example-name: producer_net + name: producer-net +spec: + forProvider: + autoCreateSubnetworks: false + +--- + +apiVersion: compute.gcp.upbound.io/v1beta1 +kind: Subnetwork +metadata: + annotations: + meta.upbound.io/example-id: redis/v1beta1/cluster + labels: + testing.upbound.io/example-name: producer_subnet + name: producer-subnet +spec: + forProvider: + ipCidrRange: 10.0.0.248/29 + networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + region: us-central1 + +--- + +apiVersion: networkconnectivity.gcp.upbound.io/v1beta1 +kind: ServiceConnectionPolicy +metadata: + annotations: + meta.upbound.io/example-id: redis/v1beta1/cluster + labels: + testing.upbound.io/example-name: default + name: default +spec: + forProvider: + description: my basic service connection policy + location: us-central1 + networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + pscConfig: + - subnetworks: + - ${google_compute_subnetwork.producer_subnet.id} + serviceClass: gcp-memorystore-redis diff --git a/package/crds/networkconnectivity.gcp.upbound.io_serviceconnectionpolicies.yaml b/package/crds/networkconnectivity.gcp.upbound.io_serviceconnectionpolicies.yaml new file mode 100644 index 000000000..0d351e302 --- /dev/null +++ b/package/crds/networkconnectivity.gcp.upbound.io_serviceconnectionpolicies.yaml @@ -0,0 +1,866 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: serviceconnectionpolicies.networkconnectivity.gcp.upbound.io +spec: + group: networkconnectivity.gcp.upbound.io + names: + categories: + - crossplane + - managed + - gcp + kind: ServiceConnectionPolicy + listKind: ServiceConnectionPolicyList + plural: serviceconnectionpolicies + singular: serviceconnectionpolicy + 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: v1beta1 + schema: + openAPIV3Schema: + description: ServiceConnectionPolicy is the Schema for the ServiceConnectionPolicys + API. Manage Service Connection Policies. + 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: ServiceConnectionPolicySpec defines the desired state of + ServiceConnectionPolicy + 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: + description: Free-text description of the resource. + type: string + labels: + additionalProperties: + type: string + description: User-defined labels. + type: object + x-kubernetes-map-type: granular + location: + description: The location of the ServiceConnectionPolicy. + type: string + network: + description: 'The resource path of the consumer network. Example: + - projects/{projectNumOrId}/global/networks/{resourceId}.' + type: string + networkRef: + description: Reference to a Network in compute to populate network. + 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 + networkSelector: + description: Selector for a Network in compute to populate network. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + pscConfig: + description: |- + Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + Structure is documented below. + items: + properties: + limit: + description: Max number of PSC connections for this policy. + type: string + subnetworkRef: + description: Reference to a Subnetwork in compute to populate + subnetwork. + items: + description: A Reference to a named object. + 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 + type: array + subnetworkSelector: + description: Selector for a Subnetwork in compute to populate + subnetwork. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + subnetworks: + description: IDs of the subnetworks or fully qualified identifiers + for the subnetworks + items: + type: string + type: array + type: object + type: array + serviceClass: + description: |- + The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. + It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + type: string + required: + - location + 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: + description: Free-text description of the resource. + type: string + labels: + additionalProperties: + type: string + description: User-defined labels. + type: object + x-kubernetes-map-type: granular + network: + description: 'The resource path of the consumer network. Example: + - projects/{projectNumOrId}/global/networks/{resourceId}.' + type: string + networkRef: + description: Reference to a Network in compute to populate network. + 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 + networkSelector: + description: Selector for a Network in compute to populate network. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + pscConfig: + description: |- + Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + Structure is documented below. + items: + properties: + limit: + description: Max number of PSC connections for this policy. + type: string + subnetworkRef: + description: Reference to a Subnetwork in compute to populate + subnetwork. + items: + description: A Reference to a named object. + 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 + type: array + subnetworkSelector: + description: Selector for a Subnetwork in compute to populate + subnetwork. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + subnetworks: + description: IDs of the subnetworks or fully qualified identifiers + for the subnetworks + items: + type: string + type: array + type: object + type: array + serviceClass: + description: |- + The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. + It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + 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.serviceClass is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.serviceClass) + || (has(self.initProvider) && has(self.initProvider.serviceClass))' + status: + description: ServiceConnectionPolicyStatus defines the observed state + of ServiceConnectionPolicy. + properties: + atProvider: + properties: + createTime: + description: The timestamp when the resource was created. + type: string + description: + description: Free-text description of the resource. + type: string + effectiveLabels: + additionalProperties: + type: string + description: for all of the labels present on the resource. + type: object + x-kubernetes-map-type: granular + etag: + description: The etag is computed by the server, and may be sent + on update and delete requests to ensure the client has an up-to-date + value before proceeding. + type: string + id: + description: an identifier for the resource with format projects/{{project}}/locations/{{location}}/serviceConnectionPolicies/{{name}} + type: string + infrastructure: + description: The type of underlying resources used to create the + connection. + type: string + labels: + additionalProperties: + type: string + description: User-defined labels. + type: object + x-kubernetes-map-type: granular + location: + description: The location of the ServiceConnectionPolicy. + type: string + network: + description: 'The resource path of the consumer network. Example: + - projects/{projectNumOrId}/global/networks/{resourceId}.' + type: string + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + pscConfig: + description: |- + Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + Structure is documented below. + items: + properties: + limit: + description: Max number of PSC connections for this policy. + type: string + subnetworks: + description: IDs of the subnetworks or fully qualified identifiers + for the subnetworks + items: + type: string + type: array + type: object + type: array + pscConnections: + description: |- + Information about each Private Service Connect connection. + Structure is documented below. + items: + properties: + consumerAddress: + description: The resource reference of the consumer address. + type: string + consumerForwardingRule: + description: The resource reference of the PSC Forwarding + Rule within the consumer VPC. + type: string + consumerTargetProject: + description: The project where the PSC connection is created. + type: string + error: + description: |- + The most recent error during operating this connection. + Structure is documented below. + items: + properties: + code: + description: The status code, which should be an enum + value of [google.rpc.Code][]. + type: number + details: + description: |- + (Output) + A list of messages that carry the error details. + items: + additionalProperties: + type: string + type: object + type: array + message: + description: A developer-facing error message. + type: string + type: object + type: array + errorInfo: + description: |- + The error info for the latest error during operating this connection. + Structure is documented below. + items: + properties: + domain: + description: The logical grouping to which the "reason" + belongs. + type: string + metadata: + additionalProperties: + type: string + description: Additional structured details about this + error. + type: object + x-kubernetes-map-type: granular + reason: + description: The reason of the error. + type: string + type: object + type: array + errorType: + description: |- + The error type indicates whether the error is consumer facing, producer + facing or system internal. + Possible values are: CONNECTION_ERROR_TYPE_UNSPECIFIED, ERROR_INTERNAL, ERROR_CONSUMER_SIDE, ERROR_PRODUCER_SIDE. + type: string + gceOperation: + description: The last Compute Engine operation to setup + PSC connection. + type: string + pscConnectionId: + description: The PSC connection id of the PSC forwarding + rule. + type: string + state: + description: |- + The state of the PSC connection. + Possible values are: STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING, FAILED. + type: string + type: object + type: array + serviceClass: + description: |- + The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. + It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + type: string + terraformLabels: + additionalProperties: + type: string + description: |- + The combination of labels configured directly on the resource + and default labels configured on the provider. + type: object + x-kubernetes-map-type: granular + updateTime: + description: The timestamp when the resource was updated. + 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/redis.gcp.upbound.io_clusters.yaml b/package/crds/redis.gcp.upbound.io_clusters.yaml new file mode 100644 index 000000000..80de290bd --- /dev/null +++ b/package/crds/redis.gcp.upbound.io_clusters.yaml @@ -0,0 +1,698 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: clusters.redis.gcp.upbound.io +spec: + group: redis.gcp.upbound.io + names: + categories: + - crossplane + - managed + - gcp + kind: Cluster + listKind: ClusterList + plural: clusters + singular: cluster + 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: v1beta1 + schema: + openAPIV3Schema: + description: Cluster is the Schema for the Clusters API. A Google Cloud Redis + Cluster instance. + 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: ClusterSpec defines the desired state of Cluster + 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: + authorizationMode: + description: |- + Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. + Default value is AUTH_MODE_DISABLED. + Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED. + type: string + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + pscConfigs: + description: |- + Required. Each PscConfig configures the consumer network where two + network addresses will be designated to the cluster for client access. + Currently, only one PscConfig is supported. + Structure is documented below. + items: + properties: + network: + description: |- + Required. The consumer network where the network address of + the discovery endpoint will be reserved, in the form of + projects/{network_project_id_or_number}/global/networks/{network_id}. + type: string + networkRef: + description: Reference to a Network in compute to populate + network. + 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 + networkSelector: + description: Selector for a Network in compute to populate + network. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + type: array + region: + description: The name of the region of the Redis cluster. + type: string + replicaCount: + description: Optional. The number of replica nodes per shard. + type: number + shardCount: + description: Required. Number of shards for the Redis cluster. + type: number + transitEncryptionMode: + description: |- + Optional. The in-transit encryption for the Redis cluster. + If not provided, encryption is disabled for the cluster. + Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. + Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION. + 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: + authorizationMode: + description: |- + Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. + Default value is AUTH_MODE_DISABLED. + Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED. + type: string + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + pscConfigs: + description: |- + Required. Each PscConfig configures the consumer network where two + network addresses will be designated to the cluster for client access. + Currently, only one PscConfig is supported. + Structure is documented below. + items: + properties: + network: + description: |- + Required. The consumer network where the network address of + the discovery endpoint will be reserved, in the form of + projects/{network_project_id_or_number}/global/networks/{network_id}. + type: string + networkRef: + description: Reference to a Network in compute to populate + network. + 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 + networkSelector: + description: Selector for a Network in compute to populate + network. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + type: array + replicaCount: + description: Optional. The number of replica nodes per shard. + type: number + shardCount: + description: Required. Number of shards for the Redis cluster. + type: number + transitEncryptionMode: + description: |- + Optional. The in-transit encryption for the Redis cluster. + If not provided, encryption is disabled for the cluster. + Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. + Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION. + 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.pscConfigs is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.pscConfigs) + || (has(self.initProvider) && has(self.initProvider.pscConfigs))' + - message: spec.forProvider.shardCount is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.shardCount) + || (has(self.initProvider) && has(self.initProvider.shardCount))' + status: + description: ClusterStatus defines the observed state of Cluster. + properties: + atProvider: + properties: + authorizationMode: + description: |- + Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. + Default value is AUTH_MODE_DISABLED. + Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED. + type: string + createTime: + description: |- + The timestamp associated with the cluster creation request. A timestamp in + RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional + digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". + type: string + discoveryEndpoints: + description: |- + Output only. Endpoints created on each given network, + for Redis clients to connect to the cluster. + Currently only one endpoint is supported. + Structure is documented below. + items: + properties: + address: + description: Output only. Network address of the exposed + Redis endpoint used by clients to connect to the service. + type: string + port: + description: Output only. The port number of the exposed + Redis endpoint. + type: number + pscConfig: + description: |- + Output only. Customer configuration for where the endpoint + is created and accessed from. + Structure is documented below. + items: + properties: + network: + description: The consumer network where the IP address + resides, in the form of projects/{projectId}/global/networks/{network_id}. + type: string + type: object + type: array + type: object + type: array + id: + description: an identifier for the resource with format projects/{{project}}/locations/{{region}}/clusters/{{name}} + type: string + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + pscConfigs: + description: |- + Required. Each PscConfig configures the consumer network where two + network addresses will be designated to the cluster for client access. + Currently, only one PscConfig is supported. + Structure is documented below. + items: + properties: + network: + description: |- + Required. The consumer network where the network address of + the discovery endpoint will be reserved, in the form of + projects/{network_project_id_or_number}/global/networks/{network_id}. + type: string + type: object + type: array + pscConnections: + description: |- + Output only. PSC connections for discovery of the cluster topology and accessing the cluster. + Structure is documented below. + items: + properties: + address: + description: Output only. The IP allocated on the consumer + network for the PSC forwarding rule. + type: string + forwardingRule: + description: 'Output only. The URI of the consumer side + forwarding rule. Example: projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.' + type: string + network: + description: The consumer network where the IP address resides, + in the form of projects/{projectId}/global/networks/{network_id}. + type: string + projectId: + description: Output only. The consumer projectId where the + forwarding rule is created from. + type: string + pscConnectionId: + description: Output only. The PSC connection id of the forwarding + rule connected to the service attachment. + type: string + type: object + type: array + region: + description: The name of the region of the Redis cluster. + type: string + replicaCount: + description: Optional. The number of replica nodes per shard. + type: number + shardCount: + description: Required. Number of shards for the Redis cluster. + type: number + sizeGb: + description: Output only. Redis memory size in GB for the entire + cluster. + type: number + state: + description: The current state of this cluster. Can be CREATING, + READY, UPDATING, DELETING and SUSPENDED + type: string + stateInfo: + description: |- + Output only. Additional information about the current state of the cluster. + Structure is documented below. + items: + properties: + updateInfo: + description: |- + A nested object resource + Structure is documented below. + items: + properties: + targetReplicaCount: + description: Target number of replica nodes per shard. + type: number + targetShardCount: + description: Target number of shards for redis cluster. + type: number + type: object + type: array + type: object + type: array + transitEncryptionMode: + description: |- + Optional. The in-transit encryption for the Redis cluster. + If not provided, encryption is disabled for the cluster. + Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. + Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION. + type: string + uid: + description: System assigned, unique identifier for the cluster. + 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: {}