From 92dc7c4c9ab484e8b8c02e1e99732a037e2bc509 Mon Sep 17 00:00:00 2001 From: Anh Le Date: Thu, 10 Oct 2024 19:37:02 +0000 Subject: [PATCH 1/3] Promote RedisCluster to v1alpha1 --- apis/redis/v1alpha1/types.generated.go | 23 - apis/redis/v1alpha1/zz_generated.deepcopy.go | 67 -- .../redis/v1beta1/doc.go | 16 +- apis/redis/v1beta1/groupversion_info.go | 33 + apis/redis/v1beta1/rediscluster_types.go | 168 +++++ apis/redis/v1beta1/types.generated.go | 117 +++ .../redis/v1beta1}/zz_generated.deepcopy.go | 445 ++++++------ ...sclusters.redis.cnrm.cloud.google.com.yaml | 340 +++++++++ config/servicemappings/redis.yaml | 6 +- dev/tools/controllerbuilder/generate.sh | 10 +- .../generated/apis/redis/v1alpha1/doc.go | 38 - .../generated/apis/redis/v1alpha1/register.go | 63 -- .../rediscluster_types.go | 4 +- .../generated/apis/redis/v1beta1/register.go | 6 + .../redis/v1beta1/zz_generated.deepcopy.go | 492 +++++++++++++ .../client/clientset/versioned/clientset.go | 13 - .../versioned/fake/clientset_generated.go | 7 - .../clientset/versioned/fake/register.go | 2 - .../clientset/versioned/scheme/register.go | 2 - .../versioned/typed/redis/v1alpha1/doc.go | 23 - .../typed/redis/v1alpha1/fake/doc.go | 23 - .../redis/v1alpha1/fake/fake_redis_client.go | 43 -- .../typed/redis/v1alpha1/redis_client.go | 110 --- .../redis/v1beta1/fake/fake_redis_client.go | 4 + .../fake/fake_rediscluster.go | 50 +- .../redis/v1beta1/generated_expansion.go | 2 + .../typed/redis/v1beta1/redis_client.go | 5 + .../{v1alpha1 => v1beta1}/rediscluster.go | 42 +- .../direct/redis/cluster/mapper.generated.go | 98 +-- pkg/controller/direct/redis/cluster/mapper.go | 2 +- .../redis/cluster/rediscluster_controller.go | 2 +- pkg/gvks/supportedgvks/gvks_generated.go | 16 +- .../v1beta1/basicrediscluster/create.yaml | 2 +- .../v1beta1/basicrediscluster/update.yaml | 2 +- .../v1beta1/fullrediscluster/create.yaml | 4 +- .../v1beta1/fullrediscluster/update.yaml | 2 +- .../resource-docs/redis/rediscluster.md | 685 ++++++++++++++++++ .../templates/redis_rediscluster.tmpl | 54 ++ 38 files changed, 2216 insertions(+), 805 deletions(-) rename pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/generated_expansion.go => apis/redis/v1beta1/doc.go (56%) create mode 100644 apis/redis/v1beta1/groupversion_info.go create mode 100644 apis/redis/v1beta1/rediscluster_types.go create mode 100644 apis/redis/v1beta1/types.generated.go rename {pkg/clients/generated/apis/redis/v1alpha1 => apis/redis/v1beta1}/zz_generated.deepcopy.go (77%) delete mode 100644 pkg/clients/generated/apis/redis/v1alpha1/doc.go delete mode 100644 pkg/clients/generated/apis/redis/v1alpha1/register.go rename pkg/clients/generated/apis/redis/{v1alpha1 => v1beta1}/rediscluster_types.go (99%) delete mode 100644 pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/doc.go delete mode 100644 pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/doc.go delete mode 100644 pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_redis_client.go delete mode 100644 pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/redis_client.go rename pkg/clients/generated/client/clientset/versioned/typed/redis/{v1alpha1 => v1beta1}/fake/fake_rediscluster.go (73%) rename pkg/clients/generated/client/clientset/versioned/typed/redis/{v1alpha1 => v1beta1}/rediscluster.go (80%) create mode 100644 scripts/generate-google3-docs/resource-reference/generated/resource-docs/redis/rediscluster.md create mode 100644 scripts/generate-google3-docs/resource-reference/templates/redis_rediscluster.tmpl diff --git a/apis/redis/v1alpha1/types.generated.go b/apis/redis/v1alpha1/types.generated.go index eefd17e9f3..fa605f6459 100644 --- a/apis/redis/v1alpha1/types.generated.go +++ b/apis/redis/v1alpha1/types.generated.go @@ -14,29 +14,6 @@ package v1alpha1 -// +kcc:proto=google.cloud.redis.cluster.v1.CertificateAuthority -type CertificateAuthority struct { - ManagedServerCa *CertificateAuthority_ManagedCertificateAuthority `json:"managedServerCa,omitempty"` - - // Identifier. Unique name of the resource in this scope including project, - // location and cluster using the form: - // `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` - Name *string `json:"name,omitempty"` -} - -// +kcc:proto=google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority -type CertificateAuthority_ManagedCertificateAuthority struct { - // The PEM encoded CA certificate chains for redis managed - // server authentication - CaCerts []CertificateAuthority_ManagedCertificateAuthority_CertChain `json:"caCerts,omitempty"` -} - -// +kcc:proto=google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain -type CertificateAuthority_ManagedCertificateAuthority_CertChain struct { - // The certificates that form the CA chain, from leaf to root order. - Certificates []string `json:"certificates,omitempty"` -} - // +kcc:proto=google.cloud.redis.cluster.v1.Cluster.StateInfo type Cluster_StateInfo struct { // Describes ongoing update on the cluster when cluster state is UPDATING. diff --git a/apis/redis/v1alpha1/zz_generated.deepcopy.go b/apis/redis/v1alpha1/zz_generated.deepcopy.go index e59ee73bd7..087810693f 100644 --- a/apis/redis/v1alpha1/zz_generated.deepcopy.go +++ b/apis/redis/v1alpha1/zz_generated.deepcopy.go @@ -24,73 +24,6 @@ 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 *CertificateAuthority) DeepCopyInto(out *CertificateAuthority) { - *out = *in - if in.ManagedServerCa != nil { - in, out := &in.ManagedServerCa, &out.ManagedServerCa - *out = new(CertificateAuthority_ManagedCertificateAuthority) - (*in).DeepCopyInto(*out) - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthority. -func (in *CertificateAuthority) DeepCopy() *CertificateAuthority { - if in == nil { - return nil - } - out := new(CertificateAuthority) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertificateAuthority_ManagedCertificateAuthority) DeepCopyInto(out *CertificateAuthority_ManagedCertificateAuthority) { - *out = *in - if in.CaCerts != nil { - in, out := &in.CaCerts, &out.CaCerts - *out = make([]CertificateAuthority_ManagedCertificateAuthority_CertChain, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthority_ManagedCertificateAuthority. -func (in *CertificateAuthority_ManagedCertificateAuthority) DeepCopy() *CertificateAuthority_ManagedCertificateAuthority { - if in == nil { - return nil - } - out := new(CertificateAuthority_ManagedCertificateAuthority) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertificateAuthority_ManagedCertificateAuthority_CertChain) DeepCopyInto(out *CertificateAuthority_ManagedCertificateAuthority_CertChain) { - *out = *in - if in.Certificates != nil { - in, out := &in.Certificates, &out.Certificates - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateAuthority_ManagedCertificateAuthority_CertChain. -func (in *CertificateAuthority_ManagedCertificateAuthority_CertChain) DeepCopy() *CertificateAuthority_ManagedCertificateAuthority_CertChain { - if in == nil { - return nil - } - out := new(CertificateAuthority_ManagedCertificateAuthority_CertChain) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterPersistenceConfig) DeepCopyInto(out *ClusterPersistenceConfig) { *out = *in diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/generated_expansion.go b/apis/redis/v1beta1/doc.go similarity index 56% rename from pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/generated_expansion.go rename to apis/redis/v1beta1/doc.go index 1b9ebd92cd..05a7bf375f 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/generated_expansion.go +++ b/apis/redis/v1beta1/doc.go @@ -1,10 +1,10 @@ -// Copyright 2020 Google LLC +// Copyright 2024 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -12,13 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -type RedisClusterExpansion interface{} +// +kcc:proto=google.cloud.redis.cluster.v1 +package v1beta1 diff --git a/apis/redis/v1beta1/groupversion_info.go b/apis/redis/v1beta1/groupversion_info.go new file mode 100644 index 0000000000..6e279f980e --- /dev/null +++ b/apis/redis/v1beta1/groupversion_info.go @@ -0,0 +1,33 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +kubebuilder:object:generate=true +// +groupName=redis.cnrm.cloud.google.com +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "redis.cnrm.cloud.google.com", Version: "v1alpha1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/apis/redis/v1beta1/rediscluster_types.go b/apis/redis/v1beta1/rediscluster_types.go new file mode 100644 index 0000000000..a6bc0ac676 --- /dev/null +++ b/apis/redis/v1beta1/rediscluster_types.go @@ -0,0 +1,168 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v1beta1 + +import ( + refs "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/apis/k8s/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +var RedisClusterGVK = GroupVersion.WithKind("RedisCluster") + +// RedisClusterSpec defines the desired state of RedisCluster +// +kcc:proto=google.cloud.redis.cluster.v1.Cluster +type RedisClusterSpec struct { + + /* Immutable. The Project that this resource belongs to. */ + ProjectRef refs.ProjectRef `json:"projectRef"` + + /* Immutable. Location of the resource. */ + Location *string `json:"location"` + + // The RedisCluster name. If not given, the metadata.name will be used. + // + optional + ResourceID *string `json:"resourceID,omitempty"` + + // Optional. The authorization mode of the Redis cluster. + // If not provided, auth feature is disabled for the cluster. + AuthorizationMode *string `json:"authorizationMode,omitempty"` + + // Optional. The in-transit encryption for the Redis cluster. + // If not provided, encryption is disabled for the cluster. + TransitEncryptionMode *string `json:"transitEncryptionMode,omitempty"` + + // Required. Number of shards for the Redis cluster. + ShardCount *int32 `json:"shardCount,omitempty"` + + // Required. Each PscConfig configures the consumer network where IPs will + // be designated to the cluster for client access through Private Service + // Connect Automation. Currently, only one PscConfig is supported. + PscConfigs []PscConfigSpec `json:"pscConfigs,omitempty"` + + // Optional. The type of a redis node in the cluster. NodeType determines the + // underlying machine-type of a redis node. + NodeType *string `json:"nodeType,omitempty"` + + // Optional. Persistence config (RDB, AOF) for the cluster. + PersistenceConfig *ClusterPersistenceConfig `json:"persistenceConfig,omitempty"` + + // Optional. Key/Value pairs of customer overrides for mutable Redis Configs + RedisConfigs map[string]string `json:"redisConfigs,omitempty"` + + // Optional. The number of replica nodes per shard. + ReplicaCount *int32 `json:"replicaCount,omitempty"` + + // Optional. This config will be used to determine how the customer wants us + // to distribute cluster resources within the region. + ZoneDistributionConfig *ZoneDistributionConfig `json:"zoneDistributionConfig,omitempty"` + + // Optional. The delete operation will fail when the value is set to true. + DeletionProtectionEnabled *bool `json:"deletionProtectionEnabled,omitempty"` +} + +type PscConfigSpec struct { + // Required. The network where the IP address of the discovery endpoint will + // be reserved, in the form of + // projects/{network_project}/global/networks/{network_id}. + // +required + NetworkRef *refs.ComputeNetworkRef `json:"networkRef,omitempty"` +} + +// RedisClusterStatus defines the config connector machine state of RedisCluster +type RedisClusterStatus struct { + /* Conditions represent the latest available observations of the + object's current state. */ + Conditions []v1alpha1.Condition `json:"conditions,omitempty"` + + // ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource. + // +optional + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + + // A unique specifier for the RedisCluster resource in GCP. + // +optional + ExternalRef *string `json:"externalRef,omitempty"` + + // ObservedState is the state of the resource as most recently observed in GCP. + // +optional + ObservedState *RedisClusterObservedState `json:"observedState,omitempty"` +} + +// RedisClusterSpec defines the desired state of RedisCluster +// +kcc:proto=google.cloud.redis.cluster.v1.Cluster +type RedisClusterObservedState struct { + + // Output only. The timestamp associated with the cluster creation request. + CreateTime *string `json:"createTime,omitempty"` + + // Output only. The current state of this cluster. + // Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + State *string `json:"state,omitempty"` + + // Output only. System assigned, unique identifier for the cluster. + Uid *string `json:"uid,omitempty"` + + // Output only. Redis memory size in GB for the entire cluster rounded up to + // the next integer. + SizeGb *int32 `json:"sizeGb,omitempty"` + + // Output only. Endpoints created on each given network, for Redis clients to + // connect to the cluster. Currently only one discovery endpoint is supported. + DiscoveryEndpoints []DiscoveryEndpoint `json:"discoveryEndpoints,omitempty"` + + // Output only. PSC connections for discovery of the cluster topology and + // accessing the cluster. + PscConnections []PscConnection `json:"pscConnections,omitempty"` + + // Output only. Additional information about the current state of the cluster. + StateInfo *Cluster_StateInfo `json:"stateInfo,omitempty"` + + // Output only. Precise value of redis memory size in GB for the entire + // cluster. + PreciseSizeGb *float64 `json:"preciseSizeGb,omitempty"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:resource:categories=gcp +// +kubebuilder:subresource:status +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/system=true";"cnrm.cloud.google.com/stability-level=beta" +// +kubebuilder:printcolumn:name="Age",JSONPath=".metadata.creationTimestamp",type="date" +// +kubebuilder:printcolumn:name="Ready",JSONPath=".status.conditions[?(@.type=='Ready')].status",type="string",description="When 'True', the most recent reconcile of the resource succeeded" +// +kubebuilder:printcolumn:name="Status",JSONPath=".status.conditions[?(@.type=='Ready')].reason",type="string",description="The reason for the value in 'Ready'" +// +kubebuilder:printcolumn:name="Status Age",JSONPath=".status.conditions[?(@.type=='Ready')].lastTransitionTime",type="date",description="The last transition time for the value in 'Status'" + +// RedisCluster is the Schema for the RedisCluster API +// +k8s:openapi-gen=true +// +kubebuilder:storageversion +type RedisCluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec RedisClusterSpec `json:"spec,omitempty"` + Status RedisClusterStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// RedisClusterList contains a list of RedisCluster +type RedisClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []RedisCluster `json:"items"` +} + +func init() { + SchemeBuilder.Register(&RedisCluster{}, &RedisClusterList{}) +} diff --git a/apis/redis/v1beta1/types.generated.go b/apis/redis/v1beta1/types.generated.go new file mode 100644 index 0000000000..cf3f4c5db3 --- /dev/null +++ b/apis/redis/v1beta1/types.generated.go @@ -0,0 +1,117 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v1beta1 + +// +kcc:proto=google.cloud.redis.cluster.v1.Cluster.StateInfo +type Cluster_StateInfo struct { + // Describes ongoing update on the cluster when cluster state is UPDATING. + UpdateInfo *Cluster_StateInfo_UpdateInfo `json:"updateInfo,omitempty"` +} + +// +kcc:proto=google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo +type Cluster_StateInfo_UpdateInfo struct { + // Target number of shards for redis cluster + TargetShardCount *int32 `json:"targetShardCount,omitempty"` + + // Target number of replica nodes per shard. + TargetReplicaCount *int32 `json:"targetReplicaCount,omitempty"` +} + +// +kcc:proto=google.cloud.redis.cluster.v1.ClusterPersistenceConfig +type ClusterPersistenceConfig struct { + // Optional. The mode of persistence. + Mode *string `json:"mode,omitempty"` + + // Optional. RDB configuration. This field will be ignored if mode is not RDB. + RdbConfig *ClusterPersistenceConfig_RDBConfig `json:"rdbConfig,omitempty"` + + // Optional. AOF configuration. This field will be ignored if mode is not AOF. + AofConfig *ClusterPersistenceConfig_AOFConfig `json:"aofConfig,omitempty"` +} + +// +kcc:proto=google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig +type ClusterPersistenceConfig_AOFConfig struct { + // Optional. fsync configuration. + AppendFsync *string `json:"appendFsync,omitempty"` +} + +// +kcc:proto=google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig +type ClusterPersistenceConfig_RDBConfig struct { + // Optional. Period between RDB snapshots. + RdbSnapshotPeriod *string `json:"rdbSnapshotPeriod,omitempty"` + + // Optional. The time that the first snapshot was/will be attempted, and to + // which future snapshots will be aligned. If not provided, the current time + // will be used. + RdbSnapshotStartTime *string `json:"rdbSnapshotStartTime,omitempty"` +} + +// +kcc:proto=google.cloud.redis.cluster.v1.DiscoveryEndpoint +type DiscoveryEndpoint struct { + // Output only. Address of the exposed Redis endpoint used by clients to + // connect to the service. The address could be either IP or hostname. + Address *string `json:"address,omitempty"` + + // Output only. The port number of the exposed Redis endpoint. + Port *int32 `json:"port,omitempty"` + + // Output only. Customer configuration for where the endpoint is created and + // accessed from. + PscConfig *PscConfig `json:"pscConfig,omitempty"` +} + +// +kcc:proto=google.cloud.redis.cluster.v1.PscConfig +type PscConfig struct { + // Required. The network where the IP address of the discovery endpoint will + // be reserved, in the form of + // projects/{network_project}/global/networks/{network_id}. + Network *string `json:"network,omitempty"` +} + +// +kcc:proto=google.cloud.redis.cluster.v1.PscConnection +type PscConnection struct { + // Output only. The PSC connection id of the forwarding rule connected to the + // service attachment. + PscConnectionID *string `json:"pscConnectionID,omitempty"` + + // Output only. The IP allocated on the consumer network for the PSC + // forwarding rule. + Address *string `json:"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"` + + // Output only. The consumer project_id where the forwarding rule is created + // from. + ProjectID *string `json:"projectID,omitempty"` + + // The consumer network where the IP address resides, in the form of + // projects/{project_id}/global/networks/{network_id}. + Network *string `json:"network,omitempty"` +} + +// +kcc:proto=google.cloud.redis.cluster.v1.ZoneDistributionConfig +type ZoneDistributionConfig struct { + // Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + // specified. + Mode *string `json:"mode,omitempty"` + + // Optional. When SINGLE ZONE distribution is selected, zone field would be + // used to allocate all resources in that zone. This is not applicable to + // MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + Zone *string `json:"zone,omitempty"` +} diff --git a/pkg/clients/generated/apis/redis/v1alpha1/zz_generated.deepcopy.go b/apis/redis/v1beta1/zz_generated.deepcopy.go similarity index 77% rename from pkg/clients/generated/apis/redis/v1alpha1/zz_generated.deepcopy.go rename to apis/redis/v1beta1/zz_generated.deepcopy.go index e2d74db5b7..bbb7686fc1 100644 --- a/pkg/clients/generated/apis/redis/v1alpha1/zz_generated.deepcopy.go +++ b/apis/redis/v1beta1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Copyright 2020 Google LLC // @@ -15,337 +14,242 @@ // See the License for the specific language governing permissions and // limitations under the License. -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! +// Code generated by controller-gen. DO NOT EDIT. -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha1 +package v1beta1 import ( - k8sv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/k8s/v1alpha1" + refsv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/apis/k8s/v1alpha1" 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 *ClusterAofConfig) DeepCopyInto(out *ClusterAofConfig) { +func (in *ClusterPersistenceConfig) DeepCopyInto(out *ClusterPersistenceConfig) { *out = *in - if in.AppendFsync != nil { - in, out := &in.AppendFsync, &out.AppendFsync + if in.Mode != nil { + in, out := &in.Mode, &out.Mode *out = new(string) **out = **in } - return + if in.RdbConfig != nil { + in, out := &in.RdbConfig, &out.RdbConfig + *out = new(ClusterPersistenceConfig_RDBConfig) + (*in).DeepCopyInto(*out) + } + if in.AofConfig != nil { + in, out := &in.AofConfig, &out.AofConfig + *out = new(ClusterPersistenceConfig_AOFConfig) + (*in).DeepCopyInto(*out) + } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAofConfig. -func (in *ClusterAofConfig) DeepCopy() *ClusterAofConfig { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPersistenceConfig. +func (in *ClusterPersistenceConfig) DeepCopy() *ClusterPersistenceConfig { if in == nil { return nil } - out := new(ClusterAofConfig) + out := new(ClusterPersistenceConfig) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterDiscoveryEndpointsStatus) DeepCopyInto(out *ClusterDiscoveryEndpointsStatus) { +func (in *ClusterPersistenceConfig_AOFConfig) DeepCopyInto(out *ClusterPersistenceConfig_AOFConfig) { *out = *in - if in.Address != nil { - in, out := &in.Address, &out.Address + if in.AppendFsync != nil { + in, out := &in.AppendFsync, &out.AppendFsync *out = new(string) **out = **in } - if in.Port != nil { - in, out := &in.Port, &out.Port - *out = new(int32) - **out = **in - } - if in.PscConfig != nil { - in, out := &in.PscConfig, &out.PscConfig - *out = new(ClusterPscConfigStatus) - (*in).DeepCopyInto(*out) - } - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDiscoveryEndpointsStatus. -func (in *ClusterDiscoveryEndpointsStatus) DeepCopy() *ClusterDiscoveryEndpointsStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPersistenceConfig_AOFConfig. +func (in *ClusterPersistenceConfig_AOFConfig) DeepCopy() *ClusterPersistenceConfig_AOFConfig { if in == nil { return nil } - out := new(ClusterDiscoveryEndpointsStatus) + out := new(ClusterPersistenceConfig_AOFConfig) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterObservedStateStatus) DeepCopyInto(out *ClusterObservedStateStatus) { +func (in *ClusterPersistenceConfig_RDBConfig) DeepCopyInto(out *ClusterPersistenceConfig_RDBConfig) { *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([]ClusterDiscoveryEndpointsStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.PreciseSizeGb != nil { - in, out := &in.PreciseSizeGb, &out.PreciseSizeGb - *out = new(float64) - **out = **in - } - if in.PscConnections != nil { - in, out := &in.PscConnections, &out.PscConnections - *out = make([]ClusterPscConnectionsStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SizeGb != nil { - in, out := &in.SizeGb, &out.SizeGb - *out = new(int32) - **out = **in - } - if in.State != nil { - in, out := &in.State, &out.State + if in.RdbSnapshotPeriod != nil { + in, out := &in.RdbSnapshotPeriod, &out.RdbSnapshotPeriod *out = new(string) **out = **in } - if in.StateInfo != nil { - in, out := &in.StateInfo, &out.StateInfo - *out = new(ClusterStateInfoStatus) - (*in).DeepCopyInto(*out) - } - if in.Uid != nil { - in, out := &in.Uid, &out.Uid + if in.RdbSnapshotStartTime != nil { + in, out := &in.RdbSnapshotStartTime, &out.RdbSnapshotStartTime *out = new(string) **out = **in } - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterObservedStateStatus. -func (in *ClusterObservedStateStatus) DeepCopy() *ClusterObservedStateStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPersistenceConfig_RDBConfig. +func (in *ClusterPersistenceConfig_RDBConfig) DeepCopy() *ClusterPersistenceConfig_RDBConfig { if in == nil { return nil } - out := new(ClusterObservedStateStatus) + out := new(ClusterPersistenceConfig_RDBConfig) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterPersistenceConfig) DeepCopyInto(out *ClusterPersistenceConfig) { +func (in *Cluster_StateInfo) DeepCopyInto(out *Cluster_StateInfo) { *out = *in - if in.AofConfig != nil { - in, out := &in.AofConfig, &out.AofConfig - *out = new(ClusterAofConfig) - (*in).DeepCopyInto(*out) - } - if in.Mode != nil { - in, out := &in.Mode, &out.Mode - *out = new(string) - **out = **in - } - if in.RdbConfig != nil { - in, out := &in.RdbConfig, &out.RdbConfig - *out = new(ClusterRdbConfig) + if in.UpdateInfo != nil { + in, out := &in.UpdateInfo, &out.UpdateInfo + *out = new(Cluster_StateInfo_UpdateInfo) (*in).DeepCopyInto(*out) } - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPersistenceConfig. -func (in *ClusterPersistenceConfig) DeepCopy() *ClusterPersistenceConfig { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster_StateInfo. +func (in *Cluster_StateInfo) DeepCopy() *Cluster_StateInfo { if in == nil { return nil } - out := new(ClusterPersistenceConfig) + out := new(Cluster_StateInfo) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterPscConfigStatus) DeepCopyInto(out *ClusterPscConfigStatus) { +func (in *Cluster_StateInfo_UpdateInfo) DeepCopyInto(out *Cluster_StateInfo_UpdateInfo) { *out = *in - if in.Network != nil { - in, out := &in.Network, &out.Network - *out = new(string) + if in.TargetShardCount != nil { + in, out := &in.TargetShardCount, &out.TargetShardCount + *out = new(int32) **out = **in } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPscConfigStatus. -func (in *ClusterPscConfigStatus) DeepCopy() *ClusterPscConfigStatus { - if in == nil { - return nil + if in.TargetReplicaCount != nil { + in, out := &in.TargetReplicaCount, &out.TargetReplicaCount + *out = new(int32) + **out = **in } - out := new(ClusterPscConfigStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterPscConfigs) DeepCopyInto(out *ClusterPscConfigs) { - *out = *in - out.NetworkRef = in.NetworkRef - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPscConfigs. -func (in *ClusterPscConfigs) DeepCopy() *ClusterPscConfigs { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster_StateInfo_UpdateInfo. +func (in *Cluster_StateInfo_UpdateInfo) DeepCopy() *Cluster_StateInfo_UpdateInfo { if in == nil { return nil } - out := new(ClusterPscConfigs) + out := new(Cluster_StateInfo_UpdateInfo) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterPscConnectionsStatus) DeepCopyInto(out *ClusterPscConnectionsStatus) { +func (in *DiscoveryEndpoint) DeepCopyInto(out *DiscoveryEndpoint) { *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) + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(int32) **out = **in } - if in.PscConnectionID != nil { - in, out := &in.PscConnectionID, &out.PscConnectionID - *out = new(string) - **out = **in + if in.PscConfig != nil { + in, out := &in.PscConfig, &out.PscConfig + *out = new(PscConfig) + (*in).DeepCopyInto(*out) } - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPscConnectionsStatus. -func (in *ClusterPscConnectionsStatus) DeepCopy() *ClusterPscConnectionsStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveryEndpoint. +func (in *DiscoveryEndpoint) DeepCopy() *DiscoveryEndpoint { if in == nil { return nil } - out := new(ClusterPscConnectionsStatus) + out := new(DiscoveryEndpoint) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterRdbConfig) DeepCopyInto(out *ClusterRdbConfig) { +func (in *PscConfig) DeepCopyInto(out *PscConfig) { *out = *in - if in.RdbSnapshotPeriod != nil { - in, out := &in.RdbSnapshotPeriod, &out.RdbSnapshotPeriod - *out = new(string) - **out = **in - } - if in.RdbSnapshotStartTime != nil { - in, out := &in.RdbSnapshotStartTime, &out.RdbSnapshotStartTime + if in.Network != nil { + in, out := &in.Network, &out.Network *out = new(string) **out = **in } - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRdbConfig. -func (in *ClusterRdbConfig) DeepCopy() *ClusterRdbConfig { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfig. +func (in *PscConfig) DeepCopy() *PscConfig { if in == nil { return nil } - out := new(ClusterRdbConfig) + out := new(PscConfig) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterStateInfoStatus) DeepCopyInto(out *ClusterStateInfoStatus) { +func (in *PscConfigSpec) DeepCopyInto(out *PscConfigSpec) { *out = *in - if in.UpdateInfo != nil { - in, out := &in.UpdateInfo, &out.UpdateInfo - *out = new(ClusterUpdateInfoStatus) - (*in).DeepCopyInto(*out) + if in.NetworkRef != nil { + in, out := &in.NetworkRef, &out.NetworkRef + *out = new(refsv1beta1.ComputeNetworkRef) + **out = **in } - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStateInfoStatus. -func (in *ClusterStateInfoStatus) DeepCopy() *ClusterStateInfoStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigSpec. +func (in *PscConfigSpec) DeepCopy() *PscConfigSpec { if in == nil { return nil } - out := new(ClusterStateInfoStatus) + out := new(PscConfigSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterUpdateInfoStatus) DeepCopyInto(out *ClusterUpdateInfoStatus) { +func (in *PscConnection) DeepCopyInto(out *PscConnection) { *out = *in - if in.TargetReplicaCount != nil { - in, out := &in.TargetReplicaCount, &out.TargetReplicaCount - *out = new(int32) + if in.PscConnectionID != nil { + in, out := &in.PscConnectionID, &out.PscConnectionID + *out = new(string) **out = **in } - if in.TargetShardCount != nil { - in, out := &in.TargetShardCount, &out.TargetShardCount - *out = new(int32) + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) **out = **in } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterUpdateInfoStatus. -func (in *ClusterUpdateInfoStatus) DeepCopy() *ClusterUpdateInfoStatus { - if in == nil { - return nil + if in.ForwardingRule != nil { + in, out := &in.ForwardingRule, &out.ForwardingRule + *out = new(string) + **out = **in } - out := new(ClusterUpdateInfoStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterZoneDistributionConfig) DeepCopyInto(out *ClusterZoneDistributionConfig) { - *out = *in - if in.Mode != nil { - in, out := &in.Mode, &out.Mode + if in.ProjectID != nil { + in, out := &in.ProjectID, &out.ProjectID *out = new(string) **out = **in } - if in.Zone != nil { - in, out := &in.Zone, &out.Zone + if in.Network != nil { + in, out := &in.Network, &out.Network *out = new(string) **out = **in } - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterZoneDistributionConfig. -func (in *ClusterZoneDistributionConfig) DeepCopy() *ClusterZoneDistributionConfig { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnection. +func (in *PscConnection) DeepCopy() *PscConnection { if in == nil { return nil } - out := new(ClusterZoneDistributionConfig) + out := new(PscConnection) in.DeepCopyInto(out) return out } @@ -357,7 +261,6 @@ func (in *RedisCluster) DeepCopyInto(out *RedisCluster) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisCluster. @@ -390,7 +293,6 @@ func (in *RedisClusterList) DeepCopyInto(out *RedisClusterList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisClusterList. @@ -411,19 +313,101 @@ func (in *RedisClusterList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RedisClusterObservedState) DeepCopyInto(out *RedisClusterObservedState) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } + if in.Uid != nil { + in, out := &in.Uid, &out.Uid + *out = new(string) + **out = **in + } + if in.SizeGb != nil { + in, out := &in.SizeGb, &out.SizeGb + *out = new(int32) + **out = **in + } + if in.DiscoveryEndpoints != nil { + in, out := &in.DiscoveryEndpoints, &out.DiscoveryEndpoints + *out = make([]DiscoveryEndpoint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PscConnections != nil { + in, out := &in.PscConnections, &out.PscConnections + *out = make([]PscConnection, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.StateInfo != nil { + in, out := &in.StateInfo, &out.StateInfo + *out = new(Cluster_StateInfo) + (*in).DeepCopyInto(*out) + } + if in.PreciseSizeGb != nil { + in, out := &in.PreciseSizeGb, &out.PreciseSizeGb + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisClusterObservedState. +func (in *RedisClusterObservedState) DeepCopy() *RedisClusterObservedState { + if in == nil { + return nil + } + out := new(RedisClusterObservedState) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RedisClusterSpec) DeepCopyInto(out *RedisClusterSpec) { *out = *in + out.ProjectRef = in.ProjectRef + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.ResourceID != nil { + in, out := &in.ResourceID, &out.ResourceID + *out = new(string) + **out = **in + } if in.AuthorizationMode != nil { in, out := &in.AuthorizationMode, &out.AuthorizationMode *out = new(string) **out = **in } - if in.DeletionProtectionEnabled != nil { - in, out := &in.DeletionProtectionEnabled, &out.DeletionProtectionEnabled - *out = new(bool) + if in.TransitEncryptionMode != nil { + in, out := &in.TransitEncryptionMode, &out.TransitEncryptionMode + *out = new(string) **out = **in } + if in.ShardCount != nil { + in, out := &in.ShardCount, &out.ShardCount + *out = new(int32) + **out = **in + } + if in.PscConfigs != nil { + in, out := &in.PscConfigs, &out.PscConfigs + *out = make([]PscConfigSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } if in.NodeType != nil { in, out := &in.NodeType, &out.NodeType *out = new(string) @@ -434,12 +418,6 @@ func (in *RedisClusterSpec) DeepCopyInto(out *RedisClusterSpec) { *out = new(ClusterPersistenceConfig) (*in).DeepCopyInto(*out) } - out.ProjectRef = in.ProjectRef - if in.PscConfigs != nil { - in, out := &in.PscConfigs, &out.PscConfigs - *out = make([]ClusterPscConfigs, len(*in)) - copy(*out, *in) - } if in.RedisConfigs != nil { in, out := &in.RedisConfigs, &out.RedisConfigs *out = make(map[string]string, len(*in)) @@ -452,27 +430,16 @@ func (in *RedisClusterSpec) DeepCopyInto(out *RedisClusterSpec) { *out = new(int32) **out = **in } - if in.ResourceID != nil { - in, out := &in.ResourceID, &out.ResourceID - *out = new(string) - **out = **in - } - if in.ShardCount != nil { - in, out := &in.ShardCount, &out.ShardCount - *out = new(int32) - **out = **in - } - if in.TransitEncryptionMode != nil { - in, out := &in.TransitEncryptionMode, &out.TransitEncryptionMode - *out = new(string) - **out = **in - } if in.ZoneDistributionConfig != nil { in, out := &in.ZoneDistributionConfig, &out.ZoneDistributionConfig - *out = new(ClusterZoneDistributionConfig) + *out = new(ZoneDistributionConfig) (*in).DeepCopyInto(*out) } - return + if in.DeletionProtectionEnabled != nil { + in, out := &in.DeletionProtectionEnabled, &out.DeletionProtectionEnabled + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisClusterSpec. @@ -490,25 +457,24 @@ func (in *RedisClusterStatus) DeepCopyInto(out *RedisClusterStatus) { *out = *in if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make([]k8sv1alpha1.Condition, len(*in)) + *out = make([]v1alpha1.Condition, len(*in)) copy(*out, *in) } - if in.ExternalRef != nil { - in, out := &in.ExternalRef, &out.ExternalRef - *out = new(string) - **out = **in - } if in.ObservedGeneration != nil { in, out := &in.ObservedGeneration, &out.ObservedGeneration *out = new(int64) **out = **in } + if in.ExternalRef != nil { + in, out := &in.ExternalRef, &out.ExternalRef + *out = new(string) + **out = **in + } if in.ObservedState != nil { in, out := &in.ObservedState, &out.ObservedState - *out = new(ClusterObservedStateStatus) + *out = new(RedisClusterObservedState) (*in).DeepCopyInto(*out) } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisClusterStatus. @@ -520,3 +486,28 @@ func (in *RedisClusterStatus) DeepCopy() *RedisClusterStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ZoneDistributionConfig) DeepCopyInto(out *ZoneDistributionConfig) { + *out = *in + if in.Mode != nil { + in, out := &in.Mode, &out.Mode + *out = new(string) + **out = **in + } + if in.Zone != nil { + in, out := &in.Zone, &out.Zone + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZoneDistributionConfig. +func (in *ZoneDistributionConfig) DeepCopy() *ZoneDistributionConfig { + if in == nil { + return nil + } + out := new(ZoneDistributionConfig) + in.DeepCopyInto(out) + return out +} diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_redisclusters.redis.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_redisclusters.redis.cnrm.cloud.google.com.yaml index 5a72e4d2c9..8224cd5313 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_redisclusters.redis.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_redisclusters.redis.cnrm.cloud.google.com.yaml @@ -6,6 +6,7 @@ metadata: creationTimestamp: null labels: cnrm.cloud.google.com/managed-by-kcc: "true" + cnrm.cloud.google.com/stability-level: beta cnrm.cloud.google.com/system: "true" name: redisclusters.redis.cnrm.cloud.google.com spec: @@ -356,6 +357,345 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: When 'True', the most recent reconcile of the resource succeeded + jsonPath: .status.conditions[?(@.type=='Ready')].status + name: Ready + type: string + - description: The reason for the value in 'Ready' + jsonPath: .status.conditions[?(@.type=='Ready')].reason + name: Status + type: string + - description: The last transition time for the value in 'Status' + jsonPath: .status.conditions[?(@.type=='Ready')].lastTransitionTime + name: Status Age + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: RedisCluster is the Schema for the RedisCluster API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: RedisClusterSpec defines the desired state of RedisCluster + properties: + authorizationMode: + description: Optional. The authorization mode of the Redis cluster. + If not provided, auth feature is disabled for the cluster. + type: string + deletionProtectionEnabled: + description: Optional. The delete operation will fail when the value + is set to true. + type: boolean + location: + description: Immutable. Location of the resource. + type: string + nodeType: + description: Optional. The type of a redis node in the cluster. NodeType + determines the underlying machine-type of a redis node. + type: string + persistenceConfig: + description: Optional. Persistence config (RDB, AOF) for the cluster. + properties: + aofConfig: + description: Optional. AOF configuration. This field will be ignored + if mode is not AOF. + properties: + appendFsync: + description: Optional. fsync configuration. + type: string + type: object + mode: + description: Optional. The mode of persistence. + type: string + rdbConfig: + description: Optional. RDB configuration. This field will be ignored + if mode is not RDB. + properties: + rdbSnapshotPeriod: + description: Optional. Period between RDB snapshots. + type: string + rdbSnapshotStartTime: + description: Optional. The time that the first snapshot was/will + be attempted, and to which future snapshots will be aligned. + If not provided, the current time will be used. + type: string + type: object + type: object + projectRef: + description: Immutable. The Project that this resource belongs to. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: The `projectID` field of a project, when not managed + by Config Connector. + type: string + kind: + description: The kind of the Project resource; optional but must + be `Project` if provided. + type: string + name: + description: The `name` field of a `Project` resource. + type: string + namespace: + description: The `namespace` field of a `Project` resource. + type: string + type: object + pscConfigs: + description: Required. Each PscConfig configures the consumer network + where IPs will be designated to the cluster for client access through + Private Service Connect Automation. Currently, only one PscConfig + is supported. + items: + properties: + networkRef: + description: Required. The network where the IP address of the + discovery endpoint will be reserved, in the form of projects/{network_project}/global/networks/{network_id}. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: A reference to an externally managed Compute + Network resource. Should be in the format `projects//global/networks/`. + type: string + name: + description: The `name` field of a `ComputeNetwork` resource. + type: string + namespace: + description: The `namespace` field of a `ComputeNetwork` + resource. + type: string + type: object + required: + - networkRef + type: object + type: array + redisConfigs: + additionalProperties: + type: string + description: Optional. Key/Value pairs of customer overrides for mutable + Redis Configs + type: object + replicaCount: + description: Optional. The number of replica nodes per shard. + format: int32 + type: integer + resourceID: + description: The RedisCluster name. If not given, the metadata.name + will be used. + type: string + shardCount: + description: Required. Number of shards for the Redis cluster. + format: int32 + type: integer + transitEncryptionMode: + description: Optional. The in-transit encryption for the Redis cluster. + If not provided, encryption is disabled for the cluster. + type: string + zoneDistributionConfig: + description: Optional. This config will be used to determine how the + customer wants us to distribute cluster resources within the region. + properties: + mode: + description: Optional. The mode of zone distribution. Defaults + to MULTI_ZONE, when not specified. + type: string + zone: + description: Optional. When SINGLE ZONE distribution is selected, + zone field would be used to allocate all resources in that zone. + This is not applicable to MULTI_ZONE, and would be ignored for + MULTI_ZONE clusters. + type: string + type: object + required: + - location + - projectRef + type: object + status: + description: RedisClusterStatus defines the config connector machine state + of RedisCluster + properties: + conditions: + description: Conditions represent the latest available observations + of the object's current state. + items: + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status + to another. + type: string + message: + description: Human-readable message indicating details about + last transition. + type: string + reason: + description: Unique, one-word, CamelCase reason for the condition's + last transition. + type: string + status: + description: Status is the status of the condition. Can be True, + False, Unknown. + type: string + type: + description: Type is the type of the condition. + type: string + type: object + type: array + externalRef: + description: A unique specifier for the RedisCluster resource in GCP. + type: string + observedGeneration: + description: ObservedGeneration is the generation of the resource + that was most recently observed by the Config Connector controller. + If this is equal to metadata.generation, then that means that the + current reported status reflects the most recent desired state of + the resource. + format: int64 + type: integer + observedState: + description: ObservedState is the state of the resource as most recently + observed in GCP. + properties: + createTime: + description: Output only. The timestamp associated with the cluster + creation request. + type: string + discoveryEndpoints: + description: Output only. Endpoints created on each given network, + for Redis clients to connect to the cluster. Currently only + one discovery endpoint is supported. + items: + properties: + address: + description: Output only. Address of the exposed Redis endpoint + used by clients to connect to the service. The address + could be either IP or hostname. + type: string + port: + description: Output only. The port number of the exposed + Redis endpoint. + format: int32 + type: integer + pscConfig: + description: Output only. Customer configuration for where + the endpoint is created and accessed from. + properties: + network: + description: Required. The network where the IP address + of the discovery endpoint will be reserved, in the + form of projects/{network_project}/global/networks/{network_id}. + type: string + type: object + type: object + type: array + preciseSizeGb: + description: Output only. Precise value of redis memory size in + GB for the entire cluster. + type: number + pscConnections: + description: Output only. PSC connections for discovery of the + cluster topology and accessing the cluster. + 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/{project_id}/global/networks/{network_id}. + type: string + projectID: + description: Output only. The consumer project_id 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 + sizeGb: + description: Output only. Redis memory size in GB for the entire + cluster rounded up to the next integer. + format: int32 + type: integer + state: + description: Output only. 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. + properties: + updateInfo: + description: Describes ongoing update on the cluster when + cluster state is UPDATING. + properties: + targetReplicaCount: + description: Target number of replica nodes per shard. + format: int32 + type: integer + targetShardCount: + description: Target number of shards for redis cluster + format: int32 + type: integer + type: object + type: object + uid: + description: Output only. System assigned, unique identifier for + the cluster. + type: string + type: object + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/servicemappings/redis.yaml b/config/servicemappings/redis.yaml index 38fbe0450e..ab911e82d4 100644 --- a/config/servicemappings/redis.yaml +++ b/config/servicemappings/redis.yaml @@ -22,6 +22,10 @@ spec: version: v1beta1 serviceHostName: "redis.googleapis.com" resources: + - name: google_redis_cluster + kind: RedisCluster + direct: true + - name: google_redis_instance kind: RedisInstance idTemplate: "{{project}}/{{region}}/{{name}}" @@ -58,4 +62,4 @@ spec: targetField: self_link containers: - type: project - tfField: project + tfField: project \ No newline at end of file diff --git a/dev/tools/controllerbuilder/generate.sh b/dev/tools/controllerbuilder/generate.sh index 066700799b..b972441642 100755 --- a/dev/tools/controllerbuilder/generate.sh +++ b/dev/tools/controllerbuilder/generate.sh @@ -67,10 +67,18 @@ go run . generate-types \ --kind RedisCluster \ --proto-resource Cluster +go run . generate-types \ + --proto-source-path ../proto-to-mapper/build/googleapis.pb \ + --service google.cloud.redis.cluster.v1 \ + --api-version redis.cnrm.cloud.google.com/v1beta1 \ + --output-api ${APIS_DIR} \ + --kind RedisCluster \ + --proto-resource Cluster + go run . generate-mapper \ --proto-source-path ../proto-to-mapper/build/googleapis.pb \ --service google.cloud.redis.cluster.v1 \ - --api-version redis.cnrm.cloud.google.com/v1alpha1 \ + --api-version redis.cnrm.cloud.google.com/v1beta1 \ --api-go-package-path github.com/GoogleCloudPlatform/k8s-config-connector/apis \ --output-dir ${OUTPUT_MAPPER} \ --api-dir ${APIS_DIR} diff --git a/pkg/clients/generated/apis/redis/v1alpha1/doc.go b/pkg/clients/generated/apis/redis/v1alpha1/doc.go deleted file mode 100644 index e74be89f6f..0000000000 --- a/pkg/clients/generated/apis/redis/v1alpha1/doc.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** -// -// ---------------------------------------------------------------------------- -// -// This file is automatically generated by Config Connector and manual -// changes will be clobbered when the file is regenerated. -// -// ---------------------------------------------------------------------------- - -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Package v1alpha1 contains API Schema definitions for the redis v1alpha1 API group. -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/pkg/apis/redis -// +k8s:defaulter-gen=TypeMeta -// +groupName=redis.cnrm.cloud.google.com - -package v1alpha1 diff --git a/pkg/clients/generated/apis/redis/v1alpha1/register.go b/pkg/clients/generated/apis/redis/v1alpha1/register.go deleted file mode 100644 index c9333d9ff4..0000000000 --- a/pkg/clients/generated/apis/redis/v1alpha1/register.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** -// -// ---------------------------------------------------------------------------- -// -// This file is automatically generated by Config Connector and manual -// changes will be clobbered when the file is regenerated. -// -// ---------------------------------------------------------------------------- - -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Package v1alpha1 contains API Schema definitions for the redis v1alpha1 API group. -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/pkg/apis/redis -// +k8s:defaulter-gen=TypeMeta -// +groupName=redis.cnrm.cloud.google.com -package v1alpha1 - -import ( - "reflect" - - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // SchemeGroupVersion is the group version used to register these objects. - SchemeGroupVersion = schema.GroupVersion{Group: "redis.cnrm.cloud.google.com", Version: "v1alpha1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme. - SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} - - // AddToScheme is a global function that registers this API group & version to a scheme - AddToScheme = SchemeBuilder.AddToScheme - - RedisClusterGVK = schema.GroupVersionKind{ - Group: SchemeGroupVersion.Group, - Version: SchemeGroupVersion.Version, - Kind: reflect.TypeOf(RedisCluster{}).Name(), - } - - redisAPIVersion = SchemeGroupVersion.String() -) diff --git a/pkg/clients/generated/apis/redis/v1alpha1/rediscluster_types.go b/pkg/clients/generated/apis/redis/v1beta1/rediscluster_types.go similarity index 99% rename from pkg/clients/generated/apis/redis/v1alpha1/rediscluster_types.go rename to pkg/clients/generated/apis/redis/v1beta1/rediscluster_types.go index b96f178e20..a47dfb3f82 100644 --- a/pkg/clients/generated/apis/redis/v1alpha1/rediscluster_types.go +++ b/pkg/clients/generated/apis/redis/v1beta1/rediscluster_types.go @@ -28,7 +28,7 @@ // that future versions of the go-client may include breaking changes. // Please try it out and give us feedback! -package v1alpha1 +package v1beta1 import ( "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/k8s/v1alpha1" @@ -245,7 +245,7 @@ type RedisClusterStatus struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=gcp,shortName= // +kubebuilder:subresource:status -// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/system=true" +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/stability-level=beta";"cnrm.cloud.google.com/system=true" // +kubebuilder:printcolumn:name="Age",JSONPath=".metadata.creationTimestamp",type="date" // +kubebuilder:printcolumn:name="Ready",JSONPath=".status.conditions[?(@.type=='Ready')].status",type="string",description="When 'True', the most recent reconcile of the resource succeeded" // +kubebuilder:printcolumn:name="Status",JSONPath=".status.conditions[?(@.type=='Ready')].reason",type="string",description="The reason for the value in 'Ready'" diff --git a/pkg/clients/generated/apis/redis/v1beta1/register.go b/pkg/clients/generated/apis/redis/v1beta1/register.go index 25681d1718..8637205da1 100644 --- a/pkg/clients/generated/apis/redis/v1beta1/register.go +++ b/pkg/clients/generated/apis/redis/v1beta1/register.go @@ -53,6 +53,12 @@ var ( // AddToScheme is a global function that registers this API group & version to a scheme AddToScheme = SchemeBuilder.AddToScheme + RedisClusterGVK = schema.GroupVersionKind{ + Group: SchemeGroupVersion.Group, + Version: SchemeGroupVersion.Version, + Kind: reflect.TypeOf(RedisCluster{}).Name(), + } + RedisInstanceGVK = schema.GroupVersionKind{ Group: SchemeGroupVersion.Group, Version: SchemeGroupVersion.Version, diff --git a/pkg/clients/generated/apis/redis/v1beta1/zz_generated.deepcopy.go b/pkg/clients/generated/apis/redis/v1beta1/zz_generated.deepcopy.go index 54f7bd4196..bc7cb42baa 100644 --- a/pkg/clients/generated/apis/redis/v1beta1/zz_generated.deepcopy.go +++ b/pkg/clients/generated/apis/redis/v1beta1/zz_generated.deepcopy.go @@ -29,6 +29,327 @@ 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 *ClusterAofConfig) DeepCopyInto(out *ClusterAofConfig) { + *out = *in + if in.AppendFsync != nil { + in, out := &in.AppendFsync, &out.AppendFsync + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAofConfig. +func (in *ClusterAofConfig) DeepCopy() *ClusterAofConfig { + if in == nil { + return nil + } + out := new(ClusterAofConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterDiscoveryEndpointsStatus) DeepCopyInto(out *ClusterDiscoveryEndpointsStatus) { + *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(int32) + **out = **in + } + if in.PscConfig != nil { + in, out := &in.PscConfig, &out.PscConfig + *out = new(ClusterPscConfigStatus) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDiscoveryEndpointsStatus. +func (in *ClusterDiscoveryEndpointsStatus) DeepCopy() *ClusterDiscoveryEndpointsStatus { + if in == nil { + return nil + } + out := new(ClusterDiscoveryEndpointsStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterObservedStateStatus) DeepCopyInto(out *ClusterObservedStateStatus) { + *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([]ClusterDiscoveryEndpointsStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PreciseSizeGb != nil { + in, out := &in.PreciseSizeGb, &out.PreciseSizeGb + *out = new(float64) + **out = **in + } + if in.PscConnections != nil { + in, out := &in.PscConnections, &out.PscConnections + *out = make([]ClusterPscConnectionsStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SizeGb != nil { + in, out := &in.SizeGb, &out.SizeGb + *out = new(int32) + **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 = new(ClusterStateInfoStatus) + (*in).DeepCopyInto(*out) + } + if in.Uid != nil { + in, out := &in.Uid, &out.Uid + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterObservedStateStatus. +func (in *ClusterObservedStateStatus) DeepCopy() *ClusterObservedStateStatus { + if in == nil { + return nil + } + out := new(ClusterObservedStateStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterPersistenceConfig) DeepCopyInto(out *ClusterPersistenceConfig) { + *out = *in + if in.AofConfig != nil { + in, out := &in.AofConfig, &out.AofConfig + *out = new(ClusterAofConfig) + (*in).DeepCopyInto(*out) + } + if in.Mode != nil { + in, out := &in.Mode, &out.Mode + *out = new(string) + **out = **in + } + if in.RdbConfig != nil { + in, out := &in.RdbConfig, &out.RdbConfig + *out = new(ClusterRdbConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPersistenceConfig. +func (in *ClusterPersistenceConfig) DeepCopy() *ClusterPersistenceConfig { + if in == nil { + return nil + } + out := new(ClusterPersistenceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterPscConfigStatus) DeepCopyInto(out *ClusterPscConfigStatus) { + *out = *in + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPscConfigStatus. +func (in *ClusterPscConfigStatus) DeepCopy() *ClusterPscConfigStatus { + if in == nil { + return nil + } + out := new(ClusterPscConfigStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterPscConfigs) DeepCopyInto(out *ClusterPscConfigs) { + *out = *in + out.NetworkRef = in.NetworkRef + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPscConfigs. +func (in *ClusterPscConfigs) DeepCopy() *ClusterPscConfigs { + if in == nil { + return nil + } + out := new(ClusterPscConfigs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterPscConnectionsStatus) DeepCopyInto(out *ClusterPscConnectionsStatus) { + *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 + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPscConnectionsStatus. +func (in *ClusterPscConnectionsStatus) DeepCopy() *ClusterPscConnectionsStatus { + if in == nil { + return nil + } + out := new(ClusterPscConnectionsStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterRdbConfig) DeepCopyInto(out *ClusterRdbConfig) { + *out = *in + if in.RdbSnapshotPeriod != nil { + in, out := &in.RdbSnapshotPeriod, &out.RdbSnapshotPeriod + *out = new(string) + **out = **in + } + if in.RdbSnapshotStartTime != nil { + in, out := &in.RdbSnapshotStartTime, &out.RdbSnapshotStartTime + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRdbConfig. +func (in *ClusterRdbConfig) DeepCopy() *ClusterRdbConfig { + if in == nil { + return nil + } + out := new(ClusterRdbConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterStateInfoStatus) DeepCopyInto(out *ClusterStateInfoStatus) { + *out = *in + if in.UpdateInfo != nil { + in, out := &in.UpdateInfo, &out.UpdateInfo + *out = new(ClusterUpdateInfoStatus) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStateInfoStatus. +func (in *ClusterStateInfoStatus) DeepCopy() *ClusterStateInfoStatus { + if in == nil { + return nil + } + out := new(ClusterStateInfoStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterUpdateInfoStatus) DeepCopyInto(out *ClusterUpdateInfoStatus) { + *out = *in + if in.TargetReplicaCount != nil { + in, out := &in.TargetReplicaCount, &out.TargetReplicaCount + *out = new(int32) + **out = **in + } + if in.TargetShardCount != nil { + in, out := &in.TargetShardCount, &out.TargetShardCount + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterUpdateInfoStatus. +func (in *ClusterUpdateInfoStatus) DeepCopy() *ClusterUpdateInfoStatus { + if in == nil { + return nil + } + out := new(ClusterUpdateInfoStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterZoneDistributionConfig) DeepCopyInto(out *ClusterZoneDistributionConfig) { + *out = *in + if in.Mode != nil { + in, out := &in.Mode, &out.Mode + *out = new(string) + **out = **in + } + if in.Zone != nil { + in, out := &in.Zone, &out.Zone + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterZoneDistributionConfig. +func (in *ClusterZoneDistributionConfig) DeepCopy() *ClusterZoneDistributionConfig { + if in == nil { + return nil + } + out := new(ClusterZoneDistributionConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InstanceMaintenancePolicy) DeepCopyInto(out *InstanceMaintenancePolicy) { *out = *in @@ -311,6 +632,177 @@ func (in *InstanceWeeklyMaintenanceWindow) DeepCopy() *InstanceWeeklyMaintenance return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RedisCluster) DeepCopyInto(out *RedisCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisCluster. +func (in *RedisCluster) DeepCopy() *RedisCluster { + if in == nil { + return nil + } + out := new(RedisCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RedisCluster) 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 *RedisClusterList) DeepCopyInto(out *RedisClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]RedisCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisClusterList. +func (in *RedisClusterList) DeepCopy() *RedisClusterList { + if in == nil { + return nil + } + out := new(RedisClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RedisClusterList) 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 *RedisClusterSpec) DeepCopyInto(out *RedisClusterSpec) { + *out = *in + if in.AuthorizationMode != nil { + in, out := &in.AuthorizationMode, &out.AuthorizationMode + *out = new(string) + **out = **in + } + if in.DeletionProtectionEnabled != nil { + in, out := &in.DeletionProtectionEnabled, &out.DeletionProtectionEnabled + *out = new(bool) + **out = **in + } + if in.NodeType != nil { + in, out := &in.NodeType, &out.NodeType + *out = new(string) + **out = **in + } + if in.PersistenceConfig != nil { + in, out := &in.PersistenceConfig, &out.PersistenceConfig + *out = new(ClusterPersistenceConfig) + (*in).DeepCopyInto(*out) + } + out.ProjectRef = in.ProjectRef + if in.PscConfigs != nil { + in, out := &in.PscConfigs, &out.PscConfigs + *out = make([]ClusterPscConfigs, len(*in)) + copy(*out, *in) + } + if in.RedisConfigs != nil { + in, out := &in.RedisConfigs, &out.RedisConfigs + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ReplicaCount != nil { + in, out := &in.ReplicaCount, &out.ReplicaCount + *out = new(int32) + **out = **in + } + if in.ResourceID != nil { + in, out := &in.ResourceID, &out.ResourceID + *out = new(string) + **out = **in + } + if in.ShardCount != nil { + in, out := &in.ShardCount, &out.ShardCount + *out = new(int32) + **out = **in + } + if in.TransitEncryptionMode != nil { + in, out := &in.TransitEncryptionMode, &out.TransitEncryptionMode + *out = new(string) + **out = **in + } + if in.ZoneDistributionConfig != nil { + in, out := &in.ZoneDistributionConfig, &out.ZoneDistributionConfig + *out = new(ClusterZoneDistributionConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisClusterSpec. +func (in *RedisClusterSpec) DeepCopy() *RedisClusterSpec { + if in == nil { + return nil + } + out := new(RedisClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RedisClusterStatus) DeepCopyInto(out *RedisClusterStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1alpha1.Condition, len(*in)) + copy(*out, *in) + } + if in.ExternalRef != nil { + in, out := &in.ExternalRef, &out.ExternalRef + *out = new(string) + **out = **in + } + if in.ObservedGeneration != nil { + in, out := &in.ObservedGeneration, &out.ObservedGeneration + *out = new(int64) + **out = **in + } + if in.ObservedState != nil { + in, out := &in.ObservedState, &out.ObservedState + *out = new(ClusterObservedStateStatus) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisClusterStatus. +func (in *RedisClusterStatus) DeepCopy() *RedisClusterStatus { + if in == nil { + return nil + } + out := new(RedisClusterStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RedisInstance) DeepCopyInto(out *RedisInstance) { *out = *in diff --git a/pkg/clients/generated/client/clientset/versioned/clientset.go b/pkg/clients/generated/client/clientset/versioned/clientset.go index e3282a3539..0fe320edc0 100644 --- a/pkg/clients/generated/client/clientset/versioned/clientset.go +++ b/pkg/clients/generated/client/clientset/versioned/clientset.go @@ -120,7 +120,6 @@ import ( pubsublitev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/pubsublite/v1alpha1" pubsublitev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/pubsublite/v1beta1" recaptchaenterprisev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/recaptchaenterprise/v1beta1" - redisv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1" redisv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1" resourcemanagerv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/resourcemanager/v1beta1" runv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/run/v1beta1" @@ -247,7 +246,6 @@ type Interface interface { PubsubliteV1alpha1() pubsublitev1alpha1.PubsubliteV1alpha1Interface PubsubliteV1beta1() pubsublitev1beta1.PubsubliteV1beta1Interface RecaptchaenterpriseV1beta1() recaptchaenterprisev1beta1.RecaptchaenterpriseV1beta1Interface - RedisV1alpha1() redisv1alpha1.RedisV1alpha1Interface RedisV1beta1() redisv1beta1.RedisV1beta1Interface ResourcemanagerV1beta1() resourcemanagerv1beta1.ResourcemanagerV1beta1Interface RunV1beta1() runv1beta1.RunV1beta1Interface @@ -372,7 +370,6 @@ type Clientset struct { pubsubliteV1alpha1 *pubsublitev1alpha1.PubsubliteV1alpha1Client pubsubliteV1beta1 *pubsublitev1beta1.PubsubliteV1beta1Client recaptchaenterpriseV1beta1 *recaptchaenterprisev1beta1.RecaptchaenterpriseV1beta1Client - redisV1alpha1 *redisv1alpha1.RedisV1alpha1Client redisV1beta1 *redisv1beta1.RedisV1beta1Client resourcemanagerV1beta1 *resourcemanagerv1beta1.ResourcemanagerV1beta1Client runV1beta1 *runv1beta1.RunV1beta1Client @@ -874,11 +871,6 @@ func (c *Clientset) RecaptchaenterpriseV1beta1() recaptchaenterprisev1beta1.Reca return c.recaptchaenterpriseV1beta1 } -// RedisV1alpha1 retrieves the RedisV1alpha1Client -func (c *Clientset) RedisV1alpha1() redisv1alpha1.RedisV1alpha1Interface { - return c.redisV1alpha1 -} - // RedisV1beta1 retrieves the RedisV1beta1Client func (c *Clientset) RedisV1beta1() redisv1beta1.RedisV1beta1Interface { return c.redisV1beta1 @@ -1423,10 +1415,6 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } - cs.redisV1alpha1, err = redisv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } cs.redisV1beta1, err = redisv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -1639,7 +1627,6 @@ func New(c rest.Interface) *Clientset { cs.pubsubliteV1alpha1 = pubsublitev1alpha1.New(c) cs.pubsubliteV1beta1 = pubsublitev1beta1.New(c) cs.recaptchaenterpriseV1beta1 = recaptchaenterprisev1beta1.New(c) - cs.redisV1alpha1 = redisv1alpha1.New(c) cs.redisV1beta1 = redisv1beta1.New(c) cs.resourcemanagerV1beta1 = resourcemanagerv1beta1.New(c) cs.runV1beta1 = runv1beta1.New(c) diff --git a/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go b/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go index aa2eca9da0..8749aff444 100644 --- a/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go @@ -213,8 +213,6 @@ import ( fakepubsublitev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/pubsublite/v1beta1/fake" recaptchaenterprisev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/recaptchaenterprise/v1beta1" fakerecaptchaenterprisev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/recaptchaenterprise/v1beta1/fake" - redisv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1" - fakeredisv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake" redisv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1" fakeredisv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/fake" resourcemanagerv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/resourcemanager/v1beta1" @@ -795,11 +793,6 @@ func (c *Clientset) RecaptchaenterpriseV1beta1() recaptchaenterprisev1beta1.Reca return &fakerecaptchaenterprisev1beta1.FakeRecaptchaenterpriseV1beta1{Fake: &c.Fake} } -// RedisV1alpha1 retrieves the RedisV1alpha1Client -func (c *Clientset) RedisV1alpha1() redisv1alpha1.RedisV1alpha1Interface { - return &fakeredisv1alpha1.FakeRedisV1alpha1{Fake: &c.Fake} -} - // RedisV1beta1 retrieves the RedisV1beta1Client func (c *Clientset) RedisV1beta1() redisv1beta1.RedisV1beta1Interface { return &fakeredisv1beta1.FakeRedisV1beta1{Fake: &c.Fake} diff --git a/pkg/clients/generated/client/clientset/versioned/fake/register.go b/pkg/clients/generated/client/clientset/versioned/fake/register.go index f0196b0327..f4efc4d736 100644 --- a/pkg/clients/generated/client/clientset/versioned/fake/register.go +++ b/pkg/clients/generated/client/clientset/versioned/fake/register.go @@ -117,7 +117,6 @@ import ( pubsublitev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/pubsublite/v1alpha1" pubsublitev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/pubsublite/v1beta1" recaptchaenterprisev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/recaptchaenterprise/v1beta1" - redisv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/redis/v1alpha1" redisv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/redis/v1beta1" resourcemanagerv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/resourcemanager/v1beta1" runv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/run/v1beta1" @@ -248,7 +247,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{ pubsublitev1alpha1.AddToScheme, pubsublitev1beta1.AddToScheme, recaptchaenterprisev1beta1.AddToScheme, - redisv1alpha1.AddToScheme, redisv1beta1.AddToScheme, resourcemanagerv1beta1.AddToScheme, runv1beta1.AddToScheme, diff --git a/pkg/clients/generated/client/clientset/versioned/scheme/register.go b/pkg/clients/generated/client/clientset/versioned/scheme/register.go index e859526d90..95c366701a 100644 --- a/pkg/clients/generated/client/clientset/versioned/scheme/register.go +++ b/pkg/clients/generated/client/clientset/versioned/scheme/register.go @@ -117,7 +117,6 @@ import ( pubsublitev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/pubsublite/v1alpha1" pubsublitev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/pubsublite/v1beta1" recaptchaenterprisev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/recaptchaenterprise/v1beta1" - redisv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/redis/v1alpha1" redisv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/redis/v1beta1" resourcemanagerv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/resourcemanager/v1beta1" runv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/run/v1beta1" @@ -248,7 +247,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{ pubsublitev1alpha1.AddToScheme, pubsublitev1beta1.AddToScheme, recaptchaenterprisev1beta1.AddToScheme, - redisv1alpha1.AddToScheme, redisv1beta1.AddToScheme, resourcemanagerv1beta1.AddToScheme, runv1beta1.AddToScheme, diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/doc.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/doc.go deleted file mode 100644 index d3dac805d0..0000000000 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1alpha1 diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/doc.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/doc.go deleted file mode 100644 index dfbe79f9af..0000000000 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_redis_client.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_redis_client.go deleted file mode 100644 index a96eef0eb8..0000000000 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_redis_client.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeRedisV1alpha1 struct { - *testing.Fake -} - -func (c *FakeRedisV1alpha1) RedisClusters(namespace string) v1alpha1.RedisClusterInterface { - return &FakeRedisClusters{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeRedisV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/redis_client.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/redis_client.go deleted file mode 100644 index 9eba919850..0000000000 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/redis_client.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "net/http" - - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/redis/v1alpha1" - "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/scheme" - rest "k8s.io/client-go/rest" -) - -type RedisV1alpha1Interface interface { - RESTClient() rest.Interface - RedisClustersGetter -} - -// RedisV1alpha1Client is used to interact with features provided by the redis.cnrm.cloud.google.com group. -type RedisV1alpha1Client struct { - restClient rest.Interface -} - -func (c *RedisV1alpha1Client) RedisClusters(namespace string) RedisClusterInterface { - return newRedisClusters(c, namespace) -} - -// NewForConfig creates a new RedisV1alpha1Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*RedisV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - httpClient, err := rest.HTTPClientFor(&config) - if err != nil { - return nil, err - } - return NewForConfigAndClient(&config, httpClient) -} - -// NewForConfigAndClient creates a new RedisV1alpha1Client for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*RedisV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientForConfigAndClient(&config, h) - if err != nil { - return nil, err - } - return &RedisV1alpha1Client{client}, nil -} - -// NewForConfigOrDie creates a new RedisV1alpha1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *RedisV1alpha1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new RedisV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *RedisV1alpha1Client { - return &RedisV1alpha1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *RedisV1alpha1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/fake/fake_redis_client.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/fake/fake_redis_client.go index ed8e1a18cb..9952d5b9d9 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/fake/fake_redis_client.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/fake/fake_redis_client.go @@ -31,6 +31,10 @@ type FakeRedisV1beta1 struct { *testing.Fake } +func (c *FakeRedisV1beta1) RedisClusters(namespace string) v1beta1.RedisClusterInterface { + return &FakeRedisClusters{c, namespace} +} + func (c *FakeRedisV1beta1) RedisInstances(namespace string) v1beta1.RedisInstanceInterface { return &FakeRedisInstances{c, namespace} } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_rediscluster.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/fake/fake_rediscluster.go similarity index 73% rename from pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_rediscluster.go rename to pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/fake/fake_rediscluster.go index d3491c0d47..0f94388c12 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_rediscluster.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/fake/fake_rediscluster.go @@ -24,7 +24,7 @@ package fake import ( "context" - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/redis/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/redis/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" @@ -34,29 +34,29 @@ import ( // FakeRedisClusters implements RedisClusterInterface type FakeRedisClusters struct { - Fake *FakeRedisV1alpha1 + Fake *FakeRedisV1beta1 ns string } -var redisclustersResource = v1alpha1.SchemeGroupVersion.WithResource("redisclusters") +var redisclustersResource = v1beta1.SchemeGroupVersion.WithResource("redisclusters") -var redisclustersKind = v1alpha1.SchemeGroupVersion.WithKind("RedisCluster") +var redisclustersKind = v1beta1.SchemeGroupVersion.WithKind("RedisCluster") // Get takes name of the redisCluster, and returns the corresponding redisCluster object, and an error if there is any. -func (c *FakeRedisClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RedisCluster, err error) { +func (c *FakeRedisClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RedisCluster, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(redisclustersResource, c.ns, name), &v1alpha1.RedisCluster{}) + Invokes(testing.NewGetAction(redisclustersResource, c.ns, name), &v1beta1.RedisCluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.RedisCluster), err + return obj.(*v1beta1.RedisCluster), err } // List takes label and field selectors, and returns the list of RedisClusters that match those selectors. -func (c *FakeRedisClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RedisClusterList, err error) { +func (c *FakeRedisClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RedisClusterList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(redisclustersResource, redisclustersKind, c.ns, opts), &v1alpha1.RedisClusterList{}) + Invokes(testing.NewListAction(redisclustersResource, redisclustersKind, c.ns, opts), &v1beta1.RedisClusterList{}) if obj == nil { return nil, err @@ -66,8 +66,8 @@ func (c *FakeRedisClusters) List(ctx context.Context, opts v1.ListOptions) (resu if label == nil { label = labels.Everything() } - list := &v1alpha1.RedisClusterList{ListMeta: obj.(*v1alpha1.RedisClusterList).ListMeta} - for _, item := range obj.(*v1alpha1.RedisClusterList).Items { + list := &v1beta1.RedisClusterList{ListMeta: obj.(*v1beta1.RedisClusterList).ListMeta} + for _, item := range obj.(*v1beta1.RedisClusterList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -83,43 +83,43 @@ func (c *FakeRedisClusters) Watch(ctx context.Context, opts v1.ListOptions) (wat } // Create takes the representation of a redisCluster and creates it. Returns the server's representation of the redisCluster, and an error, if there is any. -func (c *FakeRedisClusters) Create(ctx context.Context, redisCluster *v1alpha1.RedisCluster, opts v1.CreateOptions) (result *v1alpha1.RedisCluster, err error) { +func (c *FakeRedisClusters) Create(ctx context.Context, redisCluster *v1beta1.RedisCluster, opts v1.CreateOptions) (result *v1beta1.RedisCluster, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(redisclustersResource, c.ns, redisCluster), &v1alpha1.RedisCluster{}) + Invokes(testing.NewCreateAction(redisclustersResource, c.ns, redisCluster), &v1beta1.RedisCluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.RedisCluster), err + return obj.(*v1beta1.RedisCluster), err } // Update takes the representation of a redisCluster and updates it. Returns the server's representation of the redisCluster, and an error, if there is any. -func (c *FakeRedisClusters) Update(ctx context.Context, redisCluster *v1alpha1.RedisCluster, opts v1.UpdateOptions) (result *v1alpha1.RedisCluster, err error) { +func (c *FakeRedisClusters) Update(ctx context.Context, redisCluster *v1beta1.RedisCluster, opts v1.UpdateOptions) (result *v1beta1.RedisCluster, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(redisclustersResource, c.ns, redisCluster), &v1alpha1.RedisCluster{}) + Invokes(testing.NewUpdateAction(redisclustersResource, c.ns, redisCluster), &v1beta1.RedisCluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.RedisCluster), err + return obj.(*v1beta1.RedisCluster), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeRedisClusters) UpdateStatus(ctx context.Context, redisCluster *v1alpha1.RedisCluster, opts v1.UpdateOptions) (*v1alpha1.RedisCluster, error) { +func (c *FakeRedisClusters) UpdateStatus(ctx context.Context, redisCluster *v1beta1.RedisCluster, opts v1.UpdateOptions) (*v1beta1.RedisCluster, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(redisclustersResource, "status", c.ns, redisCluster), &v1alpha1.RedisCluster{}) + Invokes(testing.NewUpdateSubresourceAction(redisclustersResource, "status", c.ns, redisCluster), &v1beta1.RedisCluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.RedisCluster), err + return obj.(*v1beta1.RedisCluster), err } // Delete takes name of the redisCluster and deletes it. Returns an error if one occurs. func (c *FakeRedisClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(redisclustersResource, c.ns, name, opts), &v1alpha1.RedisCluster{}) + Invokes(testing.NewDeleteActionWithOptions(redisclustersResource, c.ns, name, opts), &v1beta1.RedisCluster{}) return err } @@ -128,17 +128,17 @@ func (c *FakeRedisClusters) Delete(ctx context.Context, name string, opts v1.Del func (c *FakeRedisClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionAction(redisclustersResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha1.RedisClusterList{}) + _, err := c.Fake.Invokes(action, &v1beta1.RedisClusterList{}) return err } // Patch applies the patch and returns the patched redisCluster. -func (c *FakeRedisClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RedisCluster, err error) { +func (c *FakeRedisClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RedisCluster, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(redisclustersResource, c.ns, name, pt, data, subresources...), &v1alpha1.RedisCluster{}) + Invokes(testing.NewPatchSubresourceAction(redisclustersResource, c.ns, name, pt, data, subresources...), &v1beta1.RedisCluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.RedisCluster), err + return obj.(*v1beta1.RedisCluster), err } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/generated_expansion.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/generated_expansion.go index 42487dbb3d..b152ade497 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/generated_expansion.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/generated_expansion.go @@ -21,4 +21,6 @@ package v1beta1 +type RedisClusterExpansion interface{} + type RedisInstanceExpansion interface{} diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/redis_client.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/redis_client.go index 6dc4aa258e..70551584ce 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/redis_client.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/redis_client.go @@ -31,6 +31,7 @@ import ( type RedisV1beta1Interface interface { RESTClient() rest.Interface + RedisClustersGetter RedisInstancesGetter } @@ -39,6 +40,10 @@ type RedisV1beta1Client struct { restClient rest.Interface } +func (c *RedisV1beta1Client) RedisClusters(namespace string) RedisClusterInterface { + return newRedisClusters(c, namespace) +} + func (c *RedisV1beta1Client) RedisInstances(namespace string) RedisInstanceInterface { return newRedisInstances(c, namespace) } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/rediscluster.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/rediscluster.go similarity index 80% rename from pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/rediscluster.go rename to pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/rediscluster.go index b1fdbfa73f..83f1e77f30 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/rediscluster.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1beta1/rediscluster.go @@ -19,13 +19,13 @@ // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "context" "time" - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/redis/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/redis/v1beta1" scheme "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -41,15 +41,15 @@ type RedisClustersGetter interface { // RedisClusterInterface has methods to work with RedisCluster resources. type RedisClusterInterface interface { - Create(ctx context.Context, redisCluster *v1alpha1.RedisCluster, opts v1.CreateOptions) (*v1alpha1.RedisCluster, error) - Update(ctx context.Context, redisCluster *v1alpha1.RedisCluster, opts v1.UpdateOptions) (*v1alpha1.RedisCluster, error) - UpdateStatus(ctx context.Context, redisCluster *v1alpha1.RedisCluster, opts v1.UpdateOptions) (*v1alpha1.RedisCluster, error) + Create(ctx context.Context, redisCluster *v1beta1.RedisCluster, opts v1.CreateOptions) (*v1beta1.RedisCluster, error) + Update(ctx context.Context, redisCluster *v1beta1.RedisCluster, opts v1.UpdateOptions) (*v1beta1.RedisCluster, error) + UpdateStatus(ctx context.Context, redisCluster *v1beta1.RedisCluster, opts v1.UpdateOptions) (*v1beta1.RedisCluster, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.RedisCluster, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RedisClusterList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.RedisCluster, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RedisClusterList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RedisCluster, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RedisCluster, err error) RedisClusterExpansion } @@ -60,7 +60,7 @@ type redisClusters struct { } // newRedisClusters returns a RedisClusters -func newRedisClusters(c *RedisV1alpha1Client, namespace string) *redisClusters { +func newRedisClusters(c *RedisV1beta1Client, namespace string) *redisClusters { return &redisClusters{ client: c.RESTClient(), ns: namespace, @@ -68,8 +68,8 @@ func newRedisClusters(c *RedisV1alpha1Client, namespace string) *redisClusters { } // Get takes name of the redisCluster, and returns the corresponding redisCluster object, and an error if there is any. -func (c *redisClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RedisCluster, err error) { - result = &v1alpha1.RedisCluster{} +func (c *redisClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RedisCluster, err error) { + result = &v1beta1.RedisCluster{} err = c.client.Get(). Namespace(c.ns). Resource("redisclusters"). @@ -81,12 +81,12 @@ func (c *redisClusters) Get(ctx context.Context, name string, options v1.GetOpti } // List takes label and field selectors, and returns the list of RedisClusters that match those selectors. -func (c *redisClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RedisClusterList, err error) { +func (c *redisClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RedisClusterList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.RedisClusterList{} + result = &v1beta1.RedisClusterList{} err = c.client.Get(). Namespace(c.ns). Resource("redisclusters"). @@ -113,8 +113,8 @@ func (c *redisClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.I } // Create takes the representation of a redisCluster and creates it. Returns the server's representation of the redisCluster, and an error, if there is any. -func (c *redisClusters) Create(ctx context.Context, redisCluster *v1alpha1.RedisCluster, opts v1.CreateOptions) (result *v1alpha1.RedisCluster, err error) { - result = &v1alpha1.RedisCluster{} +func (c *redisClusters) Create(ctx context.Context, redisCluster *v1beta1.RedisCluster, opts v1.CreateOptions) (result *v1beta1.RedisCluster, err error) { + result = &v1beta1.RedisCluster{} err = c.client.Post(). Namespace(c.ns). Resource("redisclusters"). @@ -126,8 +126,8 @@ func (c *redisClusters) Create(ctx context.Context, redisCluster *v1alpha1.Redis } // Update takes the representation of a redisCluster and updates it. Returns the server's representation of the redisCluster, and an error, if there is any. -func (c *redisClusters) Update(ctx context.Context, redisCluster *v1alpha1.RedisCluster, opts v1.UpdateOptions) (result *v1alpha1.RedisCluster, err error) { - result = &v1alpha1.RedisCluster{} +func (c *redisClusters) Update(ctx context.Context, redisCluster *v1beta1.RedisCluster, opts v1.UpdateOptions) (result *v1beta1.RedisCluster, err error) { + result = &v1beta1.RedisCluster{} err = c.client.Put(). Namespace(c.ns). Resource("redisclusters"). @@ -141,8 +141,8 @@ func (c *redisClusters) Update(ctx context.Context, redisCluster *v1alpha1.Redis // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *redisClusters) UpdateStatus(ctx context.Context, redisCluster *v1alpha1.RedisCluster, opts v1.UpdateOptions) (result *v1alpha1.RedisCluster, err error) { - result = &v1alpha1.RedisCluster{} +func (c *redisClusters) UpdateStatus(ctx context.Context, redisCluster *v1beta1.RedisCluster, opts v1.UpdateOptions) (result *v1beta1.RedisCluster, err error) { + result = &v1beta1.RedisCluster{} err = c.client.Put(). Namespace(c.ns). Resource("redisclusters"). @@ -183,8 +183,8 @@ func (c *redisClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOpti } // Patch applies the patch and returns the patched redisCluster. -func (c *redisClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RedisCluster, err error) { - result = &v1alpha1.RedisCluster{} +func (c *redisClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RedisCluster, err error) { + result = &v1beta1.RedisCluster{} err = c.client.Patch(pt). Namespace(c.ns). Resource("redisclusters"). diff --git a/pkg/controller/direct/redis/cluster/mapper.generated.go b/pkg/controller/direct/redis/cluster/mapper.generated.go index 58dba208e0..e021a3104e 100644 --- a/pkg/controller/direct/redis/cluster/mapper.generated.go +++ b/pkg/controller/direct/redis/cluster/mapper.generated.go @@ -16,62 +16,10 @@ package cluster import ( pb "cloud.google.com/go/redis/cluster/apiv1/clusterpb" - krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/redis/v1alpha1" + krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/redis/v1beta1" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" ) -func CertificateAuthority_FromProto(mapCtx *direct.MapContext, in *pb.CertificateAuthority) *krm.CertificateAuthority { - if in == nil { - return nil - } - out := &krm.CertificateAuthority{} - out.ManagedServerCa = CertificateAuthority_ManagedCertificateAuthority_FromProto(mapCtx, in.GetManagedServerCa()) - out.Name = direct.LazyPtr(in.GetName()) - return out -} -func CertificateAuthority_ToProto(mapCtx *direct.MapContext, in *krm.CertificateAuthority) *pb.CertificateAuthority { - if in == nil { - return nil - } - out := &pb.CertificateAuthority{} - if oneof := CertificateAuthority_ManagedCertificateAuthority_ToProto(mapCtx, in.ManagedServerCa); oneof != nil { - out.ServerCa = &pb.CertificateAuthority_ManagedServerCa{ManagedServerCa: oneof} - } - out.Name = direct.ValueOf(in.Name) - return out -} -func CertificateAuthority_ManagedCertificateAuthority_FromProto(mapCtx *direct.MapContext, in *pb.CertificateAuthority_ManagedCertificateAuthority) *krm.CertificateAuthority_ManagedCertificateAuthority { - if in == nil { - return nil - } - out := &krm.CertificateAuthority_ManagedCertificateAuthority{} - out.CaCerts = direct.Slice_FromProto(mapCtx, in.CaCerts, CertificateAuthority_ManagedCertificateAuthority_CertChain_FromProto) - return out -} -func CertificateAuthority_ManagedCertificateAuthority_ToProto(mapCtx *direct.MapContext, in *krm.CertificateAuthority_ManagedCertificateAuthority) *pb.CertificateAuthority_ManagedCertificateAuthority { - if in == nil { - return nil - } - out := &pb.CertificateAuthority_ManagedCertificateAuthority{} - out.CaCerts = direct.Slice_ToProto(mapCtx, in.CaCerts, CertificateAuthority_ManagedCertificateAuthority_CertChain_ToProto) - return out -} -func CertificateAuthority_ManagedCertificateAuthority_CertChain_FromProto(mapCtx *direct.MapContext, in *pb.CertificateAuthority_ManagedCertificateAuthority_CertChain) *krm.CertificateAuthority_ManagedCertificateAuthority_CertChain { - if in == nil { - return nil - } - out := &krm.CertificateAuthority_ManagedCertificateAuthority_CertChain{} - out.Certificates = in.Certificates - return out -} -func CertificateAuthority_ManagedCertificateAuthority_CertChain_ToProto(mapCtx *direct.MapContext, in *krm.CertificateAuthority_ManagedCertificateAuthority_CertChain) *pb.CertificateAuthority_ManagedCertificateAuthority_CertChain { - if in == nil { - return nil - } - out := &pb.CertificateAuthority_ManagedCertificateAuthority_CertChain{} - out.Certificates = in.Certificates - return out -} func ClusterPersistenceConfig_FromProto(mapCtx *direct.MapContext, in *pb.ClusterPersistenceConfig) *krm.ClusterPersistenceConfig { if in == nil { return nil @@ -114,7 +62,7 @@ func ClusterPersistenceConfig_RDBConfig_FromProto(mapCtx *direct.MapContext, in } out := &krm.ClusterPersistenceConfig_RDBConfig{} out.RdbSnapshotPeriod = direct.Enum_FromProto(mapCtx, in.GetRdbSnapshotPeriod()) - out.RdbSnapshotStartTime = RDBConfig_RdbSnapshotStartTime_FromProto(mapCtx, in.GetRdbSnapshotStartTime()) + out.RdbSnapshotStartTime = direct.StringTimestamp_FromProto(mapCtx, in.GetRdbSnapshotStartTime()) return out } func ClusterPersistenceConfig_RDBConfig_ToProto(mapCtx *direct.MapContext, in *krm.ClusterPersistenceConfig_RDBConfig) *pb.ClusterPersistenceConfig_RDBConfig { @@ -123,7 +71,7 @@ func ClusterPersistenceConfig_RDBConfig_ToProto(mapCtx *direct.MapContext, in *k } out := &pb.ClusterPersistenceConfig_RDBConfig{} out.RdbSnapshotPeriod = direct.Enum_ToProto[pb.ClusterPersistenceConfig_RDBConfig_SnapshotPeriod](mapCtx, in.RdbSnapshotPeriod) - out.RdbSnapshotStartTime = RDBConfig_RdbSnapshotStartTime_ToProto(mapCtx, in.RdbSnapshotStartTime) + out.RdbSnapshotStartTime = direct.StringTimestamp_ToProto(mapCtx, in.RdbSnapshotStartTime) return out } func Cluster_StateInfo_FromProto(mapCtx *direct.MapContext, in *pb.Cluster_StateInfo) *krm.Cluster_StateInfo { @@ -228,24 +176,14 @@ func RedisClusterObservedState_FromProto(mapCtx *direct.MapContext, in *pb.Clust } out := &krm.RedisClusterObservedState{} // MISSING: Name - out.CreateTime = Cluster_CreateTime_FromProto(mapCtx, in.GetCreateTime()) + out.CreateTime = direct.StringTimestamp_FromProto(mapCtx, in.GetCreateTime()) out.State = direct.Enum_FromProto(mapCtx, in.GetState()) out.Uid = direct.LazyPtr(in.GetUid()) - // MISSING: ReplicaCount - // MISSING: AuthorizationMode - // MISSING: TransitEncryptionMode out.SizeGb = in.SizeGb - // MISSING: ShardCount - // MISSING: PscConfigs out.DiscoveryEndpoints = direct.Slice_FromProto(mapCtx, in.DiscoveryEndpoints, DiscoveryEndpoint_FromProto) out.PscConnections = direct.Slice_FromProto(mapCtx, in.PscConnections, PscConnection_FromProto) out.StateInfo = Cluster_StateInfo_FromProto(mapCtx, in.GetStateInfo()) - // MISSING: NodeType - // MISSING: PersistenceConfig - // MISSING: RedisConfigs out.PreciseSizeGb = in.PreciseSizeGb - // MISSING: ZoneDistributionConfig - // MISSING: DeletionProtectionEnabled return out } func RedisClusterObservedState_ToProto(mapCtx *direct.MapContext, in *krm.RedisClusterObservedState) *pb.Cluster { @@ -254,24 +192,14 @@ func RedisClusterObservedState_ToProto(mapCtx *direct.MapContext, in *krm.RedisC } out := &pb.Cluster{} // MISSING: Name - out.CreateTime = Cluster_CreateTime_ToProto(mapCtx, in.CreateTime) + out.CreateTime = direct.StringTimestamp_ToProto(mapCtx, in.CreateTime) out.State = direct.Enum_ToProto[pb.Cluster_State](mapCtx, in.State) out.Uid = direct.ValueOf(in.Uid) - // MISSING: ReplicaCount - // MISSING: AuthorizationMode - // MISSING: TransitEncryptionMode out.SizeGb = in.SizeGb - // MISSING: ShardCount - // MISSING: PscConfigs out.DiscoveryEndpoints = direct.Slice_ToProto(mapCtx, in.DiscoveryEndpoints, DiscoveryEndpoint_ToProto) out.PscConnections = direct.Slice_ToProto(mapCtx, in.PscConnections, PscConnection_ToProto) out.StateInfo = Cluster_StateInfo_ToProto(mapCtx, in.StateInfo) - // MISSING: NodeType - // MISSING: PersistenceConfig - // MISSING: RedisConfigs out.PreciseSizeGb = in.PreciseSizeGb - // MISSING: ZoneDistributionConfig - // MISSING: DeletionProtectionEnabled return out } func RedisClusterSpec_FromProto(mapCtx *direct.MapContext, in *pb.Cluster) *krm.RedisClusterSpec { @@ -280,22 +208,14 @@ func RedisClusterSpec_FromProto(mapCtx *direct.MapContext, in *pb.Cluster) *krm. } out := &krm.RedisClusterSpec{} // MISSING: Name - // MISSING: CreateTime - // MISSING: State - // MISSING: Uid out.ReplicaCount = in.ReplicaCount out.AuthorizationMode = direct.Enum_FromProto(mapCtx, in.GetAuthorizationMode()) out.TransitEncryptionMode = direct.Enum_FromProto(mapCtx, in.GetTransitEncryptionMode()) - // MISSING: SizeGb out.ShardCount = in.ShardCount out.PscConfigs = direct.Slice_FromProto(mapCtx, in.PscConfigs, PscConfigSpec_FromProto) - // MISSING: DiscoveryEndpoints - // MISSING: PscConnections - // MISSING: StateInfo out.NodeType = direct.Enum_FromProto(mapCtx, in.GetNodeType()) out.PersistenceConfig = ClusterPersistenceConfig_FromProto(mapCtx, in.GetPersistenceConfig()) out.RedisConfigs = in.RedisConfigs - // MISSING: PreciseSizeGb out.ZoneDistributionConfig = ZoneDistributionConfig_FromProto(mapCtx, in.GetZoneDistributionConfig()) out.DeletionProtectionEnabled = in.DeletionProtectionEnabled return out @@ -306,22 +226,14 @@ func RedisClusterSpec_ToProto(mapCtx *direct.MapContext, in *krm.RedisClusterSpe } out := &pb.Cluster{} // MISSING: Name - // MISSING: CreateTime - // MISSING: State - // MISSING: Uid out.ReplicaCount = in.ReplicaCount out.AuthorizationMode = direct.Enum_ToProto[pb.AuthorizationMode](mapCtx, in.AuthorizationMode) out.TransitEncryptionMode = direct.Enum_ToProto[pb.TransitEncryptionMode](mapCtx, in.TransitEncryptionMode) - // MISSING: SizeGb out.ShardCount = in.ShardCount out.PscConfigs = direct.Slice_ToProto(mapCtx, in.PscConfigs, PscConfigSpec_ToProto) - // MISSING: DiscoveryEndpoints - // MISSING: PscConnections - // MISSING: StateInfo out.NodeType = direct.Enum_ToProto[pb.NodeType](mapCtx, in.NodeType) out.PersistenceConfig = ClusterPersistenceConfig_ToProto(mapCtx, in.PersistenceConfig) out.RedisConfigs = in.RedisConfigs - // MISSING: PreciseSizeGb out.ZoneDistributionConfig = ZoneDistributionConfig_ToProto(mapCtx, in.ZoneDistributionConfig) out.DeletionProtectionEnabled = in.DeletionProtectionEnabled return out diff --git a/pkg/controller/direct/redis/cluster/mapper.go b/pkg/controller/direct/redis/cluster/mapper.go index b436409a57..06d662c8b8 100644 --- a/pkg/controller/direct/redis/cluster/mapper.go +++ b/pkg/controller/direct/redis/cluster/mapper.go @@ -18,7 +18,7 @@ import ( "time" pb "cloud.google.com/go/redis/cluster/apiv1/clusterpb" - krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/redis/v1alpha1" + krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/redis/v1beta1" refs "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" "google.golang.org/protobuf/types/known/timestamppb" diff --git a/pkg/controller/direct/redis/cluster/rediscluster_controller.go b/pkg/controller/direct/redis/cluster/rediscluster_controller.go index 6aae8291dd..6a21f0fc16 100644 --- a/pkg/controller/direct/redis/cluster/rediscluster_controller.go +++ b/pkg/controller/direct/redis/cluster/rediscluster_controller.go @@ -29,7 +29,7 @@ import ( "k8s.io/klog/v2" "sigs.k8s.io/controller-runtime/pkg/client" - krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/redis/v1alpha1" + krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/redis/v1beta1" refs "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/config" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" diff --git a/pkg/gvks/supportedgvks/gvks_generated.go b/pkg/gvks/supportedgvks/gvks_generated.go index db5f1c3bd9..aee64df3a9 100644 --- a/pkg/gvks/supportedgvks/gvks_generated.go +++ b/pkg/gvks/supportedgvks/gvks_generated.go @@ -3732,8 +3732,20 @@ var SupportedGVKs = map[schema.GroupVersionKind]GVKMetadata{ Kind: "RedisCluster", }: { Labels: map[string]string{ - "cnrm.cloud.google.com/managed-by-kcc": "true", - "cnrm.cloud.google.com/system": "true", + "cnrm.cloud.google.com/managed-by-kcc": "true", + "cnrm.cloud.google.com/stability-level": "beta", + "cnrm.cloud.google.com/system": "true", + }, + }, + { + Group: "redis.cnrm.cloud.google.com", + Version: "v1beta1", + Kind: "RedisCluster", + }: { + Labels: map[string]string{ + "cnrm.cloud.google.com/managed-by-kcc": "true", + "cnrm.cloud.google.com/stability-level": "beta", + "cnrm.cloud.google.com/system": "true", }, }, { diff --git a/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/basicrediscluster/create.yaml b/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/basicrediscluster/create.yaml index 9d3f5016b8..61fbab3ea8 100644 --- a/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/basicrediscluster/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/basicrediscluster/create.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: redis.cnrm.cloud.google.com/v1alpha1 +apiVersion: redis.cnrm.cloud.google.com/v1beta1 kind: RedisCluster metadata: name: rediscluster-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/basicrediscluster/update.yaml b/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/basicrediscluster/update.yaml index ca5a7f9ca1..750b8db8ea 100644 --- a/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/basicrediscluster/update.yaml +++ b/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/basicrediscluster/update.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: redis.cnrm.cloud.google.com/v1alpha1 +apiVersion: redis.cnrm.cloud.google.com/v1beta1 kind: RedisCluster metadata: name: rediscluster-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/fullrediscluster/create.yaml b/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/fullrediscluster/create.yaml index b9a8d21ca2..9fadc8ee8a 100644 --- a/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/fullrediscluster/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/fullrediscluster/create.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: redis.cnrm.cloud.google.com/v1alpha1 +apiVersion: redis.cnrm.cloud.google.com/v1beta1 kind: RedisCluster metadata: name: rediscluster-${uniqueId} @@ -35,6 +35,6 @@ spec: zone: us-central1-b persistenceConfig: mode: AOF - aofConfig: + aofConfig: appendFsync: EVERYSEC deletionProtectionEnabled: true diff --git a/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/fullrediscluster/update.yaml b/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/fullrediscluster/update.yaml index f9cee2a146..63925716ba 100644 --- a/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/fullrediscluster/update.yaml +++ b/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/fullrediscluster/update.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: redis.cnrm.cloud.google.com/v1alpha1 +apiVersion: redis.cnrm.cloud.google.com/v1beta1 kind: RedisCluster metadata: name: rediscluster-${uniqueId} diff --git a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/redis/rediscluster.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/redis/rediscluster.md new file mode 100644 index 0000000000..24b9266786 --- /dev/null +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/redis/rediscluster.md @@ -0,0 +1,685 @@ +{# AUTOGENERATED. DO NOT EDIT. #} + +{% extends "config-connector/_base.html" %} + +{% block page_title %}RedisCluster{% endblock %} +{% block body %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyValue
{{gcp_name_short}} Service NameCloud Memorystore for Redis
{{gcp_name_short}} Service Documentation/memorystore/docs/redis/
{{gcp_name_short}} REST Resource Namev1.projects.locations.instances
{{gcp_name_short}} REST Resource Documentation/memorystore/docs/redis/reference/rest/v1/projects.locations.instances
{{product_name_short}} Resource Short Namesrediscluster
{{product_name_short}} Service Nameredis.googleapis.com
{{product_name_short}} Resource Fully Qualified Nameredisclusters.redis.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMemberNo
{{product_name_short}} Default Average Reconcile Interval In Seconds600
+ +## Custom Resource Definition Properties + + + +### Spec +#### Schema +```yaml +authorizationMode: string +deletionProtectionEnabled: boolean +location: string +nodeType: string +persistenceConfig: + aofConfig: + appendFsync: string + mode: string + rdbConfig: + rdbSnapshotPeriod: string + rdbSnapshotStartTime: string +projectRef: + external: string + kind: string + name: string + namespace: string +pscConfigs: +- networkRef: + external: string + name: string + namespace: string +redisConfigs: + string: string +replicaCount: integer +resourceID: string +shardCount: integer +transitEncryptionMode: string +zoneDistributionConfig: + mode: string + zone: string +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fields
+

authorizationMode

+

Optional

+
+

string

+

{% verbatim %}Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster.{% endverbatim %}

+
+

deletionProtectionEnabled

+

Optional

+
+

boolean

+

{% verbatim %}Optional. The delete operation will fail when the value is set to true.{% endverbatim %}

+
+

location

+

Required*

+
+

string

+

{% verbatim %}Immutable. Location of the resource.{% endverbatim %}

+
+

nodeType

+

Optional

+
+

string

+

{% verbatim %}Optional. The type of a redis node in the cluster. NodeType determines the underlying machine-type of a redis node.{% endverbatim %}

+
+

persistenceConfig

+

Optional

+
+

object

+

{% verbatim %}Optional. Persistence config (RDB, AOF) for the cluster.{% endverbatim %}

+
+

persistenceConfig.aofConfig

+

Optional

+
+

object

+

{% verbatim %}Optional. AOF configuration. This field will be ignored if mode is not AOF.{% endverbatim %}

+
+

persistenceConfig.aofConfig.appendFsync

+

Optional

+
+

string

+

{% verbatim %}Optional. fsync configuration.{% endverbatim %}

+
+

persistenceConfig.mode

+

Optional

+
+

string

+

{% verbatim %}Optional. The mode of persistence.{% endverbatim %}

+
+

persistenceConfig.rdbConfig

+

Optional

+
+

object

+

{% verbatim %}Optional. RDB configuration. This field will be ignored if mode is not RDB.{% endverbatim %}

+
+

persistenceConfig.rdbConfig.rdbSnapshotPeriod

+

Optional

+
+

string

+

{% verbatim %}Optional. Period between RDB snapshots.{% endverbatim %}

+
+

persistenceConfig.rdbConfig.rdbSnapshotStartTime

+

Optional

+
+

string

+

{% verbatim %}Optional. The time that the first snapshot was/will be attempted, and to which future snapshots will be aligned. If not provided, the current time will be used.{% endverbatim %}

+
+

projectRef

+

Required*

+
+

object

+

{% verbatim %}Immutable. The Project that this resource belongs to.{% endverbatim %}

+
+

projectRef.external

+

Optional

+
+

string

+

{% verbatim %}The `projectID` field of a project, when not managed by Config Connector.{% endverbatim %}

+
+

projectRef.kind

+

Optional

+
+

string

+

{% verbatim %}The kind of the Project resource; optional but must be `Project` if provided.{% endverbatim %}

+
+

projectRef.name

+

Optional

+
+

string

+

{% verbatim %}The `name` field of a `Project` resource.{% endverbatim %}

+
+

projectRef.namespace

+

Optional

+
+

string

+

{% verbatim %}The `namespace` field of a `Project` resource.{% endverbatim %}

+
+

pscConfigs

+

Optional

+
+

list (object)

+

{% verbatim %}Required. Each PscConfig configures the consumer network where IPs will be designated to the cluster for client access through Private Service Connect Automation. Currently, only one PscConfig is supported.{% endverbatim %}

+
+

pscConfigs[]

+

Optional

+
+

object

+

{% verbatim %}{% endverbatim %}

+
+

pscConfigs[].networkRef

+

Required*

+
+

object

+

{% verbatim %}Required. The network where the IP address of the discovery endpoint will be reserved, in the form of projects/{network_project}/global/networks/{network_id}.{% endverbatim %}

+
+

pscConfigs[].networkRef.external

+

Optional

+
+

string

+

{% verbatim %}A reference to an externally managed Compute Network resource. Should be in the format `projects//global/networks/`.{% endverbatim %}

+
+

pscConfigs[].networkRef.name

+

Optional

+
+

string

+

{% verbatim %}The `name` field of a `ComputeNetwork` resource.{% endverbatim %}

+
+

pscConfigs[].networkRef.namespace

+

Optional

+
+

string

+

{% verbatim %}The `namespace` field of a `ComputeNetwork` resource.{% endverbatim %}

+
+

redisConfigs

+

Optional

+
+

map (key: string, value: string)

+

{% verbatim %}Optional. Key/Value pairs of customer overrides for mutable Redis Configs{% endverbatim %}

+
+

replicaCount

+

Optional

+
+

integer

+

{% verbatim %}Optional. The number of replica nodes per shard.{% endverbatim %}

+
+

resourceID

+

Optional

+
+

string

+

{% verbatim %}The RedisCluster name. If not given, the metadata.name will be used.{% endverbatim %}

+
+

shardCount

+

Optional

+
+

integer

+

{% verbatim %}Required. Number of shards for the Redis cluster.{% endverbatim %}

+
+

transitEncryptionMode

+

Optional

+
+

string

+

{% verbatim %}Optional. The in-transit encryption for the Redis cluster. If not provided, encryption is disabled for the cluster.{% endverbatim %}

+
+

zoneDistributionConfig

+

Optional

+
+

object

+

{% verbatim %}Optional. This config will be used to determine how the customer wants us to distribute cluster resources within the region.{% endverbatim %}

+
+

zoneDistributionConfig.mode

+

Optional

+
+

string

+

{% verbatim %}Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not specified.{% endverbatim %}

+
+

zoneDistributionConfig.zone

+

Optional

+
+

string

+

{% verbatim %}Optional. When SINGLE ZONE distribution is selected, zone field would be used to allocate all resources in that zone. This is not applicable to MULTI_ZONE, and would be ignored for MULTI_ZONE clusters.{% endverbatim %}

+
+ + +

* Field is required when parent field is specified

+ + +### Status +#### Schema +```yaml +conditions: +- lastTransitionTime: string + message: string + reason: string + status: string + type: string +externalRef: string +observedGeneration: integer +observedState: + createTime: string + discoveryEndpoints: + - address: string + port: integer + pscConfig: + network: string + preciseSizeGb: float + pscConnections: + - address: string + forwardingRule: string + network: string + projectID: string + pscConnectionID: string + sizeGb: integer + state: string + stateInfo: + updateInfo: + targetReplicaCount: integer + targetShardCount: integer + uid: string +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fields
conditions +

list (object)

+

{% verbatim %}Conditions represent the latest available observations of the object's current state.{% endverbatim %}

+
conditions[] +

object

+

{% verbatim %}{% endverbatim %}

+
conditions[].lastTransitionTime +

string

+

{% verbatim %}Last time the condition transitioned from one status to another.{% endverbatim %}

+
conditions[].message +

string

+

{% verbatim %}Human-readable message indicating details about last transition.{% endverbatim %}

+
conditions[].reason +

string

+

{% verbatim %}Unique, one-word, CamelCase reason for the condition's last transition.{% endverbatim %}

+
conditions[].status +

string

+

{% verbatim %}Status is the status of the condition. Can be True, False, Unknown.{% endverbatim %}

+
conditions[].type +

string

+

{% verbatim %}Type is the type of the condition.{% endverbatim %}

+
externalRef +

string

+

{% verbatim %}A unique specifier for the RedisCluster resource in GCP.{% endverbatim %}

+
observedGeneration +

integer

+

{% verbatim %}ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.{% endverbatim %}

+
observedState +

object

+

{% verbatim %}ObservedState is the state of the resource as most recently observed in GCP.{% endverbatim %}

+
observedState.createTime +

string

+

{% verbatim %}Output only. The timestamp associated with the cluster creation request.{% endverbatim %}

+
observedState.discoveryEndpoints +

list (object)

+

{% verbatim %}Output only. Endpoints created on each given network, for Redis clients to connect to the cluster. Currently only one discovery endpoint is supported.{% endverbatim %}

+
observedState.discoveryEndpoints[] +

object

+

{% verbatim %}{% endverbatim %}

+
observedState.discoveryEndpoints[].address +

string

+

{% verbatim %}Output only. Address of the exposed Redis endpoint used by clients to connect to the service. The address could be either IP or hostname.{% endverbatim %}

+
observedState.discoveryEndpoints[].port +

integer

+

{% verbatim %}Output only. The port number of the exposed Redis endpoint.{% endverbatim %}

+
observedState.discoveryEndpoints[].pscConfig +

object

+

{% verbatim %}Output only. Customer configuration for where the endpoint is created and accessed from.{% endverbatim %}

+
observedState.discoveryEndpoints[].pscConfig.network +

string

+

{% verbatim %}Required. The network where the IP address of the discovery endpoint will be reserved, in the form of projects/{network_project}/global/networks/{network_id}.{% endverbatim %}

+
observedState.preciseSizeGb +

float

+

{% verbatim %}Output only. Precise value of redis memory size in GB for the entire cluster.{% endverbatim %}

+
observedState.pscConnections +

list (object)

+

{% verbatim %}Output only. PSC connections for discovery of the cluster topology and accessing the cluster.{% endverbatim %}

+
observedState.pscConnections[] +

object

+

{% verbatim %}{% endverbatim %}

+
observedState.pscConnections[].address +

string

+

{% verbatim %}Output only. The IP allocated on the consumer network for the PSC forwarding rule.{% endverbatim %}

+
observedState.pscConnections[].forwardingRule +

string

+

{% verbatim %}Output only. The URI of the consumer side forwarding rule. Example: projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.{% endverbatim %}

+
observedState.pscConnections[].network +

string

+

{% verbatim %}The consumer network where the IP address resides, in the form of projects/{project_id}/global/networks/{network_id}.{% endverbatim %}

+
observedState.pscConnections[].projectID +

string

+

{% verbatim %}Output only. The consumer project_id where the forwarding rule is created from.{% endverbatim %}

+
observedState.pscConnections[].pscConnectionID +

string

+

{% verbatim %}Output only. The PSC connection id of the forwarding rule connected to the service attachment.{% endverbatim %}

+
observedState.sizeGb +

integer

+

{% verbatim %}Output only. Redis memory size in GB for the entire cluster rounded up to the next integer.{% endverbatim %}

+
observedState.state +

string

+

{% verbatim %}Output only. The current state of this cluster. Can be CREATING, READY, UPDATING, DELETING and SUSPENDED{% endverbatim %}

+
observedState.stateInfo +

object

+

{% verbatim %}Output only. Additional information about the current state of the cluster.{% endverbatim %}

+
observedState.stateInfo.updateInfo +

object

+

{% verbatim %}Describes ongoing update on the cluster when cluster state is UPDATING.{% endverbatim %}

+
observedState.stateInfo.updateInfo.targetReplicaCount +

integer

+

{% verbatim %}Target number of replica nodes per shard.{% endverbatim %}

+
observedState.stateInfo.updateInfo.targetShardCount +

integer

+

{% verbatim %}Target number of shards for redis cluster{% endverbatim %}

+
observedState.uid +

string

+

{% verbatim %}Output only. System assigned, unique identifier for the cluster.{% endverbatim %}

+
+ +## Sample YAML(s) + + +Note: If you have any trouble with instantiating the resource, refer to Troubleshoot Config Connector. + +{% endblock %} \ No newline at end of file diff --git a/scripts/generate-google3-docs/resource-reference/templates/redis_rediscluster.tmpl b/scripts/generate-google3-docs/resource-reference/templates/redis_rediscluster.tmpl new file mode 100644 index 0000000000..3c823419be --- /dev/null +++ b/scripts/generate-google3-docs/resource-reference/templates/redis_rediscluster.tmpl @@ -0,0 +1,54 @@ +{{template "headercomment.tmpl" .}} + +{% extends "config-connector/_base.html" %} + +{% block page_title %}{{ .Kind}}{% endblock %} +{% block body %} +{{template "alphadisclaimer.tmpl" .}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{{template "iamsupport.tmpl" .}} + + + + + +
PropertyValue
{{"{{gcp_name_short}}"}} Service NameCloud Memorystore for Redis
{{"{{gcp_name_short}}"}} Service Documentation/memorystore/docs/redis/
{{"{{gcp_name_short}}"}} REST Resource Namev1.projects.locations.instances
{{"{{gcp_name_short}}"}} REST Resource Documentation/memorystore/docs/redis/reference/rest/v1/projects.locations.instances
{{"{{product_name_short}}"}} Resource Short Names{{ .ShortNames}}
{{"{{product_name_short}}"}} Service Nameredis.googleapis.com
{{"{{product_name_short}}"}} Resource Fully Qualified Name{{ .FullyQualifiedName}}
{{"{{product_name_short}}"}} Default Average Reconcile Interval In Seconds{{ .DefaultReconcileInterval}}
+ +{{template "resource.tmpl" .}} +{{template "endnote.tmpl" .}} +{% endblock %} \ No newline at end of file From 6e56b1e567cfbeba7dfdbcf6283936d8bc6df973 Mon Sep 17 00:00:00 2001 From: Anh Le Date: Thu, 10 Oct 2024 21:48:27 +0000 Subject: [PATCH 2/3] Update and fix test --- .../servicemappings/networkconnectivity.yaml | 22 +- pkg/resourceskeleton/uri/uri.go | 3 + pkg/test/resourcefixture/sets.go | 2 + ...ated_object_redisclustersimple.golden.yaml | 50 - .../rediscluster/redisclustersimple/_http.log | 1255 ----------------- .../redisclustersimple/dependencies.yaml | 51 - .../redisclustersimple/update.yaml | 27 - ...rated_object_basicrediscluster.golden.yaml | 4 +- ...erated_object_fullrediscluster.golden.yaml | 4 +- 9 files changed, 22 insertions(+), 1396 deletions(-) rename pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/create.yaml => config/servicemappings/networkconnectivity.yaml (59%) delete mode 100644 pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/_generated_object_redisclustersimple.golden.yaml delete mode 100644 pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/_http.log delete mode 100644 pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/dependencies.yaml delete mode 100644 pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/update.yaml diff --git a/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/create.yaml b/config/servicemappings/networkconnectivity.yaml similarity index 59% rename from pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/create.yaml rename to config/servicemappings/networkconnectivity.yaml index 81a3bdccb6..2bea2e84c8 100644 --- a/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/create.yaml +++ b/config/servicemappings/networkconnectivity.yaml @@ -12,16 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: redis.cnrm.cloud.google.com/v1alpha1 -kind: RedisCluster +apiVersion: core.cnrm.cloud.google.com/v1alpha1 +kind: ServiceMapping metadata: - name: rediscluster-${uniqueId} + name: networkconnectivity.cnrm.cloud.google.com + namespace: cnrm-system spec: - location: us-central1 - projectRef: - external: ${projectId} - shardCount: 3 - replicaCount: 1 - pscConfigs: - - networkRef: - name: network-${uniqueId} + name: NetworkConnectivity + version: v1alpha1 + serviceHostName: networkconnectivity.googleapis.com + resources: + - name: google_network_connectivity_service_connection_policy + kind: NetworkConnectivityServiceConnectionPolicy + direct: true \ No newline at end of file diff --git a/pkg/resourceskeleton/uri/uri.go b/pkg/resourceskeleton/uri/uri.go index ff38578366..c74b6439ce 100644 --- a/pkg/resourceskeleton/uri/uri.go +++ b/pkg/resourceskeleton/uri/uri.go @@ -43,6 +43,9 @@ func matchResourceNameToRC(uriPath string, sm *v1alpha1.ServiceMapping) (*v1alph func matchResourceNameToRCGeneral(uriPath string, sm *v1alpha1.ServiceMapping) (*v1alpha1.ResourceConfig, error) { for _, rc := range sm.Spec.Resources { + if rc.Direct { + continue + } if !*rc.IDTemplateCanBeUsedToMatchResourceName { continue } diff --git a/pkg/test/resourcefixture/sets.go b/pkg/test/resourcefixture/sets.go index e326405d72..e2f7ef763c 100644 --- a/pkg/test/resourcefixture/sets.go +++ b/pkg/test/resourcefixture/sets.go @@ -89,6 +89,8 @@ func addResourceConfig(t *testing.T, smLoader *servicemappingloader.ServiceMappi func IsPureDirectResource(gk schema.GroupKind) bool { pureDirectResources := []string{ "CloudBuildWorkerPool", + "RedisCluster", + "NetworkConnectivityServiceConnectionPolicy", "DataformRepository", } return slices.Contains(pureDirectResources, gk.Kind) diff --git a/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/_generated_object_redisclustersimple.golden.yaml b/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/_generated_object_redisclustersimple.golden.yaml deleted file mode 100644 index f46f7f57c0..0000000000 --- a/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/_generated_object_redisclustersimple.golden.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: redis.cnrm.cloud.google.com/v1alpha1 -kind: RedisCluster -metadata: - finalizers: - - cnrm.cloud.google.com/finalizer - - cnrm.cloud.google.com/deletion-defender - generation: 2 - labels: - cnrm-test: "true" - name: rediscluster-${uniqueId} - namespace: ${uniqueId} -spec: - location: us-central1 - projectRef: - external: ${projectId} - pscConfigs: - - networkRef: - name: ${networkID} - replicaCount: 2 - shardCount: 3 -status: - conditions: - - lastTransitionTime: "1970-01-01T00:00:00Z" - message: The resource is up to date - reason: UpToDate - status: "True" - type: Ready - observedGeneration: 2 - observedState: - createTime: "1970-01-01T00:00:00Z" - discoveryEndpoints: - - address: 10.128.0.3 - port: 6379 - pscConfig: - network: projects/${projectId}/global/networks/${networkID} - preciseSizeGb: 39 - pscConnections: - - address: 10.128.0.2 - forwardingRule: https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/forwardingRules/${forwardingRuleID} - network: projects/${projectId}/global/networks/${networkID} - projectID: ${projectId} - pscConnectionID: ${pscConnectionID} - - address: 10.128.0.3 - forwardingRule: https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/forwardingRules/${forwardingRuleID} - network: projects/${projectId}/global/networks/${networkID} - projectID: ${projectId} - pscConnectionID: ${pscConnectionID} - sizeGb: 39 - state: ACTIVE - uid: 0123456789abcdef diff --git a/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/_http.log b/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/_http.log deleted file mode 100644 index e4f6fdfc6d..0000000000 --- a/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/_http.log +++ /dev/null @@ -1,1255 +0,0 @@ -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}?alt=json -Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -404 Not Found -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "error": { - "code": 404, - "errors": [ - { - "domain": "global", - "message": "The resource 'projects/${projectId}/global/networks/network-${uniqueId}' was not found", - "reason": "notFound" - } - ], - "message": "The resource 'projects/${projectId}/global/networks/network-${uniqueId}' was not found" - } -} - ---- - -POST https://compute.googleapis.com/compute/v1/projects/${projectId}/global/networks?alt=json -Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -{ - "autoCreateSubnetworks": false, - "description": "Test network for the project", - "name": "network-${uniqueId}", - "networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL" -} - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "id": "000000000000000000000", - "insertTime": "2024-04-01T12:34:56.123456Z", - "kind": "compute#operation", - "name": "${operationID}", - "operationType": "insert", - "progress": 0, - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", - "startTime": "2024-04-01T12:34:56.123456Z", - "status": "RUNNING", - "targetId": "${networkID}", - "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/network-${uniqueId}", - "user": "user@example.com" -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "endTime": "2024-04-01T12:34:56.123456Z", - "id": "000000000000000000000", - "insertTime": "2024-04-01T12:34:56.123456Z", - "kind": "compute#operation", - "name": "${operationID}", - "operationType": "insert", - "progress": 100, - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", - "startTime": "2024-04-01T12:34:56.123456Z", - "status": "DONE", - "targetId": "${networkID}", - "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/network-${uniqueId}", - "user": "user@example.com" -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}?alt=json -Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "autoCreateSubnetworks": false, - "creationTimestamp": "2024-04-01T12:34:56.123456Z", - "description": "Test network for the project", - "id": "000000000000000000000", - "kind": "compute#network", - "name": "network-${uniqueId}", - "networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL", - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/network-${uniqueId}", - "selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}" -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/${subnetworkID}?alt=json -Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -404 Not Found -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "error": { - "code": 404, - "errors": [ - { - "domain": "global", - "message": "The resource 'projects/${projectId}/regions/us-central1/subnetworks/subnet-${uniqueId}' was not found", - "reason": "notFound" - } - ], - "message": "The resource 'projects/${projectId}/regions/us-central1/subnetworks/subnet-${uniqueId}' was not found" - } -} - ---- - -POST https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks?alt=json -Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -{ - "ipCidrRange": "10.128.0.0/20", - "logConfig": { - "enable": false - }, - "name": "subnet-${uniqueId}", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "region": "projects/${projectId}/global/regions/us-central1" -} - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "id": "000000000000000000000", - "insertTime": "2024-04-01T12:34:56.123456Z", - "kind": "compute#operation", - "name": "${operationID}", - "operationType": "insert", - "progress": 0, - "region": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1", - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/operations/${operationID}", - "startTime": "2024-04-01T12:34:56.123456Z", - "status": "RUNNING", - "targetId": "${subnetworkNumber}", - "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/subnet-${uniqueId}", - "user": "user@example.com" -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "endTime": "2024-04-01T12:34:56.123456Z", - "id": "000000000000000000000", - "insertTime": "2024-04-01T12:34:56.123456Z", - "kind": "compute#operation", - "name": "${operationID}", - "operationType": "insert", - "progress": 100, - "region": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1", - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/operations/${operationID}", - "startTime": "2024-04-01T12:34:56.123456Z", - "status": "DONE", - "targetId": "${subnetworkNumber}", - "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/subnet-${uniqueId}", - "user": "user@example.com" -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/${subnetworkID}?alt=json -Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "creationTimestamp": "2024-04-01T12:34:56.123456Z", - "enableFlowLogs": false, - "fingerprint": "abcdef0123A=", - "gatewayAddress": "10.2.0.1", - "id": "000000000000000000000", - "ipCidrRange": "10.128.0.0/20", - "kind": "compute#subnetwork", - "logConfig": { - "enable": false - }, - "name": "subnet-${uniqueId}", - "network": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/network-${uniqueId}", - "privateIpGoogleAccess": false, - "privateIpv6GoogleAccess": "DISABLE_GOOGLE_ACCESS", - "purpose": "PRIVATE", - "region": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1", - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/subnet-${uniqueId}", - "stackType": "IPV4_ONLY" -} - ---- - -GET https://networkconnectivity.googleapis.com/v1/projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}?alt=json&prettyPrint=false -User-Agent: kcc/controller-manager - -404 Not Found -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "error": { - "code": 404, - "message": "Resource 'projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}' was not found", - "status": "NOT_FOUND" - } -} - ---- - -POST https://networkconnectivity.googleapis.com/v1/projects/${projectId}/locations/us-central1/serviceConnectionPolicies?alt=json&prettyPrint=false&serviceConnectionPolicyId=serviceconnectionpolicy-${uniqueId} -Content-Type: application/json -User-Agent: kcc/controller-manager - -{ - "description": "Service Connection Policy for redis", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "pscConfig": { - "subnetworks": [ - "projects/${projectId}/regions/us-central1/subnetworks/subnet-${uniqueId}" - ] - }, - "serviceClass": "gcp-memorystore-redis" -} - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "metadata": { - "@type": "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "target": "projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}", - "verb": "create" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}" -} - ---- - -GET https://networkconnectivity.googleapis.com/v1/projects/${projectId}/locations/us-central1/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "done": true, - "metadata": { - "@type": "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "endTime": "2024-04-01T12:34:56.123456Z", - "target": "projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}", - "verb": "create" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}", - "response": { - "@type": "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy", - "createTime": "2024-04-01T12:34:56.123456Z", - "etag": "abcdef0123A=", - "name": "projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}", - "updateTime": "2024-04-01T12:34:56.123456Z" - } -} - ---- - -GET https://networkconnectivity.googleapis.com/v1/projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}?alt=json&prettyPrint=false -User-Agent: kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "createTime": "2024-04-01T12:34:56.123456Z", - "description": "Service Connection Policy for redis", - "etag": "abcdef0123A=", - "infrastructure": "PSC", - "name": "projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "pscConfig": { - "subnetworks": [ - "projects/${projectId}/regions/us-central1/subnetworks/subnet-${uniqueId}" - ] - }, - "serviceClass": "gcp-memorystore-redis", - "updateTime": "2024-04-01T12:34:56.123456Z" -} - ---- - -PATCH https://networkconnectivity.googleapis.com/v1/projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}?alt=json&prettyPrint=false -Content-Type: application/json -User-Agent: kcc/controller-manager - -{ - "description": "Service Connection Policy for redis", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "pscConfig": { - "subnetworks": [ - "projects/${projectId}/regions/us-central1/subnetworks/subnet-${uniqueId}" - ] - }, - "serviceClass": "gcp-memorystore-redis" -} - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "metadata": { - "@type": "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "target": "projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}", - "verb": "update" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}" -} - ---- - -GET https://networkconnectivity.googleapis.com/v1/projects/${projectId}/locations/us-central1/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "done": true, - "metadata": { - "@type": "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "endTime": "2024-04-01T12:34:56.123456Z", - "target": "projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}", - "verb": "update" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}", - "response": { - "@type": "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy", - "createTime": "2024-04-01T12:34:56.123456Z", - "etag": "abcdef0123A=", - "name": "projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}", - "updateTime": "2024-04-01T12:34:56.123456Z" - } -} - ---- - -GET https://networkconnectivity.googleapis.com/v1/projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}?alt=json&prettyPrint=false -User-Agent: kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "createTime": "2024-04-01T12:34:56.123456Z", - "description": "Service Connection Policy for redis", - "etag": "abcdef0123A=", - "infrastructure": "PSC", - "name": "projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "pscConfig": { - "subnetworks": [ - "projects/${projectId}/regions/us-central1/subnetworks/subnet-${uniqueId}" - ] - }, - "serviceClass": "gcp-memorystore-redis", - "updateTime": "2024-04-01T12:34:56.123456Z" -} - ---- - -GET https://redis.googleapis.com/v1/projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}?%24alt=json%3Benum-encoding%3Dint -Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Fclusters%2Frediscluster-${uniqueId} - -404 Not Found -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "error": { - "code": 404, - "message": "Resource 'projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}' was not found", - "status": "NOT_FOUND" - } -} - ---- - -POST https://redis.googleapis.com/v1/projects/${projectId}/locations/us-central1/clusters?%24alt=json%3Benum-encoding%3Dint&clusterId=rediscluster-${uniqueId} -Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: parent=projects%2F${projectId}%2Flocations%2Fus-central1 - -{ - "persistenceConfig": { - "mode": 1 - }, - "pscConfigs": [ - { - "network": "projects/${projectId}/global/networks/network-${uniqueId}" - } - ], - "replicaCount": 1, - "shardCount": 3 -} - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "metadata": { - "@type": "type.googleapis.com/google.cloud.redis.cluster.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "target": "projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}", - "verb": "create" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}" -} - ---- - -GET https://redis.googleapis.com/v1/projects/${projectId}/locations/us-central1/operations/${operationID} -Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Foperations%2F${operationID} - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "done": true, - "metadata": { - "@type": "type.googleapis.com/google.cloud.redis.cluster.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "endTime": "2024-04-01T12:34:56.123456Z", - "target": "projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}", - "verb": "create" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}", - "response": { - "@type": "type.googleapis.com/google.cloud.redis.cluster.v1.Cluster", - "authorizationMode": "AUTH_MODE_DISABLED", - "createTime": "2024-04-01T12:34:56.123456Z", - "deletionProtectionEnabled": false, - "discoveryEndpoints": [ - { - "address": "10.128.0.3", - "port": 6379, - "pscConfig": { - "network": "projects/${projectId}/global/networks/network-${uniqueId}" - } - } - ], - "name": "projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}", - "nodeType": "REDIS_HIGHMEM_MEDIUM", - "persistenceConfig": { - "mode": "DISABLED" - }, - "preciseSizeGb": 39, - "pscConnections": [ - { - "address": "10.128.0.2", - "forwardingRule": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/forwardingRules/${forwardingRuleID}", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "projectId": "${projectId}", - "pscConnectionId": "${pscConnectionID}" - }, - { - "address": "10.128.0.3", - "forwardingRule": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/forwardingRules/${forwardingRuleID}", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "projectId": "${projectId}", - "pscConnectionId": "${pscConnectionID}" - } - ], - "replicaCount": 1, - "shardCount": 3, - "sizeGb": 39, - "state": "ACTIVE", - "transitEncryptionMode": "TRANSIT_ENCRYPTION_MODE_DISABLED", - "uid": "111111111111111111111", - "zoneDistributionConfig": { - "mode": "MULTI_ZONE" - } - } -} - ---- - -GET https://redis.googleapis.com/v1/projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}?%24alt=json%3Benum-encoding%3Dint -Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Fclusters%2Frediscluster-${uniqueId} - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "authorizationMode": 2, - "createTime": "2024-04-01T12:34:56.123456Z", - "deletionProtectionEnabled": false, - "discoveryEndpoints": [ - { - "address": "10.128.0.3", - "port": 6379, - "pscConfig": { - "network": "projects/${projectId}/global/networks/network-${uniqueId}" - } - } - ], - "name": "projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}", - "nodeType": 2, - "persistenceConfig": { - "mode": 1 - }, - "preciseSizeGb": 39, - "pscConnections": [ - { - "address": "10.128.0.2", - "forwardingRule": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/forwardingRules/${forwardingRuleID}", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "projectId": "${projectId}", - "pscConnectionId": "${pscConnectionID}" - }, - { - "address": "10.128.0.3", - "forwardingRule": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/forwardingRules/${forwardingRuleID}", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "projectId": "${projectId}", - "pscConnectionId": "${pscConnectionID}" - } - ], - "replicaCount": 1, - "shardCount": 3, - "sizeGb": 39, - "state": 2, - "transitEncryptionMode": 1, - "uid": "111111111111111111111", - "zoneDistributionConfig": { - "mode": 1 - } -} - ---- - -PATCH https://redis.googleapis.com/v1/projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}?%24alt=json%3Benum-encoding%3Dint&updateMask=replicaCount -Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: cluster.name=projects%2F${projectId}%2Flocations%2Fus-central1%2Fclusters%2Frediscluster-${uniqueId} - -{ - "name": "projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}", - "persistenceConfig": { - "mode": 1 - }, - "pscConfigs": [ - { - "network": "projects/${projectId}/global/networks/network-${uniqueId}" - } - ], - "replicaCount": 2, - "shardCount": 3 -} - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "metadata": { - "@type": "type.googleapis.com/google.cloud.redis.cluster.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "target": "projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}", - "verb": "update" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}" -} - ---- - -GET https://redis.googleapis.com/v1/projects/${projectId}/locations/us-central1/operations/${operationID} -Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Foperations%2F${operationID} - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "done": true, - "metadata": { - "@type": "type.googleapis.com/google.cloud.redis.cluster.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "endTime": "2024-04-01T12:34:56.123456Z", - "target": "projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}", - "verb": "update" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}", - "response": { - "@type": "type.googleapis.com/google.cloud.redis.cluster.v1.Cluster", - "authorizationMode": "AUTH_MODE_DISABLED", - "createTime": "2024-04-01T12:34:56.123456Z", - "deletionProtectionEnabled": false, - "discoveryEndpoints": [ - { - "address": "10.128.0.3", - "port": 6379, - "pscConfig": { - "network": "projects/${projectId}/global/networks/network-${uniqueId}" - } - } - ], - "name": "projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}", - "nodeType": "REDIS_HIGHMEM_MEDIUM", - "persistenceConfig": { - "mode": "DISABLED" - }, - "preciseSizeGb": 39, - "pscConnections": [ - { - "address": "10.128.0.2", - "forwardingRule": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/forwardingRules/${forwardingRuleID}", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "projectId": "${projectId}", - "pscConnectionId": "${pscConnectionID}" - }, - { - "address": "10.128.0.3", - "forwardingRule": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/forwardingRules/${forwardingRuleID}", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "projectId": "${projectId}", - "pscConnectionId": "${pscConnectionID}" - } - ], - "replicaCount": 2, - "shardCount": 3, - "sizeGb": 39, - "state": "ACTIVE", - "transitEncryptionMode": "TRANSIT_ENCRYPTION_MODE_DISABLED", - "uid": "111111111111111111111", - "zoneDistributionConfig": { - "mode": "MULTI_ZONE" - } - } -} - ---- - -GET https://redis.googleapis.com/v1/projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}?%24alt=json%3Benum-encoding%3Dint -Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Fclusters%2Frediscluster-${uniqueId} - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "authorizationMode": 2, - "createTime": "2024-04-01T12:34:56.123456Z", - "deletionProtectionEnabled": false, - "discoveryEndpoints": [ - { - "address": "10.128.0.3", - "port": 6379, - "pscConfig": { - "network": "projects/${projectId}/global/networks/network-${uniqueId}" - } - } - ], - "name": "projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}", - "nodeType": 2, - "persistenceConfig": { - "mode": 1 - }, - "preciseSizeGb": 39, - "pscConnections": [ - { - "address": "10.128.0.2", - "forwardingRule": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/forwardingRules/${forwardingRuleID}", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "projectId": "${projectId}", - "pscConnectionId": "${pscConnectionID}" - }, - { - "address": "10.128.0.3", - "forwardingRule": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/forwardingRules/${forwardingRuleID}", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "projectId": "${projectId}", - "pscConnectionId": "${pscConnectionID}" - } - ], - "replicaCount": 2, - "shardCount": 3, - "sizeGb": 39, - "state": 2, - "transitEncryptionMode": 1, - "uid": "111111111111111111111", - "zoneDistributionConfig": { - "mode": 1 - } -} - ---- - -DELETE https://redis.googleapis.com/v1/projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}?%24alt=json%3Benum-encoding%3Dint -Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Fclusters%2Frediscluster-${uniqueId} - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "metadata": { - "@type": "type.googleapis.com/google.cloud.redis.cluster.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "target": "projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}", - "verb": "delete" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}" -} - ---- - -GET https://redis.googleapis.com/v1/projects/${projectId}/locations/us-central1/operations/${operationID} -Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2Foperations%2F${operationID} - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "done": true, - "metadata": { - "@type": "type.googleapis.com/google.cloud.redis.cluster.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "endTime": "2024-04-01T12:34:56.123456Z", - "target": "projects/${projectId}/locations/us-central1/clusters/rediscluster-${uniqueId}", - "verb": "delete" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}", - "response": { - "@type": "type.googleapis.com/google.protobuf.Empty" - } -} - ---- - -GET https://networkconnectivity.googleapis.com/v1/projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}?alt=json&prettyPrint=false -User-Agent: kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "createTime": "2024-04-01T12:34:56.123456Z", - "description": "Service Connection Policy for redis", - "etag": "abcdef0123A=", - "infrastructure": "PSC", - "name": "projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}", - "network": "projects/${projectId}/global/networks/network-${uniqueId}", - "pscConfig": { - "subnetworks": [ - "projects/${projectId}/regions/us-central1/subnetworks/subnet-${uniqueId}" - ] - }, - "serviceClass": "gcp-memorystore-redis", - "updateTime": "2024-04-01T12:34:56.123456Z" -} - ---- - -DELETE https://networkconnectivity.googleapis.com/v1/projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}?alt=json&prettyPrint=false -User-Agent: kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "metadata": { - "@type": "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "target": "projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}", - "verb": "delete" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}" -} - ---- - -GET https://networkconnectivity.googleapis.com/v1/projects/${projectId}/locations/us-central1/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "done": true, - "metadata": { - "@type": "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata", - "apiVersion": "v1", - "createTime": "2024-04-01T12:34:56.123456Z", - "endTime": "2024-04-01T12:34:56.123456Z", - "target": "projects/${projectId}/locations/us-central1/serviceConnectionPolicies/serviceconnectionpolicy-${uniqueId}", - "verb": "delete" - }, - "name": "projects/${projectId}/locations/us-central1/operations/${operationID}", - "response": { - "@type": "type.googleapis.com/google.protobuf.Empty" - } -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/${subnetworkID}?alt=json -Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "creationTimestamp": "2024-04-01T12:34:56.123456Z", - "enableFlowLogs": false, - "fingerprint": "abcdef0123A=", - "gatewayAddress": "10.2.0.1", - "id": "000000000000000000000", - "ipCidrRange": "10.128.0.0/20", - "kind": "compute#subnetwork", - "logConfig": { - "enable": false - }, - "name": "subnet-${uniqueId}", - "network": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/network-${uniqueId}", - "privateIpGoogleAccess": false, - "privateIpv6GoogleAccess": "DISABLE_GOOGLE_ACCESS", - "purpose": "PRIVATE", - "region": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1", - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/subnet-${uniqueId}", - "stackType": "IPV4_ONLY" -} - ---- - -DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/${subnetworkID}?alt=json -Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "id": "000000000000000000000", - "insertTime": "2024-04-01T12:34:56.123456Z", - "kind": "compute#operation", - "name": "${operationID}", - "operationType": "delete", - "progress": 0, - "region": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1", - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/operations/${operationID}", - "startTime": "2024-04-01T12:34:56.123456Z", - "status": "RUNNING", - "targetId": "${subnetworkNumber}", - "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/subnet-${uniqueId}", - "user": "user@example.com" -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "endTime": "2024-04-01T12:34:56.123456Z", - "id": "000000000000000000000", - "insertTime": "2024-04-01T12:34:56.123456Z", - "kind": "compute#operation", - "name": "${operationID}", - "operationType": "delete", - "progress": 100, - "region": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1", - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/operations/${operationID}", - "startTime": "2024-04-01T12:34:56.123456Z", - "status": "DONE", - "targetId": "${subnetworkNumber}", - "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/subnetworks/subnet-${uniqueId}", - "user": "user@example.com" -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}?alt=json -Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "autoCreateSubnetworks": false, - "creationTimestamp": "2024-04-01T12:34:56.123456Z", - "description": "Test network for the project", - "id": "000000000000000000000", - "kind": "compute#network", - "name": "network-${uniqueId}", - "networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL", - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/network-${uniqueId}", - "selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}" -} - ---- - -DELETE https://compute.googleapis.com/compute/v1/projects/${projectId}/global/networks/${networkID}?alt=json -Content-Type: application/json -User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "id": "000000000000000000000", - "insertTime": "2024-04-01T12:34:56.123456Z", - "kind": "compute#operation", - "name": "${operationID}", - "operationType": "delete", - "progress": 0, - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", - "startTime": "2024-04-01T12:34:56.123456Z", - "status": "RUNNING", - "targetId": "${networkID}", - "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/network-${uniqueId}", - "user": "user@example.com" -} - ---- - -GET https://compute.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}?alt=json&prettyPrint=false -User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager - -200 OK -Cache-Control: private -Content-Type: application/json; charset=UTF-8 -Server: ESF -Vary: Origin -Vary: X-Origin -Vary: Referer -X-Content-Type-Options: nosniff -X-Frame-Options: SAMEORIGIN -X-Xss-Protection: 0 - -{ - "endTime": "2024-04-01T12:34:56.123456Z", - "id": "000000000000000000000", - "insertTime": "2024-04-01T12:34:56.123456Z", - "kind": "compute#operation", - "name": "${operationID}", - "operationType": "delete", - "progress": 100, - "selfLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/operations/${operationID}", - "startTime": "2024-04-01T12:34:56.123456Z", - "status": "DONE", - "targetId": "${networkID}", - "targetLink": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/networks/network-${uniqueId}", - "user": "user@example.com" -} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/dependencies.yaml deleted file mode 100644 index fc9dadcbaf..0000000000 --- a/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/dependencies.yaml +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: compute.cnrm.cloud.google.com/v1beta1 -kind: ComputeNetwork -metadata: - name: network-${uniqueId} -spec: - description: Test network for the project - autoCreateSubnetworks: false ---- -apiVersion: compute.cnrm.cloud.google.com/v1beta1 -kind: ComputeSubnetwork -metadata: - name: subnet-${uniqueId} -spec: - ipCidrRange: 10.128.0.0/20 - region: us-central1 - networkRef: - # TODO: Is delete broken here? - external: projects/${projectId}/global/networks/network-${uniqueId} - #name: network-${uniqueId} ---- -apiVersion: networkconnectivity.cnrm.cloud.google.com/v1alpha1 -kind: NetworkConnectivityServiceConnectionPolicy -metadata: - name: serviceconnectionpolicy-${uniqueId} - labels: - label-one: "value-one" -spec: - projectRef: - external: projects/${projectId} - location: us-central1 - serviceClass: "gcp-memorystore-redis" - description: "Service Connection Policy for redis" - networkRef: - name: network-${uniqueId} - pscConfig: - subnetworkRefs: - - name: subnet-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/update.yaml b/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/update.yaml deleted file mode 100644 index 2def94acaa..0000000000 --- a/pkg/test/resourcefixture/testdata/basic/redis/v1alpha1/rediscluster/redisclustersimple/update.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: redis.cnrm.cloud.google.com/v1alpha1 -kind: RedisCluster -metadata: - name: rediscluster-${uniqueId} -spec: - location: us-central1 - projectRef: - external: ${projectId} - shardCount: 3 - replicaCount: 2 - pscConfigs: - - networkRef: - name: network-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/basicrediscluster/_generated_object_basicrediscluster.golden.yaml b/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/basicrediscluster/_generated_object_basicrediscluster.golden.yaml index 36b09b1d90..d02360731a 100644 --- a/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/basicrediscluster/_generated_object_basicrediscluster.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/basicrediscluster/_generated_object_basicrediscluster.golden.yaml @@ -1,6 +1,8 @@ -apiVersion: redis.cnrm.cloud.google.com/v1alpha1 +apiVersion: redis.cnrm.cloud.google.com/v1beta1 kind: RedisCluster metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender diff --git a/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/fullrediscluster/_generated_object_fullrediscluster.golden.yaml b/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/fullrediscluster/_generated_object_fullrediscluster.golden.yaml index f410054906..1e02e3e891 100644 --- a/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/fullrediscluster/_generated_object_fullrediscluster.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/redis/v1beta1/fullrediscluster/_generated_object_fullrediscluster.golden.yaml @@ -1,6 +1,8 @@ -apiVersion: redis.cnrm.cloud.google.com/v1alpha1 +apiVersion: redis.cnrm.cloud.google.com/v1beta1 kind: RedisCluster metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender From 6e7a7699b42ff9f6caa9f9d94c9b38d7494120a3 Mon Sep 17 00:00:00 2001 From: Anh Le Date: Thu, 10 Oct 2024 23:31:42 +0000 Subject: [PATCH 3/3] Update serviceconnectionpolicybasic test --- .../_generated_object_serviceconnectionpolicybasic.golden.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/test/resourcefixture/testdata/basic/networkconnectivity/v1alpha1/serviceconnectionpolicy/serviceconnectionpolicybasic/_generated_object_serviceconnectionpolicybasic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/networkconnectivity/v1alpha1/serviceconnectionpolicy/serviceconnectionpolicybasic/_generated_object_serviceconnectionpolicybasic.golden.yaml index 45080d4aa2..d4a928318c 100644 --- a/pkg/test/resourcefixture/testdata/basic/networkconnectivity/v1alpha1/serviceconnectionpolicy/serviceconnectionpolicybasic/_generated_object_serviceconnectionpolicybasic.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/networkconnectivity/v1alpha1/serviceconnectionpolicy/serviceconnectionpolicybasic/_generated_object_serviceconnectionpolicybasic.golden.yaml @@ -1,6 +1,8 @@ apiVersion: networkconnectivity.cnrm.cloud.google.com/v1alpha1 kind: NetworkConnectivityServiceConnectionPolicy metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender