From 6e7ba2a4e9de3ea4c314e8203ba49a26425ec519 Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Tue, 5 Nov 2024 11:18:32 +0100 Subject: [PATCH 01/17] feat: BQCC uses SQLDatabaseRef --- .../v1alpha1/connection_types.go | 4 +- .../v1alpha1/zz_generated.deepcopy.go | 6 +- apis/refs/v1beta1/sqldatabaseref.go | 118 ++++++++++++++++++ apis/refs/v1beta1/sqlinstanceref.go | 33 +++++ ...queryconnection.cnrm.cloud.google.com.yaml | 33 ++++- .../connection_controller.go | 9 +- .../bigqueryconnection/connection_mapping.go | 14 ++- ...object_cloudsqlconnectionbasic.golden.yaml | 3 +- .../cloudsqlconnectionbasic/_http.log | 6 +- .../cloudsqlconnectionbasic/create.yaml | 3 +- 10 files changed, 210 insertions(+), 19 deletions(-) create mode 100644 apis/refs/v1beta1/sqldatabaseref.go diff --git a/apis/bigqueryconnection/v1alpha1/connection_types.go b/apis/bigqueryconnection/v1alpha1/connection_types.go index a71d606b04..31d0b7151b 100644 --- a/apis/bigqueryconnection/v1alpha1/connection_types.go +++ b/apis/bigqueryconnection/v1alpha1/connection_types.go @@ -144,9 +144,9 @@ type CloudSqlPropertiesSpec struct { // +required InstanceRef *refv1beta1.SQLInstanceRef `json:"instanceRef,omitempty"` - // Database name. + // Reference to the SQL Database. // +required - Database *string `json:"database,omitempty"` + DatabaseRef *refv1beta1.SQLDatabaseRef `json:"databaseRef,omitempty"` // Type of the Cloud SQL database. // +required diff --git a/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go b/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go index b3806139de..125b5b42f3 100644 --- a/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go +++ b/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go @@ -738,9 +738,9 @@ func (in *CloudSqlPropertiesSpec) DeepCopyInto(out *CloudSqlPropertiesSpec) { *out = new(v1beta1.SQLInstanceRef) **out = **in } - if in.Database != nil { - in, out := &in.Database, &out.Database - *out = new(string) + if in.DatabaseRef != nil { + in, out := &in.DatabaseRef, &out.DatabaseRef + *out = new(v1beta1.SQLDatabaseRef) **out = **in } if in.Type != nil { diff --git a/apis/refs/v1beta1/sqldatabaseref.go b/apis/refs/v1beta1/sqldatabaseref.go new file mode 100644 index 0000000000..504d3102f6 --- /dev/null +++ b/apis/refs/v1beta1/sqldatabaseref.go @@ -0,0 +1,118 @@ +// 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 ( + "context" + "fmt" + "strings" + + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type SQLDatabaseRef struct { + /* The SQL Database selfLink, when not managed by Config Connector. */ + External string `json:"external,omitempty"` + /* The `name` field of a `SQLDatabase` resource. */ + Name string `json:"name,omitempty"` + /* The `namespace` field of a `SQLDatabase` resource. */ + Namespace string `json:"namespace,omitempty"` +} + +type SQLDatabase struct { + ProjectID string + InstanceID string + DatabaseID string +} + +func (s *SQLDatabase) String() string { + return "projects/" + s.ProjectID + "/instances/" + s.InstanceID + "/databases/" + s.DatabaseID +} + +func ResolveSQLDatabaseRef(ctx context.Context, reader client.Reader, obj client.Object, ref *SQLDatabaseRef) (*SQLDatabase, error) { + if ref == nil { + return nil, nil + } + + if ref.Name == "" && ref.External == "" { + return nil, fmt.Errorf("must specify either name or external on databaseRef") + } + if ref.External != "" && ref.Name != "" { + return nil, fmt.Errorf("cannot specify both spec.databaseRef.name and spec.databaseRef.external") + } + + if ref.External != "" { + // External must be in form `projects//instances//databases/`. + // see https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/databases/get + tokens := strings.Split(ref.External, "/") + if len(tokens) == 6 && tokens[0] == "projects" && tokens[2] == "instances" && tokens[4] == "databases" { + return &SQLDatabase{ + ProjectID: tokens[1], + InstanceID: tokens[3], + DatabaseID: tokens[5], + }, nil + } + return nil, fmt.Errorf("format of SQLinstance external=%q was not known (use projects//instances//databases/)", ref.External) + } + + key := types.NamespacedName{ + Namespace: ref.Namespace, + Name: ref.Name, + } + if key.Namespace == "" { + key.Namespace = obj.GetNamespace() + } + + sqldatabase := &unstructured.Unstructured{} + sqldatabase.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "sql.cnrm.cloud.google.com", + Version: "v1beta1", + Kind: "SQLDatabase", + }) + if err := reader.Get(ctx, key, sqldatabase); err != nil { + if apierrors.IsNotFound(err) { + return nil, fmt.Errorf("referenced SQL databse %v not found", key) + } + return nil, fmt.Errorf("error reading referenced SQL databse %v: %w", key, err) + } + + resourceID, _, err := unstructured.NestedString(sqldatabase.Object, "spec", "resourceID") + if err != nil { + return nil, fmt.Errorf("reading spec.resourceID from Sql Database %s/%s: %w", sqldatabase.GetNamespace(), sqldatabase.GetName(), err) + } + if resourceID == "" { + resourceID = sqldatabase.GetName() + } + + projectID, err := ResolveProjectID(ctx, reader, sqldatabase) + if err != nil { + return nil, err + } + + instanceID, err := ResolveSQLInstanceID(ctx, reader, sqldatabase) + if err != nil { + return nil, err + } + + return &SQLDatabase{ + ProjectID: projectID, + InstanceID: instanceID, + DatabaseID: resourceID, + }, nil +} diff --git a/apis/refs/v1beta1/sqlinstanceref.go b/apis/refs/v1beta1/sqlinstanceref.go index be864d0994..dc5e354010 100644 --- a/apis/refs/v1beta1/sqlinstanceref.go +++ b/apis/refs/v1beta1/sqlinstanceref.go @@ -119,3 +119,36 @@ func ResolveSQLInstanceRef(ctx context.Context, reader client.Reader, obj client SQLInstanceName: resourceID, }, nil } + +func ResolveSQLInstanceID(ctx context.Context, reader client.Reader, obj *unstructured.Unstructured) (string, error) { + instanceRefExternal, _, _ := unstructured.NestedString(obj.Object, "spec", "instanceRef", "external") + if instanceRefExternal != "" { + instanceRef := &SQLInstanceRef{ + External: instanceRefExternal, + } + instance, err := ResolveSQLInstanceRef(ctx, reader, obj, instanceRef) + if err != nil { + return "", fmt.Errorf("cannot parse instanceRef.external %q in %v %v/%v: %w", instanceRefExternal, obj.GetKind(), obj.GetNamespace(), obj.GetName(), err) + } + return instance.SQLInstanceName, nil + } + + instanceRefName, _, _ := unstructured.NestedString(obj.Object, "spec", "instanceRef", "name") + if instanceRefName != "" { + namespace, _, _ := unstructured.NestedString(obj.Object, "spec", "instanceRef", "namespace") + instanceRef := &SQLInstanceRef{ + Name: instanceRefName, + Namespace: namespace, + } + if instanceRef.Namespace == "" { + instanceRef.Namespace = obj.GetNamespace() + } + instance, err := ResolveSQLInstanceRef(ctx, reader, obj, instanceRef) + if err != nil { + return "", fmt.Errorf("cannot parse instanceRef.name %q in %v %v/%v: %w", instanceRefName, obj.GetKind(), obj.GetNamespace(), obj.GetName(), err) + } + return instance.SQLInstanceName, nil + } + + return "", fmt.Errorf("cannot find instance id for %v %v/%v", obj.GetKind(), obj.GetNamespace(), obj.GetName()) +} diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_bigqueryconnectionconnections.bigqueryconnection.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_bigqueryconnectionconnections.bigqueryconnection.cnrm.cloud.google.com.yaml index 11536fbff5..4f4904b88d 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_bigqueryconnectionconnections.bigqueryconnection.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_bigqueryconnectionconnections.bigqueryconnection.cnrm.cloud.google.com.yaml @@ -117,9 +117,34 @@ spec: - name type: object type: object - database: - description: Database name. - type: string + databaseRef: + description: Reference to the SQL Database. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: The SQL Database selfLink, when not managed by + Config Connector. + type: string + name: + description: The `name` field of a `SQLDatabase` resource. + type: string + namespace: + description: The `namespace` field of a `SQLDatabase` resource. + type: string + type: object instanceRef: description: Reference to the Cloud SQL instance ID. oneOf: @@ -153,7 +178,7 @@ spec: type: string required: - credential - - database + - databaseRef - instanceRef - type type: object diff --git a/pkg/controller/direct/bigqueryconnection/connection_controller.go b/pkg/controller/direct/bigqueryconnection/connection_controller.go index d5fde8fc86..8e51c35a8c 100644 --- a/pkg/controller/direct/bigqueryconnection/connection_controller.go +++ b/pkg/controller/direct/bigqueryconnection/connection_controller.go @@ -96,7 +96,7 @@ func (m *model) AdapterForObject(ctx context.Context, reader client.Reader, u *u func (a *Adapter) normalizeReference(ctx context.Context) error { obj := a.desired - // Resolve SQLInstanceRef + // Resolve SQLInstanceRef and SQLDatabaseRef if obj.Spec.CloudSQLSpec != nil { sql := obj.Spec.CloudSQLSpec if sql.InstanceRef != nil { @@ -106,6 +106,13 @@ func (a *Adapter) normalizeReference(ctx context.Context) error { } sql.InstanceRef.External = instance.ConnectionName() } + if sql.DatabaseRef != nil { + database, err := refs.ResolveSQLDatabaseRef(ctx, a.reader, obj, sql.DatabaseRef) + if err != nil { + return err + } + sql.DatabaseRef.External = database.String() + } if sql.Credential != nil { if err := refsv1beta1secret.NormalizedSecret(ctx, sql.Credential.SecretRef, a.reader, a.namespace); err != nil { return err diff --git a/pkg/controller/direct/bigqueryconnection/connection_mapping.go b/pkg/controller/direct/bigqueryconnection/connection_mapping.go index 6204215c7a..a702a360f4 100644 --- a/pkg/controller/direct/bigqueryconnection/connection_mapping.go +++ b/pkg/controller/direct/bigqueryconnection/connection_mapping.go @@ -101,8 +101,6 @@ func CloudSqlPropertiesSpec_ToProto(mapCtx *direct.MapContext, in *krm.CloudSqlP return nil } out := &pb.CloudSqlProperties{} - // out.InstanceId = direct.ValueOf(in.InstanceID) - out.Database = direct.ValueOf(in.Database) out.Type = direct.Enum_ToProto[pb.CloudSqlProperties_DatabaseType](mapCtx, in.Type) out.Credential = CloudSqlCredential_ToProto(mapCtx, in.Credential) if in.InstanceRef != nil { @@ -111,6 +109,12 @@ func CloudSqlPropertiesSpec_ToProto(mapCtx *direct.MapContext, in *krm.CloudSqlP } out.InstanceId = in.InstanceRef.External } + if in.DatabaseRef != nil { + if in.DatabaseRef.External == "" { + mapCtx.Errorf("SQLInstance external reference was not pre-resolved") + } + out.Database = in.DatabaseRef.External + } return out } @@ -122,7 +126,9 @@ func CloudSqlPropertiesSpec_FromProto(mapCtx *direct.MapContext, in *pb.CloudSql out.InstanceRef = &refs.SQLInstanceRef{ External: in.InstanceId, } - out.Database = direct.LazyPtr(in.Database) + out.DatabaseRef = &refs.SQLDatabaseRef{ + External: in.Database, + } out.Type = direct.Enum_FromProto(mapCtx, in.GetType()) out.Credential = CloudSqlCredential_FromProto(mapCtx, in.GetCredential()) return out @@ -139,7 +145,7 @@ func CloudSpannerPropertiesSpec_ToProto(mapCtx *direct.MapContext, in *krm.Cloud out.DatabaseRole = direct.ValueOf(in.DatabaseRole) if in.DatabaseRef != nil { if in.DatabaseRef.External == "" { - mapCtx.Errorf("SQLInstance external reference was not pre-resolved") + mapCtx.Errorf("Spanner Instance external reference was not pre-resolved") } out.Database = in.DatabaseRef.External } diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_generated_object_cloudsqlconnectionbasic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_generated_object_cloudsqlconnectionbasic.golden.yaml index 3b6d7d20c0..acfa951965 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_generated_object_cloudsqlconnectionbasic.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_generated_object_cloudsqlconnectionbasic.golden.yaml @@ -16,7 +16,8 @@ spec: credential: secretRef: name: secret-${uniqueId} - database: sqldatabase-sample-${uniqueId} + databaseRef: + name: sqldatabase-sample-${uniqueId} instanceRef: name: sqlinstance-sample-${uniqueId} type: MYSQL diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_http.log b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_http.log index 93d4937b57..44abab562f 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_http.log @@ -1169,7 +1169,7 @@ x-goog-request-params: parent=projects%2F${projectId}%2Flocations%2Fus-central1 "password": "cGFzc3dvcmQ=", "username": "sqluser-${uniqueId}" }, - "database": "sqldatabase-sample-${uniqueId}", + "database": "projects/${projectId}/instances/sqlinstance-sample-${uniqueId}/databases/sqldatabase-sample-${uniqueId}", "instanceId": "${projectId}:us-central1:sqlinstance-sample-${uniqueId}", "type": 2 } @@ -1188,7 +1188,7 @@ X-Xss-Protection: 0 { "cloudSql": { - "database": "sqldatabase-sample-${uniqueId}", + "database": "projects/${projectId}/instances/sqlinstance-sample-${uniqueId}/databases/sqldatabase-sample-${uniqueId}", "instanceId": "${projectId}:us-central1:sqlinstance-sample-${uniqueId}", "serviceAccountId": "service-${projectNumber}@gcp-sa-bigqueryconnection.iam.gserviceaccount.com", "type": 2 @@ -1219,7 +1219,7 @@ X-Xss-Protection: 0 { "cloudSql": { - "database": "sqldatabase-sample-${uniqueId}", + "database": "projects/${projectId}/instances/sqlinstance-sample-${uniqueId}/databases/sqldatabase-sample-${uniqueId}", "instanceId": "${projectId}:us-central1:sqlinstance-sample-${uniqueId}", "serviceAccountId": "service-${projectNumber}@gcp-sa-bigqueryconnection.iam.gserviceaccount.com", "type": 2 diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/create.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/create.yaml index b6887e317a..ee9d56f42d 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/create.yaml @@ -24,7 +24,8 @@ spec: instanceRef: # external: "projects/${projectId}/locations/us-central1/instances/sqlinstance-sample-001" name: sqlinstance-sample-${uniqueId} - database: sqldatabase-sample-${uniqueId} + databaseRef: + name: sqldatabase-sample-${uniqueId} type: "MYSQL" credential: secretRef: From eb10bf5e1b2cf2a1b4c5893ae9a2cf2e4c81008c Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Tue, 5 Nov 2024 11:28:41 +0100 Subject: [PATCH 02/17] chore: make ready-pr for v1alpha1 API --- .../v1alpha1/bigqueryconnectionconnection_types.go | 4 ++-- .../apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/bigqueryconnectionconnection_types.go b/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/bigqueryconnectionconnection_types.go index aba87c0057..271b8ad943 100644 --- a/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/bigqueryconnectionconnection_types.go +++ b/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/bigqueryconnectionconnection_types.go @@ -61,8 +61,8 @@ type ConnectionCloudSQL struct { /* Cloud SQL credential. */ Credential ConnectionCredential `json:"credential"` - /* Database name. */ - Database string `json:"database"` + /* Reference to the SQL Database. */ + DatabaseRef v1alpha1.ResourceRef `json:"databaseRef"` /* Reference to the Cloud SQL instance ID. */ InstanceRef v1alpha1.ResourceRef `json:"instanceRef"` diff --git a/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go b/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go index d74493c2a7..bbd5cef937 100644 --- a/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go @@ -366,6 +366,7 @@ func (in *ConnectionCloudResourceStatus) DeepCopy() *ConnectionCloudResourceStat func (in *ConnectionCloudSQL) DeepCopyInto(out *ConnectionCloudSQL) { *out = *in in.Credential.DeepCopyInto(&out.Credential) + out.DatabaseRef = in.DatabaseRef out.InstanceRef = in.InstanceRef return } From 6b6baa9e7113b7f5aa95ba05973e9ef0725c7ed2 Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Tue, 5 Nov 2024 16:09:58 +0100 Subject: [PATCH 03/17] add v1beta1 API for bigqueryconnection --- .../{v1alpha1 => v1beta1}/connection_reference.go | 2 +- .../{v1alpha1 => v1beta1}/connection_types.go | 2 +- apis/bigqueryconnection/{v1alpha1 => v1beta1}/doc.go | 2 +- .../{v1alpha1 => v1beta1}/groupversion_info.go | 4 ++-- .../{v1alpha1 => v1beta1}/types.generated.go | 2 +- .../{v1alpha1 => v1beta1}/zz_generated.deepcopy.go | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename apis/bigqueryconnection/{v1alpha1 => v1beta1}/connection_reference.go (99%) rename apis/bigqueryconnection/{v1alpha1 => v1beta1}/connection_types.go (99%) rename apis/bigqueryconnection/{v1alpha1 => v1beta1}/doc.go (97%) rename apis/bigqueryconnection/{v1alpha1 => v1beta1}/groupversion_info.go (95%) rename apis/bigqueryconnection/{v1alpha1 => v1beta1}/types.generated.go (99%) rename apis/bigqueryconnection/{v1alpha1 => v1beta1}/zz_generated.deepcopy.go (99%) diff --git a/apis/bigqueryconnection/v1alpha1/connection_reference.go b/apis/bigqueryconnection/v1beta1/connection_reference.go similarity index 99% rename from apis/bigqueryconnection/v1alpha1/connection_reference.go rename to apis/bigqueryconnection/v1beta1/connection_reference.go index 70baaf1d9a..d6f7512a2e 100644 --- a/apis/bigqueryconnection/v1alpha1/connection_reference.go +++ b/apis/bigqueryconnection/v1beta1/connection_reference.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1alpha1 +package v1beta1 import ( "context" diff --git a/apis/bigqueryconnection/v1alpha1/connection_types.go b/apis/bigqueryconnection/v1beta1/connection_types.go similarity index 99% rename from apis/bigqueryconnection/v1alpha1/connection_types.go rename to apis/bigqueryconnection/v1beta1/connection_types.go index 31d0b7151b..4b038a116e 100644 --- a/apis/bigqueryconnection/v1alpha1/connection_types.go +++ b/apis/bigqueryconnection/v1beta1/connection_types.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1alpha1 +package v1beta1 import ( refv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" diff --git a/apis/bigqueryconnection/v1alpha1/doc.go b/apis/bigqueryconnection/v1beta1/doc.go similarity index 97% rename from apis/bigqueryconnection/v1alpha1/doc.go rename to apis/bigqueryconnection/v1beta1/doc.go index dbb5ea9d8e..48d13e84e7 100644 --- a/apis/bigqueryconnection/v1alpha1/doc.go +++ b/apis/bigqueryconnection/v1beta1/doc.go @@ -13,4 +13,4 @@ // limitations under the License. // +kcc:proto=google.cloud.bigquery.connection.v1 -package v1alpha1 +package v1beta1 diff --git a/apis/bigqueryconnection/v1alpha1/groupversion_info.go b/apis/bigqueryconnection/v1beta1/groupversion_info.go similarity index 95% rename from apis/bigqueryconnection/v1alpha1/groupversion_info.go rename to apis/bigqueryconnection/v1beta1/groupversion_info.go index e4cd7a75f6..705b67cac5 100644 --- a/apis/bigqueryconnection/v1alpha1/groupversion_info.go +++ b/apis/bigqueryconnection/v1beta1/groupversion_info.go @@ -14,7 +14,7 @@ // +kubebuilder:object:generate=true // +groupName=bigqueryconnection.cnrm.cloud.google.com -package v1alpha1 +package v1beta1 import ( "k8s.io/apimachinery/pkg/runtime/schema" @@ -23,7 +23,7 @@ import ( var ( // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "bigqueryconnection.cnrm.cloud.google.com", Version: "v1alpha1"} + GroupVersion = schema.GroupVersion{Group: "bigqueryconnection.cnrm.cloud.google.com", Version: "v1beta1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} diff --git a/apis/bigqueryconnection/v1alpha1/types.generated.go b/apis/bigqueryconnection/v1beta1/types.generated.go similarity index 99% rename from apis/bigqueryconnection/v1alpha1/types.generated.go rename to apis/bigqueryconnection/v1beta1/types.generated.go index a1fe20d015..7f222da9f1 100644 --- a/apis/bigqueryconnection/v1alpha1/types.generated.go +++ b/apis/bigqueryconnection/v1beta1/types.generated.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1alpha1 +package v1beta1 // +kcc:proto=google.cloud.bigquery.connection.v1.AwsAccessRole type AwsAccessRole struct { diff --git a/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go b/apis/bigqueryconnection/v1beta1/zz_generated.deepcopy.go similarity index 99% rename from apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go rename to apis/bigqueryconnection/v1beta1/zz_generated.deepcopy.go index 125b5b42f3..51cf4aa7d0 100644 --- a/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go +++ b/apis/bigqueryconnection/v1beta1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ // Code generated by controller-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" From 1949971ceb400d4bb320db94e1f1c15b263488a8 Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Tue, 5 Nov 2024 16:11:02 +0100 Subject: [PATCH 04/17] add back v1alpha1 API for bigqueryconnection The files were removed in the previous commit as a result of executing "git mv". Restore the files by checking them out from master HEAD. "git checkout master -- apis/bigqueryconnection/v1alpha1" --- .../v1alpha1/connection_reference.go | 156 +++ .../v1alpha1/connection_types.go | 343 ++++++ apis/bigqueryconnection/v1alpha1/doc.go | 16 + .../v1alpha1/groupversion_info.go | 33 + .../v1alpha1/types.generated.go | 266 ++++ .../v1alpha1/zz_generated.deepcopy.go | 1071 +++++++++++++++++ 6 files changed, 1885 insertions(+) create mode 100644 apis/bigqueryconnection/v1alpha1/connection_reference.go create mode 100644 apis/bigqueryconnection/v1alpha1/connection_types.go create mode 100644 apis/bigqueryconnection/v1alpha1/doc.go create mode 100644 apis/bigqueryconnection/v1alpha1/groupversion_info.go create mode 100644 apis/bigqueryconnection/v1alpha1/types.generated.go create mode 100644 apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go diff --git a/apis/bigqueryconnection/v1alpha1/connection_reference.go b/apis/bigqueryconnection/v1alpha1/connection_reference.go new file mode 100644 index 0000000000..70baaf1d9a --- /dev/null +++ b/apis/bigqueryconnection/v1alpha1/connection_reference.go @@ -0,0 +1,156 @@ +// 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 v1alpha1 + +import ( + "context" + "fmt" + "strings" + + refsv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/k8s" + "github.com/google/uuid" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +// NewBigQueryConnectionConnectionRef builds a BigQueryConnectionConnectionRef from the ConfigConnector BigQueryConnectionConnection object. +func NewBigQueryConnectionConnectionRef(ctx context.Context, reader client.Reader, obj *BigQueryConnectionConnection) (*BigQueryConnectionConnectionRef, error) { + id := &BigQueryConnectionConnectionRef{} + + projectRef, err := refsv1beta1.ResolveProject(ctx, reader, obj, obj.Spec.ProjectRef) + if err != nil { + return nil, err + } + projectID := projectRef.ProjectID + if projectID == "" { + return nil, fmt.Errorf("cannot resolve project") + } + // Get location + location := obj.Spec.Location + + // Get desired service-generated ID from spec + desiredServiceID := direct.ValueOf(obj.Spec.ResourceID) + if desiredServiceID != "" { + if _, err := uuid.Parse(desiredServiceID); err != nil { + return nil, fmt.Errorf("spec.resourceID should be in a UUID format, got %s ", desiredServiceID) + } + } + + // Get externalReference + externalRef := direct.ValueOf(obj.Status.ExternalRef) + if externalRef != "" { + tokens := strings.Split(externalRef, "/") + + if len(tokens) != 6 || tokens[0] != "projects" || tokens[2] != "locations" || tokens[4] != "connections" { + return nil, fmt.Errorf("externalRef should be projects//locations//connections/, got %s", externalRef) + } + id.parent = "projects/" + tokens[1] + "/locations/" + tokens[3] + + // Validate spec parent and resourceID field if the resource is already reconcilied with a GCP Connection resource. + if tokens[1] != projectID { + return nil, fmt.Errorf("spec.projectRef changed, expect %s, got %s", + tokens[1], projectID) + } + if tokens[3] != location { + return nil, fmt.Errorf("spec.location changed, expect %s, got %s", + tokens[3], location) + } + if desiredServiceID != "" && tokens[5] != desiredServiceID { + // Service generated ID shall not be reset in the same BigQueryConnectionConnection. + // TODO: what if multiple BigQueryConnectionConnection points to the same GCP Connection? + return nil, fmt.Errorf("cannot reset `spec.resourceID` to %s, since it has already acquired the Connection %s", + desiredServiceID, tokens[5]) + } + id.External = externalRef + return id, nil + } + id.parent = "projects/" + projectID + "/locations/" + location + if desiredServiceID != "" { + id.External = id.parent + "/connections/" + desiredServiceID + } + return id, nil +} + +var _ refsv1beta1.ExternalNormalizer = &BigQueryConnectionConnectionRef{} + +// BigQueryConnectionConnectionRef defines the resource reference to BigQueryConnectionConnection, which "External" field +// holds the GCP identifier for the KRM object. +type BigQueryConnectionConnectionRef struct { + // A reference to an externally managed BigQueryConnectionConnection resource. + // Should be in the format `projects//locations//connections/`. + External string `json:"external,omitempty"` + + // The `name` of a `BigQueryConnectionConnection` resource. + Name string `json:"name,omitempty"` + // The `namespace` of a `BigQueryConnectionConnection` resource. + Namespace string `json:"namespace,omitempty"` + + parent string +} + +func (r *BigQueryConnectionConnectionRef) Parent() (string, error) { + if r.parent != "" { + return r.parent, nil + } + if r.External != "" { + r.External = strings.TrimPrefix(r.External, "/") + tokens := strings.Split(r.External, "/") + if len(tokens) != 6 || tokens[0] != "projects" || tokens[2] != "locations" || tokens[4] != "connections" { + return "", fmt.Errorf("format of BigQueryConnectionConnection external=%q was not known (use projects//locations//connections/)", r.External) + } + r.parent = "projects/" + tokens[1] + "/locations/" + tokens[3] + return r.parent, nil + } + return "", fmt.Errorf("BigQueryConnectionConnectionRef not normalized to External form or not created from `New()`") +} + +// NormalizedExternal provision the "External" value. +// If the "External" comes from the ConfigConnector object, it has to acquire or reconcile with the GCP resource already. +func (r *BigQueryConnectionConnectionRef) NormalizedExternal(ctx context.Context, reader client.Reader, othernamespace string) (string, error) { + if r.External != "" && r.Name != "" { + return "", fmt.Errorf("cannot specify both name and external on %s reference", BigQueryConnectionConnectionGVK.Kind) + } + if r.External != "" { + r.External = strings.TrimPrefix(r.External, "/") + tokens := strings.Split(r.External, "/") + if len(tokens) != 6 || tokens[0] != "projects" || tokens[2] != "locations" || tokens[4] != "connections" { + return "", fmt.Errorf("format of BigQueryConnectionConnection external=%q was not known (use projects//locations//connections/)", r.External) + } + return r.External, nil + } + key := types.NamespacedName{Name: r.Name, Namespace: r.Namespace} + u := &unstructured.Unstructured{} + u.SetGroupVersionKind(BigQueryConnectionConnectionGVK) + if err := reader.Get(ctx, key, u); err != nil { + if apierrors.IsNotFound(err) { + return "", k8s.NewReferenceNotFoundError(u.GroupVersionKind(), key) + } + return "", fmt.Errorf("reading referenced %s %s: %w", BigQueryConnectionConnectionGVK, key, err) + } + // Get external from status.externalRef. This is the most trustworthy place. + actualExternalRef, _, err := unstructured.NestedString(u.Object, "status", "externalRef") + if err != nil { + return "", fmt.Errorf("reading status.externalRef: %w", err) + } + if actualExternalRef == "" { + return "", fmt.Errorf("BigQueryConnectionConnection is not ready yet.") + } + r.External = actualExternalRef + return r.External, nil +} diff --git a/apis/bigqueryconnection/v1alpha1/connection_types.go b/apis/bigqueryconnection/v1alpha1/connection_types.go new file mode 100644 index 0000000000..a71d606b04 --- /dev/null +++ b/apis/bigqueryconnection/v1alpha1/connection_types.go @@ -0,0 +1,343 @@ +// 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 v1alpha1 + +import ( + refv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" + refsv1beta1secret "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1/secret" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/apis/k8s/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +var BigQueryConnectionConnectionGVK = GroupVersion.WithKind("BigQueryConnectionConnection") + +type Parent struct { + // +required + ProjectRef *refv1beta1.ProjectRef `json:"projectRef"` + + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Location field is immutable" + // Immutable. + // +required + Location string `json:"location"` +} + +// BigQueryConnectionConnectionSpec defines the desired state to connect BigQuery to external resources +// +kcc:proto=google.cloud.bigquery.connection.v1.Connection +type BigQueryConnectionConnectionSpec struct { + Parent `json:",inline"` + + // The BigQuery ConnectionID. This is a server-generated ID in the UUID format. + // If not provided, ConfigConnector will create a new Connection and store the UUID in `status.serviceGeneratedID` field. + ResourceID *string `json:"resourceID,omitempty"` + + // User provided display name for the connection. + FriendlyName *string `json:"friendlyName,omitempty"` + + // User provided description. + Description *string `json:"description,omitempty"` + + // Cloud SQL properties. + CloudSQLSpec *CloudSqlPropertiesSpec `json:"cloudSQL,omitempty"` + + // Amazon Web Services (AWS) properties. + AwsSpec *AwsPropertiesSpec `json:"aws,omitempty"` + + // Azure properties. + AzureSpec *AzurePropertiesSpec `json:"azure,omitempty"` + + /* NOTYET + // Optional. Salesforce DataCloud properties. This field is intended for + // use only by Salesforce partner projects. This field contains properties + // for your Salesforce DataCloud connection. + SalesforceDataCloud *SalesforceDataCloudProperties `json:"salesforceDataCloud,omitempty"` + */ + + // Use Cloud Resource properties. + CloudResourceSpec *CloudResourcePropertiesSpec `json:"cloudResource,omitempty"` + + // Cloud Spanner properties. + CloudSpannerSpec *CloudSpannerPropertiesSpec `json:"cloudSpanner,omitempty"` + + // Spark properties. + SparkSpec *SparkPropertiesSpec `json:"spark,omitempty"` +} + +// BigQueryConnectionConnectionStatus defines the config connector machine state of BigQueryConnectionConnection +type BigQueryConnectionConnectionStatus 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. + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + + // A unique specifier for the BigQueryConnectionConnection resource in GCP. + ExternalRef *string `json:"externalRef,omitempty"` + + // ObservedState is the state of the resource as most recently observed in GCP. + ObservedState *BigQueryConnectionConnectionObservedState `json:"observedState,omitempty"` +} + +// BigQueryConnectionConnectionSpec defines the desired state of BigQueryConnectionConnection +// +kcc:proto=google.cloud.bigquery.connection.v1.Connection +type BigQueryConnectionConnectionObservedState struct { + Aws *AwsPropertiesStatus `json:"aws,omitempty"` + + Azure *AzurePropertiesStatus `json:"azure,omitempty"` + + CloudResource *CloudResourcePropertiesStatus `json:"cloudResource,omitempty"` + + CloudSQL *CloudSqlPropertiesStatus `json:"cloudSQL,omitempty"` + + Spark *SparkPropertiesStatus `json:"spark,omitempty"` + + // The display name for the connection. + FriendlyName *string `json:"friendlyName,omitempty"` + + // The description for the connection. + Description *string `json:"description,omitempty"` + + // Output only. True, if credential is configured for this connection. + HasCredential *bool `json:"hasCredential,omitempty"` +} + +type AwsPropertiesSpec struct { + // Authentication using Google owned service account to assume into + // customer's AWS IAM Role. + // +required + AccessRole *AwsAccessRoleSpec `json:"accessRole,omitempty"` +} + +type AwsAccessRoleSpec struct { + // The user’s AWS IAM Role that trusts the Google-owned AWS IAM user + // Connection. + // +required + IamRoleID *string `json:"iamRoleID,omitempty"` +} + +type AzurePropertiesSpec struct { + // The id of customer's directory that host the data. + // +required + CustomerTenantID *string `json:"customerTenantID,omitempty"` + + // The client ID of the user's Azure Active Directory Application used for a + // federated connection. + FederatedApplicationClientID *string `json:"federatedApplicationClientID,omitempty"` +} + +type CloudResourcePropertiesSpec struct{} + +type CloudSqlPropertiesSpec struct { + // Reference to the Cloud SQL instance ID. + // +required + InstanceRef *refv1beta1.SQLInstanceRef `json:"instanceRef,omitempty"` + + // Database name. + // +required + Database *string `json:"database,omitempty"` + + // Type of the Cloud SQL database. + // +required + Type *string `json:"type,omitempty"` + + // Cloud SQL credential. + // +required + Credential *CloudSqlCredential `json:"credential,omitempty"` +} + +type CloudSpannerPropertiesSpec struct { + // Reference to a spanner database ID. + // +required + DatabaseRef *refv1beta1.SpannerDatabaseRef `json:"databaseRef,omitempty"` + + // If parallelism should be used when reading from Cloud Spanner + UseParallelism *bool `json:"useParallelism,omitempty"` + + // Allows setting max parallelism per query when executing on Spanner + // independent compute resources. If unspecified, default values of + // parallelism are chosen that are dependent on the Cloud Spanner instance + // configuration. + // + // REQUIRES: `use_parallelism` must be set. + // REQUIRES: Either `use_data_boost` or `use_serverless_analytics` must be + // set. + MaxParallelism *int32 `json:"maxParallelism,omitempty"` + + // If the serverless analytics service should be used to read data from Cloud + // Spanner. + // Note: `use_parallelism` must be set when using serverless analytics. + UseServerlessAnalytics *bool `json:"useServerlessAnalytics,omitempty"` + + // If set, the request will be executed via Spanner independent compute + // resources. + // REQUIRES: `use_parallelism` must be set. + // + // NOTE: `use_serverless_analytics` will be deprecated. Prefer + // `use_data_boost` over `use_serverless_analytics`. + UseDataBoost *bool `json:"useDataBoost,omitempty"` + + // Optional. Cloud Spanner database role for fine-grained access control. + // The Cloud Spanner admin should have provisioned the database role with + // appropriate permissions, such as `SELECT` and `INSERT`. Other users should + // only use roles provided by their Cloud Spanner admins. + // + // For more details, see [About fine-grained access control] + // (https://cloud.google.com/spanner/docs/fgac-about). + // + // REQUIRES: The database role name must start with a letter, and can only + // contain letters, numbers, and underscores. + DatabaseRole *string `json:"databaseRole,omitempty"` +} + +type SparkPropertiesSpec struct { + // Optional. Dataproc Metastore Service configuration for the connection. + MetastoreService *MetastoreServiceConfigSpec `json:"metastoreService,omitempty"` + + // Optional. Spark History Server configuration for the connection. + SparkHistoryServer *SparkHistoryServerConfigSpec `json:"sparkHistoryServer,omitempty"` +} + +type MetastoreServiceConfigSpec struct { + // Optional. Resource name of an existing Dataproc Metastore service. + // + // Example: + // + // * `projects/[project_id]/locations/[region]/services/[service_id]` + MetastoreServiceRef *refv1beta1.MetastoreServiceRef `json:"metastoreServiceRef,omitempty"` +} + +type SparkHistoryServerConfigSpec struct { + // Optional. Resource name of an existing Dataproc Cluster to act as a Spark + // History Server for the connection. + // + // Example: + // + // * `projects/[project_id]/regions/[region]/clusters/[cluster_name]` + DataprocClusterRef *refv1beta1.DataprocClusterRef `json:"dataprocClusterRef,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.AwsProperties +type AwsPropertiesStatus struct { + AccessRole *AwsAccessRoleStatus `json:"accessRole,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.AwsAccessRole +type AwsAccessRoleStatus struct { + // A unique Google-owned and Google-generated identity for the Connection. + // This identity will be used to access the user's AWS IAM Role. + Identity *string `json:"identity,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.AzureProperties +type AzurePropertiesStatus struct { + // The name of the Azure Active Directory Application. + Application *string `json:"application,omitempty"` + + // The client id of the Azure Active Directory Application. + ClientID *string `json:"clientID,omitempty"` + + // The object id of the Azure Active Directory Application. + ObjectID *string `json:"objectID,omitempty"` + + // The URL user will be redirected to after granting consent during connection + // setup. + RedirectUri *string `json:"redirectUri,omitempty"` + + // A unique Google-owned and Google-generated identity for the + // Connection. This identity will be used to access the user's Azure Active + // Directory Application. + Identity *string `json:"identity,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.CloudSqlProperties +type CloudSqlPropertiesStatus struct { + // The account ID of the service used for the purpose of this connection. + // + // When the connection is used in the context of an operation in + // BigQuery, this service account will serve as the identity being used for + // connecting to the CloudSQL instance specified in this connection. + ServiceAccountID *string `json:"serviceAccountID,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.CloudResourceProperties +type CloudResourcePropertiesStatus struct { + // The account ID of the service created for the purpose of this + // connection. + // + // The service account does not have any permissions associated with it + // when it is created. After creation, customers delegate permissions + // to the service account. When the connection is used in the context of an + // operation in BigQuery, the service account will be used to connect to the + // desired resources in GCP. + // + // The account ID is in the form of: + // @gcp-sa-bigquery-cloudresource.iam.gserviceaccount.com + ServiceAccountID *string `json:"serviceAccountID,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.SparkProperties +type SparkPropertiesStatus struct { + // The account ID of the service created for the purpose of this + // connection. + // + // The service account does not have any permissions associated with it when + // it is created. After creation, customers delegate permissions to the + // service account. When the connection is used in the context of a stored + // procedure for Apache Spark in BigQuery, the service account is used to + // connect to the desired resources in Google Cloud. + // + // The account ID is in the form of: + // bqcx--@gcp-sa-bigquery-consp.iam.gserviceaccount.com + ServiceAccountID *string `json:"serviceAccountID,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.CloudSqlCredential +type CloudSqlCredential struct { + // The Kubernetes Secret object that stores the "username" and "password" information. + // The Secret type has to be `kubernetes.io/basic-auth`. + SecretRef *refsv1beta1secret.BasicAuthSecretRef `json:"secretRef,omitempty"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:resource:categories=gcp,shortName=gcpbigqueryconnectionconnection;gcpbigqueryconnectionconnections +// +kubebuilder:subresource:status +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true";"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'" +// +kubebuilder:printcolumn:name="Status Age",JSONPath=".status.conditions[?(@.type=='Ready')].lastTransitionTime",type="date",description="The last transition time for the value in 'Status'" + +// BigQueryConnectionConnection is the Schema for the BigQueryConnectionConnection API +// +k8s:openapi-gen=true +type BigQueryConnectionConnection struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec BigQueryConnectionConnectionSpec `json:"spec,omitempty"` + Status BigQueryConnectionConnectionStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// BigQueryConnectionConnectionList contains a list of BigQueryConnectionConnection +type BigQueryConnectionConnectionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []BigQueryConnectionConnection `json:"items"` +} + +func init() { + SchemeBuilder.Register(&BigQueryConnectionConnection{}, &BigQueryConnectionConnectionList{}) +} diff --git a/apis/bigqueryconnection/v1alpha1/doc.go b/apis/bigqueryconnection/v1alpha1/doc.go new file mode 100644 index 0000000000..dbb5ea9d8e --- /dev/null +++ b/apis/bigqueryconnection/v1alpha1/doc.go @@ -0,0 +1,16 @@ +// 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. + +// +kcc:proto=google.cloud.bigquery.connection.v1 +package v1alpha1 diff --git a/apis/bigqueryconnection/v1alpha1/groupversion_info.go b/apis/bigqueryconnection/v1alpha1/groupversion_info.go new file mode 100644 index 0000000000..e4cd7a75f6 --- /dev/null +++ b/apis/bigqueryconnection/v1alpha1/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=bigqueryconnection.cnrm.cloud.google.com +package v1alpha1 + +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: "bigqueryconnection.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/bigqueryconnection/v1alpha1/types.generated.go b/apis/bigqueryconnection/v1alpha1/types.generated.go new file mode 100644 index 0000000000..a1fe20d015 --- /dev/null +++ b/apis/bigqueryconnection/v1alpha1/types.generated.go @@ -0,0 +1,266 @@ +// 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 v1alpha1 + +// +kcc:proto=google.cloud.bigquery.connection.v1.AwsAccessRole +type AwsAccessRole struct { + // The user’s AWS IAM Role that trusts the Google-owned AWS IAM user + // Connection. + IamRoleID *string `json:"iamRoleID,omitempty"` + + // A unique Google-owned and Google-generated identity for the Connection. + // This identity will be used to access the user's AWS IAM Role. + Identity *string `json:"identity,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.AwsCrossAccountRole +type AwsCrossAccountRole struct { + // The user’s AWS IAM Role that trusts the Google-owned AWS IAM user + // Connection. + IamRoleID *string `json:"iamRoleID,omitempty"` + + // Output only. Google-owned AWS IAM User for a Connection. + IamUserID *string `json:"iamUserID,omitempty"` + + // Output only. A Google-generated id for representing Connection’s identity + // in AWS. External Id is also used for preventing the Confused Deputy + // Problem. See + // https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html + ExternalID *string `json:"externalID,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.AwsProperties +type AwsProperties struct { + // Authentication using Google owned AWS IAM user's access key to assume + // into customer's AWS IAM Role. + // Deprecated, do not use. + CrossAccountRole *AwsCrossAccountRole `json:"crossAccountRole,omitempty"` + + // Authentication using Google owned service account to assume into + // customer's AWS IAM Role. + AccessRole *AwsAccessRole `json:"accessRole,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.AzureProperties +type AzureProperties struct { + // Output only. The name of the Azure Active Directory Application. + Application *string `json:"application,omitempty"` + + // Output only. The client id of the Azure Active Directory Application. + ClientID *string `json:"clientID,omitempty"` + + // Output only. The object id of the Azure Active Directory Application. + ObjectID *string `json:"objectID,omitempty"` + + // The id of customer's directory that host the data. + CustomerTenantID *string `json:"customerTenantID,omitempty"` + + // The URL user will be redirected to after granting consent during connection + // setup. + RedirectUri *string `json:"redirectUri,omitempty"` + + // The client ID of the user's Azure Active Directory Application used for a + // federated connection. + FederatedApplicationClientID *string `json:"federatedApplicationClientID,omitempty"` + + // Output only. A unique Google-owned and Google-generated identity for the + // Connection. This identity will be used to access the user's Azure Active + // Directory Application. + Identity *string `json:"identity,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.CloudResourceProperties +type CloudResourceProperties struct { + // Output only. The account ID of the service created for the purpose of this + // connection. + // + // The service account does not have any permissions associated with it + // when it is created. After creation, customers delegate permissions + // to the service account. When the connection is used in the context of an + // operation in BigQuery, the service account will be used to connect to the + // desired resources in GCP. + // + // The account ID is in the form of: + // @gcp-sa-bigquery-cloudresource.iam.gserviceaccount.com + ServiceAccountID *string `json:"serviceAccountID,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.CloudSpannerProperties +type CloudSpannerProperties struct { + // Cloud Spanner database in the form `project/instance/database' + Database *string `json:"database,omitempty"` + + // If parallelism should be used when reading from Cloud Spanner + UseParallelism *bool `json:"useParallelism,omitempty"` + + // Allows setting max parallelism per query when executing on Spanner + // independent compute resources. If unspecified, default values of + // parallelism are chosen that are dependent on the Cloud Spanner instance + // configuration. + // + // REQUIRES: `use_parallelism` must be set. + // REQUIRES: Either `use_data_boost` or `use_serverless_analytics` must be + // set. + MaxParallelism *int32 `json:"maxParallelism,omitempty"` + + // If the serverless analytics service should be used to read data from Cloud + // Spanner. + // Note: `use_parallelism` must be set when using serverless analytics. + UseServerlessAnalytics *bool `json:"useServerlessAnalytics,omitempty"` + + // If set, the request will be executed via Spanner independent compute + // resources. + // REQUIRES: `use_parallelism` must be set. + // + // NOTE: `use_serverless_analytics` will be deprecated. Prefer + // `use_data_boost` over `use_serverless_analytics`. + UseDataBoost *bool `json:"useDataBoost,omitempty"` + + // Optional. Cloud Spanner database role for fine-grained access control. + // The Cloud Spanner admin should have provisioned the database role with + // appropriate permissions, such as `SELECT` and `INSERT`. Other users should + // only use roles provided by their Cloud Spanner admins. + // + // For more details, see [About fine-grained access control] + // (https://cloud.google.com/spanner/docs/fgac-about). + // + // REQUIRES: The database role name must start with a letter, and can only + // contain letters, numbers, and underscores. + DatabaseRole *string `json:"databaseRole,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.CloudSqlProperties +type CloudSqlProperties struct { + // Cloud SQL instance ID in the form `project:location:instance`. + InstanceID *string `json:"instanceID,omitempty"` + + // Database name. + Database *string `json:"database,omitempty"` + + // Type of the Cloud SQL database. + Type *string `json:"type,omitempty"` + + // Input only. Cloud SQL credential. + Credential *CloudSqlCredential `json:"credential,omitempty"` + + // Output only. The account ID of the service used for the purpose of this + // connection. + // + // When the connection is used in the context of an operation in + // BigQuery, this service account will serve as the identity being used for + // connecting to the CloudSQL instance specified in this connection. + ServiceAccountID *string `json:"serviceAccountID,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.Connection +type Connection struct { + // The resource name of the connection in the form of: + // `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + Name *string `json:"name,omitempty"` + + // User provided display name for the connection. + FriendlyName *string `json:"friendlyName,omitempty"` + + // User provided description. + Description *string `json:"description,omitempty"` + + // Cloud SQL properties. + CloudSql *CloudSqlProperties `json:"cloudSql,omitempty"` + + // Amazon Web Services (AWS) properties. + Aws *AwsProperties `json:"aws,omitempty"` + + // Azure properties. + Azure *AzureProperties `json:"azure,omitempty"` + + // Cloud Spanner properties. + CloudSpanner *CloudSpannerProperties `json:"cloudSpanner,omitempty"` + + // Cloud Resource properties. + CloudResource *CloudResourceProperties `json:"cloudResource,omitempty"` + + // Spark properties. + Spark *SparkProperties `json:"spark,omitempty"` + + // Optional. Salesforce DataCloud properties. This field is intended for + // use only by Salesforce partner projects. This field contains properties + // for your Salesforce DataCloud connection. + SalesforceDataCloud *SalesforceDataCloudProperties `json:"salesforceDataCloud,omitempty"` + + // Output only. The creation timestamp of the connection. + CreationTime *int64 `json:"creationTime,omitempty"` + + // Output only. The last update timestamp of the connection. + LastModifiedTime *int64 `json:"lastModifiedTime,omitempty"` + + // Output only. True, if credential is configured for this connection. + HasCredential *bool `json:"hasCredential,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.MetastoreServiceConfig +type MetastoreServiceConfig struct { + // Optional. Resource name of an existing Dataproc Metastore service. + // + // Example: + // + // * `projects/[project_id]/locations/[region]/services/[service_id]` + MetastoreService *string `json:"metastoreService,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.SalesforceDataCloudProperties +type SalesforceDataCloudProperties struct { + // The URL to the user's Salesforce DataCloud instance. + InstanceUri *string `json:"instanceUri,omitempty"` + + // Output only. A unique Google-owned and Google-generated service account + // identity for the connection. + Identity *string `json:"identity,omitempty"` + + // The ID of the user's Salesforce tenant. + TenantID *string `json:"tenantID,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.SparkHistoryServerConfig +type SparkHistoryServerConfig struct { + // Optional. Resource name of an existing Dataproc Cluster to act as a Spark + // History Server for the connection. + // + // Example: + // + // * `projects/[project_id]/regions/[region]/clusters/[cluster_name]` + DataprocCluster *string `json:"dataprocCluster,omitempty"` +} + +// +kcc:proto=google.cloud.bigquery.connection.v1.SparkProperties +type SparkProperties struct { + // Output only. The account ID of the service created for the purpose of this + // connection. + // + // The service account does not have any permissions associated with it when + // it is created. After creation, customers delegate permissions to the + // service account. When the connection is used in the context of a stored + // procedure for Apache Spark in BigQuery, the service account is used to + // connect to the desired resources in Google Cloud. + // + // The account ID is in the form of: + // bqcx--@gcp-sa-bigquery-consp.iam.gserviceaccount.com + ServiceAccountID *string `json:"serviceAccountID,omitempty"` + + // Optional. Dataproc Metastore Service configuration for the connection. + MetastoreServiceConfig *MetastoreServiceConfig `json:"metastoreServiceConfig,omitempty"` + + // Optional. Spark History Server configuration for the connection. + SparkHistoryServerConfig *SparkHistoryServerConfig `json:"sparkHistoryServerConfig,omitempty"` +} diff --git a/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go b/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..b3806139de --- /dev/null +++ b/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,1071 @@ +//go:build !ignore_autogenerated + +// 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. + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" + "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1/secret" + k8sv1alpha1 "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 *AwsAccessRole) DeepCopyInto(out *AwsAccessRole) { + *out = *in + if in.IamRoleID != nil { + in, out := &in.IamRoleID, &out.IamRoleID + *out = new(string) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AwsAccessRole. +func (in *AwsAccessRole) DeepCopy() *AwsAccessRole { + if in == nil { + return nil + } + out := new(AwsAccessRole) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AwsAccessRoleSpec) DeepCopyInto(out *AwsAccessRoleSpec) { + *out = *in + if in.IamRoleID != nil { + in, out := &in.IamRoleID, &out.IamRoleID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AwsAccessRoleSpec. +func (in *AwsAccessRoleSpec) DeepCopy() *AwsAccessRoleSpec { + if in == nil { + return nil + } + out := new(AwsAccessRoleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AwsAccessRoleStatus) DeepCopyInto(out *AwsAccessRoleStatus) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AwsAccessRoleStatus. +func (in *AwsAccessRoleStatus) DeepCopy() *AwsAccessRoleStatus { + if in == nil { + return nil + } + out := new(AwsAccessRoleStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AwsCrossAccountRole) DeepCopyInto(out *AwsCrossAccountRole) { + *out = *in + if in.IamRoleID != nil { + in, out := &in.IamRoleID, &out.IamRoleID + *out = new(string) + **out = **in + } + if in.IamUserID != nil { + in, out := &in.IamUserID, &out.IamUserID + *out = new(string) + **out = **in + } + if in.ExternalID != nil { + in, out := &in.ExternalID, &out.ExternalID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AwsCrossAccountRole. +func (in *AwsCrossAccountRole) DeepCopy() *AwsCrossAccountRole { + if in == nil { + return nil + } + out := new(AwsCrossAccountRole) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AwsProperties) DeepCopyInto(out *AwsProperties) { + *out = *in + if in.CrossAccountRole != nil { + in, out := &in.CrossAccountRole, &out.CrossAccountRole + *out = new(AwsCrossAccountRole) + (*in).DeepCopyInto(*out) + } + if in.AccessRole != nil { + in, out := &in.AccessRole, &out.AccessRole + *out = new(AwsAccessRole) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AwsProperties. +func (in *AwsProperties) DeepCopy() *AwsProperties { + if in == nil { + return nil + } + out := new(AwsProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AwsPropertiesSpec) DeepCopyInto(out *AwsPropertiesSpec) { + *out = *in + if in.AccessRole != nil { + in, out := &in.AccessRole, &out.AccessRole + *out = new(AwsAccessRoleSpec) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AwsPropertiesSpec. +func (in *AwsPropertiesSpec) DeepCopy() *AwsPropertiesSpec { + if in == nil { + return nil + } + out := new(AwsPropertiesSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AwsPropertiesStatus) DeepCopyInto(out *AwsPropertiesStatus) { + *out = *in + if in.AccessRole != nil { + in, out := &in.AccessRole, &out.AccessRole + *out = new(AwsAccessRoleStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AwsPropertiesStatus. +func (in *AwsPropertiesStatus) DeepCopy() *AwsPropertiesStatus { + if in == nil { + return nil + } + out := new(AwsPropertiesStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureProperties) DeepCopyInto(out *AzureProperties) { + *out = *in + if in.Application != nil { + in, out := &in.Application, &out.Application + *out = new(string) + **out = **in + } + if in.ClientID != nil { + in, out := &in.ClientID, &out.ClientID + *out = new(string) + **out = **in + } + if in.ObjectID != nil { + in, out := &in.ObjectID, &out.ObjectID + *out = new(string) + **out = **in + } + if in.CustomerTenantID != nil { + in, out := &in.CustomerTenantID, &out.CustomerTenantID + *out = new(string) + **out = **in + } + if in.RedirectUri != nil { + in, out := &in.RedirectUri, &out.RedirectUri + *out = new(string) + **out = **in + } + if in.FederatedApplicationClientID != nil { + in, out := &in.FederatedApplicationClientID, &out.FederatedApplicationClientID + *out = new(string) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureProperties. +func (in *AzureProperties) DeepCopy() *AzureProperties { + if in == nil { + return nil + } + out := new(AzureProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzurePropertiesSpec) DeepCopyInto(out *AzurePropertiesSpec) { + *out = *in + if in.CustomerTenantID != nil { + in, out := &in.CustomerTenantID, &out.CustomerTenantID + *out = new(string) + **out = **in + } + if in.FederatedApplicationClientID != nil { + in, out := &in.FederatedApplicationClientID, &out.FederatedApplicationClientID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzurePropertiesSpec. +func (in *AzurePropertiesSpec) DeepCopy() *AzurePropertiesSpec { + if in == nil { + return nil + } + out := new(AzurePropertiesSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzurePropertiesStatus) DeepCopyInto(out *AzurePropertiesStatus) { + *out = *in + if in.Application != nil { + in, out := &in.Application, &out.Application + *out = new(string) + **out = **in + } + if in.ClientID != nil { + in, out := &in.ClientID, &out.ClientID + *out = new(string) + **out = **in + } + if in.ObjectID != nil { + in, out := &in.ObjectID, &out.ObjectID + *out = new(string) + **out = **in + } + if in.RedirectUri != nil { + in, out := &in.RedirectUri, &out.RedirectUri + *out = new(string) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzurePropertiesStatus. +func (in *AzurePropertiesStatus) DeepCopy() *AzurePropertiesStatus { + if in == nil { + return nil + } + out := new(AzurePropertiesStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BigQueryConnectionConnection) DeepCopyInto(out *BigQueryConnectionConnection) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BigQueryConnectionConnection. +func (in *BigQueryConnectionConnection) DeepCopy() *BigQueryConnectionConnection { + if in == nil { + return nil + } + out := new(BigQueryConnectionConnection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BigQueryConnectionConnection) 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 *BigQueryConnectionConnectionList) DeepCopyInto(out *BigQueryConnectionConnectionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]BigQueryConnectionConnection, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BigQueryConnectionConnectionList. +func (in *BigQueryConnectionConnectionList) DeepCopy() *BigQueryConnectionConnectionList { + if in == nil { + return nil + } + out := new(BigQueryConnectionConnectionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BigQueryConnectionConnectionList) 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 *BigQueryConnectionConnectionObservedState) DeepCopyInto(out *BigQueryConnectionConnectionObservedState) { + *out = *in + if in.Aws != nil { + in, out := &in.Aws, &out.Aws + *out = new(AwsPropertiesStatus) + (*in).DeepCopyInto(*out) + } + if in.Azure != nil { + in, out := &in.Azure, &out.Azure + *out = new(AzurePropertiesStatus) + (*in).DeepCopyInto(*out) + } + if in.CloudResource != nil { + in, out := &in.CloudResource, &out.CloudResource + *out = new(CloudResourcePropertiesStatus) + (*in).DeepCopyInto(*out) + } + if in.CloudSQL != nil { + in, out := &in.CloudSQL, &out.CloudSQL + *out = new(CloudSqlPropertiesStatus) + (*in).DeepCopyInto(*out) + } + if in.Spark != nil { + in, out := &in.Spark, &out.Spark + *out = new(SparkPropertiesStatus) + (*in).DeepCopyInto(*out) + } + if in.FriendlyName != nil { + in, out := &in.FriendlyName, &out.FriendlyName + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.HasCredential != nil { + in, out := &in.HasCredential, &out.HasCredential + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BigQueryConnectionConnectionObservedState. +func (in *BigQueryConnectionConnectionObservedState) DeepCopy() *BigQueryConnectionConnectionObservedState { + if in == nil { + return nil + } + out := new(BigQueryConnectionConnectionObservedState) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BigQueryConnectionConnectionRef) DeepCopyInto(out *BigQueryConnectionConnectionRef) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BigQueryConnectionConnectionRef. +func (in *BigQueryConnectionConnectionRef) DeepCopy() *BigQueryConnectionConnectionRef { + if in == nil { + return nil + } + out := new(BigQueryConnectionConnectionRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BigQueryConnectionConnectionSpec) DeepCopyInto(out *BigQueryConnectionConnectionSpec) { + *out = *in + in.Parent.DeepCopyInto(&out.Parent) + if in.ResourceID != nil { + in, out := &in.ResourceID, &out.ResourceID + *out = new(string) + **out = **in + } + if in.FriendlyName != nil { + in, out := &in.FriendlyName, &out.FriendlyName + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.CloudSQLSpec != nil { + in, out := &in.CloudSQLSpec, &out.CloudSQLSpec + *out = new(CloudSqlPropertiesSpec) + (*in).DeepCopyInto(*out) + } + if in.AwsSpec != nil { + in, out := &in.AwsSpec, &out.AwsSpec + *out = new(AwsPropertiesSpec) + (*in).DeepCopyInto(*out) + } + if in.AzureSpec != nil { + in, out := &in.AzureSpec, &out.AzureSpec + *out = new(AzurePropertiesSpec) + (*in).DeepCopyInto(*out) + } + if in.CloudResourceSpec != nil { + in, out := &in.CloudResourceSpec, &out.CloudResourceSpec + *out = new(CloudResourcePropertiesSpec) + **out = **in + } + if in.CloudSpannerSpec != nil { + in, out := &in.CloudSpannerSpec, &out.CloudSpannerSpec + *out = new(CloudSpannerPropertiesSpec) + (*in).DeepCopyInto(*out) + } + if in.SparkSpec != nil { + in, out := &in.SparkSpec, &out.SparkSpec + *out = new(SparkPropertiesSpec) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BigQueryConnectionConnectionSpec. +func (in *BigQueryConnectionConnectionSpec) DeepCopy() *BigQueryConnectionConnectionSpec { + if in == nil { + return nil + } + out := new(BigQueryConnectionConnectionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BigQueryConnectionConnectionStatus) DeepCopyInto(out *BigQueryConnectionConnectionStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]k8sv1alpha1.Condition, len(*in)) + copy(*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(BigQueryConnectionConnectionObservedState) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BigQueryConnectionConnectionStatus. +func (in *BigQueryConnectionConnectionStatus) DeepCopy() *BigQueryConnectionConnectionStatus { + if in == nil { + return nil + } + out := new(BigQueryConnectionConnectionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudResourceProperties) DeepCopyInto(out *CloudResourceProperties) { + *out = *in + if in.ServiceAccountID != nil { + in, out := &in.ServiceAccountID, &out.ServiceAccountID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudResourceProperties. +func (in *CloudResourceProperties) DeepCopy() *CloudResourceProperties { + if in == nil { + return nil + } + out := new(CloudResourceProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudResourcePropertiesSpec) DeepCopyInto(out *CloudResourcePropertiesSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudResourcePropertiesSpec. +func (in *CloudResourcePropertiesSpec) DeepCopy() *CloudResourcePropertiesSpec { + if in == nil { + return nil + } + out := new(CloudResourcePropertiesSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudResourcePropertiesStatus) DeepCopyInto(out *CloudResourcePropertiesStatus) { + *out = *in + if in.ServiceAccountID != nil { + in, out := &in.ServiceAccountID, &out.ServiceAccountID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudResourcePropertiesStatus. +func (in *CloudResourcePropertiesStatus) DeepCopy() *CloudResourcePropertiesStatus { + if in == nil { + return nil + } + out := new(CloudResourcePropertiesStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudSpannerProperties) DeepCopyInto(out *CloudSpannerProperties) { + *out = *in + if in.Database != nil { + in, out := &in.Database, &out.Database + *out = new(string) + **out = **in + } + if in.UseParallelism != nil { + in, out := &in.UseParallelism, &out.UseParallelism + *out = new(bool) + **out = **in + } + if in.MaxParallelism != nil { + in, out := &in.MaxParallelism, &out.MaxParallelism + *out = new(int32) + **out = **in + } + if in.UseServerlessAnalytics != nil { + in, out := &in.UseServerlessAnalytics, &out.UseServerlessAnalytics + *out = new(bool) + **out = **in + } + if in.UseDataBoost != nil { + in, out := &in.UseDataBoost, &out.UseDataBoost + *out = new(bool) + **out = **in + } + if in.DatabaseRole != nil { + in, out := &in.DatabaseRole, &out.DatabaseRole + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudSpannerProperties. +func (in *CloudSpannerProperties) DeepCopy() *CloudSpannerProperties { + if in == nil { + return nil + } + out := new(CloudSpannerProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudSpannerPropertiesSpec) DeepCopyInto(out *CloudSpannerPropertiesSpec) { + *out = *in + if in.DatabaseRef != nil { + in, out := &in.DatabaseRef, &out.DatabaseRef + *out = new(v1beta1.SpannerDatabaseRef) + **out = **in + } + if in.UseParallelism != nil { + in, out := &in.UseParallelism, &out.UseParallelism + *out = new(bool) + **out = **in + } + if in.MaxParallelism != nil { + in, out := &in.MaxParallelism, &out.MaxParallelism + *out = new(int32) + **out = **in + } + if in.UseServerlessAnalytics != nil { + in, out := &in.UseServerlessAnalytics, &out.UseServerlessAnalytics + *out = new(bool) + **out = **in + } + if in.UseDataBoost != nil { + in, out := &in.UseDataBoost, &out.UseDataBoost + *out = new(bool) + **out = **in + } + if in.DatabaseRole != nil { + in, out := &in.DatabaseRole, &out.DatabaseRole + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudSpannerPropertiesSpec. +func (in *CloudSpannerPropertiesSpec) DeepCopy() *CloudSpannerPropertiesSpec { + if in == nil { + return nil + } + out := new(CloudSpannerPropertiesSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudSqlCredential) DeepCopyInto(out *CloudSqlCredential) { + *out = *in + if in.SecretRef != nil { + in, out := &in.SecretRef, &out.SecretRef + *out = new(secret.BasicAuthSecretRef) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudSqlCredential. +func (in *CloudSqlCredential) DeepCopy() *CloudSqlCredential { + if in == nil { + return nil + } + out := new(CloudSqlCredential) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudSqlProperties) DeepCopyInto(out *CloudSqlProperties) { + *out = *in + if in.InstanceID != nil { + in, out := &in.InstanceID, &out.InstanceID + *out = new(string) + **out = **in + } + if in.Database != nil { + in, out := &in.Database, &out.Database + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Credential != nil { + in, out := &in.Credential, &out.Credential + *out = new(CloudSqlCredential) + (*in).DeepCopyInto(*out) + } + if in.ServiceAccountID != nil { + in, out := &in.ServiceAccountID, &out.ServiceAccountID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudSqlProperties. +func (in *CloudSqlProperties) DeepCopy() *CloudSqlProperties { + if in == nil { + return nil + } + out := new(CloudSqlProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudSqlPropertiesSpec) DeepCopyInto(out *CloudSqlPropertiesSpec) { + *out = *in + if in.InstanceRef != nil { + in, out := &in.InstanceRef, &out.InstanceRef + *out = new(v1beta1.SQLInstanceRef) + **out = **in + } + if in.Database != nil { + in, out := &in.Database, &out.Database + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Credential != nil { + in, out := &in.Credential, &out.Credential + *out = new(CloudSqlCredential) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudSqlPropertiesSpec. +func (in *CloudSqlPropertiesSpec) DeepCopy() *CloudSqlPropertiesSpec { + if in == nil { + return nil + } + out := new(CloudSqlPropertiesSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudSqlPropertiesStatus) DeepCopyInto(out *CloudSqlPropertiesStatus) { + *out = *in + if in.ServiceAccountID != nil { + in, out := &in.ServiceAccountID, &out.ServiceAccountID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudSqlPropertiesStatus. +func (in *CloudSqlPropertiesStatus) DeepCopy() *CloudSqlPropertiesStatus { + if in == nil { + return nil + } + out := new(CloudSqlPropertiesStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Connection) DeepCopyInto(out *Connection) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.FriendlyName != nil { + in, out := &in.FriendlyName, &out.FriendlyName + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.CloudSql != nil { + in, out := &in.CloudSql, &out.CloudSql + *out = new(CloudSqlProperties) + (*in).DeepCopyInto(*out) + } + if in.Aws != nil { + in, out := &in.Aws, &out.Aws + *out = new(AwsProperties) + (*in).DeepCopyInto(*out) + } + if in.Azure != nil { + in, out := &in.Azure, &out.Azure + *out = new(AzureProperties) + (*in).DeepCopyInto(*out) + } + if in.CloudSpanner != nil { + in, out := &in.CloudSpanner, &out.CloudSpanner + *out = new(CloudSpannerProperties) + (*in).DeepCopyInto(*out) + } + if in.CloudResource != nil { + in, out := &in.CloudResource, &out.CloudResource + *out = new(CloudResourceProperties) + (*in).DeepCopyInto(*out) + } + if in.Spark != nil { + in, out := &in.Spark, &out.Spark + *out = new(SparkProperties) + (*in).DeepCopyInto(*out) + } + if in.SalesforceDataCloud != nil { + in, out := &in.SalesforceDataCloud, &out.SalesforceDataCloud + *out = new(SalesforceDataCloudProperties) + (*in).DeepCopyInto(*out) + } + if in.CreationTime != nil { + in, out := &in.CreationTime, &out.CreationTime + *out = new(int64) + **out = **in + } + if in.LastModifiedTime != nil { + in, out := &in.LastModifiedTime, &out.LastModifiedTime + *out = new(int64) + **out = **in + } + if in.HasCredential != nil { + in, out := &in.HasCredential, &out.HasCredential + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Connection. +func (in *Connection) DeepCopy() *Connection { + if in == nil { + return nil + } + out := new(Connection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MetastoreServiceConfig) DeepCopyInto(out *MetastoreServiceConfig) { + *out = *in + if in.MetastoreService != nil { + in, out := &in.MetastoreService, &out.MetastoreService + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetastoreServiceConfig. +func (in *MetastoreServiceConfig) DeepCopy() *MetastoreServiceConfig { + if in == nil { + return nil + } + out := new(MetastoreServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MetastoreServiceConfigSpec) DeepCopyInto(out *MetastoreServiceConfigSpec) { + *out = *in + if in.MetastoreServiceRef != nil { + in, out := &in.MetastoreServiceRef, &out.MetastoreServiceRef + *out = new(v1beta1.MetastoreServiceRef) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetastoreServiceConfigSpec. +func (in *MetastoreServiceConfigSpec) DeepCopy() *MetastoreServiceConfigSpec { + if in == nil { + return nil + } + out := new(MetastoreServiceConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Parent) DeepCopyInto(out *Parent) { + *out = *in + if in.ProjectRef != nil { + in, out := &in.ProjectRef, &out.ProjectRef + *out = new(v1beta1.ProjectRef) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Parent. +func (in *Parent) DeepCopy() *Parent { + if in == nil { + return nil + } + out := new(Parent) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SalesforceDataCloudProperties) DeepCopyInto(out *SalesforceDataCloudProperties) { + *out = *in + if in.InstanceUri != nil { + in, out := &in.InstanceUri, &out.InstanceUri + *out = new(string) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(string) + **out = **in + } + if in.TenantID != nil { + in, out := &in.TenantID, &out.TenantID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SalesforceDataCloudProperties. +func (in *SalesforceDataCloudProperties) DeepCopy() *SalesforceDataCloudProperties { + if in == nil { + return nil + } + out := new(SalesforceDataCloudProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SparkHistoryServerConfig) DeepCopyInto(out *SparkHistoryServerConfig) { + *out = *in + if in.DataprocCluster != nil { + in, out := &in.DataprocCluster, &out.DataprocCluster + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SparkHistoryServerConfig. +func (in *SparkHistoryServerConfig) DeepCopy() *SparkHistoryServerConfig { + if in == nil { + return nil + } + out := new(SparkHistoryServerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SparkHistoryServerConfigSpec) DeepCopyInto(out *SparkHistoryServerConfigSpec) { + *out = *in + if in.DataprocClusterRef != nil { + in, out := &in.DataprocClusterRef, &out.DataprocClusterRef + *out = new(v1beta1.DataprocClusterRef) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SparkHistoryServerConfigSpec. +func (in *SparkHistoryServerConfigSpec) DeepCopy() *SparkHistoryServerConfigSpec { + if in == nil { + return nil + } + out := new(SparkHistoryServerConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SparkProperties) DeepCopyInto(out *SparkProperties) { + *out = *in + if in.ServiceAccountID != nil { + in, out := &in.ServiceAccountID, &out.ServiceAccountID + *out = new(string) + **out = **in + } + if in.MetastoreServiceConfig != nil { + in, out := &in.MetastoreServiceConfig, &out.MetastoreServiceConfig + *out = new(MetastoreServiceConfig) + (*in).DeepCopyInto(*out) + } + if in.SparkHistoryServerConfig != nil { + in, out := &in.SparkHistoryServerConfig, &out.SparkHistoryServerConfig + *out = new(SparkHistoryServerConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SparkProperties. +func (in *SparkProperties) DeepCopy() *SparkProperties { + if in == nil { + return nil + } + out := new(SparkProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SparkPropertiesSpec) DeepCopyInto(out *SparkPropertiesSpec) { + *out = *in + if in.MetastoreService != nil { + in, out := &in.MetastoreService, &out.MetastoreService + *out = new(MetastoreServiceConfigSpec) + (*in).DeepCopyInto(*out) + } + if in.SparkHistoryServer != nil { + in, out := &in.SparkHistoryServer, &out.SparkHistoryServer + *out = new(SparkHistoryServerConfigSpec) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SparkPropertiesSpec. +func (in *SparkPropertiesSpec) DeepCopy() *SparkPropertiesSpec { + if in == nil { + return nil + } + out := new(SparkPropertiesSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SparkPropertiesStatus) DeepCopyInto(out *SparkPropertiesStatus) { + *out = *in + if in.ServiceAccountID != nil { + in, out := &in.ServiceAccountID, &out.ServiceAccountID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SparkPropertiesStatus. +func (in *SparkPropertiesStatus) DeepCopy() *SparkPropertiesStatus { + if in == nil { + return nil + } + out := new(SparkPropertiesStatus) + in.DeepCopyInto(out) + return out +} From 87625012c2ab8ae8ed72b79403aee762595fd91b Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Tue, 5 Nov 2024 16:16:42 +0100 Subject: [PATCH 05/17] re-generate CRD for bigqueryconnection API v1beta1 --- .../v1beta1/connection_types.go | 1 + .../v1beta1/zz_generated.deepcopy.go | 18 +- ...queryconnection.cnrm.cloud.google.com.yaml | 470 ++++++++++++++++++ 3 files changed, 480 insertions(+), 9 deletions(-) diff --git a/apis/bigqueryconnection/v1beta1/connection_types.go b/apis/bigqueryconnection/v1beta1/connection_types.go index 4b038a116e..bcf8d5602a 100644 --- a/apis/bigqueryconnection/v1beta1/connection_types.go +++ b/apis/bigqueryconnection/v1beta1/connection_types.go @@ -319,6 +319,7 @@ type CloudSqlCredential struct { // +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'" +// +kubebuilder:storageversion // BigQueryConnectionConnection is the Schema for the BigQueryConnectionConnection API // +k8s:openapi-gen=true diff --git a/apis/bigqueryconnection/v1beta1/zz_generated.deepcopy.go b/apis/bigqueryconnection/v1beta1/zz_generated.deepcopy.go index 51cf4aa7d0..94c12286e0 100644 --- a/apis/bigqueryconnection/v1beta1/zz_generated.deepcopy.go +++ b/apis/bigqueryconnection/v1beta1/zz_generated.deepcopy.go @@ -19,9 +19,9 @@ package v1beta1 import ( - "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" + refsv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1/secret" - k8sv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/apis/k8s/v1alpha1" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/apis/k8s/v1alpha1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -495,7 +495,7 @@ func (in *BigQueryConnectionConnectionStatus) DeepCopyInto(out *BigQueryConnecti *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.ObservedGeneration != nil { @@ -630,7 +630,7 @@ func (in *CloudSpannerPropertiesSpec) DeepCopyInto(out *CloudSpannerPropertiesSp *out = *in if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1beta1.SpannerDatabaseRef) + *out = new(refsv1beta1.SpannerDatabaseRef) **out = **in } if in.UseParallelism != nil { @@ -735,12 +735,12 @@ func (in *CloudSqlPropertiesSpec) DeepCopyInto(out *CloudSqlPropertiesSpec) { *out = *in if in.InstanceRef != nil { in, out := &in.InstanceRef, &out.InstanceRef - *out = new(v1beta1.SQLInstanceRef) + *out = new(refsv1beta1.SQLInstanceRef) **out = **in } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1beta1.SQLDatabaseRef) + *out = new(refsv1beta1.SQLDatabaseRef) **out = **in } if in.Type != nil { @@ -890,7 +890,7 @@ func (in *MetastoreServiceConfigSpec) DeepCopyInto(out *MetastoreServiceConfigSp *out = *in if in.MetastoreServiceRef != nil { in, out := &in.MetastoreServiceRef, &out.MetastoreServiceRef - *out = new(v1beta1.MetastoreServiceRef) + *out = new(refsv1beta1.MetastoreServiceRef) **out = **in } } @@ -910,7 +910,7 @@ func (in *Parent) DeepCopyInto(out *Parent) { *out = *in if in.ProjectRef != nil { in, out := &in.ProjectRef, &out.ProjectRef - *out = new(v1beta1.ProjectRef) + *out = new(refsv1beta1.ProjectRef) **out = **in } } @@ -980,7 +980,7 @@ func (in *SparkHistoryServerConfigSpec) DeepCopyInto(out *SparkHistoryServerConf *out = *in if in.DataprocClusterRef != nil { in, out := &in.DataprocClusterRef, &out.DataprocClusterRef - *out = new(v1beta1.DataprocClusterRef) + *out = new(refsv1beta1.DataprocClusterRef) **out = **in } } diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_bigqueryconnectionconnections.bigqueryconnection.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_bigqueryconnectionconnections.bigqueryconnection.cnrm.cloud.google.com.yaml index 4f4904b88d..d080393483 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_bigqueryconnectionconnections.bigqueryconnection.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_bigqueryconnectionconnections.bigqueryconnection.cnrm.cloud.google.com.yaml @@ -40,6 +40,476 @@ spec: name: Status Age type: date name: v1alpha1 + schema: + openAPIV3Schema: + description: BigQueryConnectionConnection is the Schema for the BigQueryConnectionConnection + 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: BigQueryConnectionConnectionSpec defines the desired state + to connect BigQuery to external resources + properties: + aws: + description: Amazon Web Services (AWS) properties. + properties: + accessRole: + description: Authentication using Google owned service account + to assume into customer's AWS IAM Role. + properties: + iamRoleID: + description: The user’s AWS IAM Role that trusts the Google-owned + AWS IAM user Connection. + type: string + required: + - iamRoleID + type: object + required: + - accessRole + type: object + azure: + description: Azure properties. + properties: + customerTenantID: + description: The id of customer's directory that host the data. + type: string + federatedApplicationClientID: + description: The client ID of the user's Azure Active Directory + Application used for a federated connection. + type: string + required: + - customerTenantID + type: object + cloudResource: + description: Use Cloud Resource properties. + type: object + cloudSQL: + description: Cloud SQL properties. + properties: + credential: + description: Cloud SQL credential. + properties: + secretRef: + description: The Kubernetes Secret object that stores the + "username" and "password" information. The Secret type has + to be `kubernetes.io/basic-auth`. + properties: + name: + description: The `metadata.name` field of a Kubernetes + `Secret` + type: string + namespace: + description: The `metadata.namespace` field of a Kubernetes + `Secret`. + type: string + required: + - name + type: object + type: object + database: + description: Database name. + type: string + instanceRef: + description: Reference to the Cloud SQL instance ID. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: The SQLInstance selfLink, when not managed by + Config Connector. + type: string + name: + description: The `name` field of a `SQLInstance` resource. + type: string + namespace: + description: The `namespace` field of a `SQLInstance` resource. + type: string + type: object + type: + description: Type of the Cloud SQL database. + type: string + required: + - credential + - database + - instanceRef + - type + type: object + cloudSpanner: + description: Cloud Spanner properties. + properties: + databaseRef: + description: Reference to a spanner database ID. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: The Spanner Database selfLink, when not managed + by Config Connector. + type: string + name: + description: The `name` field of a `SpannerDatabase` resource. + type: string + namespace: + description: The `namespace` field of a `SpannerDatabase` + resource. + type: string + type: object + databaseRole: + description: |- + Optional. Cloud Spanner database role for fine-grained access control. + The Cloud Spanner admin should have provisioned the database role with + appropriate permissions, such as `SELECT` and `INSERT`. Other users should + only use roles provided by their Cloud Spanner admins. + + For more details, see [About fine-grained access control] + (https://cloud.google.com/spanner/docs/fgac-about). + + REQUIRES: The database role name must start with a letter, and can only + contain letters, numbers, and underscores. + type: string + maxParallelism: + description: |- + Allows setting max parallelism per query when executing on Spanner + independent compute resources. If unspecified, default values of + parallelism are chosen that are dependent on the Cloud Spanner instance + configuration. + + REQUIRES: `use_parallelism` must be set. + REQUIRES: Either `use_data_boost` or `use_serverless_analytics` must be + set. + format: int32 + type: integer + useDataBoost: + description: |- + If set, the request will be executed via Spanner independent compute + resources. + REQUIRES: `use_parallelism` must be set. + + NOTE: `use_serverless_analytics` will be deprecated. Prefer + `use_data_boost` over `use_serverless_analytics`. + type: boolean + useParallelism: + description: If parallelism should be used when reading from Cloud + Spanner + type: boolean + useServerlessAnalytics: + description: 'If the serverless analytics service should be used + to read data from Cloud Spanner. Note: `use_parallelism` must + be set when using serverless analytics.' + type: boolean + required: + - databaseRef + type: object + description: + description: User provided description. + type: string + friendlyName: + description: User provided display name for the connection. + type: string + location: + description: Immutable. + type: string + x-kubernetes-validations: + - message: Location field is immutable + rule: self == oldSelf + projectRef: + description: 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 + resourceID: + description: The BigQuery ConnectionID. This is a server-generated + ID in the UUID format. If not provided, ConfigConnector will create + a new Connection and store the UUID in `status.serviceGeneratedID` + field. + type: string + spark: + description: Spark properties. + properties: + metastoreService: + description: Optional. Dataproc Metastore Service configuration + for the connection. + properties: + metastoreServiceRef: + description: |- + Optional. Resource name of an existing Dataproc Metastore service. + + Example: + + * `projects/[project_id]/locations/[region]/services/[service_id]` + properties: + external: + description: The self-link of an existing Dataproc Metastore + service , when not managed by Config Connector. + type: string + required: + - external + type: object + type: object + sparkHistoryServer: + description: Optional. Spark History Server configuration for + the connection. + properties: + dataprocClusterRef: + description: |- + Optional. Resource name of an existing Dataproc Cluster to act as a Spark + History Server for the connection. + + Example: + + * `projects/[project_id]/regions/[region]/clusters/[cluster_name]` + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: The self-link of an existing Dataproc Cluster + to act as a Spark History Server for the connection + , when not managed by Config Connector. + type: string + name: + description: The `name` field of a Dataproc Cluster. + type: string + namespace: + description: The `namespace` field of a Dataproc Cluster. + type: string + type: object + type: object + type: object + required: + - location + - projectRef + type: object + status: + description: BigQueryConnectionConnectionStatus defines the config connector + machine state of BigQueryConnectionConnection + 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 BigQueryConnectionConnection + 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: + aws: + properties: + accessRole: + properties: + identity: + description: A unique Google-owned and Google-generated + identity for the Connection. This identity will be used + to access the user's AWS IAM Role. + type: string + type: object + type: object + azure: + properties: + application: + description: The name of the Azure Active Directory Application. + type: string + clientID: + description: The client id of the Azure Active Directory Application. + type: string + identity: + description: A unique Google-owned and Google-generated identity + for the Connection. This identity will be used to access + the user's Azure Active Directory Application. + type: string + objectID: + description: The object id of the Azure Active Directory Application. + type: string + redirectUri: + description: The URL user will be redirected to after granting + consent during connection setup. + type: string + type: object + cloudResource: + properties: + serviceAccountID: + description: |2- + The account ID of the service created for the purpose of this + connection. + + The service account does not have any permissions associated with it + when it is created. After creation, customers delegate permissions + to the service account. When the connection is used in the context of an + operation in BigQuery, the service account will be used to connect to the + desired resources in GCP. + + The account ID is in the form of: + @gcp-sa-bigquery-cloudresource.iam.gserviceaccount.com + type: string + type: object + cloudSQL: + properties: + serviceAccountID: + description: |- + The account ID of the service used for the purpose of this connection. + + When the connection is used in the context of an operation in + BigQuery, this service account will serve as the identity being used for + connecting to the CloudSQL instance specified in this connection. + type: string + type: object + description: + description: The description for the connection. + type: string + friendlyName: + description: The display name for the connection. + type: string + hasCredential: + description: Output only. True, if credential is configured for + this connection. + type: boolean + spark: + properties: + serviceAccountID: + description: |2- + The account ID of the service created for the purpose of this + connection. + + The service account does not have any permissions associated with it when + it is created. After creation, customers delegate permissions to the + service account. When the connection is used in the context of a stored + procedure for Apache Spark in BigQuery, the service account is used to + connect to the desired resources in Google Cloud. + + The account ID is in the form of: + bqcx--@gcp-sa-bigquery-consp.iam.gserviceaccount.com + type: string + type: object + type: object + 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: BigQueryConnectionConnection is the Schema for the BigQueryConnectionConnection From 484b81f641a1204c869b7db3603dc65e63c28c6b Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Tue, 5 Nov 2024 16:19:29 +0100 Subject: [PATCH 06/17] update Bigqueryconnection controller to use v1beta1 API --- .../direct/bigqueryconnection/connection_controller.go | 2 +- pkg/controller/direct/bigqueryconnection/connection_mapping.go | 2 +- pkg/controller/direct/bigqueryconnection/mapper.generated.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/controller/direct/bigqueryconnection/connection_controller.go b/pkg/controller/direct/bigqueryconnection/connection_controller.go index 8e51c35a8c..997fe4f76f 100644 --- a/pkg/controller/direct/bigqueryconnection/connection_controller.go +++ b/pkg/controller/direct/bigqueryconnection/connection_controller.go @@ -21,7 +21,7 @@ import ( gcp "cloud.google.com/go/bigquery/connection/apiv1" bigqueryconnectionpb "cloud.google.com/go/bigquery/connection/apiv1/connectionpb" - krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/bigqueryconnection/v1alpha1" + krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/bigqueryconnection/v1beta1" refs "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" refsv1beta1secret "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1/secret" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/config" diff --git a/pkg/controller/direct/bigqueryconnection/connection_mapping.go b/pkg/controller/direct/bigqueryconnection/connection_mapping.go index a702a360f4..9a62efe09b 100644 --- a/pkg/controller/direct/bigqueryconnection/connection_mapping.go +++ b/pkg/controller/direct/bigqueryconnection/connection_mapping.go @@ -16,7 +16,7 @@ package bigqueryconnection import ( pb "cloud.google.com/go/bigquery/connection/apiv1/connectionpb" - krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/bigqueryconnection/v1alpha1" + krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/bigqueryconnection/v1beta1" refs "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" ) diff --git a/pkg/controller/direct/bigqueryconnection/mapper.generated.go b/pkg/controller/direct/bigqueryconnection/mapper.generated.go index 3191f33cd4..00eb0b7ddb 100644 --- a/pkg/controller/direct/bigqueryconnection/mapper.generated.go +++ b/pkg/controller/direct/bigqueryconnection/mapper.generated.go @@ -16,7 +16,7 @@ package bigqueryconnection import ( pb "cloud.google.com/go/bigquery/connection/apiv1/connectionpb" - krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/bigqueryconnection/v1alpha1" + krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/bigqueryconnection/v1beta1" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" ) From 043b545a4eb001a30d903fef7b64b531669910aa Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Tue, 5 Nov 2024 16:39:54 +0100 Subject: [PATCH 07/17] turn on doc auto-generation for BigQueryConnection v1beta1 --- .../servicemappings/bigqueryconnection.yaml | 27 +++++++++ pkg/test/resourcefixture/sets.go | 1 + ...nnection_bigqueryconnectionconnection.tmpl | 55 +++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 config/servicemappings/bigqueryconnection.yaml create mode 100644 scripts/generate-google3-docs/resource-reference/templates/bigqueryconnection_bigqueryconnectionconnection.tmpl diff --git a/config/servicemappings/bigqueryconnection.yaml b/config/servicemappings/bigqueryconnection.yaml new file mode 100644 index 0000000000..424ff25faa --- /dev/null +++ b/config/servicemappings/bigqueryconnection.yaml @@ -0,0 +1,27 @@ +# 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: core.cnrm.cloud.google.com/v1alpha1 +kind: ServiceMapping +metadata: + name: bigqueryconnection.cnrm.cloud.google.com + namespace: cnrm-system +spec: + name: BigQueryConnection + version: v1beta1 + serviceHostName: "bigqueryconnection.googleapis.com" + resources: + - name: google_bigquery_connection + kind: BigQueryConnectionConnection + direct: true \ No newline at end of file diff --git a/pkg/test/resourcefixture/sets.go b/pkg/test/resourcefixture/sets.go index 3d5d2eb4ec..de4cd2b1be 100644 --- a/pkg/test/resourcefixture/sets.go +++ b/pkg/test/resourcefixture/sets.go @@ -88,6 +88,7 @@ func addResourceConfig(t *testing.T, smLoader *servicemappingloader.ServiceMappi // TODO(yuwenma): This is a temp fix. We should use a more generic approach. func IsPureDirectResource(gk schema.GroupKind) bool { pureDirectResources := []string{ + "BigQueryConnectionConnection", "BigQueryDataTransferConfig", "CloudBuildWorkerPool", "DataformRepository", diff --git a/scripts/generate-google3-docs/resource-reference/templates/bigqueryconnection_bigqueryconnectionconnection.tmpl b/scripts/generate-google3-docs/resource-reference/templates/bigqueryconnection_bigqueryconnectionconnection.tmpl new file mode 100644 index 0000000000..ffa284fe36 --- /dev/null +++ b/scripts/generate-google3-docs/resource-reference/templates/bigqueryconnection_bigqueryconnectionconnection.tmpl @@ -0,0 +1,55 @@ +{{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 NameBigQueryConnection
{{"{{gcp_name_short}}"}} Service Documentation/bigquery/docs/
{{"{{gcp_name_short}}"}} REST Resource Namebigqueryconnection/v1/connections
{{"{{gcp_name_short}}"}} Rest Resource Documentationbigqueryconnection/rest/v1/projects.locations.connections
{{"{{product_name_short}}"}} Resource Short Names{{ .ShortNames}}
{{"{{product_name_short}}"}} Service Namebigqueryconnection.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 %} +Footer \ No newline at end of file From 329e929a294c56ba1fef666849e4b1884af99975 Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Tue, 5 Nov 2024 17:20:33 +0100 Subject: [PATCH 08/17] update BigQueryConnection test to use v1beta1 --- .../_generated_object_awsconnectionbasic.golden.yaml | 2 +- .../bigqueryconnectionconnection/awsconnectionbasic/create.yaml | 2 +- .../bigqueryconnectionconnection/awsconnectionbasic/update.yaml | 2 +- .../_generated_object_azureconnectionbasic.golden.yaml | 2 +- .../azureconnectionbasic/create.yaml | 2 +- .../azureconnectionbasic/update.yaml | 2 +- ...nerated_object_bigqueryconnectionconnectionbasic.golden.yaml | 2 +- .../bigqueryconnectionconnectionbasic/create.yaml | 2 +- ...enerated_object_bigqueryconnectionconnectionfull.golden.yaml | 2 +- .../bigqueryconnectionconnectionfull/create.yaml | 2 +- .../bigqueryconnectionconnectionfull/update.yaml | 2 +- .../_generated_object_cloudspannerconnectionbasic.golden.yaml | 2 +- .../cloudspannerconnectionbasic/create.yaml | 2 +- .../cloudspannerconnectionbasic/update.yaml | 2 +- .../_generated_object_cloudsqlconnectionbasic.golden.yaml | 2 +- .../cloudsqlconnectionbasic/create.yaml | 2 +- .../_generated_object_sparkconnectionbasic.golden.yaml | 2 +- .../sparkconnectionbasic/create.yaml | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/awsconnectionbasic/_generated_object_awsconnectionbasic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/awsconnectionbasic/_generated_object_awsconnectionbasic.golden.yaml index 40ad6fec5e..47c211398a 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/awsconnectionbasic/_generated_object_awsconnectionbasic.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/awsconnectionbasic/_generated_object_awsconnectionbasic.golden.yaml @@ -1,4 +1,4 @@ -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: annotations: diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/awsconnectionbasic/create.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/awsconnectionbasic/create.yaml index 15412d7518..3476eaab3b 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/awsconnectionbasic/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/awsconnectionbasic/create.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: name: bigqueryconnectionconnection-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/awsconnectionbasic/update.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/awsconnectionbasic/update.yaml index ba3a0e32f2..eeeaca339d 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/awsconnectionbasic/update.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/awsconnectionbasic/update.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: name: bigqueryconnectionconnection-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/azureconnectionbasic/_generated_object_azureconnectionbasic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/azureconnectionbasic/_generated_object_azureconnectionbasic.golden.yaml index 1d3812884d..fa4b4d357a 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/azureconnectionbasic/_generated_object_azureconnectionbasic.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/azureconnectionbasic/_generated_object_azureconnectionbasic.golden.yaml @@ -1,4 +1,4 @@ -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: annotations: diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/azureconnectionbasic/create.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/azureconnectionbasic/create.yaml index 51a2a58deb..46f61c0ad0 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/azureconnectionbasic/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/azureconnectionbasic/create.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: name: bigqueryconnectionconnection-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/azureconnectionbasic/update.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/azureconnectionbasic/update.yaml index 3edc12fdef..9c17f93a24 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/azureconnectionbasic/update.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/azureconnectionbasic/update.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: name: bigqueryconnectionconnection-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionbasic/_generated_object_bigqueryconnectionconnectionbasic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionbasic/_generated_object_bigqueryconnectionconnectionbasic.golden.yaml index 26ed04dec2..9a5658a2af 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionbasic/_generated_object_bigqueryconnectionconnectionbasic.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionbasic/_generated_object_bigqueryconnectionconnectionbasic.golden.yaml @@ -1,4 +1,4 @@ -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: annotations: diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionbasic/create.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionbasic/create.yaml index 2ad511e52c..0081198798 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionbasic/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionbasic/create.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: name: bigqueryconnectionconnection-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionfull/_generated_object_bigqueryconnectionconnectionfull.golden.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionfull/_generated_object_bigqueryconnectionconnectionfull.golden.yaml index 065cbe89fb..fa42de65f4 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionfull/_generated_object_bigqueryconnectionconnectionfull.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionfull/_generated_object_bigqueryconnectionconnectionfull.golden.yaml @@ -1,4 +1,4 @@ -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: annotations: diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionfull/create.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionfull/create.yaml index bad4b6a2fb..a5705b678e 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionfull/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionfull/create.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: name: bigqueryconnectionconnection-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionfull/update.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionfull/update.yaml index bfac1a068d..dc979d9861 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionfull/update.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/bigqueryconnectionconnectionfull/update.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: name: bigqueryconnectionconnection-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudspannerconnectionbasic/_generated_object_cloudspannerconnectionbasic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudspannerconnectionbasic/_generated_object_cloudspannerconnectionbasic.golden.yaml index aeb4222bac..8c6890f485 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudspannerconnectionbasic/_generated_object_cloudspannerconnectionbasic.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudspannerconnectionbasic/_generated_object_cloudspannerconnectionbasic.golden.yaml @@ -1,4 +1,4 @@ -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: annotations: diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudspannerconnectionbasic/create.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudspannerconnectionbasic/create.yaml index 2fc52c6400..98401e0eb6 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudspannerconnectionbasic/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudspannerconnectionbasic/create.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: name: bigqueryconnectionconnection-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudspannerconnectionbasic/update.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudspannerconnectionbasic/update.yaml index 965ac48122..fb09a8304a 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudspannerconnectionbasic/update.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudspannerconnectionbasic/update.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: name: bigqueryconnectionconnection-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_generated_object_cloudsqlconnectionbasic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_generated_object_cloudsqlconnectionbasic.golden.yaml index acfa951965..da720ba032 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_generated_object_cloudsqlconnectionbasic.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_generated_object_cloudsqlconnectionbasic.golden.yaml @@ -1,4 +1,4 @@ -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: annotations: diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/create.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/create.yaml index ee9d56f42d..c746aceea4 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/create.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: name: bigqueryconnectionconnection-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/sparkconnectionbasic/_generated_object_sparkconnectionbasic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/sparkconnectionbasic/_generated_object_sparkconnectionbasic.golden.yaml index 8ff0841c75..5043f936e1 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/sparkconnectionbasic/_generated_object_sparkconnectionbasic.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/sparkconnectionbasic/_generated_object_sparkconnectionbasic.golden.yaml @@ -1,4 +1,4 @@ -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: annotations: diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/sparkconnectionbasic/create.yaml b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/sparkconnectionbasic/create.yaml index 35396aebcb..40ba03dd1d 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/sparkconnectionbasic/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/sparkconnectionbasic/create.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1 kind: BigQueryConnectionConnection metadata: name: bigqueryconnectionconnection-${uniqueId} From fe810c3ee981a65b7028bc49655848a2e3ad858f Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Tue, 5 Nov 2024 18:46:30 +0100 Subject: [PATCH 09/17] add v1beta1 samples for BigQueryConnection --- ..._v1beta1_bigqueryconnectionconnection.yaml | 26 +++++++++++++++ ..._v1beta1_bigqueryconnectionconnection.yaml | 26 +++++++++++++++ ...v1beta1_bigqueryconnectionconnection.yaml} | 6 ++-- ..._v1beta1_bigqueryconnectionconnection.yaml | 30 +++++++++++++++++ .../spanner_v1beta1_spannerdatabase.yaml | 23 +++++++++++++ .../spanner_v1beta1_spannerinstance.yaml | 21 ++++++++++++ ..._v1beta1_bigqueryconnectionconnection.yaml | 32 +++++++++++++++++++ .../cloudsql-connection/secret.yaml | 22 +++++++++++++ .../sql_v1beta1_sqldatabase.yaml | 22 +++++++++++++ .../sql_v1beta1_sqlinstance.yaml | 25 +++++++++++++++ .../sql_v1beta1_sqluser.yaml | 30 +++++++++++++++++ ..._v1beta1_bigqueryconnectionconnection.yaml | 25 +++++++++++++++ 12 files changed, 285 insertions(+), 3 deletions(-) create mode 100644 config/samples/resources/bigqueryconnectionconnection/aws-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml create mode 100644 config/samples/resources/bigqueryconnectionconnection/azure-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml rename config/samples/resources/bigqueryconnectionconnection/{bigqueryconnection_v1alpha1_bigqueryconnectionconnection.yaml => cloudresource-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml} (88%) create mode 100644 config/samples/resources/bigqueryconnectionconnection/cloudspanner-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml create mode 100644 config/samples/resources/bigqueryconnectionconnection/cloudspanner-connection/spanner_v1beta1_spannerdatabase.yaml create mode 100644 config/samples/resources/bigqueryconnectionconnection/cloudspanner-connection/spanner_v1beta1_spannerinstance.yaml create mode 100644 config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml create mode 100644 config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/secret.yaml create mode 100644 config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqldatabase.yaml create mode 100644 config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqlinstance.yaml create mode 100644 config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqluser.yaml create mode 100644 config/samples/resources/bigqueryconnectionconnection/spark-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml diff --git a/config/samples/resources/bigqueryconnectionconnection/aws-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml b/config/samples/resources/bigqueryconnectionconnection/aws-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml new file mode 100644 index 0000000000..aa650e73ce --- /dev/null +++ b/config/samples/resources/bigqueryconnectionconnection/aws-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml @@ -0,0 +1,26 @@ +# 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: bigqueryconnection.cnrm.cloud.google.com/v1beta1 +kind: BigQueryConnectionConnection +metadata: + name: bigqueryconnectionconnection-sample +spec: + location: aws-us-east-1 + projectRef: + # Replace ${PROJECT_ID?} with your project ID + external: ${PROJECT_ID?} + aws: + accessRole: + iamRoleID: "arn:aws:iam::999999999999:role/omnirole" \ No newline at end of file diff --git a/config/samples/resources/bigqueryconnectionconnection/azure-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml b/config/samples/resources/bigqueryconnectionconnection/azure-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml new file mode 100644 index 0000000000..57881bb20d --- /dev/null +++ b/config/samples/resources/bigqueryconnectionconnection/azure-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml @@ -0,0 +1,26 @@ +# 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: bigqueryconnection.cnrm.cloud.google.com/v1beta1 +kind: BigQueryConnectionConnection +metadata: + name: bigqueryconnectionconnection-sample +spec: + location: "azure-eastus2" + projectRef: + # Replace ${PROJECT_ID?} with your project ID + external: ${PROJECT_ID?} + azure: + customerTenantID: "customer-tenant-id-1111111" + federatedApplicationClientID: "b43eeeee-eeee-eeee-eeee-a480155501ce" \ No newline at end of file diff --git a/config/samples/resources/bigqueryconnectionconnection/bigqueryconnection_v1alpha1_bigqueryconnectionconnection.yaml b/config/samples/resources/bigqueryconnectionconnection/cloudresource-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml similarity index 88% rename from config/samples/resources/bigqueryconnectionconnection/bigqueryconnection_v1alpha1_bigqueryconnectionconnection.yaml rename to config/samples/resources/bigqueryconnectionconnection/cloudresource-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml index ccc225d5e9..5b0aa0523c 100644 --- a/config/samples/resources/bigqueryconnectionconnection/bigqueryconnection_v1alpha1_bigqueryconnectionconnection.yaml +++ b/config/samples/resources/bigqueryconnectionconnection/cloudresource-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml @@ -1,3 +1,4 @@ + # Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,7 +20,6 @@ metadata: spec: location: us-central1 projectRef: + # Replace ${PROJECT_ID?} with your project ID external: ${PROJECT_ID?} - description: "BigQueryConnection CloudResource Connection" - cloudResource: - serviceAccountId: "" \ No newline at end of file + cloudResource: {} diff --git a/config/samples/resources/bigqueryconnectionconnection/cloudspanner-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml b/config/samples/resources/bigqueryconnectionconnection/cloudspanner-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml new file mode 100644 index 0000000000..fb89a63dd8 --- /dev/null +++ b/config/samples/resources/bigqueryconnectionconnection/cloudspanner-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml @@ -0,0 +1,30 @@ +# 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: bigqueryconnection.cnrm.cloud.google.com/v1beta1 +kind: BigQueryConnectionConnection +metadata: + name: bigqueryconnectionconnection-sample +spec: + location: us-central1 + projectRef: + # Replace ${PROJECT_ID?} with your project ID + external: ${PROJECT_ID?} + cloudSpanner: + databaseRef: + name: bigqueryconnection-dep + maxParallelism: 100 + useDataBoost: True + useParallelism: True + databaseRole: "admin" \ No newline at end of file diff --git a/config/samples/resources/bigqueryconnectionconnection/cloudspanner-connection/spanner_v1beta1_spannerdatabase.yaml b/config/samples/resources/bigqueryconnectionconnection/cloudspanner-connection/spanner_v1beta1_spannerdatabase.yaml new file mode 100644 index 0000000000..d872064beb --- /dev/null +++ b/config/samples/resources/bigqueryconnectionconnection/cloudspanner-connection/spanner_v1beta1_spannerdatabase.yaml @@ -0,0 +1,23 @@ +# 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: spanner.cnrm.cloud.google.com/v1beta1 +kind: SpannerDatabase +metadata: + name: bigqueryconnection-dep +spec: + instanceRef: + name: bigqueryconnection-dep + ddl: + - "CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)" \ No newline at end of file diff --git a/config/samples/resources/bigqueryconnectionconnection/cloudspanner-connection/spanner_v1beta1_spannerinstance.yaml b/config/samples/resources/bigqueryconnectionconnection/cloudspanner-connection/spanner_v1beta1_spannerinstance.yaml new file mode 100644 index 0000000000..e083cac609 --- /dev/null +++ b/config/samples/resources/bigqueryconnectionconnection/cloudspanner-connection/spanner_v1beta1_spannerinstance.yaml @@ -0,0 +1,21 @@ +# 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: spanner.cnrm.cloud.google.com/v1beta1 +kind: SpannerInstance +metadata: + name: bigqueryconnection-dep +spec: + config: regional-us-west1 + displayName: BigQueryConnection Dependency \ No newline at end of file diff --git a/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml b/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml new file mode 100644 index 0000000000..d1cadf40d4 --- /dev/null +++ b/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml @@ -0,0 +1,32 @@ +# 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: bigqueryconnection.cnrm.cloud.google.com/v1beta1 +kind: BigQueryConnectionConnection +metadata: + name: bigqueryconnectionconnection-sample +spec: + location: us-central1 + projectRef: + # Replace ${PROJECT_ID?} with your project ID + external: ${PROJECT_ID?} + cloudSQL: + instanceRef: + name: bigqueryconnection-dep + databaseRef: + name: bigqueryconnection-dep + type: "MYSQL" + credential: + secretRef: + name: bigqueryconnection-dep \ No newline at end of file diff --git a/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/secret.yaml b/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/secret.yaml new file mode 100644 index 0000000000..a854ba7b6c --- /dev/null +++ b/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/secret.yaml @@ -0,0 +1,22 @@ +# 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: v1 +kind: Secret +metadata: + name: bigqueryconnection-dep +type: kubernetes.io/basic-auth +stringData: + username: sqluser-${uniqueId} + password: cGFzc3dvcmQ= \ No newline at end of file diff --git a/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqldatabase.yaml b/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqldatabase.yaml new file mode 100644 index 0000000000..147ecf275e --- /dev/null +++ b/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqldatabase.yaml @@ -0,0 +1,22 @@ +# 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. + +apiVersion: sql.cnrm.cloud.google.com/v1beta1 +kind: SQLDatabase +metadata: + name: bigqueryconnection-dep +spec: + charset: utf8 + instanceRef: + name: bigqueryconnection-dep \ No newline at end of file diff --git a/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqlinstance.yaml b/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqlinstance.yaml new file mode 100644 index 0000000000..6bca06c87a --- /dev/null +++ b/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqlinstance.yaml @@ -0,0 +1,25 @@ +# 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: sql.cnrm.cloud.google.com/v1beta1 +kind: SQLInstance +metadata: + name: bigqueryconnection-dep +spec: + region: us-central1 + databaseVersion: MYSQL_5_7 + settings: + locationPreference: + zone: us-central1-a + tier: db-custom-1-3840 \ No newline at end of file diff --git a/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqluser.yaml b/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqluser.yaml new file mode 100644 index 0000000000..bac4846c97 --- /dev/null +++ b/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqluser.yaml @@ -0,0 +1,30 @@ + +# 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: sql.cnrm.cloud.google.com/v1beta1 +kind: SQLUser +metadata: + labels: + label-one: "value-one" + name: bigqueryconnection-dep +spec: + instanceRef: + name: bigqueryconnection-dep + host: foo + password: + valueFrom: + secretKeyRef: + name: bigqueryconnection-dep + key: password diff --git a/config/samples/resources/bigqueryconnectionconnection/spark-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml b/config/samples/resources/bigqueryconnectionconnection/spark-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml new file mode 100644 index 0000000000..b0d3bd4ba3 --- /dev/null +++ b/config/samples/resources/bigqueryconnectionconnection/spark-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml @@ -0,0 +1,25 @@ + +# 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: bigqueryconnection.cnrm.cloud.google.com/v1beta1 +kind: BigQueryConnectionConnection +metadata: + name: bigqueryconnectionconnection-sample +spec: + location: us-central1 + projectRef: + # Replace ${PROJECT_ID?} with your project ID + external: ${PROJECT_ID?} + spark: {} From 4c56007cf470a27080ef1c30899aa74c8593277a Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Tue, 5 Nov 2024 18:53:58 +0100 Subject: [PATCH 10/17] add reference doc for BigQueryConnection v1beta1 --- .../snippetgeneration/snippetgeneration.go | 1 + .../resource-reference/_toc.yaml | 2 + .../bigqueryconnectionconnection.md | 1169 +++++++++++++++++ .../resource-reference/overview.md | 4 + ...nnection_bigqueryconnectionconnection.tmpl | 6 +- 5 files changed, 1179 insertions(+), 3 deletions(-) create mode 100644 scripts/generate-google3-docs/resource-reference/generated/resource-docs/bigqueryconnection/bigqueryconnectionconnection.md diff --git a/pkg/snippet/snippetgeneration/snippetgeneration.go b/pkg/snippet/snippetgeneration/snippetgeneration.go index 6905e370fc..03c302db4a 100644 --- a/pkg/snippet/snippetgeneration/snippetgeneration.go +++ b/pkg/snippet/snippetgeneration/snippetgeneration.go @@ -39,6 +39,7 @@ var preferredSampleForResource = map[string]string{ "bigtableappprofile": "multicluster-bigtable-app-profile", "bigtableinstance": "replicated-instance", "bigquerydatatransferconfig": "bigquerydatatransferconfig-scheduledquery", + "bigqueryconnectionconnection": "cloudresource-connection", "billingbudgetsbudget": "calendar-budget", "binaryauthorizationpolicy": "cluster-policy", "certificatemanagercertificate": "self-managed-certificate", diff --git a/scripts/generate-google3-docs/resource-reference/_toc.yaml b/scripts/generate-google3-docs/resource-reference/_toc.yaml index f599ad09cc..acc980f577 100644 --- a/scripts/generate-google3-docs/resource-reference/_toc.yaml +++ b/scripts/generate-google3-docs/resource-reference/_toc.yaml @@ -49,6 +49,8 @@ toc: path: /config-connector/docs/reference/resource-docs/bigqueranalyticshub/bigqueranalyticshubydataexchange.md - title: "BigQuery" section: + - title: "BigqueryConnectionConnection" + path: /config-connector/docs/reference/resource-docs/bigqueryconnection/bigqueryconnectionconnection.md - title: "BigQueryDataset" path: /config-connector/docs/reference/resource-docs/bigquery/bigquerydataset.md - title: "BigQueryJob" diff --git a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/bigqueryconnection/bigqueryconnectionconnection.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/bigqueryconnection/bigqueryconnectionconnection.md new file mode 100644 index 0000000000..3192e27d29 --- /dev/null +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/bigqueryconnection/bigqueryconnectionconnection.md @@ -0,0 +1,1169 @@ +{# AUTOGENERATED. DO NOT EDIT. #} + +{% extends "config-connector/_base.html" %} + +{% block page_title %}BigQueryConnectionConnection{% endblock %} +{% block body %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyValue
{{gcp_name_short}} Service NameBigQuery Connection
{{gcp_name_short}} Service Documentation/bigquery/docs/
{{gcp_name_short}} REST Resource Namev1beta1.projects.locations.connections
{{gcp_name_short}} REST Resource Documentationbigqueryconnection/rest/v1/projects.locations.connections
{{product_name_short}} Resource Short Namesgcpbigqueryconnectionconnection
gcpbigqueryconnectionconnections
bigqueryconnectionconnection
{{product_name_short}} Service Namebigqueryconnection.googleapis.com
{{product_name_short}} Resource Fully Qualified Namebigqueryconnectionconnections.bigqueryconnection.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 +aws: + accessRole: + iamRoleID: string +azure: + customerTenantID: string + federatedApplicationClientID: string +cloudResource: {} +cloudSQL: + credential: + secretRef: + name: string + namespace: string + databaseRef: + external: string + name: string + namespace: string + instanceRef: + external: string + name: string + namespace: string + type: string +cloudSpanner: + databaseRef: + external: string + name: string + namespace: string + databaseRole: string + maxParallelism: integer + useDataBoost: boolean + useParallelism: boolean + useServerlessAnalytics: boolean +description: string +friendlyName: string +location: string +projectRef: + external: string + kind: string + name: string + namespace: string +resourceID: string +spark: + metastoreService: + metastoreServiceRef: + external: string + sparkHistoryServer: + dataprocClusterRef: + external: string + name: string + namespace: string +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fields
+

aws

+

Optional

+
+

object

+

{% verbatim %}Amazon Web Services (AWS) properties.{% endverbatim %}

+
+

aws.accessRole

+

Required*

+
+

object

+

{% verbatim %}Authentication using Google owned service account to assume into customer's AWS IAM Role.{% endverbatim %}

+
+

aws.accessRole.iamRoleID

+

Required*

+
+

string

+

{% verbatim %}The user’s AWS IAM Role that trusts the Google-owned AWS IAM user Connection.{% endverbatim %}

+
+

azure

+

Optional

+
+

object

+

{% verbatim %}Azure properties.{% endverbatim %}

+
+

azure.customerTenantID

+

Required*

+
+

string

+

{% verbatim %}The id of customer's directory that host the data.{% endverbatim %}

+
+

azure.federatedApplicationClientID

+

Optional

+
+

string

+

{% verbatim %}The client ID of the user's Azure Active Directory Application used for a federated connection.{% endverbatim %}

+
+

cloudResource

+

Optional

+
+

object

+

{% verbatim %}Use Cloud Resource properties.{% endverbatim %}

+
+

cloudSQL

+

Optional

+
+

object

+

{% verbatim %}Cloud SQL properties.{% endverbatim %}

+
+

cloudSQL.credential

+

Required*

+
+

object

+

{% verbatim %}Cloud SQL credential.{% endverbatim %}

+
+

cloudSQL.credential.secretRef

+

Optional

+
+

object

+

{% verbatim %}The Kubernetes Secret object that stores the "username" and "password" information. The Secret type has to be `kubernetes.io/basic-auth`.{% endverbatim %}

+
+

cloudSQL.credential.secretRef.name

+

Required*

+
+

string

+

{% verbatim %}The `metadata.name` field of a Kubernetes `Secret`{% endverbatim %}

+
+

cloudSQL.credential.secretRef.namespace

+

Optional

+
+

string

+

{% verbatim %}The `metadata.namespace` field of a Kubernetes `Secret`.{% endverbatim %}

+
+

cloudSQL.databaseRef

+

Required*

+
+

object

+

{% verbatim %}Reference to the SQL Database.{% endverbatim %}

+
+

cloudSQL.databaseRef.external

+

Optional

+
+

string

+

{% verbatim %}The SQL Database selfLink, when not managed by Config Connector.{% endverbatim %}

+
+

cloudSQL.databaseRef.name

+

Optional

+
+

string

+

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

+
+

cloudSQL.databaseRef.namespace

+

Optional

+
+

string

+

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

+
+

cloudSQL.instanceRef

+

Required*

+
+

object

+

{% verbatim %}Reference to the Cloud SQL instance ID.{% endverbatim %}

+
+

cloudSQL.instanceRef.external

+

Optional

+
+

string

+

{% verbatim %}The SQLInstance selfLink, when not managed by Config Connector.{% endverbatim %}

+
+

cloudSQL.instanceRef.name

+

Optional

+
+

string

+

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

+
+

cloudSQL.instanceRef.namespace

+

Optional

+
+

string

+

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

+
+

cloudSQL.type

+

Required*

+
+

string

+

{% verbatim %}Type of the Cloud SQL database.{% endverbatim %}

+
+

cloudSpanner

+

Optional

+
+

object

+

{% verbatim %}Cloud Spanner properties.{% endverbatim %}

+
+

cloudSpanner.databaseRef

+

Required*

+
+

object

+

{% verbatim %}Reference to a spanner database ID.{% endverbatim %}

+
+

cloudSpanner.databaseRef.external

+

Optional

+
+

string

+

{% verbatim %}The Spanner Database selfLink, when not managed by Config Connector.{% endverbatim %}

+
+

cloudSpanner.databaseRef.name

+

Optional

+
+

string

+

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

+
+

cloudSpanner.databaseRef.namespace

+

Optional

+
+

string

+

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

+
+

cloudSpanner.databaseRole

+

Optional

+
+

string

+

{% verbatim %}Optional. Cloud Spanner database role for fine-grained access control. + The Cloud Spanner admin should have provisioned the database role with + appropriate permissions, such as `SELECT` and `INSERT`. Other users should + only use roles provided by their Cloud Spanner admins. + + For more details, see [About fine-grained access control] + (https://cloud.google.com/spanner/docs/fgac-about). + + REQUIRES: The database role name must start with a letter, and can only + contain letters, numbers, and underscores.{% endverbatim %}

+
+

cloudSpanner.maxParallelism

+

Optional

+
+

integer

+

{% verbatim %}Allows setting max parallelism per query when executing on Spanner + independent compute resources. If unspecified, default values of + parallelism are chosen that are dependent on the Cloud Spanner instance + configuration. + + REQUIRES: `use_parallelism` must be set. + REQUIRES: Either `use_data_boost` or `use_serverless_analytics` must be + set.{% endverbatim %}

+
+

cloudSpanner.useDataBoost

+

Optional

+
+

boolean

+

{% verbatim %}If set, the request will be executed via Spanner independent compute + resources. + REQUIRES: `use_parallelism` must be set. + + NOTE: `use_serverless_analytics` will be deprecated. Prefer + `use_data_boost` over `use_serverless_analytics`.{% endverbatim %}

+
+

cloudSpanner.useParallelism

+

Optional

+
+

boolean

+

{% verbatim %}If parallelism should be used when reading from Cloud Spanner{% endverbatim %}

+
+

cloudSpanner.useServerlessAnalytics

+

Optional

+
+

boolean

+

{% verbatim %}If the serverless analytics service should be used to read data from Cloud Spanner. Note: `use_parallelism` must be set when using serverless analytics.{% endverbatim %}

+
+

description

+

Optional

+
+

string

+

{% verbatim %}User provided description.{% endverbatim %}

+
+

friendlyName

+

Optional

+
+

string

+

{% verbatim %}User provided display name for the connection.{% endverbatim %}

+
+

location

+

Required*

+
+

string

+

{% verbatim %}Immutable.{% endverbatim %}

+
+

projectRef

+

Required*

+
+

object

+

{% verbatim %}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 %}

+
+

resourceID

+

Optional

+
+

string

+

{% verbatim %}The BigQuery ConnectionID. This is a server-generated ID in the UUID format. If not provided, ConfigConnector will create a new Connection and store the UUID in `status.serviceGeneratedID` field.{% endverbatim %}

+
+

spark

+

Optional

+
+

object

+

{% verbatim %}Spark properties.{% endverbatim %}

+
+

spark.metastoreService

+

Optional

+
+

object

+

{% verbatim %}Optional. Dataproc Metastore Service configuration for the connection.{% endverbatim %}

+
+

spark.metastoreService.metastoreServiceRef

+

Optional

+
+

object

+

{% verbatim %}Optional. Resource name of an existing Dataproc Metastore service. + + Example: + + * `projects/[project_id]/locations/[region]/services/[service_id]`{% endverbatim %}

+
+

spark.metastoreService.metastoreServiceRef.external

+

Required*

+
+

string

+

{% verbatim %}The self-link of an existing Dataproc Metastore service , when not managed by Config Connector.{% endverbatim %}

+
+

spark.sparkHistoryServer

+

Optional

+
+

object

+

{% verbatim %}Optional. Spark History Server configuration for the connection.{% endverbatim %}

+
+

spark.sparkHistoryServer.dataprocClusterRef

+

Optional

+
+

object

+

{% verbatim %}Optional. Resource name of an existing Dataproc Cluster to act as a Spark + History Server for the connection. + + Example: + + * `projects/[project_id]/regions/[region]/clusters/[cluster_name]`{% endverbatim %}

+
+

spark.sparkHistoryServer.dataprocClusterRef.external

+

Optional

+
+

string

+

{% verbatim %}The self-link of an existing Dataproc Cluster to act as a Spark History Server for the connection , when not managed by Config Connector.{% endverbatim %}

+
+

spark.sparkHistoryServer.dataprocClusterRef.name

+

Optional

+
+

string

+

{% verbatim %}The `name` field of a Dataproc Cluster.{% endverbatim %}

+
+

spark.sparkHistoryServer.dataprocClusterRef.namespace

+

Optional

+
+

string

+

{% verbatim %}The `namespace` field of a Dataproc Cluster.{% 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: + aws: + accessRole: + identity: string + azure: + application: string + clientID: string + identity: string + objectID: string + redirectUri: string + cloudResource: + serviceAccountID: string + cloudSQL: + serviceAccountID: string + description: string + friendlyName: string + hasCredential: boolean + spark: + serviceAccountID: 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 BigQueryConnectionConnection 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.aws +

object

+

{% verbatim %}{% endverbatim %}

+
observedState.aws.accessRole +

object

+

{% verbatim %}{% endverbatim %}

+
observedState.aws.accessRole.identity +

string

+

{% verbatim %}A unique Google-owned and Google-generated identity for the Connection. This identity will be used to access the user's AWS IAM Role.{% endverbatim %}

+
observedState.azure +

object

+

{% verbatim %}{% endverbatim %}

+
observedState.azure.application +

string

+

{% verbatim %}The name of the Azure Active Directory Application.{% endverbatim %}

+
observedState.azure.clientID +

string

+

{% verbatim %}The client id of the Azure Active Directory Application.{% endverbatim %}

+
observedState.azure.identity +

string

+

{% verbatim %}A unique Google-owned and Google-generated identity for the Connection. This identity will be used to access the user's Azure Active Directory Application.{% endverbatim %}

+
observedState.azure.objectID +

string

+

{% verbatim %}The object id of the Azure Active Directory Application.{% endverbatim %}

+
observedState.azure.redirectUri +

string

+

{% verbatim %}The URL user will be redirected to after granting consent during connection setup.{% endverbatim %}

+
observedState.cloudResource +

object

+

{% verbatim %}{% endverbatim %}

+
observedState.cloudResource.serviceAccountID +

string

+

{% verbatim %} The account ID of the service created for the purpose of this + connection. + + The service account does not have any permissions associated with it + when it is created. After creation, customers delegate permissions + to the service account. When the connection is used in the context of an + operation in BigQuery, the service account will be used to connect to the + desired resources in GCP. + + The account ID is in the form of: + @gcp-sa-bigquery-cloudresource.iam.gserviceaccount.com{% endverbatim %}

+
observedState.cloudSQL +

object

+

{% verbatim %}{% endverbatim %}

+
observedState.cloudSQL.serviceAccountID +

string

+

{% verbatim %}The account ID of the service used for the purpose of this connection. + + When the connection is used in the context of an operation in + BigQuery, this service account will serve as the identity being used for + connecting to the CloudSQL instance specified in this connection.{% endverbatim %}

+
observedState.description +

string

+

{% verbatim %}The description for the connection.{% endverbatim %}

+
observedState.friendlyName +

string

+

{% verbatim %}The display name for the connection.{% endverbatim %}

+
observedState.hasCredential +

boolean

+

{% verbatim %}Output only. True, if credential is configured for this connection.{% endverbatim %}

+
observedState.spark +

object

+

{% verbatim %}{% endverbatim %}

+
observedState.spark.serviceAccountID +

string

+

{% verbatim %} The account ID of the service created for the purpose of this + connection. + + The service account does not have any permissions associated with it when + it is created. After creation, customers delegate permissions to the + service account. When the connection is used in the context of a stored + procedure for Apache Spark in BigQuery, the service account is used to + connect to the desired resources in Google Cloud. + + The account ID is in the form of: + bqcx--@gcp-sa-bigquery-consp.iam.gserviceaccount.com{% endverbatim %}

+
+ +## Sample YAML(s) + +### Aws Connection +```yaml +# 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: bigqueryconnection.cnrm.cloud.google.com/v1beta1 +kind: BigQueryConnectionConnection +metadata: + name: bigqueryconnectionconnection-sample +spec: + location: aws-us-east-1 + projectRef: + # Replace ${PROJECT_ID?} with your project ID + external: ${PROJECT_ID?} + aws: + accessRole: + iamRoleID: "arn:aws:iam::999999999999:role/omnirole" +``` + +### Azure Connection +```yaml +# 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: bigqueryconnection.cnrm.cloud.google.com/v1beta1 +kind: BigQueryConnectionConnection +metadata: + name: bigqueryconnectionconnection-sample +spec: + location: "azure-eastus2" + projectRef: + # Replace ${PROJECT_ID?} with your project ID + external: ${PROJECT_ID?} + azure: + customerTenantID: "customer-tenant-id-1111111" + federatedApplicationClientID: "b43eeeee-eeee-eeee-eeee-a480155501ce" +``` + +### Cloudresource Connection +```yaml +# 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: bigqueryconnection.cnrm.cloud.google.com/v1alpha1 +kind: BigQueryConnectionConnection +metadata: + name: bigqueryconnectionconnection-sample +spec: + location: us-central1 + projectRef: + # Replace ${PROJECT_ID?} with your project ID + external: ${PROJECT_ID?} + cloudResource: {} +``` + +### Cloudspanner Connection +```yaml +# 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: bigqueryconnection.cnrm.cloud.google.com/v1beta1 +kind: BigQueryConnectionConnection +metadata: + name: bigqueryconnectionconnection-sample +spec: + location: us-central1 + projectRef: + # Replace ${PROJECT_ID?} with your project ID + external: ${PROJECT_ID?} + cloudSpanner: + databaseRef: + name: bigqueryconnection-dep + maxParallelism: 100 + useDataBoost: True + useParallelism: True + databaseRole: "admin" +--- +apiVersion: spanner.cnrm.cloud.google.com/v1beta1 +kind: SpannerDatabase +metadata: + name: bigqueryconnection-dep +spec: + instanceRef: + name: bigqueryconnection-dep + ddl: + - "CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)" +--- +apiVersion: spanner.cnrm.cloud.google.com/v1beta1 +kind: SpannerInstance +metadata: + name: bigqueryconnection-dep +spec: + config: regional-us-west1 + displayName: BigQueryConnection Dependency +``` + +### Cloudsql Connection +```yaml +# 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: bigqueryconnection.cnrm.cloud.google.com/v1beta1 +kind: BigQueryConnectionConnection +metadata: + name: bigqueryconnectionconnection-sample +spec: + location: us-central1 + projectRef: + # Replace ${PROJECT_ID?} with your project ID + external: ${PROJECT_ID?} + cloudSQL: + instanceRef: + name: bigqueryconnection-dep + databaseRef: + name: bigqueryconnection-dep + type: "MYSQL" + credential: + secretRef: + name: bigqueryconnection-dep +--- +apiVersion: v1 +kind: Secret +metadata: + name: bigqueryconnection-dep +type: kubernetes.io/basic-auth +stringData: + username: sqluser-${uniqueId} + password: cGFzc3dvcmQ= +--- +apiVersion: sql.cnrm.cloud.google.com/v1beta1 +kind: SQLDatabase +metadata: + name: bigqueryconnection-dep +spec: + charset: utf8 + instanceRef: + name: bigqueryconnection-dep +--- +apiVersion: sql.cnrm.cloud.google.com/v1beta1 +kind: SQLInstance +metadata: + name: bigqueryconnection-dep +spec: + region: us-central1 + databaseVersion: MYSQL_5_7 + settings: + locationPreference: + zone: us-central1-a + tier: db-custom-1-3840 +--- +apiVersion: sql.cnrm.cloud.google.com/v1beta1 +kind: SQLUser +metadata: + labels: + label-one: "value-one" + name: bigqueryconnection-dep +spec: + instanceRef: + name: bigqueryconnection-dep + host: foo + password: + valueFrom: + secretKeyRef: + name: bigqueryconnection-dep + key: password +``` + +### Spark Connection +```yaml +# 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: bigqueryconnection.cnrm.cloud.google.com/v1beta1 +kind: BigQueryConnectionConnection +metadata: + name: bigqueryconnectionconnection-sample +spec: + location: us-central1 + projectRef: + # Replace ${PROJECT_ID?} with your project ID + external: ${PROJECT_ID?} + spark: {} +``` + + +Note: If you have any trouble with instantiating the resource, refer to Troubleshoot Config Connector. + +{% endblock %} +Footer \ No newline at end of file diff --git a/scripts/generate-google3-docs/resource-reference/overview.md b/scripts/generate-google3-docs/resource-reference/overview.md index 3b059de445..6762e30a33 100644 --- a/scripts/generate-google3-docs/resource-reference/overview.md +++ b/scripts/generate-google3-docs/resource-reference/overview.md @@ -78,6 +78,10 @@ issues for {{product_name_short}}. BigQueryAnalyticsHubDataExchange + + {{bigquery_name}} + BigqueryConnectionConnection + {{bigquery_name}} BigQueryDataset diff --git a/scripts/generate-google3-docs/resource-reference/templates/bigqueryconnection_bigqueryconnectionconnection.tmpl b/scripts/generate-google3-docs/resource-reference/templates/bigqueryconnection_bigqueryconnectionconnection.tmpl index ffa284fe36..d2f84c4b73 100644 --- a/scripts/generate-google3-docs/resource-reference/templates/bigqueryconnection_bigqueryconnectionconnection.tmpl +++ b/scripts/generate-google3-docs/resource-reference/templates/bigqueryconnection_bigqueryconnectionconnection.tmpl @@ -15,7 +15,7 @@ {{"{{gcp_name_short}}"}} Service Name -BigQueryConnection +BigQuery Connection {{"{{gcp_name_short}}"}} Service Documentation @@ -23,10 +23,10 @@ {{"{{gcp_name_short}}"}} REST Resource Name -bigqueryconnection/v1/connections +v1beta1.projects.locations.connections -{{"{{gcp_name_short}}"}} Rest Resource Documentation +{{"{{gcp_name_short}}"}} REST Resource Documentation bigqueryconnection/rest/v1/projects.locations.connections From 7db0a0ab3820c8a34b20bd7c7a945cb6ff6bacd2 Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Tue, 5 Nov 2024 19:10:40 +0100 Subject: [PATCH 11/17] chore: make ready-pr and merge with #3073 rm -rf pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1 scripts/generate-go-crd-clients/generate-clients.sh make ready-pr --- .../bigqueryconnectionconnection_types.go | 2 +- .../{v1alpha1 => v1beta1}/doc.go | 4 +- .../{v1alpha1 => v1beta1}/register.go | 6 +-- .../zz_generated.deepcopy.go | 12 ++--- .../client/clientset/versioned/clientset.go | 16 +++--- .../versioned/fake/clientset_generated.go | 10 ++-- .../clientset/versioned/fake/register.go | 4 +- .../clientset/versioned/scheme/register.go | 4 +- .../bigqueryconnection_client.go | 36 ++++++------- .../bigqueryconnectionconnection.go | 42 ++++++++-------- .../{v1alpha1 => v1beta1}/doc.go | 2 +- .../{v1alpha1 => v1beta1}/fake/doc.go | 0 .../fake/fake_bigqueryconnection_client.go | 8 +-- .../fake/fake_bigqueryconnectionconnection.go | 50 +++++++++---------- .../generated_expansion.go | 2 +- pkg/gvks/supportedgvks/gvks_generated.go | 10 ++++ 16 files changed, 109 insertions(+), 99 deletions(-) rename pkg/clients/generated/apis/bigqueryconnection/{v1alpha1 => v1beta1}/bigqueryconnectionconnection_types.go (99%) rename pkg/clients/generated/apis/bigqueryconnection/{v1alpha1 => v1beta1}/doc.go (92%) rename pkg/clients/generated/apis/bigqueryconnection/{v1alpha1 => v1beta1}/register.go (93%) rename pkg/clients/generated/apis/bigqueryconnection/{v1alpha1 => v1beta1}/zz_generated.deepcopy.go (98%) rename pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/{v1alpha1 => v1beta1}/bigqueryconnection_client.go (64%) rename pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/{v1alpha1 => v1beta1}/bigqueryconnectionconnection.go (76%) rename pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/{v1alpha1 => v1beta1}/doc.go (98%) rename pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/{v1alpha1 => v1beta1}/fake/doc.go (100%) rename pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/{v1alpha1 => v1beta1}/fake/fake_bigqueryconnection_client.go (74%) rename pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/{v1alpha1 => v1beta1}/fake/fake_bigqueryconnectionconnection.go (66%) rename pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/{v1alpha1 => v1beta1}/generated_expansion.go (98%) diff --git a/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/bigqueryconnectionconnection_types.go b/pkg/clients/generated/apis/bigqueryconnection/v1beta1/bigqueryconnectionconnection_types.go similarity index 99% rename from pkg/clients/generated/apis/bigqueryconnection/v1alpha1/bigqueryconnectionconnection_types.go rename to pkg/clients/generated/apis/bigqueryconnection/v1beta1/bigqueryconnectionconnection_types.go index 271b8ad943..236636964e 100644 --- a/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/bigqueryconnectionconnection_types.go +++ b/pkg/clients/generated/apis/bigqueryconnection/v1beta1/bigqueryconnectionconnection_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" diff --git a/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/doc.go b/pkg/clients/generated/apis/bigqueryconnection/v1beta1/doc.go similarity index 92% rename from pkg/clients/generated/apis/bigqueryconnection/v1alpha1/doc.go rename to pkg/clients/generated/apis/bigqueryconnection/v1beta1/doc.go index cf7ffc3ac8..b133721e15 100644 --- a/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/doc.go +++ b/pkg/clients/generated/apis/bigqueryconnection/v1beta1/doc.go @@ -28,11 +28,11 @@ // 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 bigqueryconnection v1alpha1 API group. +// Package v1beta1 contains API Schema definitions for the bigqueryconnection v1beta1 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/bigqueryconnection // +k8s:defaulter-gen=TypeMeta // +groupName=bigqueryconnection.cnrm.cloud.google.com -package v1alpha1 +package v1beta1 diff --git a/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/register.go b/pkg/clients/generated/apis/bigqueryconnection/v1beta1/register.go similarity index 93% rename from pkg/clients/generated/apis/bigqueryconnection/v1alpha1/register.go rename to pkg/clients/generated/apis/bigqueryconnection/v1beta1/register.go index 9b03dc0951..60fc181044 100644 --- a/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/register.go +++ b/pkg/clients/generated/apis/bigqueryconnection/v1beta1/register.go @@ -28,13 +28,13 @@ // 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 bigqueryconnection v1alpha1 API group. +// Package v1beta1 contains API Schema definitions for the bigqueryconnection v1beta1 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/bigqueryconnection // +k8s:defaulter-gen=TypeMeta // +groupName=bigqueryconnection.cnrm.cloud.google.com -package v1alpha1 +package v1beta1 import ( "reflect" @@ -45,7 +45,7 @@ import ( var ( // SchemeGroupVersion is the group version used to register these objects. - SchemeGroupVersion = schema.GroupVersion{Group: "bigqueryconnection.cnrm.cloud.google.com", Version: "v1alpha1"} + SchemeGroupVersion = schema.GroupVersion{Group: "bigqueryconnection.cnrm.cloud.google.com", Version: "v1beta1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme. SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} diff --git a/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go b/pkg/clients/generated/apis/bigqueryconnection/v1beta1/zz_generated.deepcopy.go similarity index 98% rename from pkg/clients/generated/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go rename to pkg/clients/generated/apis/bigqueryconnection/v1beta1/zz_generated.deepcopy.go index bbd5cef937..37788fd724 100644 --- a/pkg/clients/generated/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/clients/generated/apis/bigqueryconnection/v1beta1/zz_generated.deepcopy.go @@ -22,10 +22,10 @@ // 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" + v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/k8s/v1alpha1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -157,7 +157,7 @@ func (in *BigQueryConnectionConnectionStatus) DeepCopyInto(out *BigQueryConnecti *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 { @@ -449,7 +449,7 @@ func (in *ConnectionCredential) DeepCopyInto(out *ConnectionCredential) { *out = *in if in.SecretRef != nil { in, out := &in.SecretRef, &out.SecretRef - *out = new(k8sv1alpha1.ResourceRef) + *out = new(v1alpha1.ResourceRef) **out = **in } return @@ -470,7 +470,7 @@ func (in *ConnectionMetastoreService) DeepCopyInto(out *ConnectionMetastoreServi *out = *in if in.MetastoreServiceRef != nil { in, out := &in.MetastoreServiceRef, &out.MetastoreServiceRef - *out = new(k8sv1alpha1.ResourceRef) + *out = new(v1alpha1.ResourceRef) **out = **in } return @@ -573,7 +573,7 @@ func (in *ConnectionSparkHistoryServer) DeepCopyInto(out *ConnectionSparkHistory *out = *in if in.DataprocClusterRef != nil { in, out := &in.DataprocClusterRef, &out.DataprocClusterRef - *out = new(k8sv1alpha1.ResourceRef) + *out = new(v1alpha1.ResourceRef) **out = **in } return diff --git a/pkg/clients/generated/client/clientset/versioned/clientset.go b/pkg/clients/generated/client/clientset/versioned/clientset.go index 136ead487d..0b6895ddb5 100644 --- a/pkg/clients/generated/client/clientset/versioned/clientset.go +++ b/pkg/clients/generated/client/clientset/versioned/clientset.go @@ -39,7 +39,7 @@ import ( bigqueryv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigquery/v1beta1" bigqueryanalyticshubv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryanalyticshub/v1alpha1" bigqueryanalyticshubv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryanalyticshub/v1beta1" - bigqueryconnectionv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1" + bigqueryconnectionv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1" bigquerydatapolicyv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigquerydatapolicy/v1alpha1" bigquerydatatransferv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigquerydatatransfer/v1beta1" bigqueryreservationv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryreservation/v1alpha1" @@ -168,7 +168,7 @@ type Interface interface { BigqueryV1beta1() bigqueryv1beta1.BigqueryV1beta1Interface BigqueryanalyticshubV1alpha1() bigqueryanalyticshubv1alpha1.BigqueryanalyticshubV1alpha1Interface BigqueryanalyticshubV1beta1() bigqueryanalyticshubv1beta1.BigqueryanalyticshubV1beta1Interface - BigqueryconnectionV1alpha1() bigqueryconnectionv1alpha1.BigqueryconnectionV1alpha1Interface + BigqueryconnectionV1beta1() bigqueryconnectionv1beta1.BigqueryconnectionV1beta1Interface BigquerydatapolicyV1alpha1() bigquerydatapolicyv1alpha1.BigquerydatapolicyV1alpha1Interface BigquerydatatransferV1beta1() bigquerydatatransferv1beta1.BigquerydatatransferV1beta1Interface BigqueryreservationV1alpha1() bigqueryreservationv1alpha1.BigqueryreservationV1alpha1Interface @@ -295,7 +295,7 @@ type Clientset struct { bigqueryV1beta1 *bigqueryv1beta1.BigqueryV1beta1Client bigqueryanalyticshubV1alpha1 *bigqueryanalyticshubv1alpha1.BigqueryanalyticshubV1alpha1Client bigqueryanalyticshubV1beta1 *bigqueryanalyticshubv1beta1.BigqueryanalyticshubV1beta1Client - bigqueryconnectionV1alpha1 *bigqueryconnectionv1alpha1.BigqueryconnectionV1alpha1Client + bigqueryconnectionV1beta1 *bigqueryconnectionv1beta1.BigqueryconnectionV1beta1Client bigquerydatapolicyV1alpha1 *bigquerydatapolicyv1alpha1.BigquerydatapolicyV1alpha1Client bigquerydatatransferV1beta1 *bigquerydatatransferv1beta1.BigquerydatatransferV1beta1Client bigqueryreservationV1alpha1 *bigqueryreservationv1alpha1.BigqueryreservationV1alpha1Client @@ -475,9 +475,9 @@ func (c *Clientset) BigqueryanalyticshubV1beta1() bigqueryanalyticshubv1beta1.Bi return c.bigqueryanalyticshubV1beta1 } -// BigqueryconnectionV1alpha1 retrieves the BigqueryconnectionV1alpha1Client -func (c *Clientset) BigqueryconnectionV1alpha1() bigqueryconnectionv1alpha1.BigqueryconnectionV1alpha1Interface { - return c.bigqueryconnectionV1alpha1 +// BigqueryconnectionV1beta1 retrieves the BigqueryconnectionV1beta1Client +func (c *Clientset) BigqueryconnectionV1beta1() bigqueryconnectionv1beta1.BigqueryconnectionV1beta1Interface { + return c.bigqueryconnectionV1beta1 } // BigquerydatapolicyV1alpha1 retrieves the BigquerydatapolicyV1alpha1Client @@ -1115,7 +1115,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } - cs.bigqueryconnectionV1alpha1, err = bigqueryconnectionv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.bigqueryconnectionV1beta1, err = bigqueryconnectionv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -1582,7 +1582,7 @@ func New(c rest.Interface) *Clientset { cs.bigqueryV1beta1 = bigqueryv1beta1.New(c) cs.bigqueryanalyticshubV1alpha1 = bigqueryanalyticshubv1alpha1.New(c) cs.bigqueryanalyticshubV1beta1 = bigqueryanalyticshubv1beta1.New(c) - cs.bigqueryconnectionV1alpha1 = bigqueryconnectionv1alpha1.New(c) + cs.bigqueryconnectionV1beta1 = bigqueryconnectionv1beta1.New(c) cs.bigquerydatapolicyV1alpha1 = bigquerydatapolicyv1alpha1.New(c) cs.bigquerydatatransferV1beta1 = bigquerydatatransferv1beta1.New(c) cs.bigqueryreservationV1alpha1 = bigqueryreservationv1alpha1.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 276f3f952a..c446e6516b 100644 --- a/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go @@ -51,8 +51,8 @@ import ( fakebigqueryanalyticshubv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryanalyticshub/v1alpha1/fake" bigqueryanalyticshubv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryanalyticshub/v1beta1" fakebigqueryanalyticshubv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryanalyticshub/v1beta1/fake" - bigqueryconnectionv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1" - fakebigqueryconnectionv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/fake" + bigqueryconnectionv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1" + fakebigqueryconnectionv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/fake" bigquerydatapolicyv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigquerydatapolicy/v1alpha1" fakebigquerydatapolicyv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigquerydatapolicy/v1alpha1/fake" bigquerydatatransferv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigquerydatatransfer/v1beta1" @@ -394,9 +394,9 @@ func (c *Clientset) BigqueryanalyticshubV1beta1() bigqueryanalyticshubv1beta1.Bi return &fakebigqueryanalyticshubv1beta1.FakeBigqueryanalyticshubV1beta1{Fake: &c.Fake} } -// BigqueryconnectionV1alpha1 retrieves the BigqueryconnectionV1alpha1Client -func (c *Clientset) BigqueryconnectionV1alpha1() bigqueryconnectionv1alpha1.BigqueryconnectionV1alpha1Interface { - return &fakebigqueryconnectionv1alpha1.FakeBigqueryconnectionV1alpha1{Fake: &c.Fake} +// BigqueryconnectionV1beta1 retrieves the BigqueryconnectionV1beta1Client +func (c *Clientset) BigqueryconnectionV1beta1() bigqueryconnectionv1beta1.BigqueryconnectionV1beta1Interface { + return &fakebigqueryconnectionv1beta1.FakeBigqueryconnectionV1beta1{Fake: &c.Fake} } // BigquerydatapolicyV1alpha1 retrieves the BigquerydatapolicyV1alpha1Client diff --git a/pkg/clients/generated/client/clientset/versioned/fake/register.go b/pkg/clients/generated/client/clientset/versioned/fake/register.go index 6de26447dd..9d1dee405a 100644 --- a/pkg/clients/generated/client/clientset/versioned/fake/register.go +++ b/pkg/clients/generated/client/clientset/versioned/fake/register.go @@ -36,7 +36,7 @@ import ( bigqueryv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigquery/v1beta1" bigqueryanalyticshubv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryanalyticshub/v1alpha1" bigqueryanalyticshubv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryanalyticshub/v1beta1" - bigqueryconnectionv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryconnection/v1alpha1" + bigqueryconnectionv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryconnection/v1beta1" bigquerydatapolicyv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigquerydatapolicy/v1alpha1" bigquerydatatransferv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigquerydatatransfer/v1beta1" bigqueryreservationv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryreservation/v1alpha1" @@ -169,7 +169,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ bigqueryv1beta1.AddToScheme, bigqueryanalyticshubv1alpha1.AddToScheme, bigqueryanalyticshubv1beta1.AddToScheme, - bigqueryconnectionv1alpha1.AddToScheme, + bigqueryconnectionv1beta1.AddToScheme, bigquerydatapolicyv1alpha1.AddToScheme, bigquerydatatransferv1beta1.AddToScheme, bigqueryreservationv1alpha1.AddToScheme, diff --git a/pkg/clients/generated/client/clientset/versioned/scheme/register.go b/pkg/clients/generated/client/clientset/versioned/scheme/register.go index 78b538c2e2..cf610ff9d7 100644 --- a/pkg/clients/generated/client/clientset/versioned/scheme/register.go +++ b/pkg/clients/generated/client/clientset/versioned/scheme/register.go @@ -36,7 +36,7 @@ import ( bigqueryv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigquery/v1beta1" bigqueryanalyticshubv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryanalyticshub/v1alpha1" bigqueryanalyticshubv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryanalyticshub/v1beta1" - bigqueryconnectionv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryconnection/v1alpha1" + bigqueryconnectionv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryconnection/v1beta1" bigquerydatapolicyv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigquerydatapolicy/v1alpha1" bigquerydatatransferv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigquerydatatransfer/v1beta1" bigqueryreservationv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryreservation/v1alpha1" @@ -169,7 +169,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ bigqueryv1beta1.AddToScheme, bigqueryanalyticshubv1alpha1.AddToScheme, bigqueryanalyticshubv1beta1.AddToScheme, - bigqueryconnectionv1alpha1.AddToScheme, + bigqueryconnectionv1beta1.AddToScheme, bigquerydatapolicyv1alpha1.AddToScheme, bigquerydatatransferv1beta1.AddToScheme, bigqueryreservationv1alpha1.AddToScheme, diff --git a/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/bigqueryconnection_client.go b/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/bigqueryconnection_client.go similarity index 64% rename from pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/bigqueryconnection_client.go rename to pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/bigqueryconnection_client.go index ece865ed8c..e73e3f8c72 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/bigqueryconnection_client.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/bigqueryconnection_client.go @@ -19,34 +19,34 @@ // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "net/http" - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryconnection/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryconnection/v1beta1" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) -type BigqueryconnectionV1alpha1Interface interface { +type BigqueryconnectionV1beta1Interface interface { RESTClient() rest.Interface BigQueryConnectionConnectionsGetter } -// BigqueryconnectionV1alpha1Client is used to interact with features provided by the bigqueryconnection.cnrm.cloud.google.com group. -type BigqueryconnectionV1alpha1Client struct { +// BigqueryconnectionV1beta1Client is used to interact with features provided by the bigqueryconnection.cnrm.cloud.google.com group. +type BigqueryconnectionV1beta1Client struct { restClient rest.Interface } -func (c *BigqueryconnectionV1alpha1Client) BigQueryConnectionConnections(namespace string) BigQueryConnectionConnectionInterface { +func (c *BigqueryconnectionV1beta1Client) BigQueryConnectionConnections(namespace string) BigQueryConnectionConnectionInterface { return newBigQueryConnectionConnections(c, namespace) } -// NewForConfig creates a new BigqueryconnectionV1alpha1Client for the given config. +// NewForConfig creates a new BigqueryconnectionV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*BigqueryconnectionV1alpha1Client, error) { +func NewForConfig(c *rest.Config) (*BigqueryconnectionV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -58,9 +58,9 @@ func NewForConfig(c *rest.Config) (*BigqueryconnectionV1alpha1Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new BigqueryconnectionV1alpha1Client for the given config and http client. +// NewForConfigAndClient creates a new BigqueryconnectionV1beta1Client 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) (*BigqueryconnectionV1alpha1Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*BigqueryconnectionV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -69,12 +69,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*BigqueryconnectionV if err != nil { return nil, err } - return &BigqueryconnectionV1alpha1Client{client}, nil + return &BigqueryconnectionV1beta1Client{client}, nil } -// NewForConfigOrDie creates a new BigqueryconnectionV1alpha1Client for the given config and +// NewForConfigOrDie creates a new BigqueryconnectionV1beta1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *BigqueryconnectionV1alpha1Client { +func NewForConfigOrDie(c *rest.Config) *BigqueryconnectionV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -82,13 +82,13 @@ func NewForConfigOrDie(c *rest.Config) *BigqueryconnectionV1alpha1Client { return client } -// New creates a new BigqueryconnectionV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *BigqueryconnectionV1alpha1Client { - return &BigqueryconnectionV1alpha1Client{c} +// New creates a new BigqueryconnectionV1beta1Client for the given RESTClient. +func New(c rest.Interface) *BigqueryconnectionV1beta1Client { + return &BigqueryconnectionV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion + gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() @@ -102,7 +102,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *BigqueryconnectionV1alpha1Client) RESTClient() rest.Interface { +func (c *BigqueryconnectionV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/bigqueryconnectionconnection.go b/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/bigqueryconnectionconnection.go similarity index 76% rename from pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/bigqueryconnectionconnection.go rename to pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/bigqueryconnectionconnection.go index ce317ac304..1a935108a1 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/bigqueryconnectionconnection.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/bigqueryconnectionconnection.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/bigqueryconnection/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryconnection/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 BigQueryConnectionConnectionsGetter interface { // BigQueryConnectionConnectionInterface has methods to work with BigQueryConnectionConnection resources. type BigQueryConnectionConnectionInterface interface { - Create(ctx context.Context, bigQueryConnectionConnection *v1alpha1.BigQueryConnectionConnection, opts v1.CreateOptions) (*v1alpha1.BigQueryConnectionConnection, error) - Update(ctx context.Context, bigQueryConnectionConnection *v1alpha1.BigQueryConnectionConnection, opts v1.UpdateOptions) (*v1alpha1.BigQueryConnectionConnection, error) - UpdateStatus(ctx context.Context, bigQueryConnectionConnection *v1alpha1.BigQueryConnectionConnection, opts v1.UpdateOptions) (*v1alpha1.BigQueryConnectionConnection, error) + Create(ctx context.Context, bigQueryConnectionConnection *v1beta1.BigQueryConnectionConnection, opts v1.CreateOptions) (*v1beta1.BigQueryConnectionConnection, error) + Update(ctx context.Context, bigQueryConnectionConnection *v1beta1.BigQueryConnectionConnection, opts v1.UpdateOptions) (*v1beta1.BigQueryConnectionConnection, error) + UpdateStatus(ctx context.Context, bigQueryConnectionConnection *v1beta1.BigQueryConnectionConnection, opts v1.UpdateOptions) (*v1beta1.BigQueryConnectionConnection, 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.BigQueryConnectionConnection, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BigQueryConnectionConnectionList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.BigQueryConnectionConnection, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.BigQueryConnectionConnectionList, 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.BigQueryConnectionConnection, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BigQueryConnectionConnection, err error) BigQueryConnectionConnectionExpansion } @@ -60,7 +60,7 @@ type bigQueryConnectionConnections struct { } // newBigQueryConnectionConnections returns a BigQueryConnectionConnections -func newBigQueryConnectionConnections(c *BigqueryconnectionV1alpha1Client, namespace string) *bigQueryConnectionConnections { +func newBigQueryConnectionConnections(c *BigqueryconnectionV1beta1Client, namespace string) *bigQueryConnectionConnections { return &bigQueryConnectionConnections{ client: c.RESTClient(), ns: namespace, @@ -68,8 +68,8 @@ func newBigQueryConnectionConnections(c *BigqueryconnectionV1alpha1Client, names } // Get takes name of the bigQueryConnectionConnection, and returns the corresponding bigQueryConnectionConnection object, and an error if there is any. -func (c *bigQueryConnectionConnections) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BigQueryConnectionConnection, err error) { - result = &v1alpha1.BigQueryConnectionConnection{} +func (c *bigQueryConnectionConnections) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BigQueryConnectionConnection, err error) { + result = &v1beta1.BigQueryConnectionConnection{} err = c.client.Get(). Namespace(c.ns). Resource("bigqueryconnectionconnections"). @@ -81,12 +81,12 @@ func (c *bigQueryConnectionConnections) Get(ctx context.Context, name string, op } // List takes label and field selectors, and returns the list of BigQueryConnectionConnections that match those selectors. -func (c *bigQueryConnectionConnections) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BigQueryConnectionConnectionList, err error) { +func (c *bigQueryConnectionConnections) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BigQueryConnectionConnectionList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.BigQueryConnectionConnectionList{} + result = &v1beta1.BigQueryConnectionConnectionList{} err = c.client.Get(). Namespace(c.ns). Resource("bigqueryconnectionconnections"). @@ -113,8 +113,8 @@ func (c *bigQueryConnectionConnections) Watch(ctx context.Context, opts v1.ListO } // Create takes the representation of a bigQueryConnectionConnection and creates it. Returns the server's representation of the bigQueryConnectionConnection, and an error, if there is any. -func (c *bigQueryConnectionConnections) Create(ctx context.Context, bigQueryConnectionConnection *v1alpha1.BigQueryConnectionConnection, opts v1.CreateOptions) (result *v1alpha1.BigQueryConnectionConnection, err error) { - result = &v1alpha1.BigQueryConnectionConnection{} +func (c *bigQueryConnectionConnections) Create(ctx context.Context, bigQueryConnectionConnection *v1beta1.BigQueryConnectionConnection, opts v1.CreateOptions) (result *v1beta1.BigQueryConnectionConnection, err error) { + result = &v1beta1.BigQueryConnectionConnection{} err = c.client.Post(). Namespace(c.ns). Resource("bigqueryconnectionconnections"). @@ -126,8 +126,8 @@ func (c *bigQueryConnectionConnections) Create(ctx context.Context, bigQueryConn } // Update takes the representation of a bigQueryConnectionConnection and updates it. Returns the server's representation of the bigQueryConnectionConnection, and an error, if there is any. -func (c *bigQueryConnectionConnections) Update(ctx context.Context, bigQueryConnectionConnection *v1alpha1.BigQueryConnectionConnection, opts v1.UpdateOptions) (result *v1alpha1.BigQueryConnectionConnection, err error) { - result = &v1alpha1.BigQueryConnectionConnection{} +func (c *bigQueryConnectionConnections) Update(ctx context.Context, bigQueryConnectionConnection *v1beta1.BigQueryConnectionConnection, opts v1.UpdateOptions) (result *v1beta1.BigQueryConnectionConnection, err error) { + result = &v1beta1.BigQueryConnectionConnection{} err = c.client.Put(). Namespace(c.ns). Resource("bigqueryconnectionconnections"). @@ -141,8 +141,8 @@ func (c *bigQueryConnectionConnections) Update(ctx context.Context, bigQueryConn // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *bigQueryConnectionConnections) UpdateStatus(ctx context.Context, bigQueryConnectionConnection *v1alpha1.BigQueryConnectionConnection, opts v1.UpdateOptions) (result *v1alpha1.BigQueryConnectionConnection, err error) { - result = &v1alpha1.BigQueryConnectionConnection{} +func (c *bigQueryConnectionConnections) UpdateStatus(ctx context.Context, bigQueryConnectionConnection *v1beta1.BigQueryConnectionConnection, opts v1.UpdateOptions) (result *v1beta1.BigQueryConnectionConnection, err error) { + result = &v1beta1.BigQueryConnectionConnection{} err = c.client.Put(). Namespace(c.ns). Resource("bigqueryconnectionconnections"). @@ -183,8 +183,8 @@ func (c *bigQueryConnectionConnections) DeleteCollection(ctx context.Context, op } // Patch applies the patch and returns the patched bigQueryConnectionConnection. -func (c *bigQueryConnectionConnections) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BigQueryConnectionConnection, err error) { - result = &v1alpha1.BigQueryConnectionConnection{} +func (c *bigQueryConnectionConnections) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BigQueryConnectionConnection, err error) { + result = &v1beta1.BigQueryConnectionConnection{} err = c.client.Patch(pt). Namespace(c.ns). Resource("bigqueryconnectionconnections"). diff --git a/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/doc.go b/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/doc.go similarity index 98% rename from pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/doc.go rename to pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/doc.go index d3dac805d0..41dbecdb4a 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/doc.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/doc.go @@ -20,4 +20,4 @@ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1alpha1 +package v1beta1 diff --git a/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/fake/doc.go b/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/fake/doc.go similarity index 100% rename from pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/fake/doc.go rename to pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/fake/doc.go diff --git a/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/fake/fake_bigqueryconnection_client.go b/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/fake/fake_bigqueryconnection_client.go similarity index 74% rename from pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/fake/fake_bigqueryconnection_client.go rename to pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/fake/fake_bigqueryconnection_client.go index 3d73e99ff8..e3b274fdde 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/fake/fake_bigqueryconnection_client.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/fake/fake_bigqueryconnection_client.go @@ -22,22 +22,22 @@ package fake import ( - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeBigqueryconnectionV1alpha1 struct { +type FakeBigqueryconnectionV1beta1 struct { *testing.Fake } -func (c *FakeBigqueryconnectionV1alpha1) BigQueryConnectionConnections(namespace string) v1alpha1.BigQueryConnectionConnectionInterface { +func (c *FakeBigqueryconnectionV1beta1) BigQueryConnectionConnections(namespace string) v1beta1.BigQueryConnectionConnectionInterface { return &FakeBigQueryConnectionConnections{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeBigqueryconnectionV1alpha1) RESTClient() rest.Interface { +func (c *FakeBigqueryconnectionV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/fake/fake_bigqueryconnectionconnection.go b/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/fake/fake_bigqueryconnectionconnection.go similarity index 66% rename from pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/fake/fake_bigqueryconnectionconnection.go rename to pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/fake/fake_bigqueryconnectionconnection.go index d7d5ec8c2d..66793ca4a5 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/fake/fake_bigqueryconnectionconnection.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/fake/fake_bigqueryconnectionconnection.go @@ -24,7 +24,7 @@ package fake import ( "context" - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryconnection/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/bigqueryconnection/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 ( // FakeBigQueryConnectionConnections implements BigQueryConnectionConnectionInterface type FakeBigQueryConnectionConnections struct { - Fake *FakeBigqueryconnectionV1alpha1 + Fake *FakeBigqueryconnectionV1beta1 ns string } -var bigqueryconnectionconnectionsResource = v1alpha1.SchemeGroupVersion.WithResource("bigqueryconnectionconnections") +var bigqueryconnectionconnectionsResource = v1beta1.SchemeGroupVersion.WithResource("bigqueryconnectionconnections") -var bigqueryconnectionconnectionsKind = v1alpha1.SchemeGroupVersion.WithKind("BigQueryConnectionConnection") +var bigqueryconnectionconnectionsKind = v1beta1.SchemeGroupVersion.WithKind("BigQueryConnectionConnection") // Get takes name of the bigQueryConnectionConnection, and returns the corresponding bigQueryConnectionConnection object, and an error if there is any. -func (c *FakeBigQueryConnectionConnections) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BigQueryConnectionConnection, err error) { +func (c *FakeBigQueryConnectionConnections) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BigQueryConnectionConnection, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(bigqueryconnectionconnectionsResource, c.ns, name), &v1alpha1.BigQueryConnectionConnection{}) + Invokes(testing.NewGetAction(bigqueryconnectionconnectionsResource, c.ns, name), &v1beta1.BigQueryConnectionConnection{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.BigQueryConnectionConnection), err + return obj.(*v1beta1.BigQueryConnectionConnection), err } // List takes label and field selectors, and returns the list of BigQueryConnectionConnections that match those selectors. -func (c *FakeBigQueryConnectionConnections) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BigQueryConnectionConnectionList, err error) { +func (c *FakeBigQueryConnectionConnections) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BigQueryConnectionConnectionList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(bigqueryconnectionconnectionsResource, bigqueryconnectionconnectionsKind, c.ns, opts), &v1alpha1.BigQueryConnectionConnectionList{}) + Invokes(testing.NewListAction(bigqueryconnectionconnectionsResource, bigqueryconnectionconnectionsKind, c.ns, opts), &v1beta1.BigQueryConnectionConnectionList{}) if obj == nil { return nil, err @@ -66,8 +66,8 @@ func (c *FakeBigQueryConnectionConnections) List(ctx context.Context, opts v1.Li if label == nil { label = labels.Everything() } - list := &v1alpha1.BigQueryConnectionConnectionList{ListMeta: obj.(*v1alpha1.BigQueryConnectionConnectionList).ListMeta} - for _, item := range obj.(*v1alpha1.BigQueryConnectionConnectionList).Items { + list := &v1beta1.BigQueryConnectionConnectionList{ListMeta: obj.(*v1beta1.BigQueryConnectionConnectionList).ListMeta} + for _, item := range obj.(*v1beta1.BigQueryConnectionConnectionList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -83,43 +83,43 @@ func (c *FakeBigQueryConnectionConnections) Watch(ctx context.Context, opts v1.L } // Create takes the representation of a bigQueryConnectionConnection and creates it. Returns the server's representation of the bigQueryConnectionConnection, and an error, if there is any. -func (c *FakeBigQueryConnectionConnections) Create(ctx context.Context, bigQueryConnectionConnection *v1alpha1.BigQueryConnectionConnection, opts v1.CreateOptions) (result *v1alpha1.BigQueryConnectionConnection, err error) { +func (c *FakeBigQueryConnectionConnections) Create(ctx context.Context, bigQueryConnectionConnection *v1beta1.BigQueryConnectionConnection, opts v1.CreateOptions) (result *v1beta1.BigQueryConnectionConnection, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(bigqueryconnectionconnectionsResource, c.ns, bigQueryConnectionConnection), &v1alpha1.BigQueryConnectionConnection{}) + Invokes(testing.NewCreateAction(bigqueryconnectionconnectionsResource, c.ns, bigQueryConnectionConnection), &v1beta1.BigQueryConnectionConnection{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.BigQueryConnectionConnection), err + return obj.(*v1beta1.BigQueryConnectionConnection), err } // Update takes the representation of a bigQueryConnectionConnection and updates it. Returns the server's representation of the bigQueryConnectionConnection, and an error, if there is any. -func (c *FakeBigQueryConnectionConnections) Update(ctx context.Context, bigQueryConnectionConnection *v1alpha1.BigQueryConnectionConnection, opts v1.UpdateOptions) (result *v1alpha1.BigQueryConnectionConnection, err error) { +func (c *FakeBigQueryConnectionConnections) Update(ctx context.Context, bigQueryConnectionConnection *v1beta1.BigQueryConnectionConnection, opts v1.UpdateOptions) (result *v1beta1.BigQueryConnectionConnection, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(bigqueryconnectionconnectionsResource, c.ns, bigQueryConnectionConnection), &v1alpha1.BigQueryConnectionConnection{}) + Invokes(testing.NewUpdateAction(bigqueryconnectionconnectionsResource, c.ns, bigQueryConnectionConnection), &v1beta1.BigQueryConnectionConnection{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.BigQueryConnectionConnection), err + return obj.(*v1beta1.BigQueryConnectionConnection), 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 *FakeBigQueryConnectionConnections) UpdateStatus(ctx context.Context, bigQueryConnectionConnection *v1alpha1.BigQueryConnectionConnection, opts v1.UpdateOptions) (*v1alpha1.BigQueryConnectionConnection, error) { +func (c *FakeBigQueryConnectionConnections) UpdateStatus(ctx context.Context, bigQueryConnectionConnection *v1beta1.BigQueryConnectionConnection, opts v1.UpdateOptions) (*v1beta1.BigQueryConnectionConnection, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(bigqueryconnectionconnectionsResource, "status", c.ns, bigQueryConnectionConnection), &v1alpha1.BigQueryConnectionConnection{}) + Invokes(testing.NewUpdateSubresourceAction(bigqueryconnectionconnectionsResource, "status", c.ns, bigQueryConnectionConnection), &v1beta1.BigQueryConnectionConnection{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.BigQueryConnectionConnection), err + return obj.(*v1beta1.BigQueryConnectionConnection), err } // Delete takes name of the bigQueryConnectionConnection and deletes it. Returns an error if one occurs. func (c *FakeBigQueryConnectionConnections) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(bigqueryconnectionconnectionsResource, c.ns, name, opts), &v1alpha1.BigQueryConnectionConnection{}) + Invokes(testing.NewDeleteActionWithOptions(bigqueryconnectionconnectionsResource, c.ns, name, opts), &v1beta1.BigQueryConnectionConnection{}) return err } @@ -128,17 +128,17 @@ func (c *FakeBigQueryConnectionConnections) Delete(ctx context.Context, name str func (c *FakeBigQueryConnectionConnections) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionAction(bigqueryconnectionconnectionsResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha1.BigQueryConnectionConnectionList{}) + _, err := c.Fake.Invokes(action, &v1beta1.BigQueryConnectionConnectionList{}) return err } // Patch applies the patch and returns the patched bigQueryConnectionConnection. -func (c *FakeBigQueryConnectionConnections) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BigQueryConnectionConnection, err error) { +func (c *FakeBigQueryConnectionConnections) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BigQueryConnectionConnection, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(bigqueryconnectionconnectionsResource, c.ns, name, pt, data, subresources...), &v1alpha1.BigQueryConnectionConnection{}) + Invokes(testing.NewPatchSubresourceAction(bigqueryconnectionconnectionsResource, c.ns, name, pt, data, subresources...), &v1beta1.BigQueryConnectionConnection{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.BigQueryConnectionConnection), err + return obj.(*v1beta1.BigQueryConnectionConnection), err } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/generated_expansion.go b/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/generated_expansion.go similarity index 98% rename from pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/generated_expansion.go rename to pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/generated_expansion.go index 93cb0da04d..ab827185b0 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1alpha1/generated_expansion.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/bigqueryconnection/v1beta1/generated_expansion.go @@ -19,6 +19,6 @@ // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 type BigQueryConnectionConnectionExpansion interface{} diff --git a/pkg/gvks/supportedgvks/gvks_generated.go b/pkg/gvks/supportedgvks/gvks_generated.go index c7d626d735..e942ad4782 100644 --- a/pkg/gvks/supportedgvks/gvks_generated.go +++ b/pkg/gvks/supportedgvks/gvks_generated.go @@ -509,6 +509,16 @@ var SupportedGVKs = map[schema.GroupVersionKind]GVKMetadata{ "cnrm.cloud.google.com/system": "true", }, }, + { + Group: "bigqueryconnection.cnrm.cloud.google.com", + Version: "v1beta1", + Kind: "BigQueryConnectionConnection", + }: { + Labels: map[string]string{ + "cnrm.cloud.google.com/managed-by-kcc": "true", + "cnrm.cloud.google.com/system": "true", + }, + }, { Group: "bigquerydatapolicy.cnrm.cloud.google.com", Version: "v1alpha1", From 0a7a50d4476ed616812fb8857f66c8df4836de16 Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Tue, 5 Nov 2024 20:45:23 +0100 Subject: [PATCH 12/17] fix license header and remove bqcc from allowlist --- .../bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml | 1 - .../cloudsql-connection/sql_v1beta1_sqluser.yaml | 1 - .../bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml | 1 - scripts/resource-autogen/allowlist/allowlist.go | 1 - 4 files changed, 4 deletions(-) diff --git a/config/samples/resources/bigqueryconnectionconnection/cloudresource-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml b/config/samples/resources/bigqueryconnectionconnection/cloudresource-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml index 5b0aa0523c..1130e1d427 100644 --- a/config/samples/resources/bigqueryconnectionconnection/cloudresource-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml +++ b/config/samples/resources/bigqueryconnectionconnection/cloudresource-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml @@ -1,4 +1,3 @@ - # Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqluser.yaml b/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqluser.yaml index bac4846c97..125afe810f 100644 --- a/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqluser.yaml +++ b/config/samples/resources/bigqueryconnectionconnection/cloudsql-connection/sql_v1beta1_sqluser.yaml @@ -1,4 +1,3 @@ - # Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/config/samples/resources/bigqueryconnectionconnection/spark-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml b/config/samples/resources/bigqueryconnectionconnection/spark-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml index b0d3bd4ba3..c942132974 100644 --- a/config/samples/resources/bigqueryconnectionconnection/spark-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml +++ b/config/samples/resources/bigqueryconnectionconnection/spark-connection/bigqueryconnection_v1beta1_bigqueryconnectionconnection.yaml @@ -1,4 +1,3 @@ - # Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/scripts/resource-autogen/allowlist/allowlist.go b/scripts/resource-autogen/allowlist/allowlist.go index db1a1000ca..d26cbbae4a 100644 --- a/scripts/resource-autogen/allowlist/allowlist.go +++ b/scripts/resource-autogen/allowlist/allowlist.go @@ -56,7 +56,6 @@ var ( "beyondcorp/google_beyondcorp_app_gateway", "bigquery/google_bigquery_dataset_access", "bigquery_analytics_hub/google_bigquery_analytics_hub_listing", - "bigquery_connection/google_bigquery_connection", "bigquery_datapolicy/google_bigquery_datapolicy_data_policy", "bigquery_reservation/google_bigquery_capacity_commitment", "bigquery_reservation/google_bigquery_reservation", From 457d6e068a0c764db10be4d698bc8aeeb31feb10 Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Wed, 6 Nov 2024 10:32:35 +0100 Subject: [PATCH 13/17] update Mockgcp for sqlinstance, sqluser, and sqldatabse --- mockgcp/mocksql/service.go | 11 +++++++++++ mockgcp/mocksql/sqlinstance.go | 8 +++++++- mockgcp/mocksql/sqluser.go | 5 +++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/mockgcp/mocksql/service.go b/mockgcp/mocksql/service.go index 2b88ec6df1..386c6b6e84 100644 --- a/mockgcp/mocksql/service.go +++ b/mockgcp/mocksql/service.go @@ -82,6 +82,17 @@ func (s *MockService) NewHTTPMux(ctx context.Context, conn *grpc.ClientConn) (ht error.Message = "The Cloud SQL instance does not exist." error.Status = "" } + + for errIdx := range error.Errors { + if strings.HasPrefix(error.Errors[errIdx].Message, "database ") { + error.Errors[errIdx].Message = "Not Found." + error.Errors[errIdx].Reason = "notFound" + } + } + if strings.HasPrefix(error.Message, "database ") { + error.Message = "Not Found" + error.Status = "" + } } } diff --git a/mockgcp/mocksql/sqlinstance.go b/mockgcp/mocksql/sqlinstance.go index 0046d25da1..91d5cab422 100644 --- a/mockgcp/mocksql/sqlinstance.go +++ b/mockgcp/mocksql/sqlinstance.go @@ -287,7 +287,7 @@ func setDatabaseVersionDefaults(obj *pb.DatabaseInstance) error { switch obj.DatabaseVersion { case pb.SqlDatabaseVersion_MYSQL_5_7: obj.DatabaseInstalledVersion = "MYSQL_5_7_44" - obj.MaintenanceVersion = "MYSQL_5_7_44.R20231105.01_03" + obj.MaintenanceVersion = "MYSQL_5_7_44.R20241020.00_00" obj.UpgradableDatabaseVersions = []*pb.AvailableDatabaseVersion{ { DisplayName: asRef("MySQL 8.0"), @@ -359,6 +359,11 @@ func setDatabaseVersionDefaults(obj *pb.DatabaseInstance) error { MajorVersion: asRef("MYSQL_8_0"), Name: asRef("MYSQL_8_0_37"), }, + { + DisplayName: asRef("MySQL 8.0.39"), + MajorVersion: asRef("MYSQL_8_0"), + Name: asRef("MYSQL_8_0_39"), + }, } case pb.SqlDatabaseVersion_MYSQL_8_0: obj.DatabaseInstalledVersion = "MYSQL_8_0_31" @@ -521,6 +526,7 @@ func populateDefaults(obj *pb.DatabaseInstance) { Entitled: asRef(false), FlagRecommenderEnabled: asRef(false), IndexAdvisorEnabled: asRef(false), + ActiveQueryEnabled: asRef(false), } } else if isPostgres(obj) { obj.GeminiConfig = &pb.GeminiInstanceConfig{ diff --git a/mockgcp/mocksql/sqluser.go b/mockgcp/mocksql/sqluser.go index b71efa4752..0a2b297a48 100644 --- a/mockgcp/mocksql/sqluser.go +++ b/mockgcp/mocksql/sqluser.go @@ -92,6 +92,11 @@ func (s *sqlUsersService) Insert(ctx context.Context, req *pb.SqlUsersInsertRequ obj.Project = name.Project.ID obj.Instance = name.Instance obj.Kind = "sql#user" + if obj.GetPasswordPolicy() == nil { + obj.PasswordPolicy = &pb.UserPasswordValidationPolicy{ + Status: &pb.PasswordStatus{}, + } + } obj.Etag = fields.ComputeWeakEtag(obj) From 3ea786e746b2624dc6c630fc7ad1783ff50dbde9 Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Wed, 6 Nov 2024 11:25:01 +0100 Subject: [PATCH 14/17] change the format of cloudSQL.database --- apis/refs/v1beta1/sqldatabaseref.go | 25 ++++--- .../connection_controller.go | 2 +- .../cloudsqlconnectionbasic/_http.log | 71 +++++++++++++++---- 3 files changed, 72 insertions(+), 26 deletions(-) diff --git a/apis/refs/v1beta1/sqldatabaseref.go b/apis/refs/v1beta1/sqldatabaseref.go index 504d3102f6..2aacec9bf3 100644 --- a/apis/refs/v1beta1/sqldatabaseref.go +++ b/apis/refs/v1beta1/sqldatabaseref.go @@ -17,7 +17,6 @@ package v1beta1 import ( "context" "fmt" - "strings" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -41,8 +40,15 @@ type SQLDatabase struct { DatabaseID string } +func (s *SQLDatabase) Name() string { + return s.DatabaseID +} + func (s *SQLDatabase) String() string { - return "projects/" + s.ProjectID + "/instances/" + s.InstanceID + "/databases/" + s.DatabaseID + if s.ProjectID != "" && s.InstanceID != "" { + return "projects/" + s.ProjectID + "/instances/" + s.InstanceID + "/databases/" + s.DatabaseID + } + return s.DatabaseID } func ResolveSQLDatabaseRef(ctx context.Context, reader client.Reader, obj client.Object, ref *SQLDatabaseRef) (*SQLDatabase, error) { @@ -58,17 +64,10 @@ func ResolveSQLDatabaseRef(ctx context.Context, reader client.Reader, obj client } if ref.External != "" { - // External must be in form `projects//instances//databases/`. - // see https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/databases/get - tokens := strings.Split(ref.External, "/") - if len(tokens) == 6 && tokens[0] == "projects" && tokens[2] == "instances" && tokens[4] == "databases" { - return &SQLDatabase{ - ProjectID: tokens[1], - InstanceID: tokens[3], - DatabaseID: tokens[5], - }, nil - } - return nil, fmt.Errorf("format of SQLinstance external=%q was not known (use projects//instances//databases/)", ref.External) + // External is the name of the sql database + return &SQLDatabase{ + DatabaseID: ref.External, + }, nil } key := types.NamespacedName{ diff --git a/pkg/controller/direct/bigqueryconnection/connection_controller.go b/pkg/controller/direct/bigqueryconnection/connection_controller.go index 997fe4f76f..4a791d1188 100644 --- a/pkg/controller/direct/bigqueryconnection/connection_controller.go +++ b/pkg/controller/direct/bigqueryconnection/connection_controller.go @@ -111,7 +111,7 @@ func (a *Adapter) normalizeReference(ctx context.Context) error { if err != nil { return err } - sql.DatabaseRef.External = database.String() + sql.DatabaseRef.External = database.Name() } if sql.Credential != nil { if err := refsv1beta1secret.NormalizedSecret(ctx, sql.Credential.SecretRef, a.reader, a.namespace); err != nil { diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_http.log b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_http.log index 44abab562f..6c0bd226ed 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_http.log @@ -133,6 +133,9 @@ X-Xss-Protection: 0 "instance": "sqlinstance-sample-${uniqueId}", "kind": "sql#user", "name": "root", + "passwordPolicy": { + "status": {} + }, "project": "${projectId}" } ], @@ -224,6 +227,7 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "gceZone": "us-central1-a", "geminiConfig": { + "activeQueryEnabled": false, "entitled": false, "flagRecommenderEnabled": false, "indexAdvisorEnabled": false @@ -236,7 +240,7 @@ X-Xss-Protection: 0 } ], "kind": "sql#instance", - "maintenanceVersion": "MYSQL_5_7_44.R20231105.01_03", + "maintenanceVersion": "MYSQL_5_7_44.R20241020.00_00", "name": "sqlinstance-sample-${uniqueId}", "project": "${projectId}", "region": "us-central1", @@ -365,6 +369,11 @@ X-Xss-Protection: 0 "displayName": "MySQL 8.0.37", "majorVersion": "MYSQL_8_0", "name": "MYSQL_8_0_37" + }, + { + "displayName": "MySQL 8.0.39", + "majorVersion": "MYSQL_8_0", + "name": "MYSQL_8_0_39" } ] } @@ -392,12 +401,11 @@ X-Xss-Protection: 0 "errors": [ { "domain": "global", - "message": "database \"projects/${projectId}/instances/sqlinstance-sample-${uniqueId}/databases/sqldatabase-sample-${uniqueId}\" not found", + "message": "Not Found.", "reason": "notFound" } ], - "message": "database \"projects/${projectId}/instances/sqlinstance-sample-${uniqueId}/databases/sqldatabase-sample-${uniqueId}\" not found", - "status": "NOT_FOUND" + "message": "Not Found" } } @@ -541,6 +549,7 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "gceZone": "us-central1-a", "geminiConfig": { + "activeQueryEnabled": false, "entitled": false, "flagRecommenderEnabled": false, "indexAdvisorEnabled": false @@ -553,7 +562,7 @@ X-Xss-Protection: 0 } ], "kind": "sql#instance", - "maintenanceVersion": "MYSQL_5_7_44.R20231105.01_03", + "maintenanceVersion": "MYSQL_5_7_44.R20241020.00_00", "name": "sqlinstance-sample-${uniqueId}", "project": "${projectId}", "region": "us-central1", @@ -682,6 +691,11 @@ X-Xss-Protection: 0 "displayName": "MySQL 8.0.37", "majorVersion": "MYSQL_8_0", "name": "MYSQL_8_0_37" + }, + { + "displayName": "MySQL 8.0.39", + "majorVersion": "MYSQL_8_0", + "name": "MYSQL_8_0_39" } ] } @@ -779,6 +793,9 @@ X-Xss-Protection: 0 "kind": "sql#user", "name": "sqluser-${uniqueId}", "password": "cGFzc3dvcmQ=", + "passwordPolicy": { + "status": {} + }, "project": "${projectId}" } ], @@ -810,6 +827,7 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "gceZone": "us-central1-a", "geminiConfig": { + "activeQueryEnabled": false, "entitled": false, "flagRecommenderEnabled": false, "indexAdvisorEnabled": false @@ -822,7 +840,7 @@ X-Xss-Protection: 0 } ], "kind": "sql#instance", - "maintenanceVersion": "MYSQL_5_7_44.R20231105.01_03", + "maintenanceVersion": "MYSQL_5_7_44.R20241020.00_00", "name": "sqlinstance-sample-${uniqueId}", "project": "${projectId}", "region": "us-central1", @@ -951,6 +969,11 @@ X-Xss-Protection: 0 "displayName": "MySQL 8.0.37", "majorVersion": "MYSQL_8_0", "name": "MYSQL_8_0_37" + }, + { + "displayName": "MySQL 8.0.39", + "majorVersion": "MYSQL_8_0", + "name": "MYSQL_8_0_39" } ] } @@ -980,6 +1003,9 @@ X-Xss-Protection: 0 "kind": "sql#user", "name": "sqluser-${uniqueId}", "password": "cGFzc3dvcmQ=", + "passwordPolicy": { + "status": {} + }, "project": "${projectId}" } ], @@ -1011,6 +1037,7 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "gceZone": "us-central1-a", "geminiConfig": { + "activeQueryEnabled": false, "entitled": false, "flagRecommenderEnabled": false, "indexAdvisorEnabled": false @@ -1023,7 +1050,7 @@ X-Xss-Protection: 0 } ], "kind": "sql#instance", - "maintenanceVersion": "MYSQL_5_7_44.R20231105.01_03", + "maintenanceVersion": "MYSQL_5_7_44.R20241020.00_00", "name": "sqlinstance-sample-${uniqueId}", "project": "${projectId}", "region": "us-central1", @@ -1152,6 +1179,11 @@ X-Xss-Protection: 0 "displayName": "MySQL 8.0.37", "majorVersion": "MYSQL_8_0", "name": "MYSQL_8_0_37" + }, + { + "displayName": "MySQL 8.0.39", + "majorVersion": "MYSQL_8_0", + "name": "MYSQL_8_0_39" } ] } @@ -1169,7 +1201,7 @@ x-goog-request-params: parent=projects%2F${projectId}%2Flocations%2Fus-central1 "password": "cGFzc3dvcmQ=", "username": "sqluser-${uniqueId}" }, - "database": "projects/${projectId}/instances/sqlinstance-sample-${uniqueId}/databases/sqldatabase-sample-${uniqueId}", + "database": "sqldatabase-sample-${uniqueId}", "instanceId": "${projectId}:us-central1:sqlinstance-sample-${uniqueId}", "type": 2 } @@ -1188,7 +1220,7 @@ X-Xss-Protection: 0 { "cloudSql": { - "database": "projects/${projectId}/instances/sqlinstance-sample-${uniqueId}/databases/sqldatabase-sample-${uniqueId}", + "database": "sqldatabase-sample-${uniqueId}", "instanceId": "${projectId}:us-central1:sqlinstance-sample-${uniqueId}", "serviceAccountId": "service-${projectNumber}@gcp-sa-bigqueryconnection.iam.gserviceaccount.com", "type": 2 @@ -1219,7 +1251,7 @@ X-Xss-Protection: 0 { "cloudSql": { - "database": "projects/${projectId}/instances/sqlinstance-sample-${uniqueId}/databases/sqldatabase-sample-${uniqueId}", + "database": "sqldatabase-sample-${uniqueId}", "instanceId": "${projectId}:us-central1:sqlinstance-sample-${uniqueId}", "serviceAccountId": "service-${projectNumber}@gcp-sa-bigqueryconnection.iam.gserviceaccount.com", "type": 2 @@ -1275,6 +1307,9 @@ X-Xss-Protection: 0 "kind": "sql#user", "name": "sqluser-${uniqueId}", "password": "cGFzc3dvcmQ=", + "passwordPolicy": { + "status": {} + }, "project": "${projectId}" } ], @@ -1306,6 +1341,7 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "gceZone": "us-central1-a", "geminiConfig": { + "activeQueryEnabled": false, "entitled": false, "flagRecommenderEnabled": false, "indexAdvisorEnabled": false @@ -1318,7 +1354,7 @@ X-Xss-Protection: 0 } ], "kind": "sql#instance", - "maintenanceVersion": "MYSQL_5_7_44.R20231105.01_03", + "maintenanceVersion": "MYSQL_5_7_44.R20241020.00_00", "name": "sqlinstance-sample-${uniqueId}", "project": "${projectId}", "region": "us-central1", @@ -1447,6 +1483,11 @@ X-Xss-Protection: 0 "displayName": "MySQL 8.0.37", "majorVersion": "MYSQL_8_0", "name": "MYSQL_8_0_37" + }, + { + "displayName": "MySQL 8.0.39", + "majorVersion": "MYSQL_8_0", + "name": "MYSQL_8_0_39" } ] } @@ -1625,6 +1666,7 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "gceZone": "us-central1-a", "geminiConfig": { + "activeQueryEnabled": false, "entitled": false, "flagRecommenderEnabled": false, "indexAdvisorEnabled": false @@ -1637,7 +1679,7 @@ X-Xss-Protection: 0 } ], "kind": "sql#instance", - "maintenanceVersion": "MYSQL_5_7_44.R20231105.01_03", + "maintenanceVersion": "MYSQL_5_7_44.R20241020.00_00", "name": "sqlinstance-sample-${uniqueId}", "project": "${projectId}", "region": "us-central1", @@ -1766,6 +1808,11 @@ X-Xss-Protection: 0 "displayName": "MySQL 8.0.37", "majorVersion": "MYSQL_8_0", "name": "MYSQL_8_0_37" + }, + { + "displayName": "MySQL 8.0.39", + "majorVersion": "MYSQL_8_0", + "name": "MYSQL_8_0_39" } ] } From b1e5a710bc53d3c0c892d0c0ea22b974b9715fdb Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Wed, 6 Nov 2024 14:02:56 +0100 Subject: [PATCH 15/17] revert changes to mockgcp for cloudsql #28f990192 --- mockgcp/mocksql/service.go | 11 ---- mockgcp/mocksql/sqlinstance.go | 8 +-- mockgcp/mocksql/sqluser.go | 5 -- .../cloudsqlconnectionbasic/_http.log | 65 +++---------------- 4 files changed, 10 insertions(+), 79 deletions(-) diff --git a/mockgcp/mocksql/service.go b/mockgcp/mocksql/service.go index 386c6b6e84..2b88ec6df1 100644 --- a/mockgcp/mocksql/service.go +++ b/mockgcp/mocksql/service.go @@ -82,17 +82,6 @@ func (s *MockService) NewHTTPMux(ctx context.Context, conn *grpc.ClientConn) (ht error.Message = "The Cloud SQL instance does not exist." error.Status = "" } - - for errIdx := range error.Errors { - if strings.HasPrefix(error.Errors[errIdx].Message, "database ") { - error.Errors[errIdx].Message = "Not Found." - error.Errors[errIdx].Reason = "notFound" - } - } - if strings.HasPrefix(error.Message, "database ") { - error.Message = "Not Found" - error.Status = "" - } } } diff --git a/mockgcp/mocksql/sqlinstance.go b/mockgcp/mocksql/sqlinstance.go index 91d5cab422..0046d25da1 100644 --- a/mockgcp/mocksql/sqlinstance.go +++ b/mockgcp/mocksql/sqlinstance.go @@ -287,7 +287,7 @@ func setDatabaseVersionDefaults(obj *pb.DatabaseInstance) error { switch obj.DatabaseVersion { case pb.SqlDatabaseVersion_MYSQL_5_7: obj.DatabaseInstalledVersion = "MYSQL_5_7_44" - obj.MaintenanceVersion = "MYSQL_5_7_44.R20241020.00_00" + obj.MaintenanceVersion = "MYSQL_5_7_44.R20231105.01_03" obj.UpgradableDatabaseVersions = []*pb.AvailableDatabaseVersion{ { DisplayName: asRef("MySQL 8.0"), @@ -359,11 +359,6 @@ func setDatabaseVersionDefaults(obj *pb.DatabaseInstance) error { MajorVersion: asRef("MYSQL_8_0"), Name: asRef("MYSQL_8_0_37"), }, - { - DisplayName: asRef("MySQL 8.0.39"), - MajorVersion: asRef("MYSQL_8_0"), - Name: asRef("MYSQL_8_0_39"), - }, } case pb.SqlDatabaseVersion_MYSQL_8_0: obj.DatabaseInstalledVersion = "MYSQL_8_0_31" @@ -526,7 +521,6 @@ func populateDefaults(obj *pb.DatabaseInstance) { Entitled: asRef(false), FlagRecommenderEnabled: asRef(false), IndexAdvisorEnabled: asRef(false), - ActiveQueryEnabled: asRef(false), } } else if isPostgres(obj) { obj.GeminiConfig = &pb.GeminiInstanceConfig{ diff --git a/mockgcp/mocksql/sqluser.go b/mockgcp/mocksql/sqluser.go index 0a2b297a48..b71efa4752 100644 --- a/mockgcp/mocksql/sqluser.go +++ b/mockgcp/mocksql/sqluser.go @@ -92,11 +92,6 @@ func (s *sqlUsersService) Insert(ctx context.Context, req *pb.SqlUsersInsertRequ obj.Project = name.Project.ID obj.Instance = name.Instance obj.Kind = "sql#user" - if obj.GetPasswordPolicy() == nil { - obj.PasswordPolicy = &pb.UserPasswordValidationPolicy{ - Status: &pb.PasswordStatus{}, - } - } obj.Etag = fields.ComputeWeakEtag(obj) diff --git a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_http.log b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_http.log index 6c0bd226ed..93d4937b57 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/bigqueryconnection/v1alpha1/bigqueryconnectionconnection/cloudsqlconnectionbasic/_http.log @@ -133,9 +133,6 @@ X-Xss-Protection: 0 "instance": "sqlinstance-sample-${uniqueId}", "kind": "sql#user", "name": "root", - "passwordPolicy": { - "status": {} - }, "project": "${projectId}" } ], @@ -227,7 +224,6 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "gceZone": "us-central1-a", "geminiConfig": { - "activeQueryEnabled": false, "entitled": false, "flagRecommenderEnabled": false, "indexAdvisorEnabled": false @@ -240,7 +236,7 @@ X-Xss-Protection: 0 } ], "kind": "sql#instance", - "maintenanceVersion": "MYSQL_5_7_44.R20241020.00_00", + "maintenanceVersion": "MYSQL_5_7_44.R20231105.01_03", "name": "sqlinstance-sample-${uniqueId}", "project": "${projectId}", "region": "us-central1", @@ -369,11 +365,6 @@ X-Xss-Protection: 0 "displayName": "MySQL 8.0.37", "majorVersion": "MYSQL_8_0", "name": "MYSQL_8_0_37" - }, - { - "displayName": "MySQL 8.0.39", - "majorVersion": "MYSQL_8_0", - "name": "MYSQL_8_0_39" } ] } @@ -401,11 +392,12 @@ X-Xss-Protection: 0 "errors": [ { "domain": "global", - "message": "Not Found.", + "message": "database \"projects/${projectId}/instances/sqlinstance-sample-${uniqueId}/databases/sqldatabase-sample-${uniqueId}\" not found", "reason": "notFound" } ], - "message": "Not Found" + "message": "database \"projects/${projectId}/instances/sqlinstance-sample-${uniqueId}/databases/sqldatabase-sample-${uniqueId}\" not found", + "status": "NOT_FOUND" } } @@ -549,7 +541,6 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "gceZone": "us-central1-a", "geminiConfig": { - "activeQueryEnabled": false, "entitled": false, "flagRecommenderEnabled": false, "indexAdvisorEnabled": false @@ -562,7 +553,7 @@ X-Xss-Protection: 0 } ], "kind": "sql#instance", - "maintenanceVersion": "MYSQL_5_7_44.R20241020.00_00", + "maintenanceVersion": "MYSQL_5_7_44.R20231105.01_03", "name": "sqlinstance-sample-${uniqueId}", "project": "${projectId}", "region": "us-central1", @@ -691,11 +682,6 @@ X-Xss-Protection: 0 "displayName": "MySQL 8.0.37", "majorVersion": "MYSQL_8_0", "name": "MYSQL_8_0_37" - }, - { - "displayName": "MySQL 8.0.39", - "majorVersion": "MYSQL_8_0", - "name": "MYSQL_8_0_39" } ] } @@ -793,9 +779,6 @@ X-Xss-Protection: 0 "kind": "sql#user", "name": "sqluser-${uniqueId}", "password": "cGFzc3dvcmQ=", - "passwordPolicy": { - "status": {} - }, "project": "${projectId}" } ], @@ -827,7 +810,6 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "gceZone": "us-central1-a", "geminiConfig": { - "activeQueryEnabled": false, "entitled": false, "flagRecommenderEnabled": false, "indexAdvisorEnabled": false @@ -840,7 +822,7 @@ X-Xss-Protection: 0 } ], "kind": "sql#instance", - "maintenanceVersion": "MYSQL_5_7_44.R20241020.00_00", + "maintenanceVersion": "MYSQL_5_7_44.R20231105.01_03", "name": "sqlinstance-sample-${uniqueId}", "project": "${projectId}", "region": "us-central1", @@ -969,11 +951,6 @@ X-Xss-Protection: 0 "displayName": "MySQL 8.0.37", "majorVersion": "MYSQL_8_0", "name": "MYSQL_8_0_37" - }, - { - "displayName": "MySQL 8.0.39", - "majorVersion": "MYSQL_8_0", - "name": "MYSQL_8_0_39" } ] } @@ -1003,9 +980,6 @@ X-Xss-Protection: 0 "kind": "sql#user", "name": "sqluser-${uniqueId}", "password": "cGFzc3dvcmQ=", - "passwordPolicy": { - "status": {} - }, "project": "${projectId}" } ], @@ -1037,7 +1011,6 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "gceZone": "us-central1-a", "geminiConfig": { - "activeQueryEnabled": false, "entitled": false, "flagRecommenderEnabled": false, "indexAdvisorEnabled": false @@ -1050,7 +1023,7 @@ X-Xss-Protection: 0 } ], "kind": "sql#instance", - "maintenanceVersion": "MYSQL_5_7_44.R20241020.00_00", + "maintenanceVersion": "MYSQL_5_7_44.R20231105.01_03", "name": "sqlinstance-sample-${uniqueId}", "project": "${projectId}", "region": "us-central1", @@ -1179,11 +1152,6 @@ X-Xss-Protection: 0 "displayName": "MySQL 8.0.37", "majorVersion": "MYSQL_8_0", "name": "MYSQL_8_0_37" - }, - { - "displayName": "MySQL 8.0.39", - "majorVersion": "MYSQL_8_0", - "name": "MYSQL_8_0_39" } ] } @@ -1307,9 +1275,6 @@ X-Xss-Protection: 0 "kind": "sql#user", "name": "sqluser-${uniqueId}", "password": "cGFzc3dvcmQ=", - "passwordPolicy": { - "status": {} - }, "project": "${projectId}" } ], @@ -1341,7 +1306,6 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "gceZone": "us-central1-a", "geminiConfig": { - "activeQueryEnabled": false, "entitled": false, "flagRecommenderEnabled": false, "indexAdvisorEnabled": false @@ -1354,7 +1318,7 @@ X-Xss-Protection: 0 } ], "kind": "sql#instance", - "maintenanceVersion": "MYSQL_5_7_44.R20241020.00_00", + "maintenanceVersion": "MYSQL_5_7_44.R20231105.01_03", "name": "sqlinstance-sample-${uniqueId}", "project": "${projectId}", "region": "us-central1", @@ -1483,11 +1447,6 @@ X-Xss-Protection: 0 "displayName": "MySQL 8.0.37", "majorVersion": "MYSQL_8_0", "name": "MYSQL_8_0_37" - }, - { - "displayName": "MySQL 8.0.39", - "majorVersion": "MYSQL_8_0", - "name": "MYSQL_8_0_39" } ] } @@ -1666,7 +1625,6 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "gceZone": "us-central1-a", "geminiConfig": { - "activeQueryEnabled": false, "entitled": false, "flagRecommenderEnabled": false, "indexAdvisorEnabled": false @@ -1679,7 +1637,7 @@ X-Xss-Protection: 0 } ], "kind": "sql#instance", - "maintenanceVersion": "MYSQL_5_7_44.R20241020.00_00", + "maintenanceVersion": "MYSQL_5_7_44.R20231105.01_03", "name": "sqlinstance-sample-${uniqueId}", "project": "${projectId}", "region": "us-central1", @@ -1808,11 +1766,6 @@ X-Xss-Protection: 0 "displayName": "MySQL 8.0.37", "majorVersion": "MYSQL_8_0", "name": "MYSQL_8_0_37" - }, - { - "displayName": "MySQL 8.0.39", - "majorVersion": "MYSQL_8_0", - "name": "MYSQL_8_0_39" } ] } From d8e8de50ed0cc6a865ff03cdd64ce316bb76fc92 Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Thu, 7 Nov 2024 08:50:44 +0100 Subject: [PATCH 16/17] add back the alpha API with databaseRef then copied to beta --- .../v1alpha1/connection_types.go | 4 +- .../v1alpha1/zz_generated.deepcopy.go | 6 +-- apis/refs/v1beta1/sqldatabaseref.go | 2 +- ...queryconnection.cnrm.cloud.google.com.yaml | 37 ++++++++++++++++--- 4 files changed, 37 insertions(+), 12 deletions(-) diff --git a/apis/bigqueryconnection/v1alpha1/connection_types.go b/apis/bigqueryconnection/v1alpha1/connection_types.go index a71d606b04..31d0b7151b 100644 --- a/apis/bigqueryconnection/v1alpha1/connection_types.go +++ b/apis/bigqueryconnection/v1alpha1/connection_types.go @@ -144,9 +144,9 @@ type CloudSqlPropertiesSpec struct { // +required InstanceRef *refv1beta1.SQLInstanceRef `json:"instanceRef,omitempty"` - // Database name. + // Reference to the SQL Database. // +required - Database *string `json:"database,omitempty"` + DatabaseRef *refv1beta1.SQLDatabaseRef `json:"databaseRef,omitempty"` // Type of the Cloud SQL database. // +required diff --git a/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go b/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go index b3806139de..125b5b42f3 100644 --- a/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go +++ b/apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go @@ -738,9 +738,9 @@ func (in *CloudSqlPropertiesSpec) DeepCopyInto(out *CloudSqlPropertiesSpec) { *out = new(v1beta1.SQLInstanceRef) **out = **in } - if in.Database != nil { - in, out := &in.Database, &out.Database - *out = new(string) + if in.DatabaseRef != nil { + in, out := &in.DatabaseRef, &out.DatabaseRef + *out = new(v1beta1.SQLDatabaseRef) **out = **in } if in.Type != nil { diff --git a/apis/refs/v1beta1/sqldatabaseref.go b/apis/refs/v1beta1/sqldatabaseref.go index 2aacec9bf3..186c8d428c 100644 --- a/apis/refs/v1beta1/sqldatabaseref.go +++ b/apis/refs/v1beta1/sqldatabaseref.go @@ -26,7 +26,7 @@ import ( ) type SQLDatabaseRef struct { - /* The SQL Database selfLink, when not managed by Config Connector. */ + /* The SQL Database name, when not managed by Config Connector. */ External string `json:"external,omitempty"` /* The `name` field of a `SQLDatabase` resource. */ Name string `json:"name,omitempty"` diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_bigqueryconnectionconnections.bigqueryconnection.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_bigqueryconnectionconnections.bigqueryconnection.cnrm.cloud.google.com.yaml index d080393483..6b401f5dbc 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_bigqueryconnectionconnections.bigqueryconnection.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_bigqueryconnectionconnections.bigqueryconnection.cnrm.cloud.google.com.yaml @@ -117,9 +117,34 @@ spec: - name type: object type: object - database: - description: Database name. - type: string + databaseRef: + description: Reference to the SQL Database. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: The SQL Database name, when not managed by Config + Connector. + type: string + name: + description: The `name` field of a `SQLDatabase` resource. + type: string + namespace: + description: The `namespace` field of a `SQLDatabase` resource. + type: string + type: object instanceRef: description: Reference to the Cloud SQL instance ID. oneOf: @@ -153,7 +178,7 @@ spec: type: string required: - credential - - database + - databaseRef - instanceRef - type type: object @@ -605,8 +630,8 @@ spec: - external properties: external: - description: The SQL Database selfLink, when not managed by - Config Connector. + description: The SQL Database name, when not managed by Config + Connector. type: string name: description: The `name` field of a `SQLDatabase` resource. From 3af2766859bca6abca4f251449d8480c41015481 Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Thu, 7 Nov 2024 09:27:37 +0100 Subject: [PATCH 17/17] exclude bigqueryconnection from resourceskeleton test. then run make ready-pr --- pkg/resourceskeleton/testdata/uri-skeleton.yaml | 3 --- .../bigqueryconnection/bigqueryconnectionconnection.md | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/resourceskeleton/testdata/uri-skeleton.yaml b/pkg/resourceskeleton/testdata/uri-skeleton.yaml index 686aca93fb..c4d64b5b60 100644 --- a/pkg/resourceskeleton/testdata/uri-skeleton.yaml +++ b/pkg/resourceskeleton/testdata/uri-skeleton.yaml @@ -762,9 +762,6 @@ external: bigquerydatasetsamplehnf4t2squ1g1ghnendt0 ResourceConfigId: BigQueryTable URI: "https://bigquery.googleapis.com/bigquery/v2/projects/kcc-test/datasets/bigquerydatasetsamplehnf4t2squ1g1ghnendt0/tables/bigquerytablesamplehnf4t2squ1g1ghnendt0" -- ExpectedSkeleton: null - ResourceConfigId: BigQueryConnectionConnection - URI: "https://bigqueryconnection.googleapis.com/v1/projects/kcc-test/locations/us-central1/connections/my-connection" - ExpectedSkeleton: apiVersion: secretmanager.cnrm.cloud.google.com/v1beta1 kind: SecretManagerSecret diff --git a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/bigqueryconnection/bigqueryconnectionconnection.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/bigqueryconnection/bigqueryconnectionconnection.md index 3192e27d29..a8cfc5697f 100644 --- a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/bigqueryconnection/bigqueryconnectionconnection.md +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/bigqueryconnection/bigqueryconnectionconnection.md @@ -258,7 +258,7 @@ spark:

string

-

{% verbatim %}The SQL Database selfLink, when not managed by Config Connector.{% endverbatim %}

+

{% verbatim %}The SQL Database name, when not managed by Config Connector.{% endverbatim %}