From c47dba4dc4ab9b3326c53ae9460b76e70e4e5f65 Mon Sep 17 00:00:00 2001 From: Jason Vigil Date: Mon, 9 Dec 2024 21:43:56 +0000 Subject: [PATCH] feat: Promote FirestoreDatabase to v1beta1 --- apis/firestore/v1beta1/database_types.go | 152 +++++++ .../firestore/v1beta1/doc.go | 16 +- apis/firestore/v1beta1/groupversion_info.go | 33 ++ apis/firestore/v1beta1/types.generated.go | 93 +++++ .../v1beta1}/zz_generated.deepcopy.go | 145 +++---- ...bases.firestore.cnrm.cloud.google.com.yaml | 195 +++++++++ .../firestore_v1beta1_firestoredatabase.yaml | 24 ++ config/servicemappings/firestore.yaml | 3 + dev/tools/controllerbuilder/generate.sh | 4 +- .../generated/apis/firestore/v1alpha1/doc.go | 38 -- .../apis/firestore/v1alpha1/register.go | 63 --- .../firestoredatabase_types.go | 2 +- .../apis/firestore/v1beta1/register.go | 6 + .../v1beta1/zz_generated.deepcopy.go | 185 +++++++++ .../client/clientset/versioned/clientset.go | 13 - .../versioned/fake/clientset_generated.go | 7 - .../clientset/versioned/fake/register.go | 2 - .../clientset/versioned/scheme/register.go | 2 - .../versioned/typed/firestore/v1alpha1/doc.go | 23 -- .../typed/firestore/v1alpha1/fake/doc.go | 23 -- .../v1alpha1/fake/fake_firestore_client.go | 43 -- .../firestore/v1alpha1/firestore_client.go | 110 ----- .../v1beta1/fake/fake_firestore_client.go | 4 + .../fake/fake_firestoredatabase.go | 50 +-- .../firestore/v1beta1/firestore_client.go | 5 + .../firestoredatabase.go | 42 +- .../firestore/v1beta1/generated_expansion.go | 2 + .../firestore/firestoredatabase_controller.go | 2 +- .../firestore/firestoredatabase_mappings.go | 2 +- pkg/gvks/supportedgvks/gvks_generated.go | 10 + .../snippetgeneration/snippetgeneration.go | 1 + pkg/test/resourcefixture/sets.go | 1 + ..._object_firestoredatabase-full.golden.yaml | 4 +- .../firestoredatabase-full/create.yaml | 2 +- .../firestoredatabase-full/update.yaml | 2 +- ...ject_firestoredatabase-minimal.golden.yaml | 4 +- .../firestoredatabase-minimal/create.yaml | 2 +- .../resource-reference/_toc.yaml | 2 + .../firestore/firestoredatabase.md | 384 ++++++++++++++++++ .../resource-reference/overview.md | 4 + .../firestore_firestoredatabase.tmpl | 53 +++ 41 files changed, 1288 insertions(+), 470 deletions(-) create mode 100644 apis/firestore/v1beta1/database_types.go rename pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/generated_expansion.go => apis/firestore/v1beta1/doc.go (55%) create mode 100644 apis/firestore/v1beta1/groupversion_info.go create mode 100644 apis/firestore/v1beta1/types.generated.go rename {pkg/clients/generated/apis/firestore/v1alpha1 => apis/firestore/v1beta1}/zz_generated.deepcopy.go (87%) create mode 100644 config/samples/resources/firestoredatabase/basic-firestoredatabase/firestore_v1beta1_firestoredatabase.yaml delete mode 100644 pkg/clients/generated/apis/firestore/v1alpha1/doc.go delete mode 100644 pkg/clients/generated/apis/firestore/v1alpha1/register.go rename pkg/clients/generated/apis/firestore/{v1alpha1 => v1beta1}/firestoredatabase_types.go (99%) delete mode 100644 pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/doc.go delete mode 100644 pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/fake/doc.go delete mode 100644 pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/fake/fake_firestore_client.go delete mode 100644 pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/firestore_client.go rename pkg/clients/generated/client/clientset/versioned/typed/firestore/{v1alpha1 => v1beta1}/fake/fake_firestoredatabase.go (70%) rename pkg/clients/generated/client/clientset/versioned/typed/firestore/{v1alpha1 => v1beta1}/firestoredatabase.go (78%) create mode 100644 scripts/generate-google3-docs/resource-reference/generated/resource-docs/firestore/firestoredatabase.md create mode 100644 scripts/generate-google3-docs/resource-reference/templates/firestore_firestoredatabase.tmpl diff --git a/apis/firestore/v1beta1/database_types.go b/apis/firestore/v1beta1/database_types.go new file mode 100644 index 0000000000..114302bdcc --- /dev/null +++ b/apis/firestore/v1beta1/database_types.go @@ -0,0 +1,152 @@ +// 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 ( + "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/apis/k8s/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +var FirestoreDatabaseGVK = GroupVersion.WithKind("FirestoreDatabase") + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// FirestoreDatabaseSpec defines the desired state of FirestoreDatabase +// +kcc:proto=google.firestore.admin.v1.Database +type FirestoreDatabaseSpec struct { + // Immutable. The Project that this resource belongs to. + ProjectRef v1beta1.ProjectRef `json:"projectRef"` + + // The FirestoreDatabase name. If not given, the metadata.name will be used. + ResourceID *string `json:"resourceID,omitempty"` + + // The location of the database. Available locations are listed at + // https://cloud.google.com/firestore/docs/locations. + LocationID *string `json:"locationID,omitempty"` + + // The concurrency control mode to use for this database. + // See https://cloud.google.com/firestore/docs/reference/rest/v1/projects.databases#concurrencymode for more info. + ConcurrencyMode *string `json:"concurrencyMode,omitempty"` + + // Whether to enable the PITR feature on this database. + // See https://cloud.google.com/firestore/docs/reference/rest/v1/projects.databases#pointintimerecoveryenablement for more info. + PointInTimeRecoveryEnablement *string `json:"pointInTimeRecoveryEnablement,omitempty"` +} + +// FirestoreDatabaseStatus defines the config connector machine state of FirestoreDatabase +type FirestoreDatabaseStatus struct { + /* Conditions represent the latest available observations of the + object's current state. */ + Conditions []v1alpha1.Condition `json:"conditions,omitempty"` + + // ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource. + // +optional + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + + // A unique specifier for the FirestoreDatabase resource in GCP. + // +optional + ExternalRef *string `json:"externalRef,omitempty"` + + // ObservedState is the state of the resource as most recently observed in GCP. + // +optional + ObservedState *FirestoreDatabaseObservedState `json:"observedState,omitempty"` +} + +// FirestoreDatabaseSpec defines the desired state of FirestoreDatabase +// +kcc:proto=google.firestore.admin.v1.Database +type FirestoreDatabaseObservedState struct { + // Output only. The system-generated UUID4 for this Database. + Uid *string `json:"uid,omitempty"` + + // Output only. The timestamp at which this database was created. Databases + // created before 2016 do not populate create_time. + CreateTime *string `json:"createTime,omitempty"` + + // Output only. The timestamp at which this database was most recently + // updated. Note this only includes updates to the database resource and not + // data contained by the database. + UpdateTime *string `json:"updateTime,omitempty"` + + // Output only. The period during which past versions of data are retained in + // the database. + // + // Any [read][google.firestore.v1.GetDocumentRequest.read_time] + // or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify + // a `read_time` within this window, and will read the state of the database + // at that time. + // + // If the PITR feature is enabled, the retention period is 7 days. Otherwise, + // the retention period is 1 hour. + VersionRetentionPeriod *string `json:"versionRetentionPeriod,omitempty"` + + // Output only. The earliest timestamp at which older versions of the data can + // be read from the database. See [version_retention_period] above; this field + // is populated with `now - version_retention_period`. + // + // This value is continuously updated, and becomes stale the moment it is + // queried. If you are using this value to recover data, make sure to account + // for the time from the moment when the value is queried to the moment when + // you initiate the recovery. + EarliestVersionTime *string `json:"earliestVersionTime,omitempty"` + + // Output only. The key_prefix for this database. This key_prefix is used, in + // combination with the project id ("~") to construct + // the application id that is returned from the Cloud Datastore APIs in Google + // App Engine first generation runtimes. + // + // This value may be empty in which case the appid to use for URL-encoded keys + // is the project_id (eg: foo instead of v~foo). + KeyPrefix *string `json:"keyPrefix,omitempty"` + + // This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + Etag *string `json:"etag,omitempty"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:resource:categories=gcp +// +kubebuilder:subresource:status +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/system=true" +// +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'" + +// FirestoreDatabase is the Schema for the FirestoreDatabase API +// +k8s:openapi-gen=true +// +kubebuilder:storageversion +type FirestoreDatabase struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec FirestoreDatabaseSpec `json:"spec,omitempty"` + Status FirestoreDatabaseStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// FirestoreDatabaseList contains a list of FirestoreDatabase +type FirestoreDatabaseList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []FirestoreDatabase `json:"items"` +} + +func init() { + SchemeBuilder.Register(&FirestoreDatabase{}, &FirestoreDatabaseList{}) +} diff --git a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/generated_expansion.go b/apis/firestore/v1beta1/doc.go similarity index 55% rename from pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/generated_expansion.go rename to apis/firestore/v1beta1/doc.go index 0363c6508c..51539afc31 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/generated_expansion.go +++ b/apis/firestore/v1beta1/doc.go @@ -1,10 +1,10 @@ -// Copyright 2020 Google LLC +// Copyright 2024 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -12,13 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -type FirestoreDatabaseExpansion interface{} +// +kcc:proto=google.firestore.admin.v1 +package v1beta1 diff --git a/apis/firestore/v1beta1/groupversion_info.go b/apis/firestore/v1beta1/groupversion_info.go new file mode 100644 index 0000000000..b170c0745a --- /dev/null +++ b/apis/firestore/v1beta1/groupversion_info.go @@ -0,0 +1,33 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +kubebuilder:object:generate=true +// +groupName=firestore.cnrm.cloud.google.com +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "firestore.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/firestore/v1beta1/types.generated.go b/apis/firestore/v1beta1/types.generated.go new file mode 100644 index 0000000000..42edfd2ecf --- /dev/null +++ b/apis/firestore/v1beta1/types.generated.go @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v1beta1 + +/* +// +kcc:proto=google.firestore.admin.v1.Database +type Database struct { + // The resource name of the Database. + // Format: `projects/{project}/databases/{database}` + Name *string `json:"name,omitempty"` + + // Output only. The system-generated UUID4 for this Database. + Uid *string `json:"uid,omitempty"` + + // Output only. The timestamp at which this database was created. Databases + // created before 2016 do not populate create_time. + CreateTime *string `json:"createTime,omitempty"` + + // Output only. The timestamp at which this database was most recently + // updated. Note this only includes updates to the database resource and not + // data contained by the database. + UpdateTime *string `json:"updateTime,omitempty"` + + // The location of the database. Available locations are listed at + // https://cloud.google.com/firestore/docs/locations. + LocationID *string `json:"locationID,omitempty"` + + // The type of the database. + // See https://cloud.google.com/datastore/docs/firestore-or-datastore for + // information about how to choose. + Type *string `json:"type,omitempty"` + + // The concurrency control mode to use for this database. + ConcurrencyMode *string `json:"concurrencyMode,omitempty"` + + // Output only. The period during which past versions of data are retained in + // the database. + // + // Any [read][google.firestore.v1.GetDocumentRequest.read_time] + // or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify + // a `read_time` within this window, and will read the state of the database + // at that time. + // + // If the PITR feature is enabled, the retention period is 7 days. Otherwise, + // the retention period is 1 hour. + VersionRetentionPeriod *string `json:"versionRetentionPeriod,omitempty"` + + // Output only. The earliest timestamp at which older versions of the data can + // be read from the database. See [version_retention_period] above; this field + // is populated with `now - version_retention_period`. + // + // This value is continuously updated, and becomes stale the moment it is + // queried. If you are using this value to recover data, make sure to account + // for the time from the moment when the value is queried to the moment when + // you initiate the recovery. + EarliestVersionTime *string `json:"earliestVersionTime,omitempty"` + + // Whether to enable the PITR feature on this database. + PointInTimeRecoveryEnablement *string `json:"pointInTimeRecoveryEnablement,omitempty"` + + // The App Engine integration mode to use for this database. + AppEngineIntegrationMode *string `json:"appEngineIntegrationMode,omitempty"` + + // Output only. The key_prefix for this database. This key_prefix is used, in + // combination with the project id ("~") to construct + // the application id that is returned from the Cloud Datastore APIs in Google + // App Engine first generation runtimes. + // + // This value may be empty in which case the appid to use for URL-encoded keys + // is the project_id (eg: foo instead of v~foo). + KeyPrefix *string `json:"keyPrefix,omitempty"` + + // State of delete protection for the database. + DeleteProtectionState *string `json:"deleteProtectionState,omitempty"` + + // This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + Etag *string `json:"etag,omitempty"` +} +*/ diff --git a/pkg/clients/generated/apis/firestore/v1alpha1/zz_generated.deepcopy.go b/apis/firestore/v1beta1/zz_generated.deepcopy.go similarity index 87% rename from pkg/clients/generated/apis/firestore/v1alpha1/zz_generated.deepcopy.go rename to apis/firestore/v1beta1/zz_generated.deepcopy.go index b21b1a5233..e50db5f39c 100644 --- a/pkg/clients/generated/apis/firestore/v1alpha1/zz_generated.deepcopy.go +++ b/apis/firestore/v1beta1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Copyright 2020 Google LLC // @@ -15,71 +14,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! +// Code generated by controller-gen. DO NOT EDIT. -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha1 +package v1beta1 import ( - k8sv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/k8s/v1alpha1" + "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 *DatabaseObservedStateStatus) DeepCopyInto(out *DatabaseObservedStateStatus) { - *out = *in - if in.CreateTime != nil { - in, out := &in.CreateTime, &out.CreateTime - *out = new(string) - **out = **in - } - if in.EarliestVersionTime != nil { - in, out := &in.EarliestVersionTime, &out.EarliestVersionTime - *out = new(string) - **out = **in - } - if in.Etag != nil { - in, out := &in.Etag, &out.Etag - *out = new(string) - **out = **in - } - if in.KeyPrefix != nil { - in, out := &in.KeyPrefix, &out.KeyPrefix - *out = new(string) - **out = **in - } - if in.Uid != nil { - in, out := &in.Uid, &out.Uid - *out = new(string) - **out = **in - } - if in.UpdateTime != nil { - in, out := &in.UpdateTime, &out.UpdateTime - *out = new(string) - **out = **in - } - if in.VersionRetentionPeriod != nil { - in, out := &in.VersionRetentionPeriod, &out.VersionRetentionPeriod - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseObservedStateStatus. -func (in *DatabaseObservedStateStatus) DeepCopy() *DatabaseObservedStateStatus { - if in == nil { - return nil - } - out := new(DatabaseObservedStateStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *FirestoreDatabase) DeepCopyInto(out *FirestoreDatabase) { *out = *in @@ -87,7 +30,6 @@ func (in *FirestoreDatabase) DeepCopyInto(out *FirestoreDatabase) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirestoreDatabase. @@ -120,7 +62,6 @@ func (in *FirestoreDatabaseList) DeepCopyInto(out *FirestoreDatabaseList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirestoreDatabaseList. @@ -142,30 +83,79 @@ func (in *FirestoreDatabaseList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FirestoreDatabaseSpec) DeepCopyInto(out *FirestoreDatabaseSpec) { +func (in *FirestoreDatabaseObservedState) DeepCopyInto(out *FirestoreDatabaseObservedState) { *out = *in - if in.ConcurrencyMode != nil { - in, out := &in.ConcurrencyMode, &out.ConcurrencyMode + if in.Uid != nil { + in, out := &in.Uid, &out.Uid *out = new(string) **out = **in } - if in.LocationID != nil { - in, out := &in.LocationID, &out.LocationID + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime *out = new(string) **out = **in } - if in.PointInTimeRecoveryEnablement != nil { - in, out := &in.PointInTimeRecoveryEnablement, &out.PointInTimeRecoveryEnablement + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } + if in.VersionRetentionPeriod != nil { + in, out := &in.VersionRetentionPeriod, &out.VersionRetentionPeriod *out = new(string) **out = **in } + if in.EarliestVersionTime != nil { + in, out := &in.EarliestVersionTime, &out.EarliestVersionTime + *out = new(string) + **out = **in + } + if in.KeyPrefix != nil { + in, out := &in.KeyPrefix, &out.KeyPrefix + *out = new(string) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirestoreDatabaseObservedState. +func (in *FirestoreDatabaseObservedState) DeepCopy() *FirestoreDatabaseObservedState { + if in == nil { + return nil + } + out := new(FirestoreDatabaseObservedState) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FirestoreDatabaseSpec) DeepCopyInto(out *FirestoreDatabaseSpec) { + *out = *in out.ProjectRef = in.ProjectRef if in.ResourceID != nil { in, out := &in.ResourceID, &out.ResourceID *out = new(string) **out = **in } - return + if in.LocationID != nil { + in, out := &in.LocationID, &out.LocationID + *out = new(string) + **out = **in + } + if in.ConcurrencyMode != nil { + in, out := &in.ConcurrencyMode, &out.ConcurrencyMode + *out = new(string) + **out = **in + } + if in.PointInTimeRecoveryEnablement != nil { + in, out := &in.PointInTimeRecoveryEnablement, &out.PointInTimeRecoveryEnablement + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirestoreDatabaseSpec. @@ -183,25 +173,24 @@ func (in *FirestoreDatabaseStatus) DeepCopyInto(out *FirestoreDatabaseStatus) { *out = *in if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make([]k8sv1alpha1.Condition, len(*in)) + *out = make([]v1alpha1.Condition, len(*in)) copy(*out, *in) } - if in.ExternalRef != nil { - in, out := &in.ExternalRef, &out.ExternalRef - *out = new(string) - **out = **in - } if in.ObservedGeneration != nil { in, out := &in.ObservedGeneration, &out.ObservedGeneration *out = new(int64) **out = **in } + if in.ExternalRef != nil { + in, out := &in.ExternalRef, &out.ExternalRef + *out = new(string) + **out = **in + } if in.ObservedState != nil { in, out := &in.ObservedState, &out.ObservedState - *out = new(DatabaseObservedStateStatus) + *out = new(FirestoreDatabaseObservedState) (*in).DeepCopyInto(*out) } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirestoreDatabaseStatus. diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_firestoredatabases.firestore.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_firestoredatabases.firestore.cnrm.cloud.google.com.yaml index dd602970ff..06e619d11a 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_firestoredatabases.firestore.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_firestoredatabases.firestore.cnrm.cloud.google.com.yaml @@ -212,6 +212,201 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: When 'True', the most recent reconcile of the resource succeeded + jsonPath: .status.conditions[?(@.type=='Ready')].status + name: Ready + type: string + - description: The reason for the value in 'Ready' + jsonPath: .status.conditions[?(@.type=='Ready')].reason + name: Status + type: string + - description: The last transition time for the value in 'Status' + jsonPath: .status.conditions[?(@.type=='Ready')].lastTransitionTime + name: Status Age + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: FirestoreDatabase is the Schema for the FirestoreDatabase 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: FirestoreDatabaseSpec defines the desired state of FirestoreDatabase + properties: + concurrencyMode: + description: The concurrency control mode to use for this database. + See https://cloud.google.com/firestore/docs/reference/rest/v1/projects.databases#concurrencymode + for more info. + type: string + locationID: + description: The location of the database. Available locations are + listed at https://cloud.google.com/firestore/docs/locations. + type: string + pointInTimeRecoveryEnablement: + description: Whether to enable the PITR feature on this database. + See https://cloud.google.com/firestore/docs/reference/rest/v1/projects.databases#pointintimerecoveryenablement + for more info. + type: string + projectRef: + description: Immutable. The Project that this resource belongs to. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: The `projectID` field of a project, when not managed + by Config Connector. + type: string + kind: + description: The kind of the Project resource; optional but must + be `Project` if provided. + type: string + name: + description: The `name` field of a `Project` resource. + type: string + namespace: + description: The `namespace` field of a `Project` resource. + type: string + type: object + resourceID: + description: The FirestoreDatabase name. If not given, the metadata.name + will be used. + type: string + required: + - projectRef + type: object + status: + description: FirestoreDatabaseStatus defines the config connector machine + state of FirestoreDatabase + 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 FirestoreDatabase resource + in GCP. + type: string + observedGeneration: + description: ObservedGeneration is the generation of the resource + that was most recently observed by the Config Connector controller. + If this is equal to metadata.generation, then that means that the + current reported status reflects the most recent desired state of + the resource. + format: int64 + type: integer + observedState: + description: ObservedState is the state of the resource as most recently + observed in GCP. + properties: + createTime: + description: Output only. The timestamp at which this database + was created. Databases created before 2016 do not populate create_time. + type: string + earliestVersionTime: + description: |- + Output only. The earliest timestamp at which older versions of the data can + be read from the database. See [version_retention_period] above; this field + is populated with `now - version_retention_period`. + + This value is continuously updated, and becomes stale the moment it is + queried. If you are using this value to recover data, make sure to account + for the time from the moment when the value is queried to the moment when + you initiate the recovery. + type: string + etag: + description: This checksum is computed by the server based on + the value of other fields, and may be sent on update and delete + requests to ensure the client has an up-to-date value before + proceeding. + type: string + keyPrefix: + description: |- + Output only. The key_prefix for this database. This key_prefix is used, in + combination with the project id ("~") to construct + the application id that is returned from the Cloud Datastore APIs in Google + App Engine first generation runtimes. + + This value may be empty in which case the appid to use for URL-encoded keys + is the project_id (eg: foo instead of v~foo). + type: string + uid: + description: Output only. The system-generated UUID4 for this + Database. + type: string + updateTime: + description: Output only. The timestamp at which this database + was most recently updated. Note this only includes updates to + the database resource and not data contained by the database. + type: string + versionRetentionPeriod: + description: |- + Output only. The period during which past versions of data are retained in + the database. + + Any [read][google.firestore.v1.GetDocumentRequest.read_time] + or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify + a `read_time` within this window, and will read the state of the database + at that time. + + If the PITR feature is enabled, the retention period is 7 days. Otherwise, + the retention period is 1 hour. + type: string + type: object + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/samples/resources/firestoredatabase/basic-firestoredatabase/firestore_v1beta1_firestoredatabase.yaml b/config/samples/resources/firestoredatabase/basic-firestoredatabase/firestore_v1beta1_firestoredatabase.yaml new file mode 100644 index 0000000000..6a37519304 --- /dev/null +++ b/config/samples/resources/firestoredatabase/basic-firestoredatabase/firestore_v1beta1_firestoredatabase.yaml @@ -0,0 +1,24 @@ +# 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: firestore.cnrm.cloud.google.com/v1beta1 +kind: FirestoreDatabase +metadata: + name: firestoredatabase-sample +spec: + projectRef: + external: ${PROJECT_NUMBER1} + locationID: us-west2 + concurrencyMode: OPTIMISTIC + pointInTimeRecoveryEnablement: POINT_IN_TIME_RECOVERY_ENABLED \ No newline at end of file diff --git a/config/servicemappings/firestore.yaml b/config/servicemappings/firestore.yaml index acef203027..e059be6bbb 100644 --- a/config/servicemappings/firestore.yaml +++ b/config/servicemappings/firestore.yaml @@ -22,6 +22,9 @@ spec: version: v1beta1 serviceHostName: "firestore.googleapis.com" resources: + - name: google_firestore_database + kind: FirestoreDatabase + direct: true - name: google_firestore_index kind: FirestoreIndex serverGeneratedIDField: "name" diff --git a/dev/tools/controllerbuilder/generate.sh b/dev/tools/controllerbuilder/generate.sh index 97e43a96bc..58104026ea 100755 --- a/dev/tools/controllerbuilder/generate.sh +++ b/dev/tools/controllerbuilder/generate.sh @@ -118,12 +118,12 @@ go run . generate-mapper \ # Firestore go run . generate-types \ --service google.firestore.admin.v1 \ - --api-version firestore.cnrm.cloud.google.com/v1alpha1 \ + --api-version firestore.cnrm.cloud.google.com/v1beta1 \ --resource FirestoreDatabase:Database go run . generate-mapper \ --service google.firestore.admin.v1 \ - --api-version firestore.cnrm.cloud.google.com/v1alpha1 + --api-version firestore.cnrm.cloud.google.com/v1beta1 # Certificate Manager DNSAuthorization go run . generate-types \ diff --git a/pkg/clients/generated/apis/firestore/v1alpha1/doc.go b/pkg/clients/generated/apis/firestore/v1alpha1/doc.go deleted file mode 100644 index e396930ac6..0000000000 --- a/pkg/clients/generated/apis/firestore/v1alpha1/doc.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** -// -// ---------------------------------------------------------------------------- -// -// This file is automatically generated by Config Connector and manual -// changes will be clobbered when the file is regenerated. -// -// ---------------------------------------------------------------------------- - -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Package v1alpha1 contains API Schema definitions for the firestore v1alpha1 API group. -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/pkg/apis/firestore -// +k8s:defaulter-gen=TypeMeta -// +groupName=firestore.cnrm.cloud.google.com - -package v1alpha1 diff --git a/pkg/clients/generated/apis/firestore/v1alpha1/register.go b/pkg/clients/generated/apis/firestore/v1alpha1/register.go deleted file mode 100644 index b5d3323aa5..0000000000 --- a/pkg/clients/generated/apis/firestore/v1alpha1/register.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** -// -// ---------------------------------------------------------------------------- -// -// This file is automatically generated by Config Connector and manual -// changes will be clobbered when the file is regenerated. -// -// ---------------------------------------------------------------------------- - -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Package v1alpha1 contains API Schema definitions for the firestore v1alpha1 API group. -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/pkg/apis/firestore -// +k8s:defaulter-gen=TypeMeta -// +groupName=firestore.cnrm.cloud.google.com -package v1alpha1 - -import ( - "reflect" - - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // SchemeGroupVersion is the group version used to register these objects. - SchemeGroupVersion = schema.GroupVersion{Group: "firestore.cnrm.cloud.google.com", Version: "v1alpha1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme. - SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} - - // AddToScheme is a global function that registers this API group & version to a scheme - AddToScheme = SchemeBuilder.AddToScheme - - FirestoreDatabaseGVK = schema.GroupVersionKind{ - Group: SchemeGroupVersion.Group, - Version: SchemeGroupVersion.Version, - Kind: reflect.TypeOf(FirestoreDatabase{}).Name(), - } - - firestoreAPIVersion = SchemeGroupVersion.String() -) diff --git a/pkg/clients/generated/apis/firestore/v1alpha1/firestoredatabase_types.go b/pkg/clients/generated/apis/firestore/v1beta1/firestoredatabase_types.go similarity index 99% rename from pkg/clients/generated/apis/firestore/v1alpha1/firestoredatabase_types.go rename to pkg/clients/generated/apis/firestore/v1beta1/firestoredatabase_types.go index 03bb3ddfe4..9754350a7c 100644 --- a/pkg/clients/generated/apis/firestore/v1alpha1/firestoredatabase_types.go +++ b/pkg/clients/generated/apis/firestore/v1beta1/firestoredatabase_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/firestore/v1beta1/register.go b/pkg/clients/generated/apis/firestore/v1beta1/register.go index 9aa26856d2..4f5730afc1 100644 --- a/pkg/clients/generated/apis/firestore/v1beta1/register.go +++ b/pkg/clients/generated/apis/firestore/v1beta1/register.go @@ -53,6 +53,12 @@ var ( // AddToScheme is a global function that registers this API group & version to a scheme AddToScheme = SchemeBuilder.AddToScheme + FirestoreDatabaseGVK = schema.GroupVersionKind{ + Group: SchemeGroupVersion.Group, + Version: SchemeGroupVersion.Version, + Kind: reflect.TypeOf(FirestoreDatabase{}).Name(), + } + FirestoreIndexGVK = schema.GroupVersionKind{ Group: SchemeGroupVersion.Group, Version: SchemeGroupVersion.Version, diff --git a/pkg/clients/generated/apis/firestore/v1beta1/zz_generated.deepcopy.go b/pkg/clients/generated/apis/firestore/v1beta1/zz_generated.deepcopy.go index 940e001784..b47bcf3ab6 100644 --- a/pkg/clients/generated/apis/firestore/v1beta1/zz_generated.deepcopy.go +++ b/pkg/clients/generated/apis/firestore/v1beta1/zz_generated.deepcopy.go @@ -29,6 +29,191 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatabaseObservedStateStatus) DeepCopyInto(out *DatabaseObservedStateStatus) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.EarliestVersionTime != nil { + in, out := &in.EarliestVersionTime, &out.EarliestVersionTime + *out = new(string) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.KeyPrefix != nil { + in, out := &in.KeyPrefix, &out.KeyPrefix + *out = new(string) + **out = **in + } + if in.Uid != nil { + in, out := &in.Uid, &out.Uid + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } + if in.VersionRetentionPeriod != nil { + in, out := &in.VersionRetentionPeriod, &out.VersionRetentionPeriod + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseObservedStateStatus. +func (in *DatabaseObservedStateStatus) DeepCopy() *DatabaseObservedStateStatus { + if in == nil { + return nil + } + out := new(DatabaseObservedStateStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FirestoreDatabase) DeepCopyInto(out *FirestoreDatabase) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirestoreDatabase. +func (in *FirestoreDatabase) DeepCopy() *FirestoreDatabase { + if in == nil { + return nil + } + out := new(FirestoreDatabase) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FirestoreDatabase) 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 *FirestoreDatabaseList) DeepCopyInto(out *FirestoreDatabaseList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FirestoreDatabase, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirestoreDatabaseList. +func (in *FirestoreDatabaseList) DeepCopy() *FirestoreDatabaseList { + if in == nil { + return nil + } + out := new(FirestoreDatabaseList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FirestoreDatabaseList) 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 *FirestoreDatabaseSpec) DeepCopyInto(out *FirestoreDatabaseSpec) { + *out = *in + if in.ConcurrencyMode != nil { + in, out := &in.ConcurrencyMode, &out.ConcurrencyMode + *out = new(string) + **out = **in + } + if in.LocationID != nil { + in, out := &in.LocationID, &out.LocationID + *out = new(string) + **out = **in + } + if in.PointInTimeRecoveryEnablement != nil { + in, out := &in.PointInTimeRecoveryEnablement, &out.PointInTimeRecoveryEnablement + *out = new(string) + **out = **in + } + out.ProjectRef = in.ProjectRef + if in.ResourceID != nil { + in, out := &in.ResourceID, &out.ResourceID + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirestoreDatabaseSpec. +func (in *FirestoreDatabaseSpec) DeepCopy() *FirestoreDatabaseSpec { + if in == nil { + return nil + } + out := new(FirestoreDatabaseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FirestoreDatabaseStatus) DeepCopyInto(out *FirestoreDatabaseStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1alpha1.Condition, len(*in)) + copy(*out, *in) + } + if in.ExternalRef != nil { + in, out := &in.ExternalRef, &out.ExternalRef + *out = new(string) + **out = **in + } + if in.ObservedGeneration != nil { + in, out := &in.ObservedGeneration, &out.ObservedGeneration + *out = new(int64) + **out = **in + } + if in.ObservedState != nil { + in, out := &in.ObservedState, &out.ObservedState + *out = new(DatabaseObservedStateStatus) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirestoreDatabaseStatus. +func (in *FirestoreDatabaseStatus) DeepCopy() *FirestoreDatabaseStatus { + if in == nil { + return nil + } + out := new(FirestoreDatabaseStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *FirestoreIndex) DeepCopyInto(out *FirestoreIndex) { *out = *in diff --git a/pkg/clients/generated/client/clientset/versioned/clientset.go b/pkg/clients/generated/client/clientset/versioned/clientset.go index f23e60fba9..03ceda715b 100644 --- a/pkg/clients/generated/client/clientset/versioned/clientset.go +++ b/pkg/clients/generated/client/clientset/versioned/clientset.go @@ -89,7 +89,6 @@ import ( firebasedatabasev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/firebasedatabase/v1alpha1" firebasehostingv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/firebasehosting/v1alpha1" firebasestoragev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/firebasestorage/v1alpha1" - firestorev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1" firestorev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1" gkebackupv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/gkebackup/v1alpha1" gkehubv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/gkehub/v1beta1" @@ -219,7 +218,6 @@ type Interface interface { FirebasedatabaseV1alpha1() firebasedatabasev1alpha1.FirebasedatabaseV1alpha1Interface FirebasehostingV1alpha1() firebasehostingv1alpha1.FirebasehostingV1alpha1Interface FirebasestorageV1alpha1() firebasestoragev1alpha1.FirebasestorageV1alpha1Interface - FirestoreV1alpha1() firestorev1alpha1.FirestoreV1alpha1Interface FirestoreV1beta1() firestorev1beta1.FirestoreV1beta1Interface GkebackupV1alpha1() gkebackupv1alpha1.GkebackupV1alpha1Interface GkehubV1beta1() gkehubv1beta1.GkehubV1beta1Interface @@ -347,7 +345,6 @@ type Clientset struct { firebasedatabaseV1alpha1 *firebasedatabasev1alpha1.FirebasedatabaseV1alpha1Client firebasehostingV1alpha1 *firebasehostingv1alpha1.FirebasehostingV1alpha1Client firebasestorageV1alpha1 *firebasestoragev1alpha1.FirebasestorageV1alpha1Client - firestoreV1alpha1 *firestorev1alpha1.FirestoreV1alpha1Client firestoreV1beta1 *firestorev1beta1.FirestoreV1beta1Client gkebackupV1alpha1 *gkebackupv1alpha1.GkebackupV1alpha1Client gkehubV1beta1 *gkehubv1beta1.GkehubV1beta1Client @@ -728,11 +725,6 @@ func (c *Clientset) FirebasestorageV1alpha1() firebasestoragev1alpha1.Firebasest return c.firebasestorageV1alpha1 } -// FirestoreV1alpha1 retrieves the FirestoreV1alpha1Client -func (c *Clientset) FirestoreV1alpha1() firestorev1alpha1.FirestoreV1alpha1Interface { - return c.firestoreV1alpha1 -} - // FirestoreV1beta1 retrieves the FirestoreV1beta1Client func (c *Clientset) FirestoreV1beta1() firestorev1beta1.FirestoreV1beta1Interface { return c.firestoreV1beta1 @@ -1323,10 +1315,6 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } - cs.firestoreV1alpha1, err = firestorev1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } cs.firestoreV1beta1, err = firestorev1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -1644,7 +1632,6 @@ func New(c rest.Interface) *Clientset { cs.firebasedatabaseV1alpha1 = firebasedatabasev1alpha1.New(c) cs.firebasehostingV1alpha1 = firebasehostingv1alpha1.New(c) cs.firebasestorageV1alpha1 = firebasestoragev1alpha1.New(c) - cs.firestoreV1alpha1 = firestorev1alpha1.New(c) cs.firestoreV1beta1 = firestorev1beta1.New(c) cs.gkebackupV1alpha1 = gkebackupv1alpha1.New(c) cs.gkehubV1beta1 = gkehubv1beta1.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 f0bcc3c7fe..29117bcfb9 100644 --- a/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go @@ -151,8 +151,6 @@ import ( fakefirebasehostingv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/firebasehosting/v1alpha1/fake" firebasestoragev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/firebasestorage/v1alpha1" fakefirebasestoragev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/firebasestorage/v1alpha1/fake" - firestorev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1" - fakefirestorev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/fake" firestorev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1" fakefirestorev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/fake" gkebackupv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/gkebackup/v1alpha1" @@ -646,11 +644,6 @@ func (c *Clientset) FirebasestorageV1alpha1() firebasestoragev1alpha1.Firebasest return &fakefirebasestoragev1alpha1.FakeFirebasestorageV1alpha1{Fake: &c.Fake} } -// FirestoreV1alpha1 retrieves the FirestoreV1alpha1Client -func (c *Clientset) FirestoreV1alpha1() firestorev1alpha1.FirestoreV1alpha1Interface { - return &fakefirestorev1alpha1.FakeFirestoreV1alpha1{Fake: &c.Fake} -} - // FirestoreV1beta1 retrieves the FirestoreV1beta1Client func (c *Clientset) FirestoreV1beta1() firestorev1beta1.FirestoreV1beta1Interface { return &fakefirestorev1beta1.FakeFirestoreV1beta1{Fake: &c.Fake} diff --git a/pkg/clients/generated/client/clientset/versioned/fake/register.go b/pkg/clients/generated/client/clientset/versioned/fake/register.go index 384f884653..a0316a65b2 100644 --- a/pkg/clients/generated/client/clientset/versioned/fake/register.go +++ b/pkg/clients/generated/client/clientset/versioned/fake/register.go @@ -86,7 +86,6 @@ import ( firebasedatabasev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firebasedatabase/v1alpha1" firebasehostingv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firebasehosting/v1alpha1" firebasestoragev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firebasestorage/v1alpha1" - firestorev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firestore/v1alpha1" firestorev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firestore/v1beta1" gkebackupv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/gkebackup/v1alpha1" gkehubv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/gkehub/v1beta1" @@ -220,7 +219,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{ firebasedatabasev1alpha1.AddToScheme, firebasehostingv1alpha1.AddToScheme, firebasestoragev1alpha1.AddToScheme, - firestorev1alpha1.AddToScheme, firestorev1beta1.AddToScheme, gkebackupv1alpha1.AddToScheme, gkehubv1beta1.AddToScheme, diff --git a/pkg/clients/generated/client/clientset/versioned/scheme/register.go b/pkg/clients/generated/client/clientset/versioned/scheme/register.go index c590065c98..173ef1c3ec 100644 --- a/pkg/clients/generated/client/clientset/versioned/scheme/register.go +++ b/pkg/clients/generated/client/clientset/versioned/scheme/register.go @@ -86,7 +86,6 @@ import ( firebasedatabasev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firebasedatabase/v1alpha1" firebasehostingv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firebasehosting/v1alpha1" firebasestoragev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firebasestorage/v1alpha1" - firestorev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firestore/v1alpha1" firestorev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firestore/v1beta1" gkebackupv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/gkebackup/v1alpha1" gkehubv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/gkehub/v1beta1" @@ -220,7 +219,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{ firebasedatabasev1alpha1.AddToScheme, firebasehostingv1alpha1.AddToScheme, firebasestoragev1alpha1.AddToScheme, - firestorev1alpha1.AddToScheme, firestorev1beta1.AddToScheme, gkebackupv1alpha1.AddToScheme, gkehubv1beta1.AddToScheme, diff --git a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/doc.go b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/doc.go deleted file mode 100644 index d3dac805d0..0000000000 --- a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1alpha1 diff --git a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/fake/doc.go b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/fake/doc.go deleted file mode 100644 index dfbe79f9af..0000000000 --- a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/fake/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/fake/fake_firestore_client.go b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/fake/fake_firestore_client.go deleted file mode 100644 index 65224cc5a0..0000000000 --- a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/fake/fake_firestore_client.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeFirestoreV1alpha1 struct { - *testing.Fake -} - -func (c *FakeFirestoreV1alpha1) FirestoreDatabases(namespace string) v1alpha1.FirestoreDatabaseInterface { - return &FakeFirestoreDatabases{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeFirestoreV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/firestore_client.go b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/firestore_client.go deleted file mode 100644 index ddecd9b0bc..0000000000 --- a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/firestore_client.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// *** DISCLAIMER *** -// Config Connector's go-client for CRDs is currently in ALPHA, which means -// that future versions of the go-client may include breaking changes. -// Please try it out and give us feedback! - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "net/http" - - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firestore/v1alpha1" - "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/scheme" - rest "k8s.io/client-go/rest" -) - -type FirestoreV1alpha1Interface interface { - RESTClient() rest.Interface - FirestoreDatabasesGetter -} - -// FirestoreV1alpha1Client is used to interact with features provided by the firestore.cnrm.cloud.google.com group. -type FirestoreV1alpha1Client struct { - restClient rest.Interface -} - -func (c *FirestoreV1alpha1Client) FirestoreDatabases(namespace string) FirestoreDatabaseInterface { - return newFirestoreDatabases(c, namespace) -} - -// NewForConfig creates a new FirestoreV1alpha1Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*FirestoreV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - httpClient, err := rest.HTTPClientFor(&config) - if err != nil { - return nil, err - } - return NewForConfigAndClient(&config, httpClient) -} - -// NewForConfigAndClient creates a new FirestoreV1alpha1Client 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) (*FirestoreV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientForConfigAndClient(&config, h) - if err != nil { - return nil, err - } - return &FirestoreV1alpha1Client{client}, nil -} - -// NewForConfigOrDie creates a new FirestoreV1alpha1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *FirestoreV1alpha1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new FirestoreV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *FirestoreV1alpha1Client { - return &FirestoreV1alpha1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FirestoreV1alpha1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/fake/fake_firestore_client.go b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/fake/fake_firestore_client.go index 4b41ad6137..45c9a055bd 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/fake/fake_firestore_client.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/fake/fake_firestore_client.go @@ -31,6 +31,10 @@ type FakeFirestoreV1beta1 struct { *testing.Fake } +func (c *FakeFirestoreV1beta1) FirestoreDatabases(namespace string) v1beta1.FirestoreDatabaseInterface { + return &FakeFirestoreDatabases{c, namespace} +} + func (c *FakeFirestoreV1beta1) FirestoreIndexes(namespace string) v1beta1.FirestoreIndexInterface { return &FakeFirestoreIndexes{c, namespace} } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/fake/fake_firestoredatabase.go b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/fake/fake_firestoredatabase.go similarity index 70% rename from pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/fake/fake_firestoredatabase.go rename to pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/fake/fake_firestoredatabase.go index bc8335c549..cf733acb44 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/fake/fake_firestoredatabase.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/fake/fake_firestoredatabase.go @@ -24,7 +24,7 @@ package fake import ( "context" - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firestore/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firestore/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 ( // FakeFirestoreDatabases implements FirestoreDatabaseInterface type FakeFirestoreDatabases struct { - Fake *FakeFirestoreV1alpha1 + Fake *FakeFirestoreV1beta1 ns string } -var firestoredatabasesResource = v1alpha1.SchemeGroupVersion.WithResource("firestoredatabases") +var firestoredatabasesResource = v1beta1.SchemeGroupVersion.WithResource("firestoredatabases") -var firestoredatabasesKind = v1alpha1.SchemeGroupVersion.WithKind("FirestoreDatabase") +var firestoredatabasesKind = v1beta1.SchemeGroupVersion.WithKind("FirestoreDatabase") // Get takes name of the firestoreDatabase, and returns the corresponding firestoreDatabase object, and an error if there is any. -func (c *FakeFirestoreDatabases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.FirestoreDatabase, err error) { +func (c *FakeFirestoreDatabases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.FirestoreDatabase, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(firestoredatabasesResource, c.ns, name), &v1alpha1.FirestoreDatabase{}) + Invokes(testing.NewGetAction(firestoredatabasesResource, c.ns, name), &v1beta1.FirestoreDatabase{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.FirestoreDatabase), err + return obj.(*v1beta1.FirestoreDatabase), err } // List takes label and field selectors, and returns the list of FirestoreDatabases that match those selectors. -func (c *FakeFirestoreDatabases) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.FirestoreDatabaseList, err error) { +func (c *FakeFirestoreDatabases) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FirestoreDatabaseList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(firestoredatabasesResource, firestoredatabasesKind, c.ns, opts), &v1alpha1.FirestoreDatabaseList{}) + Invokes(testing.NewListAction(firestoredatabasesResource, firestoredatabasesKind, c.ns, opts), &v1beta1.FirestoreDatabaseList{}) if obj == nil { return nil, err @@ -66,8 +66,8 @@ func (c *FakeFirestoreDatabases) List(ctx context.Context, opts v1.ListOptions) if label == nil { label = labels.Everything() } - list := &v1alpha1.FirestoreDatabaseList{ListMeta: obj.(*v1alpha1.FirestoreDatabaseList).ListMeta} - for _, item := range obj.(*v1alpha1.FirestoreDatabaseList).Items { + list := &v1beta1.FirestoreDatabaseList{ListMeta: obj.(*v1beta1.FirestoreDatabaseList).ListMeta} + for _, item := range obj.(*v1beta1.FirestoreDatabaseList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -83,43 +83,43 @@ func (c *FakeFirestoreDatabases) Watch(ctx context.Context, opts v1.ListOptions) } // Create takes the representation of a firestoreDatabase and creates it. Returns the server's representation of the firestoreDatabase, and an error, if there is any. -func (c *FakeFirestoreDatabases) Create(ctx context.Context, firestoreDatabase *v1alpha1.FirestoreDatabase, opts v1.CreateOptions) (result *v1alpha1.FirestoreDatabase, err error) { +func (c *FakeFirestoreDatabases) Create(ctx context.Context, firestoreDatabase *v1beta1.FirestoreDatabase, opts v1.CreateOptions) (result *v1beta1.FirestoreDatabase, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(firestoredatabasesResource, c.ns, firestoreDatabase), &v1alpha1.FirestoreDatabase{}) + Invokes(testing.NewCreateAction(firestoredatabasesResource, c.ns, firestoreDatabase), &v1beta1.FirestoreDatabase{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.FirestoreDatabase), err + return obj.(*v1beta1.FirestoreDatabase), err } // Update takes the representation of a firestoreDatabase and updates it. Returns the server's representation of the firestoreDatabase, and an error, if there is any. -func (c *FakeFirestoreDatabases) Update(ctx context.Context, firestoreDatabase *v1alpha1.FirestoreDatabase, opts v1.UpdateOptions) (result *v1alpha1.FirestoreDatabase, err error) { +func (c *FakeFirestoreDatabases) Update(ctx context.Context, firestoreDatabase *v1beta1.FirestoreDatabase, opts v1.UpdateOptions) (result *v1beta1.FirestoreDatabase, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(firestoredatabasesResource, c.ns, firestoreDatabase), &v1alpha1.FirestoreDatabase{}) + Invokes(testing.NewUpdateAction(firestoredatabasesResource, c.ns, firestoreDatabase), &v1beta1.FirestoreDatabase{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.FirestoreDatabase), err + return obj.(*v1beta1.FirestoreDatabase), 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 *FakeFirestoreDatabases) UpdateStatus(ctx context.Context, firestoreDatabase *v1alpha1.FirestoreDatabase, opts v1.UpdateOptions) (*v1alpha1.FirestoreDatabase, error) { +func (c *FakeFirestoreDatabases) UpdateStatus(ctx context.Context, firestoreDatabase *v1beta1.FirestoreDatabase, opts v1.UpdateOptions) (*v1beta1.FirestoreDatabase, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(firestoredatabasesResource, "status", c.ns, firestoreDatabase), &v1alpha1.FirestoreDatabase{}) + Invokes(testing.NewUpdateSubresourceAction(firestoredatabasesResource, "status", c.ns, firestoreDatabase), &v1beta1.FirestoreDatabase{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.FirestoreDatabase), err + return obj.(*v1beta1.FirestoreDatabase), err } // Delete takes name of the firestoreDatabase and deletes it. Returns an error if one occurs. func (c *FakeFirestoreDatabases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(firestoredatabasesResource, c.ns, name, opts), &v1alpha1.FirestoreDatabase{}) + Invokes(testing.NewDeleteActionWithOptions(firestoredatabasesResource, c.ns, name, opts), &v1beta1.FirestoreDatabase{}) return err } @@ -128,17 +128,17 @@ func (c *FakeFirestoreDatabases) Delete(ctx context.Context, name string, opts v func (c *FakeFirestoreDatabases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionAction(firestoredatabasesResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha1.FirestoreDatabaseList{}) + _, err := c.Fake.Invokes(action, &v1beta1.FirestoreDatabaseList{}) return err } // Patch applies the patch and returns the patched firestoreDatabase. -func (c *FakeFirestoreDatabases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.FirestoreDatabase, err error) { +func (c *FakeFirestoreDatabases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.FirestoreDatabase, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(firestoredatabasesResource, c.ns, name, pt, data, subresources...), &v1alpha1.FirestoreDatabase{}) + Invokes(testing.NewPatchSubresourceAction(firestoredatabasesResource, c.ns, name, pt, data, subresources...), &v1beta1.FirestoreDatabase{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.FirestoreDatabase), err + return obj.(*v1beta1.FirestoreDatabase), err } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/firestore_client.go b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/firestore_client.go index c05df4a1eb..dd5078f9f6 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/firestore_client.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/firestore_client.go @@ -31,6 +31,7 @@ import ( type FirestoreV1beta1Interface interface { RESTClient() rest.Interface + FirestoreDatabasesGetter FirestoreIndexesGetter } @@ -39,6 +40,10 @@ type FirestoreV1beta1Client struct { restClient rest.Interface } +func (c *FirestoreV1beta1Client) FirestoreDatabases(namespace string) FirestoreDatabaseInterface { + return newFirestoreDatabases(c, namespace) +} + func (c *FirestoreV1beta1Client) FirestoreIndexes(namespace string) FirestoreIndexInterface { return newFirestoreIndexes(c, namespace) } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/firestoredatabase.go b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/firestoredatabase.go similarity index 78% rename from pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/firestoredatabase.go rename to pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/firestoredatabase.go index 30e8f3ac75..393a1572d3 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1alpha1/firestoredatabase.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/firestoredatabase.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/firestore/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/firestore/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 FirestoreDatabasesGetter interface { // FirestoreDatabaseInterface has methods to work with FirestoreDatabase resources. type FirestoreDatabaseInterface interface { - Create(ctx context.Context, firestoreDatabase *v1alpha1.FirestoreDatabase, opts v1.CreateOptions) (*v1alpha1.FirestoreDatabase, error) - Update(ctx context.Context, firestoreDatabase *v1alpha1.FirestoreDatabase, opts v1.UpdateOptions) (*v1alpha1.FirestoreDatabase, error) - UpdateStatus(ctx context.Context, firestoreDatabase *v1alpha1.FirestoreDatabase, opts v1.UpdateOptions) (*v1alpha1.FirestoreDatabase, error) + Create(ctx context.Context, firestoreDatabase *v1beta1.FirestoreDatabase, opts v1.CreateOptions) (*v1beta1.FirestoreDatabase, error) + Update(ctx context.Context, firestoreDatabase *v1beta1.FirestoreDatabase, opts v1.UpdateOptions) (*v1beta1.FirestoreDatabase, error) + UpdateStatus(ctx context.Context, firestoreDatabase *v1beta1.FirestoreDatabase, opts v1.UpdateOptions) (*v1beta1.FirestoreDatabase, 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.FirestoreDatabase, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FirestoreDatabaseList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.FirestoreDatabase, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.FirestoreDatabaseList, 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.FirestoreDatabase, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.FirestoreDatabase, err error) FirestoreDatabaseExpansion } @@ -60,7 +60,7 @@ type firestoreDatabases struct { } // newFirestoreDatabases returns a FirestoreDatabases -func newFirestoreDatabases(c *FirestoreV1alpha1Client, namespace string) *firestoreDatabases { +func newFirestoreDatabases(c *FirestoreV1beta1Client, namespace string) *firestoreDatabases { return &firestoreDatabases{ client: c.RESTClient(), ns: namespace, @@ -68,8 +68,8 @@ func newFirestoreDatabases(c *FirestoreV1alpha1Client, namespace string) *firest } // Get takes name of the firestoreDatabase, and returns the corresponding firestoreDatabase object, and an error if there is any. -func (c *firestoreDatabases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.FirestoreDatabase, err error) { - result = &v1alpha1.FirestoreDatabase{} +func (c *firestoreDatabases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.FirestoreDatabase, err error) { + result = &v1beta1.FirestoreDatabase{} err = c.client.Get(). Namespace(c.ns). Resource("firestoredatabases"). @@ -81,12 +81,12 @@ func (c *firestoreDatabases) Get(ctx context.Context, name string, options v1.Ge } // List takes label and field selectors, and returns the list of FirestoreDatabases that match those selectors. -func (c *firestoreDatabases) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.FirestoreDatabaseList, err error) { +func (c *firestoreDatabases) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FirestoreDatabaseList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.FirestoreDatabaseList{} + result = &v1beta1.FirestoreDatabaseList{} err = c.client.Get(). Namespace(c.ns). Resource("firestoredatabases"). @@ -113,8 +113,8 @@ func (c *firestoreDatabases) Watch(ctx context.Context, opts v1.ListOptions) (wa } // Create takes the representation of a firestoreDatabase and creates it. Returns the server's representation of the firestoreDatabase, and an error, if there is any. -func (c *firestoreDatabases) Create(ctx context.Context, firestoreDatabase *v1alpha1.FirestoreDatabase, opts v1.CreateOptions) (result *v1alpha1.FirestoreDatabase, err error) { - result = &v1alpha1.FirestoreDatabase{} +func (c *firestoreDatabases) Create(ctx context.Context, firestoreDatabase *v1beta1.FirestoreDatabase, opts v1.CreateOptions) (result *v1beta1.FirestoreDatabase, err error) { + result = &v1beta1.FirestoreDatabase{} err = c.client.Post(). Namespace(c.ns). Resource("firestoredatabases"). @@ -126,8 +126,8 @@ func (c *firestoreDatabases) Create(ctx context.Context, firestoreDatabase *v1al } // Update takes the representation of a firestoreDatabase and updates it. Returns the server's representation of the firestoreDatabase, and an error, if there is any. -func (c *firestoreDatabases) Update(ctx context.Context, firestoreDatabase *v1alpha1.FirestoreDatabase, opts v1.UpdateOptions) (result *v1alpha1.FirestoreDatabase, err error) { - result = &v1alpha1.FirestoreDatabase{} +func (c *firestoreDatabases) Update(ctx context.Context, firestoreDatabase *v1beta1.FirestoreDatabase, opts v1.UpdateOptions) (result *v1beta1.FirestoreDatabase, err error) { + result = &v1beta1.FirestoreDatabase{} err = c.client.Put(). Namespace(c.ns). Resource("firestoredatabases"). @@ -141,8 +141,8 @@ func (c *firestoreDatabases) Update(ctx context.Context, firestoreDatabase *v1al // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *firestoreDatabases) UpdateStatus(ctx context.Context, firestoreDatabase *v1alpha1.FirestoreDatabase, opts v1.UpdateOptions) (result *v1alpha1.FirestoreDatabase, err error) { - result = &v1alpha1.FirestoreDatabase{} +func (c *firestoreDatabases) UpdateStatus(ctx context.Context, firestoreDatabase *v1beta1.FirestoreDatabase, opts v1.UpdateOptions) (result *v1beta1.FirestoreDatabase, err error) { + result = &v1beta1.FirestoreDatabase{} err = c.client.Put(). Namespace(c.ns). Resource("firestoredatabases"). @@ -183,8 +183,8 @@ func (c *firestoreDatabases) DeleteCollection(ctx context.Context, opts v1.Delet } // Patch applies the patch and returns the patched firestoreDatabase. -func (c *firestoreDatabases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.FirestoreDatabase, err error) { - result = &v1alpha1.FirestoreDatabase{} +func (c *firestoreDatabases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.FirestoreDatabase, err error) { + result = &v1beta1.FirestoreDatabase{} err = c.client.Patch(pt). Namespace(c.ns). Resource("firestoredatabases"). diff --git a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/generated_expansion.go b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/generated_expansion.go index 677df1f653..5f59489917 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/generated_expansion.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/firestore/v1beta1/generated_expansion.go @@ -21,4 +21,6 @@ package v1beta1 +type FirestoreDatabaseExpansion interface{} + type FirestoreIndexExpansion interface{} diff --git a/pkg/controller/direct/firestore/firestoredatabase_controller.go b/pkg/controller/direct/firestore/firestoredatabase_controller.go index 54a34ea2e8..2b4e780a8a 100644 --- a/pkg/controller/direct/firestore/firestoredatabase_controller.go +++ b/pkg/controller/direct/firestore/firestoredatabase_controller.go @@ -19,7 +19,7 @@ import ( "fmt" "reflect" - krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/firestore/v1alpha1" + krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/firestore/v1beta1" refs "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/config" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" diff --git a/pkg/controller/direct/firestore/firestoredatabase_mappings.go b/pkg/controller/direct/firestore/firestoredatabase_mappings.go index 8fafbe49e4..f362e9b9ce 100644 --- a/pkg/controller/direct/firestore/firestoredatabase_mappings.go +++ b/pkg/controller/direct/firestore/firestoredatabase_mappings.go @@ -16,7 +16,7 @@ package firestore import ( pb "cloud.google.com/go/firestore/apiv1/admin/adminpb" - krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/firestore/v1alpha1" + krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/firestore/v1beta1" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" ) diff --git a/pkg/gvks/supportedgvks/gvks_generated.go b/pkg/gvks/supportedgvks/gvks_generated.go index a7d44d8495..4b73515f46 100644 --- a/pkg/gvks/supportedgvks/gvks_generated.go +++ b/pkg/gvks/supportedgvks/gvks_generated.go @@ -2697,6 +2697,16 @@ var SupportedGVKs = map[schema.GroupVersionKind]GVKMetadata{ "cnrm.cloud.google.com/system": "true", }, }, + { + Group: "firestore.cnrm.cloud.google.com", + Version: "v1beta1", + Kind: "FirestoreDatabase", + }: { + Labels: map[string]string{ + "cnrm.cloud.google.com/managed-by-kcc": "true", + "cnrm.cloud.google.com/system": "true", + }, + }, { Group: "firestore.cnrm.cloud.google.com", Version: "v1beta1", diff --git a/pkg/snippet/snippetgeneration/snippetgeneration.go b/pkg/snippet/snippetgeneration/snippetgeneration.go index f460ee5657..0437d92f82 100644 --- a/pkg/snippet/snippetgeneration/snippetgeneration.go +++ b/pkg/snippet/snippetgeneration/snippetgeneration.go @@ -81,6 +81,7 @@ var preferredSampleForResource = map[string]string{ "dlpjobtrigger": "big-query-job-trigger", "dnsrecordset": "dns-a-record-set", "edgecontainercluster": "edgecontainercluster-remote-control-plane", + "firestoredatabase": "basic-firestoredatabase", "folder": "folder-in-folder", "gkehubfeature": "multi-cluster-ingress-feature", "gkehubfeaturemembership": "config-management-feature-membership", diff --git a/pkg/test/resourcefixture/sets.go b/pkg/test/resourcefixture/sets.go index 5fcae33e38..1b2793be9c 100644 --- a/pkg/test/resourcefixture/sets.go +++ b/pkg/test/resourcefixture/sets.go @@ -92,6 +92,7 @@ func IsPureDirectResource(gk schema.GroupKind) bool { "BigQueryDataTransferConfig", "CloudBuildWorkerPool", "DataformRepository", + "FirestoreDatabase", "NetworkConnectivityServiceConnectionPolicy", "PrivilegedAccessManagerEntitlement", "RedisCluster", diff --git a/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-full/_generated_object_firestoredatabase-full.golden.yaml b/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-full/_generated_object_firestoredatabase-full.golden.yaml index a0076d49db..fad3d446a4 100644 --- a/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-full/_generated_object_firestoredatabase-full.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-full/_generated_object_firestoredatabase-full.golden.yaml @@ -1,6 +1,8 @@ -apiVersion: firestore.cnrm.cloud.google.com/v1alpha1 +apiVersion: firestore.cnrm.cloud.google.com/v1beta1 kind: FirestoreDatabase metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender diff --git a/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-full/create.yaml b/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-full/create.yaml index 38828c0d70..5520ef6e83 100644 --- a/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-full/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-full/create.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: firestore.cnrm.cloud.google.com/v1alpha1 +apiVersion: firestore.cnrm.cloud.google.com/v1beta1 kind: FirestoreDatabase metadata: name: firestoredatabase-full-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-full/update.yaml b/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-full/update.yaml index b7590ca7e2..af528159af 100644 --- a/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-full/update.yaml +++ b/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-full/update.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: firestore.cnrm.cloud.google.com/v1alpha1 +apiVersion: firestore.cnrm.cloud.google.com/v1beta1 kind: FirestoreDatabase metadata: name: firestoredatabase-full-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-minimal/_generated_object_firestoredatabase-minimal.golden.yaml b/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-minimal/_generated_object_firestoredatabase-minimal.golden.yaml index 07e497d41d..e980e87ddb 100644 --- a/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-minimal/_generated_object_firestoredatabase-minimal.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-minimal/_generated_object_firestoredatabase-minimal.golden.yaml @@ -1,6 +1,8 @@ -apiVersion: firestore.cnrm.cloud.google.com/v1alpha1 +apiVersion: firestore.cnrm.cloud.google.com/v1beta1 kind: FirestoreDatabase metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender diff --git a/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-minimal/create.yaml b/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-minimal/create.yaml index eea2aae6f3..e391ed3401 100644 --- a/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-minimal/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/firestore/v1beta1/firestoredatabase/firestoredatabase-minimal/create.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: firestore.cnrm.cloud.google.com/v1alpha1 +apiVersion: firestore.cnrm.cloud.google.com/v1beta1 kind: FirestoreDatabase metadata: name: firestoredatabase-minimal-${uniqueId} diff --git a/scripts/generate-google3-docs/resource-reference/_toc.yaml b/scripts/generate-google3-docs/resource-reference/_toc.yaml index 3671d4f29d..a1149f61f1 100644 --- a/scripts/generate-google3-docs/resource-reference/_toc.yaml +++ b/scripts/generate-google3-docs/resource-reference/_toc.yaml @@ -413,6 +413,8 @@ toc: path: /config-connector/docs/reference/resource-docs/filestore/filestoreinstance.md - title: "Firestore" section: + - title: "FirestoreDatabase" + path: /config-connector/docs/reference/resource-docs/firestore/firestoredatabase.md - title: "FirestoreIndex" path: /config-connector/docs/reference/resource-docs/firestore/firestoreindex.md - title: "Google Kubernetes Engine (GKE)" diff --git a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/firestore/firestoredatabase.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/firestore/firestoredatabase.md new file mode 100644 index 0000000000..8c857246b9 --- /dev/null +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/firestore/firestoredatabase.md @@ -0,0 +1,384 @@ +{# AUTOGENERATED. DO NOT EDIT. #} + +{% extends "config-connector/_base.html" %} + +{% block page_title %}FirestoreDatabase{% endblock %} +{% block body %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyValue
{{gcp_name_short}} Service NameFirestore
{{gcp_name_short}} Service Documentation/firestore/docs/
{{gcp_name_short}} REST Resource Namev1.projects.databases
{{gcp_name_short}} REST Resource Documentation/firestore/docs/reference/rest/v1/projects.databases
{{product_name_short}} Resource Short Namesfirestoredatabase
{{product_name_short}} Service Namefirestore.googleapis.com
{{product_name_short}} Resource Fully Qualified Namefirestoredatabases.firestore.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 +concurrencyMode: string +locationID: string +pointInTimeRecoveryEnablement: string +projectRef: + external: string + kind: string + name: string + namespace: string +resourceID: string +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fields
+

concurrencyMode

+

Optional

+
+

string

+

{% verbatim %}The concurrency control mode to use for this database. See https://cloud.google.com/firestore/docs/reference/rest/v1/projects.databases#concurrencymode for more info.{% endverbatim %}

+
+

locationID

+

Optional

+
+

string

+

{% verbatim %}The location of the database. Available locations are listed at https://cloud.google.com/firestore/docs/locations.{% endverbatim %}

+
+

pointInTimeRecoveryEnablement

+

Optional

+
+

string

+

{% verbatim %}Whether to enable the PITR feature on this database. See https://cloud.google.com/firestore/docs/reference/rest/v1/projects.databases#pointintimerecoveryenablement for more info.{% endverbatim %}

+
+

projectRef

+

Required*

+
+

object

+

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

+
+

projectRef.external

+

Optional

+
+

string

+

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

+
+

projectRef.kind

+

Optional

+
+

string

+

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

+
+

projectRef.name

+

Optional

+
+

string

+

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

+
+

projectRef.namespace

+

Optional

+
+

string

+

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

+
+

resourceID

+

Optional

+
+

string

+

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

+
+ + +

* Field is required when parent field is specified

+ + +### Status +#### Schema +```yaml +conditions: +- lastTransitionTime: string + message: string + reason: string + status: string + type: string +externalRef: string +observedGeneration: integer +observedState: + createTime: string + earliestVersionTime: string + etag: string + keyPrefix: string + uid: string + updateTime: string + versionRetentionPeriod: 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 FirestoreDatabase resource in GCP.{% endverbatim %}

+
observedGeneration +

integer

+

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

+
observedState +

object

+

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

+
observedState.createTime +

string

+

{% verbatim %}Output only. The timestamp at which this database was created. Databases created before 2016 do not populate create_time.{% endverbatim %}

+
observedState.earliestVersionTime +

string

+

{% verbatim %}Output only. The earliest timestamp at which older versions of the data can + be read from the database. See [version_retention_period] above; this field + is populated with `now - version_retention_period`. + + This value is continuously updated, and becomes stale the moment it is + queried. If you are using this value to recover data, make sure to account + for the time from the moment when the value is queried to the moment when + you initiate the recovery.{% endverbatim %}

+
observedState.etag +

string

+

{% verbatim %}This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.{% endverbatim %}

+
observedState.keyPrefix +

string

+

{% verbatim %}Output only. The key_prefix for this database. This key_prefix is used, in + combination with the project id ("~") to construct + the application id that is returned from the Cloud Datastore APIs in Google + App Engine first generation runtimes. + + This value may be empty in which case the appid to use for URL-encoded keys + is the project_id (eg: foo instead of v~foo).{% endverbatim %}

+
observedState.uid +

string

+

{% verbatim %}Output only. The system-generated UUID4 for this Database.{% endverbatim %}

+
observedState.updateTime +

string

+

{% verbatim %}Output only. The timestamp at which this database was most recently updated. Note this only includes updates to the database resource and not data contained by the database.{% endverbatim %}

+
observedState.versionRetentionPeriod +

string

+

{% verbatim %}Output only. The period during which past versions of data are retained in + the database. + + Any [read][google.firestore.v1.GetDocumentRequest.read_time] + or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify + a `read_time` within this window, and will read the state of the database + at that time. + + If the PITR feature is enabled, the retention period is 7 days. Otherwise, + the retention period is 1 hour.{% endverbatim %}

+
+ +## Sample YAML(s) + +### Basic FirestoreDatabase +```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: firestore.cnrm.cloud.google.com/v1beta1 +kind: FirestoreDatabase +metadata: + name: firestoredatabase-sample +spec: + projectRef: + external: ${PROJECT_NUMBER1} + locationID: us-west2 + concurrencyMode: OPTIMISTIC + pointInTimeRecoveryEnablement: POINT_IN_TIME_RECOVERY_ENABLED +``` + + +Note: If you have any trouble with instantiating the resource, refer to Troubleshoot Config Connector. + +{% endblock %} diff --git a/scripts/generate-google3-docs/resource-reference/overview.md b/scripts/generate-google3-docs/resource-reference/overview.md index b2d206baa6..9d036e483f 100644 --- a/scripts/generate-google3-docs/resource-reference/overview.md +++ b/scripts/generate-google3-docs/resource-reference/overview.md @@ -494,6 +494,10 @@ issues for {{product_name_short}}. {{filestore_name}} FilestoreInstance + + {{firestore_name}} + FirestoreDatabase + {{firestore_name}} FirestoreIndex diff --git a/scripts/generate-google3-docs/resource-reference/templates/firestore_firestoredatabase.tmpl b/scripts/generate-google3-docs/resource-reference/templates/firestore_firestoredatabase.tmpl new file mode 100644 index 0000000000..db3c903d01 --- /dev/null +++ b/scripts/generate-google3-docs/resource-reference/templates/firestore_firestoredatabase.tmpl @@ -0,0 +1,53 @@ +{{template "headercomment.tmpl" .}} + +{% extends "config-connector/_base.html" %} + +{% block page_title %}{{ .Kind}}{% endblock %} +{% block body %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{{template "iamsupport.tmpl" .}} + + + + + +
PropertyValue
{{"{{gcp_name_short}}"}} Service NameFirestore
{{"{{gcp_name_short}}"}} Service Documentation/firestore/docs/
{{"{{gcp_name_short}}"}} REST Resource Namev1.projects.databases
{{"{{gcp_name_short}}"}} REST Resource Documentation/firestore/docs/reference/rest/v1/projects.databases
{{"{{product_name_short}}"}} Resource Short Names{{ .ShortNames}}
{{"{{product_name_short}}"}} Service Namefirestore.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 %}