From 4cc8afd10a3c078c69a6bfbae03cc0cf89579d81 Mon Sep 17 00:00:00 2001 From: Config Connector Team Date: Fri, 15 Sep 2023 22:00:57 +0000 Subject: [PATCH] Automated Config Connector import. - 142b6676b1ee4838cd3456a7f7e916765754b48b Create OSS version NewResourceFromTerraform by Config Connector Team - 758d698dfd61783d3588acb42ddb8e86caa2ed35 Implement beta version for all AlloyDB resources by Config Connector Team GitOrigin-RevId: 142b6676b1ee4838cd3456a7f7e916765754b48b --- README.NewResourceFromTerraform.md | 769 ++++++++++ README.Samples.md | 195 +++ ...backups.alloydb.cnrm.cloud.google.com.yaml | 240 +++- ...lusters.alloydb.cnrm.cloud.google.com.yaml | 786 ++++++++++- ...stances.alloydb.cnrm.cloud.google.com.yaml | 230 ++- .../alloydb_v1beta1_alloydbbackup.yaml | 27 + .../alloydb_v1beta1_alloydbcluster.yaml | 24 + .../alloydb_v1beta1_alloydbinstance.yaml | 22 + .../compute_v1beta1_computeaddress.yaml | 25 + .../compute_v1beta1_computenetwork.yaml | 18 + .../iam_v1beta1_iampartialpolicy.yaml | 27 + .../kms_v1beta1_kmscryptokey.yaml | 23 + .../alloydbbackup/kms_v1beta1_kmskeyring.yaml | 20 + ...g_v1beta1_servicenetworkingconnection.yaml | 24 + .../alloydb_v1beta1_alloydbcluster.yaml | 49 + .../compute_v1beta1_computeaddress.yaml | 25 + .../compute_v1beta1_computenetwork.yaml | 20 + .../iam_v1beta1_iampartialpolicy.yaml | 29 + .../kms_v1beta1_kmscryptokey.yaml | 23 + .../kms_v1beta1_kmskeyring.yaml | 20 + ...g_v1beta1_servicenetworkingconnection.yaml | 24 + .../serviceusage_v1beta1_serviceidentity.yaml | 22 + .../alloydb_v1beta1_alloydbcluster.yaml | 24 + .../alloydb_v1beta1_alloydbinstance.yaml | 26 + .../compute_v1beta1_computeaddress.yaml | 25 + .../compute_v1beta1_computenetwork.yaml | 20 + ...g_v1beta1_servicenetworkingconnection.yaml | 24 + .../alloydb_v1beta1_alloydbcluster.yaml | 24 + .../alloydb_v1beta1_alloydbinstance.yaml | 38 + .../compute_v1beta1_computeaddress.yaml | 25 + .../compute_v1beta1_computenetwork.yaml | 20 + ...g_v1beta1_servicenetworkingconnection.yaml | 24 + config/servicemappings/alloydb.yaml | 155 ++ .../alloydbbackup_types.go | 6 +- .../alloydbcluster_types.go | 22 +- .../alloydbinstance_types.go | 6 +- .../apis/alloydb/{v1alpha1 => v1beta1}/doc.go | 6 +- .../alloydb/{v1alpha1 => v1beta1}/register.go | 4 +- .../zz_generated.deepcopy.go | 23 +- .../client/clientset/versioned/clientset.go | 16 +- .../versioned/fake/clientset_generated.go | 10 +- .../clientset/versioned/fake/register.go | 4 +- .../clientset/versioned/scheme/register.go | 4 +- .../{v1alpha1 => v1beta1}/alloydb_client.go | 40 +- .../{v1alpha1 => v1beta1}/alloydbbackup.go | 42 +- .../{v1alpha1 => v1beta1}/alloydbcluster.go | 42 +- .../{v1alpha1 => v1beta1}/alloydbinstance.go | 42 +- .../alloydb/{v1alpha1 => v1beta1}/doc.go | 2 +- .../alloydb/{v1alpha1 => v1beta1}/fake/doc.go | 0 .../fake/fake_alloydb_client.go | 12 +- .../fake/fake_alloydbbackup.go | 50 +- .../fake/fake_alloydbcluster.go | 50 +- .../fake/fake_alloydbinstance.go | 50 +- .../generated_expansion.go | 2 +- .../testdata/asset-skeleton.yaml | 6 + .../testdata/uri-skeleton.yaml | 9 + .../snippetgeneration/snippetgeneration.go | 1 + pkg/test/constants/presubmitconstants.go | 1 + .../contexts/alloydb_context.go | 28 + .../basicalloydbbackup/create.yaml | 25 + .../basicalloydbbackup/dependencies.yaml | 73 + .../fullalloydbbackup/create.yaml | 27 + .../fullalloydbbackup/dependencies.yaml | 118 ++ .../basicalloydbcluster/create.yaml | 25 + .../basicalloydbcluster/dependencies.yaml | 29 + .../basicalloydbcluster/update.yaml | 28 + .../fullalloydbcluster/create.yaml | 47 + .../fullalloydbcluster/dependencies.yaml | 66 + .../fullalloydbcluster/update.yaml | 38 + .../basicalloydbinstance/create.yaml | 25 + .../basicalloydbinstance/dependencies.yaml | 59 + .../basicalloydbinstance/update.yaml | 25 + .../fullalloydbinstance/create.yaml | 25 + .../fullalloydbinstance/dependencies.yaml | 61 + .../fullalloydbinstance/update.yaml | 27 + .../readalloydbinstance/create.yaml | 27 + .../readalloydbinstance/dependencies.yaml | 80 ++ .../readalloydbinstance/update.yaml | 25 + scripts/environment-setup/gcp-setup.sh | 17 +- .../resource-reference/_toc.yaml | 8 + .../resource-docs/alloydb/alloydbbackup.md | 525 +++++++ .../resource-docs/alloydb/alloydbcluster.md | 1252 +++++++++++++++++ .../resource-docs/alloydb/alloydbinstance.md | 555 ++++++++ .../resource-reference/overview.md | 12 + .../templates/alloydb_alloydbbackup.tmpl | 54 + .../templates/alloydb_alloydbcluster.tmpl | 54 + .../templates/alloydb_alloydbinstance.tmpl | 54 + scripts/shared-vars-public.sh | 61 + 88 files changed, 6681 insertions(+), 266 deletions(-) create mode 100644 README.NewResourceFromTerraform.md create mode 100644 README.Samples.md create mode 100644 config/samples/resources/alloydbbackup/alloydb_v1beta1_alloydbbackup.yaml create mode 100644 config/samples/resources/alloydbbackup/alloydb_v1beta1_alloydbcluster.yaml create mode 100644 config/samples/resources/alloydbbackup/alloydb_v1beta1_alloydbinstance.yaml create mode 100644 config/samples/resources/alloydbbackup/compute_v1beta1_computeaddress.yaml create mode 100644 config/samples/resources/alloydbbackup/compute_v1beta1_computenetwork.yaml create mode 100644 config/samples/resources/alloydbbackup/iam_v1beta1_iampartialpolicy.yaml create mode 100644 config/samples/resources/alloydbbackup/kms_v1beta1_kmscryptokey.yaml create mode 100644 config/samples/resources/alloydbbackup/kms_v1beta1_kmskeyring.yaml create mode 100644 config/samples/resources/alloydbbackup/servicenetworking_v1beta1_servicenetworkingconnection.yaml create mode 100644 config/samples/resources/alloydbcluster/alloydb_v1beta1_alloydbcluster.yaml create mode 100644 config/samples/resources/alloydbcluster/compute_v1beta1_computeaddress.yaml create mode 100644 config/samples/resources/alloydbcluster/compute_v1beta1_computenetwork.yaml create mode 100644 config/samples/resources/alloydbcluster/iam_v1beta1_iampartialpolicy.yaml create mode 100644 config/samples/resources/alloydbcluster/kms_v1beta1_kmscryptokey.yaml create mode 100644 config/samples/resources/alloydbcluster/kms_v1beta1_kmskeyring.yaml create mode 100644 config/samples/resources/alloydbcluster/servicenetworking_v1beta1_servicenetworkingconnection.yaml create mode 100644 config/samples/resources/alloydbcluster/serviceusage_v1beta1_serviceidentity.yaml create mode 100644 config/samples/resources/alloydbinstance/primary-instance/alloydb_v1beta1_alloydbcluster.yaml create mode 100644 config/samples/resources/alloydbinstance/primary-instance/alloydb_v1beta1_alloydbinstance.yaml create mode 100644 config/samples/resources/alloydbinstance/primary-instance/compute_v1beta1_computeaddress.yaml create mode 100644 config/samples/resources/alloydbinstance/primary-instance/compute_v1beta1_computenetwork.yaml create mode 100644 config/samples/resources/alloydbinstance/primary-instance/servicenetworking_v1beta1_servicenetworkingconnection.yaml create mode 100644 config/samples/resources/alloydbinstance/read-instance/alloydb_v1beta1_alloydbcluster.yaml create mode 100644 config/samples/resources/alloydbinstance/read-instance/alloydb_v1beta1_alloydbinstance.yaml create mode 100644 config/samples/resources/alloydbinstance/read-instance/compute_v1beta1_computeaddress.yaml create mode 100644 config/samples/resources/alloydbinstance/read-instance/compute_v1beta1_computenetwork.yaml create mode 100644 config/samples/resources/alloydbinstance/read-instance/servicenetworking_v1beta1_servicenetworkingconnection.yaml create mode 100644 config/servicemappings/alloydb.yaml rename pkg/clients/generated/apis/alloydb/{v1alpha1 => v1beta1}/alloydbbackup_types.go (96%) rename pkg/clients/generated/apis/alloydb/{v1alpha1 => v1beta1}/alloydbcluster_types.go (94%) rename pkg/clients/generated/apis/alloydb/{v1alpha1 => v1beta1}/alloydbinstance_types.go (97%) rename pkg/clients/generated/apis/alloydb/{v1alpha1 => v1beta1}/doc.go (91%) rename pkg/clients/generated/apis/alloydb/{v1alpha1 => v1beta1}/register.go (96%) rename pkg/clients/generated/apis/alloydb/{v1alpha1 => v1beta1}/zz_generated.deepcopy.go (98%) rename pkg/clients/generated/client/clientset/versioned/typed/alloydb/{v1alpha1 => v1beta1}/alloydb_client.go (66%) rename pkg/clients/generated/client/clientset/versioned/typed/alloydb/{v1alpha1 => v1beta1}/alloydbbackup.go (79%) rename pkg/clients/generated/client/clientset/versioned/typed/alloydb/{v1alpha1 => v1beta1}/alloydbcluster.go (79%) rename pkg/clients/generated/client/clientset/versioned/typed/alloydb/{v1alpha1 => v1beta1}/alloydbinstance.go (79%) rename pkg/clients/generated/client/clientset/versioned/typed/alloydb/{v1alpha1 => v1beta1}/doc.go (98%) rename pkg/clients/generated/client/clientset/versioned/typed/alloydb/{v1alpha1 => v1beta1}/fake/doc.go (100%) rename pkg/clients/generated/client/clientset/versioned/typed/alloydb/{v1alpha1 => v1beta1}/fake/fake_alloydb_client.go (70%) rename pkg/clients/generated/client/clientset/versioned/typed/alloydb/{v1alpha1 => v1beta1}/fake/fake_alloydbbackup.go (73%) rename pkg/clients/generated/client/clientset/versioned/typed/alloydb/{v1alpha1 => v1beta1}/fake/fake_alloydbcluster.go (73%) rename pkg/clients/generated/client/clientset/versioned/typed/alloydb/{v1alpha1 => v1beta1}/fake/fake_alloydbinstance.go (72%) rename pkg/clients/generated/client/clientset/versioned/typed/alloydb/{v1alpha1 => v1beta1}/generated_expansion.go (98%) create mode 100644 pkg/test/resourcefixture/contexts/alloydb_context.go create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/basicalloydbbackup/create.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/basicalloydbbackup/dependencies.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/fullalloydbbackup/create.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/fullalloydbbackup/dependencies.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/create.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/dependencies.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/update.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/fullalloydbcluster/create.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/fullalloydbcluster/dependencies.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/fullalloydbcluster/update.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/create.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/dependencies.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/update.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/create.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/dependencies.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/update.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/create.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/dependencies.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/update.yaml create mode 100644 scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbbackup.md create mode 100644 scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbcluster.md create mode 100644 scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbinstance.md create mode 100644 scripts/generate-google3-docs/resource-reference/templates/alloydb_alloydbbackup.tmpl create mode 100644 scripts/generate-google3-docs/resource-reference/templates/alloydb_alloydbcluster.tmpl create mode 100644 scripts/generate-google3-docs/resource-reference/templates/alloydb_alloydbinstance.tmpl diff --git a/README.NewResourceFromTerraform.md b/README.NewResourceFromTerraform.md new file mode 100644 index 0000000000..91dc293ee5 --- /dev/null +++ b/README.NewResourceFromTerraform.md @@ -0,0 +1,769 @@ +## Before You Start + +This README entails instructions to implement a new resource CRD through +[Terraform Provider Google](https://github.com/hashicorp/terraform-provider-google). + +# Add a New Resource + +The instructions will help you add a new resource to Config Connector. A +resource is a K8s representation of a GCP resource. + +# Overview + +To add a new resource you add new metadata to +[ServiceMappings](config/servicemappings), generate a CRD, register a +controller, enable the controller access to the CRD, add test contexts, test +resource data, and update the documentation with information about the new +resource as well as samples. + +This example is written from the perspective of a developer adding a new +resource, `SpannerInstance`. However, this resource has already been +implemented! The intention is for you to map these instructions to the resource +you are adding. For example, if you were to add `PubSubTopic` then you would +replace instances of the string `Spanner` with `PubSub` and instances of the +string `SpannerInstance` with `PubSubTopic`, etc. + +## Study the Resource + +First, you'll need to find information on the resource. There are two sources of +truth for the resource; the documentation of the Google Resource and API itself, +and the documentation and code of the provider we use to wrap it. + +### Determine the Resource Name + +The resource name is divided into two parts. First, the *service name* indicates +the name of the GCP service that the resource belongs to, then, a *specific +name* for that resource within the context of the service finishes the name. + +The resource name is always Pascal case and singular (e.g. ComputeHealthCheck), +while the API will use camel case for service and resource name, dot-separated +and pluralized (e.g. compute.healthChecks), and Terraform uses snake case, +sometimes with `google_` prepended (e.g. google_compute_health_check). + +### Information from the provider + +We use Terraform Provider **google-beta** as the underlying provider library for +Config Connector resources, with a few custom patches. You should find a file +from our provider under +[third_party/github.com/hashicorp/terraform-provider-google-beta/google-beta](third_party/github.com/hashicorp/terraform-provider-google-beta/google-beta) +in the approximate format `resource_.go`. If the file is not +there, we likely need to +[update terraform provider](README.UpdatingTerraformProvider.md). + +If the resource is [locational](#legacy-configs-for-locational-resources), there +may be a locationality indicator, such as `regional` or `global`, between the +service name and specific name. + +If there are variations on the filename(s) for your resource other than +locationality indicators or `_migration` after the resource name, the resource +may be more difficult to implement. + +Check to make sure these really are for your resource, not a different resources +with a longer name (e.g. ComputeInstance, ComputeTargetInstanceGroup, and +ComputeInstanceGroupManager are three different resources which all start with +'ComputeInstance'). + +Technically, all the information you need about the provider is in this file. +However, it's not necessarily the most readable. Fortunately, the provider comes +with documentation which is submitted to and +[published by Terraform](https://registry.terraform.io/providers/hashicorp/google-beta/latest/docs/resources). +Search the Terraform documentation using the 'FILTER' box atop the list on the +left. You should be able to find documentation for your resource. Make sure it's +a resource and not a data source. + +### Information from Google + +One nice thing about the Terraform documentation mentioned above is that it will +often link to the relevant Google documentation. If it doesn't, you can attempt +to find the documentation by searching the +[Google product offerings](https://cloud.google.com/products) or just Googling +it. + +Reading the Google documentation is very important for making sure you have the +correct service name, knowing how the resource is called in the API, and gaining +context on how the resource might actually be used. + +### Information from other Config Connector contributors + +Implementing a resource requires extensive knowledge of GCP, ServiceMappings, +and the API quirks of your resource. If you're stuck or unclear on anything, +[ask for help](https://github.com/GoogleCloudPlatform/k8s-config-connector/issues/new?assignees=&labels=question&projects=&template=question.yaml)! + +# Generate the Custom Resource Definition + +[Custom Resource Definitions](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) +(CRDs), are the mechanism by which K8s developers can add new APIs to their +cluster. In the case of Config Connector, for each GCP resource there will +eventually be an associated Config Connector CRD. The CRDs are generated by the +[pkg/crd/crdgeneration](pkg/crd/crdgeneration) program. + +API Server Objects with the Kind of a registered CRD are called Custom Resources +(CRs). For Config Connector CRDs, there is a single dynamic controller which is +responsible for actuating the declared state of all CRs onto GCP. The dynamic +controller makes extensive use of the terraform library to communicate with GCP. + +Both the `crdgeneration` program and the dynamic controller need additional +metadata to properly create and operate on Config Connector CRDs. The metadata +is stored in [config/servicemappings](config/servicemappings). The service +mappings are documented inline with their definition at +[pkg/apis/core/v1alpha1/servicemapping_types.go](pkg/apis/core/v1alpha1/servicemapping_types.go). + +## Create the Service Mappings file + +For each GCP service, there is an associated Service Mappings file. Create the +Service Mappings file: + +1. Determine the name of the service for the resource you are adding. In the + case of `SpannerInstance` the name of the service is `Spanner`. +1. Determine the name of the service mappings file. The file's name is + `$(lowercaseservicename).yaml`. So, in the case of the `Spanner` service, + the name of the file is `spanner.yaml`. +1. If the file already exists, skip the rest of the steps in this section. +1. In [config/servicemappings](config/servicemappings), open `spanner.yaml` for + editing. +1. Paste the following into the file. + + ```yaml + apiVersion: core.cnrm.cloud.google.com/v1alpha1 + kind: ServiceMapping + metadata: + name: spanner.cnrm.cloud.google.com + namespace: cnrm-system + spec: + name: Spanner + version: v1beta1 + serviceHostName: "spanner.googleapis.com" + resources: + ``` + +1. Replace all instances of `spanner` and `Spanner` with the appropriate + service name you determined in step 1. + +**Tip**: You can +[use the auto-generated service mappings as a reference](#using-the-auto_generated-service-mappings-as-a-reference). + +## Add the Resource Config to Service Mappings + +For each GCP resource, there is an associated `ResourceConfig` in a +ServiceMappings file. Add the `ResourceConfig` for your resource: + +**Tip**: You can +[use the auto-generated service mappings as a reference](#using-the-auto_generated-service-mappings-as-a-reference). + +1. Open the Service Mappings file from the previous section for editing. In the + case of the `Spanner` service the file is named `spanner.yaml`. +1. In the file, under `resources`, paste the following: + + ```yaml + resources: + - name: google_spanner_instance + kind: SpannerInstance + metadataMapping: + name: name + labels: labels + ``` + +1. Replace the value for `name` with the name of the Terraform resource + associated with your GCP resource. + +1. Replace the value for `kind` with the ConfigConnector `Kind` for your + resource. The name should be in pascal case, i.e. ServiceNameResourceName, + but with acronyms in uppercase. + +1. Edit the `metadataMapping` as appropriate. For this you will need to take a + look at the terraform resource documentation, `ResourceConfig` examples for + similar resources, and the + [pkg/apis/core/servicemapping_types](pkg/apis/core/servicemapping_types) + documentation. + +1. Add `directives` if necessary. For reference, a "directive" is a specific term we're using to describe a special Terraform provider field that maps + a unique behavior on top of the underlying resource, which can't be accomplished as part of a `GET` response. + Similar to the step above, you'll need to look at Terraform resource documentation, + Google Cloud API documentation, and the [pkg/apis/core/servicemapping_types](pkg/apis/core/servicemapping_types) + documentation to determine if any fields are directives. There isn't a foolproof way to tell whether a field is + a directive , but a general rule of thumb to start with is to determine if there are any + fields specific to Terraform and also don't appear in the Google Cloud API docs.

+ For example, with Container Cluster we first compare the [Terraform documentation](https://www.terraform.io/docs/providers/google/r/container_cluster.html) to the + the [Google Cloud resource API documentation](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters). One helpful + thing to notice is that there is usually a note on the bottom of the Terraform documentation that will inform you if there are any Terraform-specific + behaviors on this resource. With Container Cluster, you can see that `remove_default_node_pool` is not present in the API. Therefore, the container cluster + resource in the `container.yaml` service mapping will have a `directives` section like this: + + ```yaml + - name: google_container_cluster + kind: ContainerCluster + ... + directives: + - remove_default_node_pool + ``` + +1. Fill out the `resourceAvailableInAssetInventory`. Set to false. + +1. Add `hierarchicalReferences` if they exist. Determine if the corresonding + Terraform resource exposes one or more parent resources through top-level + fields. These fields can have names like `org_id`, `parent_org_id`, + `parent_folder_id`, `folder`, `project`, etc. Additionally, we consider + `billing_account` to be a hierarchical reference, but this is a unique case + and should be brought to the attention when you create your PR. Hierarchical + references can be added to the servicemapping like so: + + ```yaml + // The hierarchical reference should be configured + // under both 'hierarchicalReferences` and `resourceReferences` + // lists. + hierarchicalReferences: + - type: project // one of 'project', 'folder', 'organization' and 'billingAccount' + key: projectRef // one of 'projectRef', 'folderRef', 'organizationRef' and 'billingAccountRef' + resourceReferences: + - tfField: project + key: projectRef. // must match the key defined in hierarchicalReferences list + description: |- + The project that this resource belongs to. + gvk: + kind: Project + version: v1beta1 + group: resourcemanager.cnrm.cloud.google.com + ``` + + Additional examples can be found here: + [projectRef](https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/b746248cd5a9b30669380513de8fdc6b4c43018d/config/servicemappings/pubsub.yaml#L36), + [folderRef](https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/b746248cd5a9b30669380513de8fdc6b4c43018d/config/servicemappings/resourcemanager.yaml#L42), + and + [organizationRef](https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/b746248cd5a9b30669380513de8fdc6b4c43018d/config/servicemappings/resourcemanager.yaml#L53) + + Note: The `containers` field has been deprecated, and + `hierarchicalReferences` should be used instead. + +1. Follow the resource reference guidelines + [here](README.ConfigureResourceReferences.md) to identify and configure + potential resource reference fields. + +## Generate the CRD + +1. Run `make manifests`. +1. Run `git status`. Verify that there is a new CRD in `config/crds`. + +# Add the Service to Testing and Release + +For testing to work, the service must be enabled for the test project. Add the +service to the `SUPPORTED_SERVICES` block in +[scripts/shared-vars-public.sh](scripts/shared-vars-public.sh) if it is not +there. + +# Test Your Changes + +To verify your changes, add test resource YAMLs, run targeted tests for your +resource. + +## Add necessary YAML files to `testdata/` + +Add `create.yaml` and `update.yaml` to +[pkg/test/resourcefixture/testdata/basic](pkg/test/resourcefixture/testdata/basic) +in this folder structure. Make sure that the bottommost folder is the name of +the resource in lowercase. + +**Tip**: You can +[use the auto-generated testdata as a reference](#using-the-auto_generated-testdata-as-a-reference) +when adding test YAML files under +[pkg/test/resourcefixture/testdata/basic](pkg/test/resourcefixture/testdata/basic). + +``` +pkg/test/resourcefixture/testdata/basic +├── spanner +| ├── v1alpha2 +| ├── spannerinstance +| └── create.yaml +| └── update.yaml +``` + +### Create.yaml + +Paste this into the `create.yaml` file (feel free to change labels/name/spec, +but do not change the `${uniqueId}` or `${projectId}` replacement strings): + +```yaml +apiVersion: spanner.cnrm.cloud.google.com/v1alpha2 +kind: SpannerInstance +metadata: + labels: + label-one: "value-one" + name: spannerinstance-${uniqueId} +spec: + config: regional-us-west1 + displayName: Spanner Instance Sample + numNodes: 2 +``` + +Please refer to the test data +[naming convention](#naming-conventions-special-variables-and-constants-in-testdata) +when changing `name` field. `labels` field is not needed if it wasn't included +in the resource's servicemapping. + +### Update.yaml + +The `update.yaml` file should look about exactly the same, except modify or add +any fields/labels. Note that not all fields can be added/modified. Check the +resource's Terraform implementation to see which fields support updates. For +example, the Terraform implementation for `SpannerInstance` is at +[third_party/github.com/hashicorp/terraform-provider-google-beta/google-beta/services/spanner/resource_spanner_instance.go](./third_party/github.com/hashicorp/terraform-provider-google-beta/google-beta/services/spanner/resource_spanner_instance.go). +We can see that the `name` field does not support updates since `ForceNew` is +enabled. + +In some cases, none of the fields of a resource support updates, in which case +you can skip adding the `update.yaml`. You will also need to set `SkipUpdate` to +`true` in the [test context](./pkg/test/resourcefixture/contexts/). + +### Dependencies.yaml + +In some cases, the resource being added depends on other resources being created +first. You can put the configurations for these dependencies in a +`dependencies.yaml` file. + +For example, the resource `SQLDatabase` depends on a `SQLInstance` resource +already existing, so the `dependencies.yaml` for `SQLDatabase` contains the +configuration for a `SQLInstance` resource. + +**Note:** The dependent resources are created sequentially in the integration +test, so the resources in `dependencies.yaml` **MUST** follow the topological +ordering. E.g. if both a `SQLInstance` and a `SQLUser` should be in +`dependencies.yaml`, and the `SQLUser` need to reference the `SQLInstance`, then +`SQLInstance` must be defined before `SQLUser`. + +Note: if one of the resource's dependencies is on `ComputeNetwork` and/or +`ComputeSubnetwork`, see the +[Using the Default ComputeNetwork/ComputeSubnetwork](#using-the-default-computenetworkcomputesubnetwork) +section under the Appendix. + +## Run Tests + +1. Run your newly added resource's test cases in `pkg/controller/dynamic`, + replacing `spannerinstance` with the name of your resource: + + ``` + go test -v -tags=integration ./pkg/controller/dynamic/ -test.run TestCreateNoChangeUpdateDelete -run-tests spannerinstance + ``` + + Ensure they are successful. + +## Optionally Add the Resource to Test Contexts + +If the tests passed then skip this section. + +If the update or acquire test fail, it may mean that you need to disable the +acquire and update test because the resource cannot support those functions. +Note that disabling either of these tests should ONLY be done if the resource +does not support the feature. Otherwise, you will need to debug the failures, +understand the root cause, and make the appropriate fix(es). + +To disable the acquire and update test: + +1. In [pkg/test/resourcefixture/contexts/](pkg/test/resourcefixture/contexts/) + open a file named `${service}_context.go` for editing where `${service}` is + the lowercase name of the service for your resource. In the case of + `SpannerInstance` it would be `spanner` and the file would be named + `spanner_context.go`. +1. Paste the following into the file, if the file already exists, do not paste + in the `func init()` portion. + + ```go + func init() { + resourceContextMap["spannerinstance"] = ResourceContext{ + ResourceKind: "SpannerInstance", + SkipUpdate: true, // Update is not supported because ... + SkipAcquire: true, // Acquire is not supported because ... + } + } + ``` + +1. Go line by line and convert the logic from `SpannerInstance` to your + resource type. This may require making additional changes in other files. + +1. Run through the following list of things to implement and verify: + + * change the `ResourceContextMap` key to the **lowercase** resource name + (no spaces, no underscores) + * change `ResourceKind` to the same resource name as the key, but in + **UpperCamelCase** + * change SkipUpdate to true (and add a comment documenting the reason) or + delete it + * change SkipAcquire to true (and add a comment documenting the reason) or + delete it + +## Optionally Add the Test Case to Long Running Test List + +If the test takes more than 10 minutes to finish, add it to +LONG_RUNNING_CRUD_TESTS_REGEX in +[./scripts/shared-vars-public.sh](./scripts/shared-vars-public.sh). + +## Resource skeleton test cases + +Skeleton test cases create a minimal resource definition for the provider to +match to after ingesting the resource from an alternate source, such as a Cloud +Asset or URI. To determine exactly what the expected skeleton should look like, +you may need to run the `pkg/resourceskeleton` tests a few times to refine the +resource skeleton you enter based on the diffs you get. + +These tests depend on the TF provider import, which means they are sensitive to +the `idTemplate` provided in the resources and the Terraform import itself. If +you find an issue in the resource's Terraform import then patch terraform or +create an issue for terraform to fix the importer before skipping tests. + +### Add a resource asset skeleton test case + +Check if Cloud Asset Inventory(CAI) supports the resource kind by seeing if it +exists in this +[list of supported resources](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + +Whether the resource is supported or not, you will need to add an entry in +[pkg/resourceskeleton/testdata/asset-skeleton.yaml](pkg/resourceskeleton/testdata/asset-skeleton.yaml), + +If the resource is not supported by CAI, add an entry that looks like this +(replacing `StorageNotification` with your resource type): + +```yaml +# not supported by asset inventory +- resourceConfigId: StorageNotification +``` + +If the resource is supported by CAI, you will need to add a skeleton which will +look similar to this + +```yaml +- asset: + ancestors: + - projects/1234567890 + - organizations/1234567890 + name: //spanner.googleapis.com/projects/kcc-test/instances/spannerinstance-3m5j7pbhtprbatjs96cg/databases/spannerdatabase-test + asset_type: spanner.googleapis.com/Database + expectedSkeleton: + apiVersion: spanner.cnrm.cloud.google.com/v1beta1 + kind: SpannerDatabase + metadata: + annotations: + cnrm.cloud.google.com/project-id: kcc-test + name: spannerdatabase-test + spec: + instanceRef: + external: spannerinstance-3m5j7pbhtprbatjs96cg + resourceConfigId: SpannerDatabase +``` + +### add a uri -> resource skeleton test case + +The uri -> resource skeleton test cases ensure that a resource supports +[config-connector export](https://cloud.google.com/config-connector/docs/how-to/import-export/export). +Modify +[pkg/resourceskeleton/testdata/uri-skeleton.yaml](pkg/resourceskeleton/testdata/uri-skeleton.yaml). +Add a new entry as follows. + +```yaml +- ExpectedSkeleton: null + ResourceConfigId: SpannerDatabase + URI: "" +``` + +1. Change the ResourceConfigId to match the resource config of the resource you + have added. +1. Determine if the resource can be fetched by URL. You can get a URI by + looking at the wire logs from gcloud describing your resource. Example: + `gcloud spanner databases describe asdf --instance spannerdatabase-dep + --log-http` +1. If the resource can fetched by URL: + 1. Modify the test case by filling out the URI field with a sample URL. + 1. Modify the test case by filling out the ExpectedSkeleton field which the + expected Config Connector resource that contains all the fields + necessary to identify the resource (i.e. name, location, Kind) +1. If the resource cannot be fetched by URL then, in the service mapping + resource config for your new resource, set the value for + `idTemplateCanBeUsedToMatchResourceName` to false + +# Add Sample(s) + +To enable users to get up and running quickly, samples are created for each +resource. If a given resource has different important use cases then multiple +samples are created for that resource. + +1. In [config/samples/resources](config/samples/resources), create a new + directory for the resource's samples: `mkdir spannerinstance`. +1. Follow the sample guidelines [here](README.Samples.md) and create sample(s) + for the resource. + +## Cloud Code Snippets + +We have a script that generates snippet files for Cloud Code using our samples. +If you created multiple samples (i.e. multiple samples subdirectories), you must +tell the script which sample to use for generating snippets. Update the +`preferredSampleForResource` map in +[pkg/snippet/snippetgeneration/snippetgeneration.go](pkg/snippet/snippetgeneration/snippetgeneration.go). + +# Update the Public Documentation Templates + +In order to keep +[resource reference doc](https://cloud.google.com/config-connector/docs/reference/overview) +update to date, we need to add the new CRDs and samples to existing doc. + +1. Copy one of existing files under + [scripts/generate-google3-docs/resource-reference/templates](scripts/generate-google3-docs/resource-reference/templates), + and name it like `spanner_spannerinstance.tmpl`, (i.e., + _.tmpl). +1. Change the values for "Service name" (there are **two**, one for 'Google + Cloud Service Name' and one for 'Config Connector Service Name'), "Service + Documentation", "REST Resource Name", and "REST Resource Documentation" + accordingly. Make sure that the URL in "REST Resource Documentation" points + to a working document by adding the partial URL to + `https://cloud.google.com` (i.e. + `https://cloud.google.com/spanner/docs/reference/rest/v1/projects.instances`). + Add an additional paragraph/table if needed. +1. Update + [scripts/generate-google3-docs/resource-reference/overview.md](scripts/generate-google3-docs/resource-reference/overview.md) + by adding a row for your resource to the resource table. Note you need to + use a proper template variable for your new service. TODO: Provide guidance + on how to find the variable name. +1. Update + [scripts/generate-google3-docs/resource-reference/_toc.yaml](scripts/generate-google3-docs/resource-reference/_toc.yaml) + by adding an entry and path to the corresponding API section. If there is no + entry for the API, add one. + +To generate the new resource doc, run `make resource-docs`. You should see your +resource generated to the +[scripts/generate-google3-docs/resource-reference/generated/resource-docs](scripts/generate-google3-docs/resource-reference/generated/resource-docs) +folder. + +# Create a pull request + +Run `make ready-pr` to make sure the local changes are ready to commit. + +For more details see [Contributing Guide](CONTRIBUTING.md). + +After the PR is created: + +1. Wait for the presubmit tests to pass. Look into the failures if there are + any. + +1. Wait for your review to get approved. Address the comments if there are any. + +1. Merge the PR! + +# Appendix + +## Using the Default ComputeNetwork/ComputeSubnetwork + +When writing testdata for a resource, if at least one of its dependencies is a +resource of kind `ComputeNetwork` or `ComputeSubnetwork`, then use the default +network and a default subnet if your tests do not need to create their own +networks/subnets. This is done to prevent test failures caused by tests +exceeding GCP's networks quota. + +Below is the proper configuration for the default network. Use this in +`dependencies.yaml` if you want to be able to depend on the default network. + +```yaml +apiVersion: compute.cnrm.cloud.google.com/v1alpha3 +kind: ComputeNetwork +metadata: + name: default + annotations: + cnrm.cloud.google.com/deletion-policy: "abandon" +spec: + description: Default network for the project +``` + +Below is the proper configuration for one of the default subnets (the default +subnet for the `us-central1` region in this case). Use this in +`dependencies.yaml` if you want to be able to depend on a default subnet. + +```yaml +apiVersion: compute.cnrm.cloud.google.com/v1alpha3 +kind: ComputeSubnetwork +metadata: + name: default + annotations: + cnrm.cloud.google.com/deletion-policy: "abandon" +spec: + ipCidrRange: 10.128.0.0/20 + region: us-central1 + networkRef: + name: default +``` + +Note that if you want to create a custom subnet for your dependency, you will +have to create a custom network as well. Do NOT create a custom subnet within +the default network, since this will potentially lead to the creation of +multiple subnets in the default network with overlapping ipCidrRanges, which +will lead to tests failing because this action is prohibited by GCP. + +## Test Multiple Scenarios for the Same Resource Kind + +If you want to add multiple test scenarios for the same resource kind, e.g. a +common case is to have test suites for both global and regional compute +addresses using the same `ComputeAddress` CRD, you can create multiple folders +to represent different test scenarios where each of them contains necessary YAML +files like `create.yaml` and `update.yaml`. + +``` +pkg/test/resourcefixture/testdata/basic +├── compute +| ├── v1beta1 +| ├── computeaddress +| ├── globalcomputeaddress +| └── create.yaml +| └── update.yaml +| ├── regionalcomputeaddress +| └── create.yaml +| └── update.yaml + +``` + +In case you need to customize the `ResourceContext` to disable ex: Update test, +in +[pkg/test/resourcefixture/contexts/compute_context.go](pkg/test/resourcefixture/contexts/compute_context.go), +you need to add the corresponding `ResourceContext` into `ResourceContextMap` +and the key should be the same as the folder name. For the above example, add +the following code snippet: + +```go + ResourceContextMap["regionalcomputeaddress"] = ResourceContext{ + ResourceKind: "ComputeAddress", + SkipUpdate: true, + } + + ResourceContextMap["globalcomputeaddress"] = ResourceContext{ + ResourceKind: "ComputeAddress", + SkipUpdate: true, + } +``` + +## Using the auto-generated service mappings as a reference + +When you create a new service mappings file, or add a resource config, you can +use the auto-generated service mappings as a reference. + +### Creating a new service mappings file using the auto-generated service mappings + +1. Locate the service mappings file of name `$(lowercaseservicename).yaml` + under + [scripts/resource-autogen/generated/servicemappings](./scripts/resource-autogen/generated/servicemappings). +2. Open the file and copy the lines until `resources:` +3. Paste the copied the lines into the new service mappings file you've + created. +4. Review the values to make sure they are correct. Please refer back to the + instructions under + [Create the Service Mappings file](#create-the-service-mappings-file) for + more details. + +### Adding a new resource config using the auto-generated service mappings + +1. Locate the service mappings file of name `$(lowercaseservicename).yaml` + under + [scripts/resource-autogen/generated/servicemappings](./scripts/resource-autogen/generated/servicemappings). +2. Open the file and copy the resource config (items under `resources:`) with + the name of the Terraform resource you plan to add. +3. Paste the copied the lines to the end of the service mappings file. +4. Review the values to make sure they are correct and comprehensive. Please + refer back to the instructions under + [Add the Resource Config to Service Mappings](#add-the-resource-config-to-service-mappings) + for more details. + +## Common issues running tests locally + +If you run into any errors that look like "API not enabled"/"quota exceeded" +despite having the API enabled and everything set up correctly, you may have to +reconfigure your Application Default Credentials. + +Certain APIs require authentication through the environment variable +`GOOGLE_APPLICATION_CREDENTIALS`. If this is not set correctly, your tests might +run into an error that looks a bit like this: `googleapi: Error 403: Your +application has authenticated using end user credentials from the Google Cloud +SDK or Google Cloud Shell which are not supported by the +cloudidentity.googleapis.com. We recommend configuring the billing/quota_project +setting in gcloud or using a service account through the +auth/impersonate_service_account setting. For more information about service +accounts and how to use them in your application, see +https://cloud.google.com/docs/authentication/.` + +If the GOOGLE_APPLICATION_CREDENTIALS needs to be set to a service account's key +(this is the case for CloudIdentity and AccessContextManager), you will need to +download/create key from your service account and assign the path of that key to +the GOOGLE_APPLICATION_CREDENTIALS variable. Follow these steps, replacing +SERVICE_ACCOUNT_EMAIL variable with your service account. + +``` +SERVICE_ACCOUNT_EMAIL={{insert your service account email here}} +TMP_GOOGLE_APPLICATION_CREDENTIALS=$(mktemp) +gcloud iam service-accounts keys create --iam-account "${SERVICE_ACCOUNT_EMAIL}" ${TMP_GOOGLE_APPLICATION_CREDENTIALS} +export GOOGLE_APPLICATION_CREDENTIALS=${TMP_GOOGLE_APPLICATION_CREDENTIALS +``` + +To revert this change, simply run `gcloud auth login` and `gcloud auth +application-default login` to return to your original service-account/default +login configuration. + +## Naming conventions, special variables and constants in testdata + +**WARNING: Do NOT use any plain text resource IDs for the test organizations, +projects, folders, and billing accounts.** + +* All the resource names should be `[lowercase(Kind)]-${uniqueId}`, e.g. + `cloudschedulerjob-${uniqueId}`, `pubsubtopic-${uniqueId}`. + + * ${uniqueId} is a 20-char unique ID generated + [here](pkg/test/resourcefixture/variable/variables.go#16). We always + want to use the `-${uniqueId}` as the suffix for the resource name in + testdata. + + * If there are multiple resources of the same kind used in the same test + cases, the resource names should be + `[lowercase(Kind)]-[index]-${uniqueId}`, e.g. + `pubsubtopic-1-${uniqueId}`, `pubsubtopic-2-${uniqueId}`. + + * If the resource name has length limitation, use a shorter prefix. + + * IAMServiceAccount should have the resource name `gsa-${uniqueId}`. + + * Use `spec.resourceID` to name the GCP resource if the GCP API has a + different naming convention. + +* `${projectId}`: The default project to create test resources under. When it + comes to local testing, `${projectId}` is the project ID of the current + running project configured by `gcloud config set project`. + +* `${projectNumber}`: Similar with `${projectId}`, except that it's the + generated numeric ID of the default project. We shouldn't use this variable + unless the resource doesn't accept `${projectId}` as the input. + +* Default test organization: `organizations/${TEST_ORG_ID}` + +* Default test billing account: `${TEST_BILLING_ACCOUNT_ID}` + +## Legacy configs for locational resources + +Config Connector used to handle +[locational resources](https://docs.google.com/document/d/1YNVQpBLRtSXF9hi8FK3R5qQLdO1-6J8EpcZ7bQ0ZCTQ/edit?usp=sharing), +e.g. compute addresses, forwarding rules, disks differently than other +non-locational resources. This special handling/configuration of resources is +now discouraged as we want the KRM resources reflect underlying TF rsources as +much as possible, which will also ease the learnings from contributors when +adding new resources. + +For posterity, below is the previous special configuration for locational +resources: + +Terraform google provider has separate resource types to represent global, +regional and zonal resources respectively. For example, +`google_compute_global_address` represents global addresses, +`google_compute_address` represents regional addresses, `google_compute_disk` +represents zonal disks and `google_compute_region_disk` represents regional +disks. However given that the underlying protocol buffer schema is actually the +same, Config Connector would like to use a single CRD to represent multiple +locational resources where a required `location` filed is used to specify the +region/zone name or 'global' for global resources. + +If the new resource type that you want to add is about locational resources. In +the associated `ResourceConfig`, make the following changes: + +1. have a generic kind name, e.g. name the kind of compute addresses as + `ComputeAddress` rather than `ComputeGlobalAddress` or + `ComputeRegionAddress` +1. fill in `locationality` field with the proper value: 'global', 'zonal' or + 'regional', e.g. `google_compute_address` terraform resource should specify + 'global' for `locationality` field diff --git a/README.Samples.md b/README.Samples.md new file mode 100644 index 0000000000..c501c2ddd9 --- /dev/null +++ b/README.Samples.md @@ -0,0 +1,195 @@ +# Overview + +The following guidelines and principles will help you create samples that are +useful for Config Connector users. Good samples are important to the product and +should be taken as seriously as good code. By creating good samples we enable +our users to be successful more quickly. + +# Sample Coverage + +Every resource should have at least one basic sample and additional samples as +necessary. + +## Basic Sample + +The first sample should show as many fields as possible to enable users to see +all their options and delete where necessary. For this reason, it should contain +all fields which are not mutually exclusive into a subfolder. + +## Other Samples + +When a resource has multiple important use cases, then there should be multiple +samples. A key indicator of multiple use cases is mutually exclusive fields or +exclusive values for those fields. For example, with the `SQLInstance` resource, +the `databaseVersion` property selects different database vendors in MySQL or +PostgreSQL. However, in addition to changing the version property, one must also +select a specific `tier` value that is compatible with the version. SQL is such +an important use case to our users that it is worth having samples for both. + +Another SQL example is replication. Replication is a deeply nested structure +that is complicated, and it is an important configuration for enterprise users. +However, replication requires two SQLInstances so it is not a great candidate to +be the only sample. For that reason a specific sample for replication with two +databases in it should be created. + +# Directory Organization + +In the [resources](config/samples/resources) folder each Resource should get its +own folder. The name of the folder should be its CRD Kind in all lowercase. + +If the resource has a single sample, then it should be added to the folder +directly (without any sub-folder). If there are multiple samples, then each +sample should be in a sub-folder. The sub-folder name should be all lowercase +using dashes instead of spaces, and should be a grammatical description of the +sample type, with the literal resource name included. For example, for the +`SQLInstance` sample with two replicated MySQL instances, the folder name is +`mysql-sql-instance-with-replication`. The service name can be dropped from +folder names for readability, as in the `ComputeForwardingRule` sample folders +`global-forwarding-rule` and `regional-forwarding-rule`. + +## File Naming + +Files should be named `__.yaml`. For example, +`pubsub_v1alpha2_pubsubtopic.yaml`. + +## Sample Naming Convention + +The `metadata.name` value of the sample resource should be in the format `-sample` (all lowercase). If the name of the underlying GCP +resource name cannot be in this format, specify the GCP resource name using +`spec.resourceID` instead of `metadata.name` (e.g. see +[Service sample](config/samples/resources/service/serviceusage_v1beta1_service.yaml)). + +In cases with multiple samples, the sample name should replicate the folder +name, but with the resource name moved to the front, separated from the +description by `-sample-` and with all other dashes removed. Even if the service +name wasn't present in the folder name, it should be included at the front of +the sample name. For example, the sample in +`mysql-sql-instance-with-replication` is named +`sqlinstance-sample-mysqlwithreplication`. Also, the sample in +`global-forwarding-rule` is named `computeforwardingrule-sample-global`. + +In the case where multiple instances of the main resource are needed for a +complete sample, number the sample block starting from one, for example, +`computenetworkpeering-sample1` or `sqlinstance-sample1-mysqlwithreplication` +are followed by `computenetworkpeering-sample2` or +`sqlinstance-sample2-mysqlwithreplication` respectively. + +# Dependency Resources + +When a sample has a dependency resource then the dependency should be included +in the same directory. The dependency resource's declaration should be as brief +as possible and only the most necessary fields should be included. For example, +labels should be removed, fields with default values, etc. Multiple dependencies +of the same type should be defined in the same file, split by a YAML separation +line (`---`). + +An example would be `PubSubSubscription` which depends on `PubSubTopic`. In this +case, a YAML file containing a `PubSubTopic` resource should be included in the +[pubsubsubscription](config/samples/resources/pubsubsubscription) folder. + +## Dependency Naming Convention + +The name of a dependency resource should be the name of the resource that +depends on it followed by `-dep`. For example, `PubSubSubscription` depends on +`PubSubTopic`. The Topic's name should be `pubsubsubscription-dep`. +Additionally, if there is a chain of dependencies, the name of each dependency +resource should be the name of the top-level resource that depends on it +followed by `-dep`. For example, `FilestoreBackup` depends on +`FilestoreInstance`, which in turn depends on `ComputeNetwork`. Both +`FilestoreInstance` and `ComputeNetwork` should be named `filestorebackup-dep`. +If there are multiple dependencies of the same type, then number the dep suffix, +starting from one: `-dep1`, `-dep2`, `-dep3`, etc. + +If there are multiple samples for a given resource then the sample name should +be included as well to ensure uniqueness. For example, if `PubSubSubscription` +had two samples, named `pubsubsubscription-sample-first` and +`pubsubsubscription-sample-second` then the name of the dependency topics would +be`pubsubsubscription-dep-first` and `pubsubsubscription-dep-second` +respectively. + +# Field Values + +Field values should be generic. String values should not include project or +product names. For example, values like KCC, CNRM, etc,should be avoided. + +## Project References + +Resources that support a `spec.projectRef` field should always include that +field in the sample, e.g.: + +```yaml +spec: + projectRef: + external: projects/${PROJECT_ID?} +``` + +**Note:** If the resource can be created in more than one type of hierarchical +resource (e.g. project, folder, organization), then you should have samples for +each case, and each sample should explicitly specify the hierarchical reference +like `spec.projectRef` in order to demonstrate how to create the resource under +different types of hierarchical resources. + +**Note 2:** If the sample modifies the project itself (e.g. +`ResourceManagerPolicy`, `ComputeSharedVPCHostProject`, etc.), then set +`spec.projectRef` to point to a custom `Project` resource instead. + +**Note 3:** You should create a custom `Project` resource if your test's target +resource and/or dependent resources are singleton GCP resources like +**Services** and **GKEHubFeatures**. + +## Descriptive Context + +Fields whose purpose is to provide more documentation (e.g. description fields, +title fields, etc.) should be filled with as much detail about the sample +context as possible. When there are no other descriptive fields, the name and +label fields of the resource should be used to provide any necessary context +instead. + +Examples: + +```yaml +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNodeTemplate +metadata: + name: computenodetemplate-sample-flexible +spec: + ... + description: Node template for sole tenant nodes running in us-central1, with 96vCPUs and any amount of memory on any machine type. + ... +``` + +```yaml +apiVersion: iam.cnrm.cloud.google.com/v1beta1 +kind: IAMPolicyMember +metadata: + name: iampolicymember-sample-condition +spec: + ... + condition: + title: expires_after_2019_12_31 + description: Expires at midnight of 2019-12-31 + expression: request.time < timestamp("2020-01-01T00:00:00Z") + ... +``` + +# License + +All sample files should have a license header. Copy the license header below +onto the top of your sample files and replace `[YEAR]` with the current year. + +``` +# Copyright [YEAR] 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. +``` diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbbackups.alloydb.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbbackups.alloydb.cnrm.cloud.google.com.yaml index 45c4abae55..d641b73fd6 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbbackups.alloydb.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbbackups.alloydb.cnrm.cloud.google.com.yaml @@ -6,7 +6,7 @@ metadata: creationTimestamp: null labels: cnrm.cloud.google.com/managed-by-kcc: "true" - cnrm.cloud.google.com/stability-level: alpha + cnrm.cloud.google.com/stability-level: stable cnrm.cloud.google.com/system: "true" cnrm.cloud.google.com/tf2crd: "true" name: alloydbbackups.alloydb.cnrm.cloud.google.com @@ -40,7 +40,7 @@ spec: jsonPath: .status.conditions[?(@.type=='Ready')].lastTransitionTime name: Status Age type: date - name: v1alpha1 + name: v1beta1 schema: openAPIV3Schema: properties: @@ -58,10 +58,238 @@ spec: type: object spec: properties: - clusterName: - description: Immutable. The full resource name of the backup source - cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}). + clusterNameRef: + description: The full resource name of the backup source cluster (e.g., + projects/{project}/locations/{location}/clusters/{clusterId}). + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `name` field of an `AlloyDBCluster` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object + description: + description: Immutable. User-provided description of the backup. + type: string + encryptionConfig: + description: EncryptionConfig describes the encryption config of a + cluster or a backup that is encrypted with a CMEK (customer-managed + encryption key). + properties: + kmsKeyName: + description: 'Immutable. The fully-qualified resource name of + the KMS key. Each Cloud KMS key is regionalized and has the + following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].' + type: string + type: object + location: + description: Immutable. The location where the alloydb backup should + reside. + type: string + projectRef: + description: The project that this resource belongs to. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `name` field of a `Project` resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object + resourceID: + description: Immutable. Optional. The backupId of the resource. Used + for creation and acquisition. When unset, the value of `metadata.name` + is used as the default. + type: string + required: + - clusterNameRef + - location + - projectRef + type: object + status: + properties: + conditions: + description: Conditions represent the latest available observation + of the resource'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 + createTime: + description: Time the Backup was created in UTC. + type: string + encryptionInfo: + description: EncryptionInfo describes the encryption information of + a cluster or a backup. + items: + properties: + encryptionType: + description: Output only. Type of encryption. + type: string + kmsKeyVersions: + description: Output only. Cloud KMS key versions that are being + used to protect the database or the backup. + items: + type: string + type: array + type: object + type: array + etag: + description: A hash of the resource. + type: string + name: + description: 'Output only. The name of the backup resource with the + format: * projects/{project}/locations/{region}/backups/{backupId}.' 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. + type: integer + reconciling: + description: If true, indicates that the service is actively updating + the resource. This can happen due to user-triggered updates or system + actions like failover or maintenance. + type: boolean + state: + description: The current state of the backup. + type: string + uid: + description: Output only. The system-generated UID of the resource. + The UID is assigned when the resource is created, and it is retained + until it is deleted. + type: string + updateTime: + description: Time the Backup was updated in UTC. + type: string + type: object + required: + - spec + 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: v1alpha1 + schema: + openAPIV3Schema: + 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/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/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + clusterNameRef: + description: The full resource name of the backup source cluster (e.g., + projects/{project}/locations/{location}/clusters/{clusterId}). + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `name` field of an `AlloyDBCluster` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object description: description: Immutable. User-provided description of the backup. type: string @@ -113,7 +341,7 @@ spec: is used as the default. type: string required: - - clusterName + - clusterNameRef - location - projectRef type: object diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbclusters.alloydb.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbclusters.alloydb.cnrm.cloud.google.com.yaml index 9a4a72c184..b03fba57a4 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbclusters.alloydb.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbclusters.alloydb.cnrm.cloud.google.com.yaml @@ -6,7 +6,7 @@ metadata: creationTimestamp: null labels: cnrm.cloud.google.com/managed-by-kcc: "true" - cnrm.cloud.google.com/stability-level: alpha + cnrm.cloud.google.com/stability-level: stable cnrm.cloud.google.com/system: "true" cnrm.cloud.google.com/tf2crd: "true" name: alloydbclusters.alloydb.cnrm.cloud.google.com @@ -24,6 +24,584 @@ spec: preserveUnknownFields: false scope: Namespaced versions: + - 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: + 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/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/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + automatedBackupPolicy: + description: The automated backup policy for this cluster. AutomatedBackupPolicy + is disabled by default. + properties: + backupWindow: + description: |- + The length of the time window during which a backup can be taken. If a backup does not succeed within this time window, it will be canceled and considered failed. + + The backup window must be at least 5 minutes long. There is no upper bound on the window. If not set, it will default to 1 hour. + + A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". + type: string + enabled: + description: Whether automated backups are enabled. + type: boolean + encryptionConfig: + description: EncryptionConfig describes the encryption config + of a cluster or a backup that is encrypted with a CMEK (customer-managed + encryption key). + properties: + kmsKeyNameRef: + description: '(Optional) The fully-qualified resource name + of the KMS key. Each Cloud KMS key is regionalized and has + the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].' + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `selfLink` field of a + `KMSCryptoKey` resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object + type: object + labels: + additionalProperties: + type: string + description: Labels to apply to backups created using this configuration. + type: object + location: + description: The location where the backup will be stored. Currently, + the only supported option is to store the backup in the same + region as the cluster. + type: string + quantityBasedRetention: + description: Quantity-based Backup retention policy to retain + recent backups. Conflicts with 'time_based_retention', both + can't be set together. + properties: + count: + description: The number of backups to retain. + type: integer + type: object + timeBasedRetention: + description: Time-based Backup retention policy. Conflicts with + 'quantity_based_retention', both can't be set together. + properties: + retentionPeriod: + description: |- + The retention period. + A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". + type: string + type: object + weeklySchedule: + description: Weekly schedule for the Backup. + properties: + daysOfWeek: + description: 'The days of the week to perform a backup. At + least one day of the week must be provided. Possible values: + ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", + "SATURDAY", "SUNDAY"].' + items: + type: string + type: array + startTimes: + description: The times during the day to start a backup. At + least one start time must be provided. The start times are + assumed to be in UTC and to be an exact hour (e.g., 04:00:00). + items: + properties: + hours: + description: Hours of day in 24 hour format. Should + be from 0 to 23. An API may choose to allow the value + "24:00:00" for scenarios like business closing time. + type: integer + minutes: + description: Minutes of hour of day. Currently, only + the value 0 is supported. + type: integer + nanos: + description: Fractions of seconds in nanoseconds. Currently, + only the value 0 is supported. + type: integer + seconds: + description: Seconds of minutes of the time. Currently, + only the value 0 is supported. + type: integer + type: object + type: array + required: + - startTimes + type: object + type: object + continuousBackupConfig: + description: |- + The continuous backup config for this cluster. + + If no policy is provided then the default policy will be used. The default policy takes one backup a day and retains backups for 14 days. + properties: + enabled: + description: Whether continuous backup recovery is enabled. If + not set, defaults to true. + type: boolean + encryptionConfig: + description: EncryptionConfig describes the encryption config + of a cluster or a backup that is encrypted with a CMEK (customer-managed + encryption key). + properties: + kmsKeyNameRef: + description: '(Optional) The fully-qualified resource name + of the KMS key. Each Cloud KMS key is regionalized and has + the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].' + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `selfLink` field of a + `KMSCryptoKey` resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object + type: object + recoveryWindowDays: + description: |- + The numbers of days that are eligible to restore from using PITR. To support the entire recovery window, backups and logs are retained for one day more than the recovery window. + + If not set, defaults to 14 days. + type: integer + type: object + displayName: + description: User-settable and human-readable display name for the + Cluster. + type: string + encryptionConfig: + description: EncryptionConfig describes the encryption config of a + cluster or a backup that is encrypted with a CMEK (customer-managed + encryption key). + properties: + kmsKeyNameRef: + description: '(Optional) The fully-qualified resource name of + the KMS key. Each Cloud KMS key is regionalized and has the + following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].' + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `selfLink` field of a `KMSCryptoKey` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object + type: object + initialUser: + description: Initial user to setup during cluster creation. + properties: + password: + description: The initial password for the user. + oneOf: + - not: + required: + - valueFrom + required: + - value + - not: + required: + - value + required: + - valueFrom + properties: + value: + description: Value of the field. Cannot be used if 'valueFrom' + is specified. + type: string + valueFrom: + description: Source for the field's value. Cannot be used + if 'value' is specified. + properties: + secretKeyRef: + description: Reference to a value with the given key in + the given Secret in the resource's namespace. + properties: + key: + description: Key that identifies the value to be extracted. + type: string + name: + description: Name of the Secret to extract a value + from. + type: string + required: + - name + - key + type: object + type: object + type: object + user: + description: The database username. + type: string + required: + - password + type: object + location: + description: Immutable. The location where the alloydb cluster should + reside. + type: string + networkRef: + description: "Only `external` field is supported to configure the + reference.\n\n(Required) The relative resource name of the VPC network + on which \nthe instance can be accessed. It is specified in the + following form: \nprojects/{projectNumber}/global/networks/{network_id}.\"" + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `selfLink` field of a `ComputeNetwork` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object + projectRef: + description: The project that this resource belongs to. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `name` field of a `Project` resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object + resourceID: + description: Immutable. Optional. The clusterId of the resource. Used + for creation and acquisition. When unset, the value of `metadata.name` + is used as the default. + type: string + restoreBackupSource: + description: Immutable. The source when restoring from a backup. Conflicts + with 'restore_continuous_backup_source', both can't be set together. + properties: + backupNameRef: + description: (Required) The name of the backup that this cluster + is restored from. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `name` field of an `AlloyDBBackup` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object + required: + - backupNameRef + type: object + restoreContinuousBackupSource: + description: Immutable. The source when restoring via point in time + recovery (PITR). Conflicts with 'restore_backup_source', both can't + be set together. + properties: + clusterRef: + description: (Required) The name of the source cluster that this + cluster is restored from. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `name` field of an `AlloyDBCluster` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object + pointInTime: + description: Immutable. The point in time that this cluster is + restored to, in RFC 3339 format. + type: string + required: + - clusterRef + - pointInTime + type: object + required: + - location + - networkRef + - projectRef + type: object + status: + properties: + backupSource: + description: Cluster created from backup. + items: + properties: + backupName: + description: The name of the backup resource. + type: string + type: object + type: array + conditions: + description: Conditions represent the latest available observation + of the resource'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 + continuousBackupInfo: + description: ContinuousBackupInfo describes the continuous backup + properties of a cluster. + items: + properties: + earliestRestorableTime: + description: The earliest restorable time that can be restored + to. Output only field. + type: string + enabledTime: + description: When ContinuousBackup was most recently enabled. + Set to null if ContinuousBackup is not enabled. + type: string + encryptionInfo: + description: Output only. The encryption information for the + WALs and backups required for ContinuousBackup. + items: + properties: + encryptionType: + description: Output only. Type of encryption. + type: string + kmsKeyVersions: + description: Output only. Cloud KMS key versions that + are being used to protect the database or the backup. + items: + type: string + type: array + type: object + type: array + schedule: + description: Days of the week on which a continuous backup is + taken. Output only field. Ignored if passed into the request. + items: + type: string + type: array + type: object + type: array + databaseVersion: + description: The database engine major version. This is an output-only + field and it's populated at the Cluster creation time. This field + cannot be changed after cluster creation. + type: string + encryptionInfo: + description: EncryptionInfo describes the encryption information of + a cluster or a backup. + items: + properties: + encryptionType: + description: Output only. Type of encryption. + type: string + kmsKeyVersions: + description: Output only. Cloud KMS key versions that are being + used to protect the database or the backup. + items: + type: string + type: array + type: object + type: array + migrationSource: + description: Cluster created via DMS migration. + items: + properties: + hostPort: + description: The host and port of the on-premises instance in + host:port format. + type: string + referenceId: + description: Place holder for the external source identifier(e.g + DMS job name) that created the cluster. + type: string + sourceType: + description: Type of migration source. + type: string + type: object + type: array + name: + description: The name of the cluster resource. + 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. + type: integer + uid: + description: The system-generated UID of the resource. + type: string + type: object + required: + - spec + type: object + served: true + storage: false + subresources: + status: {} - additionalPrinterColumns: - jsonPath: .metadata.creationTimestamp name: Age @@ -78,11 +656,36 @@ spec: of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). properties: - kmsKeyName: - description: 'The fully-qualified resource name of the KMS - key. Each Cloud KMS key is regionalized and has the following - format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].' - type: string + kmsKeyNameRef: + description: '(Optional) The fully-qualified resource name + of the KMS key. Each Cloud KMS key is regionalized and has + the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].' + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `selfLink` field of a + `KMSCryptoKey` resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object type: object labels: additionalProperties: @@ -168,11 +771,36 @@ spec: of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). properties: - kmsKeyName: - description: 'The fully-qualified resource name of the KMS - key. Each Cloud KMS key is regionalized and has the following - format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].' - type: string + kmsKeyNameRef: + description: '(Optional) The fully-qualified resource name + of the KMS key. Each Cloud KMS key is regionalized and has + the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].' + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `selfLink` field of a + `KMSCryptoKey` resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object type: object recoveryWindowDays: description: |- @@ -190,11 +818,36 @@ spec: cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). properties: - kmsKeyName: - description: 'Immutable. The fully-qualified resource name of + kmsKeyNameRef: + description: '(Optional) The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].' - type: string + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `selfLink` field of a `KMSCryptoKey` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object type: object initialUser: description: Initial user to setup during cluster creation. @@ -248,12 +901,37 @@ spec: description: Immutable. The location where the alloydb cluster should reside. type: string - network: - description: |- - The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: - - "projects/{projectNumber}/global/networks/{network_id}". - type: string + networkRef: + description: "Only `external` field is supported to configure the + reference.\n\n(Required) The relative resource name of the VPC network + on which \nthe instance can be accessed. It is specified in the + following form: \nprojects/{projectNumber}/global/networks/{network_id}.\"" + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `selfLink` field of a `ComputeNetwork` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object projectRef: description: The project that this resource belongs to. oneOf: @@ -290,33 +968,83 @@ spec: description: Immutable. The source when restoring from a backup. Conflicts with 'restore_continuous_backup_source', both can't be set together. properties: - backupName: - description: Immutable. The name of the backup that this cluster + backupNameRef: + description: (Required) The name of the backup that this cluster is restored from. - type: string + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `name` field of an `AlloyDBBackup` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object required: - - backupName + - backupNameRef type: object restoreContinuousBackupSource: description: Immutable. The source when restoring via point in time recovery (PITR). Conflicts with 'restore_backup_source', both can't be set together. properties: - cluster: - description: Immutable. The name of the source cluster that this + clusterRef: + description: (Required) The name of the source cluster that this cluster is restored from. - type: string + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `name` field of an `AlloyDBCluster` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object pointInTime: description: Immutable. The point in time that this cluster is restored to, in RFC 3339 format. type: string required: - - cluster + - clusterRef - pointInTime type: object required: - location - - network + - networkRef - projectRef type: object status: diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbinstances.alloydb.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbinstances.alloydb.cnrm.cloud.google.com.yaml index d690515f16..bd83074f9a 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbinstances.alloydb.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbinstances.alloydb.cnrm.cloud.google.com.yaml @@ -6,7 +6,7 @@ metadata: creationTimestamp: null labels: cnrm.cloud.google.com/managed-by-kcc: "true" - cnrm.cloud.google.com/stability-level: alpha + cnrm.cloud.google.com/stability-level: stable cnrm.cloud.google.com/system: "true" cnrm.cloud.google.com/tf2crd: "true" name: alloydbinstances.alloydb.cnrm.cloud.google.com @@ -40,7 +40,7 @@ spec: jsonPath: .status.conditions[?(@.type=='Ready')].lastTransitionTime name: Status Age type: date - name: v1alpha1 + name: v1beta1 schema: openAPIV3Schema: properties: @@ -73,11 +73,229 @@ spec: Read pool of size 1 can only have zonal availability. Read pools with node count of 2 or more can have regional availability (nodes are present in 2 or more zones in a region).' Possible values: ["AVAILABILITY_TYPE_UNSPECIFIED", "ZONAL", "REGIONAL"]. type: string - cluster: + clusterRef: + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `name` field of an `AlloyDBCluster` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object + databaseFlags: + additionalProperties: + type: string + description: Database flags. Set at instance level. * They are copied + from primary instance on read instance creation. * Read instances + can set new or override existing flags that are relevant for reads, + e.g. for enabling columnar cache on a read instance. Flags set on + read instance may or may not be present on primary. + type: object + displayName: + description: User-settable and human-readable display name for the + Instance. + type: string + gceZone: + description: The Compute Engine zone that the instance should serve + from, per https://cloud.google.com/compute/docs/regions-zones This + can ONLY be specified for ZONAL instances. If present for a REGIONAL + instance, an error will be thrown. If this is absent for a ZONAL + instance, instance is created in a random zone with available capacity. + type: string + instanceType: + description: 'Immutable. The type of the instance. If the instance + type is READ_POOL, provide the associated PRIMARY instance in the + ''depends_on'' meta-data attribute. Possible values: ["PRIMARY", + "READ_POOL"].' + type: string + machineConfig: + description: Configurations for the machines that host the underlying + database engine. + properties: + cpuCount: + description: The number of CPU's in the VM instance. + type: integer + type: object + readPoolConfig: + description: Read pool specific config. If the instance type is READ_POOL, + this configuration must be provided. + properties: + nodeCount: + description: Read capacity, i.e. number of nodes in a read pool + instance. + type: integer + type: object + resourceID: + description: Immutable. Optional. The instanceId of the resource. + Used for creation and acquisition. When unset, the value of `metadata.name` + is used as the default. + type: string + required: + - clusterRef + - instanceType + type: object + status: + properties: + conditions: + description: Conditions represent the latest available observation + of the resource'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 + createTime: + description: Time the Instance was created in UTC. + type: string + ipAddress: + description: The IP address for the Instance. This is the connection + endpoint for an end-user application. + type: string + name: + description: The name of the instance resource. + 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. + type: integer + reconciling: + description: Set to true if the current state of Instance does not + match the user's intended state, and the service is actively updating + the resource to reconcile them. This can happen due to user-triggered + updates or system actions like failover or maintenance. + type: boolean + state: + description: The current state of the alloydb instance. + type: string + uid: + description: The system-generated UID of the resource. + type: string + updateTime: + description: Time the Instance was updated in UTC. + type: string + type: object + required: + - spec + 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: v1alpha1 + schema: + openAPIV3Schema: + 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/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/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + annotations: + additionalProperties: + type: string + description: Annotations to allow client tools to store small amount + of arbitrary data. This is distinct from labels. + type: object + availabilityType: description: |- - Immutable. Identifies the alloydb cluster. Must be in the format - 'projects/{project}/locations/{location}/clusters/{cluster_id}'. + 'Availability type of an Instance. Defaults to REGIONAL for both primary and read instances. + Note that primary and read instances can have different availability types. + Only READ_POOL instance supports ZONAL type. Users can't specify the zone for READ_POOL instance. + Zone is automatically chosen from the list of zones in the region specified. + Read pool of size 1 can only have zonal availability. Read pools with node count of 2 or more + can have regional availability (nodes are present in 2 or more zones in a region).' Possible values: ["AVAILABILITY_TYPE_UNSPECIFIED", "ZONAL", "REGIONAL"]. type: string + clusterRef: + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `name` field of an `AlloyDBCluster` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object databaseFlags: additionalProperties: type: string @@ -127,7 +345,7 @@ spec: is used as the default. type: string required: - - cluster + - clusterRef - instanceType type: object status: diff --git a/config/samples/resources/alloydbbackup/alloydb_v1beta1_alloydbbackup.yaml b/config/samples/resources/alloydbbackup/alloydb_v1beta1_alloydbbackup.yaml new file mode 100644 index 0000000000..f21725690d --- /dev/null +++ b/config/samples/resources/alloydbbackup/alloydb_v1beta1_alloydbbackup.yaml @@ -0,0 +1,27 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBBackup +metadata: + name: alloydbbackup-sample +spec: + clusterNameRef: + external: "projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbbackup-dep" + location: us-central1 + encryptionConfig: + kmsKeyNameRef: + external: "projects/${PROJECT_ID?}/locations/us-central1/keyRings/alloydbbackup-dep/cryptoKeys/alloydbbackup-dep" + projectRef: + external: ${PROJECT_ID?} \ No newline at end of file diff --git a/config/samples/resources/alloydbbackup/alloydb_v1beta1_alloydbcluster.yaml b/config/samples/resources/alloydbbackup/alloydb_v1beta1_alloydbcluster.yaml new file mode 100644 index 0000000000..fdc6b85204 --- /dev/null +++ b/config/samples/resources/alloydbbackup/alloydb_v1beta1_alloydbcluster.yaml @@ -0,0 +1,24 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbbackup-dep +spec: + location: us-central1 + networkRef: + external: projects/${PROJECT_ID?}/global/networks/alloydbbackup-dep + projectRef: + external: ${PROJECT_ID?} diff --git a/config/samples/resources/alloydbbackup/alloydb_v1beta1_alloydbinstance.yaml b/config/samples/resources/alloydbbackup/alloydb_v1beta1_alloydbinstance.yaml new file mode 100644 index 0000000000..78e18fda97 --- /dev/null +++ b/config/samples/resources/alloydbbackup/alloydb_v1beta1_alloydbinstance.yaml @@ -0,0 +1,22 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbbackup-dep +spec: + clusterRef: + external: projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbbackup-dep + instanceType: PRIMARY \ No newline at end of file diff --git a/config/samples/resources/alloydbbackup/compute_v1beta1_computeaddress.yaml b/config/samples/resources/alloydbbackup/compute_v1beta1_computeaddress.yaml new file mode 100644 index 0000000000..47f168bafc --- /dev/null +++ b/config/samples/resources/alloydbbackup/compute_v1beta1_computeaddress.yaml @@ -0,0 +1,25 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: alloydbbackup-dep +spec: + location: global + addressType: INTERNAL + networkRef: + name: alloydbbackup-dep + prefixLength: 16 + purpose: VPC_PEERING \ No newline at end of file diff --git a/config/samples/resources/alloydbbackup/compute_v1beta1_computenetwork.yaml b/config/samples/resources/alloydbbackup/compute_v1beta1_computenetwork.yaml new file mode 100644 index 0000000000..d635a54721 --- /dev/null +++ b/config/samples/resources/alloydbbackup/compute_v1beta1_computenetwork.yaml @@ -0,0 +1,18 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: alloydbbackup-dep diff --git a/config/samples/resources/alloydbbackup/iam_v1beta1_iampartialpolicy.yaml b/config/samples/resources/alloydbbackup/iam_v1beta1_iampartialpolicy.yaml new file mode 100644 index 0000000000..2281b91d1e --- /dev/null +++ b/config/samples/resources/alloydbbackup/iam_v1beta1_iampartialpolicy.yaml @@ -0,0 +1,27 @@ +# Copyright 2023 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: iam.cnrm.cloud.google.com/v1beta1 +kind: IAMPartialPolicy +metadata: + name: alloydbbackup-dep +spec: + resourceRef: + apiVersion: kms.cnrm.cloud.google.com/v1beta1 + kind: KMSCryptoKey + name: alloydbbackup-dep + bindings: + - role: roles/cloudkms.cryptoKeyEncrypterDecrypter + members: + - member: serviceAccount:service-${PROJECT_NUMBER?}@gcp-sa-alloydb.iam.gserviceaccount.com \ No newline at end of file diff --git a/config/samples/resources/alloydbbackup/kms_v1beta1_kmscryptokey.yaml b/config/samples/resources/alloydbbackup/kms_v1beta1_kmscryptokey.yaml new file mode 100644 index 0000000000..b89cd3da62 --- /dev/null +++ b/config/samples/resources/alloydbbackup/kms_v1beta1_kmscryptokey.yaml @@ -0,0 +1,23 @@ +# Copyright 2023 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: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSCryptoKey +metadata: + labels: + source: kcc-alloydbbackup-sample + name: alloydbbackup-dep +spec: + keyRingRef: + name: alloydbbackup-dep \ No newline at end of file diff --git a/config/samples/resources/alloydbbackup/kms_v1beta1_kmskeyring.yaml b/config/samples/resources/alloydbbackup/kms_v1beta1_kmskeyring.yaml new file mode 100644 index 0000000000..6657eedbfb --- /dev/null +++ b/config/samples/resources/alloydbbackup/kms_v1beta1_kmskeyring.yaml @@ -0,0 +1,20 @@ +# Copyright 2023 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: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSKeyRing +metadata: + name: alloydbbackup-dep +spec: + location: us-central1 \ No newline at end of file diff --git a/config/samples/resources/alloydbbackup/servicenetworking_v1beta1_servicenetworkingconnection.yaml b/config/samples/resources/alloydbbackup/servicenetworking_v1beta1_servicenetworkingconnection.yaml new file mode 100644 index 0000000000..240c531455 --- /dev/null +++ b/config/samples/resources/alloydbbackup/servicenetworking_v1beta1_servicenetworkingconnection.yaml @@ -0,0 +1,24 @@ +# Copyright 2023 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: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: alloydbbackup-dep +spec: + networkRef: + name: alloydbbackup-dep + reservedPeeringRanges: + - external: alloydbbackup-dep + service: servicenetworking.googleapis.com \ No newline at end of file diff --git a/config/samples/resources/alloydbcluster/alloydb_v1beta1_alloydbcluster.yaml b/config/samples/resources/alloydbcluster/alloydb_v1beta1_alloydbcluster.yaml new file mode 100644 index 0000000000..944c547075 --- /dev/null +++ b/config/samples/resources/alloydbcluster/alloydb_v1beta1_alloydbcluster.yaml @@ -0,0 +1,49 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbcluster-sample +spec: + location: us-central1 + networkRef: + external: projects/${PROJECT_ID?}/global/networks/alloydbcluster-dep + projectRef: + external: ${PROJECT_ID?} + automatedBackupPolicy: + backupWindow: 3600s + encryptionConfig: + kmsKeyNameRef: + name: alloydbcluster-dep + enabled: true + labels: + source: kcc + location: us-central1 + timeBasedRetention: + retentionPeriod: 43200s + weeklySchedule: + daysOfWeek: [MONDAY] + startTimes: + - hours: 4 + minutes: 0 + seconds: 0 + nanos: 0 + encryptionConfig: + kmsKeyNameRef: + name: alloydbcluster-dep + initialUser: + user: "postgres" + password: + value: "postgres" \ No newline at end of file diff --git a/config/samples/resources/alloydbcluster/compute_v1beta1_computeaddress.yaml b/config/samples/resources/alloydbcluster/compute_v1beta1_computeaddress.yaml new file mode 100644 index 0000000000..fb9bbf6ca3 --- /dev/null +++ b/config/samples/resources/alloydbcluster/compute_v1beta1_computeaddress.yaml @@ -0,0 +1,25 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: alloydbcluster-dep +spec: + location: global + addressType: INTERNAL + networkRef: + name: alloydbcluster-dep + prefixLength: 16 + purpose: VPC_PEERING \ No newline at end of file diff --git a/config/samples/resources/alloydbcluster/compute_v1beta1_computenetwork.yaml b/config/samples/resources/alloydbcluster/compute_v1beta1_computenetwork.yaml new file mode 100644 index 0000000000..6e32ce9d63 --- /dev/null +++ b/config/samples/resources/alloydbcluster/compute_v1beta1_computenetwork.yaml @@ -0,0 +1,20 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: alloydbcluster-dep + + diff --git a/config/samples/resources/alloydbcluster/iam_v1beta1_iampartialpolicy.yaml b/config/samples/resources/alloydbcluster/iam_v1beta1_iampartialpolicy.yaml new file mode 100644 index 0000000000..7f9c596e5a --- /dev/null +++ b/config/samples/resources/alloydbcluster/iam_v1beta1_iampartialpolicy.yaml @@ -0,0 +1,29 @@ +# Copyright 2023 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: iam.cnrm.cloud.google.com/v1beta1 +kind: IAMPartialPolicy +metadata: + name: alloydbcluster-dep +spec: + resourceRef: + apiVersion: kms.cnrm.cloud.google.com/v1beta1 + kind: KMSCryptoKey + name: alloydbcluster-dep + bindings: + - role: roles/cloudkms.cryptoKeyEncrypterDecrypter + members: + - memberFrom: + serviceIdentityRef: + name: alloydbcluster-dep \ No newline at end of file diff --git a/config/samples/resources/alloydbcluster/kms_v1beta1_kmscryptokey.yaml b/config/samples/resources/alloydbcluster/kms_v1beta1_kmscryptokey.yaml new file mode 100644 index 0000000000..e384ce4c2f --- /dev/null +++ b/config/samples/resources/alloydbcluster/kms_v1beta1_kmscryptokey.yaml @@ -0,0 +1,23 @@ +# Copyright 2023 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: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSCryptoKey +metadata: + labels: + source: kcc-alloydbcluster-sample + name: alloydbcluster-dep +spec: + keyRingRef: + name: alloydbcluster-dep \ No newline at end of file diff --git a/config/samples/resources/alloydbcluster/kms_v1beta1_kmskeyring.yaml b/config/samples/resources/alloydbcluster/kms_v1beta1_kmskeyring.yaml new file mode 100644 index 0000000000..e67aee07c1 --- /dev/null +++ b/config/samples/resources/alloydbcluster/kms_v1beta1_kmskeyring.yaml @@ -0,0 +1,20 @@ +# Copyright 2023 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: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSKeyRing +metadata: + name: alloydbcluster-dep +spec: + location: us-central1 \ No newline at end of file diff --git a/config/samples/resources/alloydbcluster/servicenetworking_v1beta1_servicenetworkingconnection.yaml b/config/samples/resources/alloydbcluster/servicenetworking_v1beta1_servicenetworkingconnection.yaml new file mode 100644 index 0000000000..45f5af38a7 --- /dev/null +++ b/config/samples/resources/alloydbcluster/servicenetworking_v1beta1_servicenetworkingconnection.yaml @@ -0,0 +1,24 @@ +# Copyright 2023 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: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: alloydbcluster-dep +spec: + networkRef: + name: alloydbcluster-dep + reservedPeeringRanges: + - external: alloydbcluster-dep + service: servicenetworking.googleapis.com \ No newline at end of file diff --git a/config/samples/resources/alloydbcluster/serviceusage_v1beta1_serviceidentity.yaml b/config/samples/resources/alloydbcluster/serviceusage_v1beta1_serviceidentity.yaml new file mode 100644 index 0000000000..2e1f2e7197 --- /dev/null +++ b/config/samples/resources/alloydbcluster/serviceusage_v1beta1_serviceidentity.yaml @@ -0,0 +1,22 @@ +# Copyright 2023 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: serviceusage.cnrm.cloud.google.com/v1beta1 +kind: ServiceIdentity +metadata: + name: alloydbcluster-dep +spec: + projectRef: + external: ${PROJECT_ID?} + resourceID: alloydb.googleapis.com \ No newline at end of file diff --git a/config/samples/resources/alloydbinstance/primary-instance/alloydb_v1beta1_alloydbcluster.yaml b/config/samples/resources/alloydbinstance/primary-instance/alloydb_v1beta1_alloydbcluster.yaml new file mode 100644 index 0000000000..c537aa887e --- /dev/null +++ b/config/samples/resources/alloydbinstance/primary-instance/alloydb_v1beta1_alloydbcluster.yaml @@ -0,0 +1,24 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbinstance-dep-primary +spec: + location: us-central1 + networkRef: + external: projects/${PROJECT_ID?}/global/networks/alloydbinstance-dep-primary + projectRef: + external: ${PROJECT_ID?} diff --git a/config/samples/resources/alloydbinstance/primary-instance/alloydb_v1beta1_alloydbinstance.yaml b/config/samples/resources/alloydbinstance/primary-instance/alloydb_v1beta1_alloydbinstance.yaml new file mode 100644 index 0000000000..b5352ec7c2 --- /dev/null +++ b/config/samples/resources/alloydbinstance/primary-instance/alloydb_v1beta1_alloydbinstance.yaml @@ -0,0 +1,26 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-sample-primary +spec: + clusterRef: + name: alloydbinstance-dep-primary + instanceType: PRIMARY + databaseFlags: + enable_google_adaptive_autovacuum: "off" + machineConfig: + cpuCount: 2 \ No newline at end of file diff --git a/config/samples/resources/alloydbinstance/primary-instance/compute_v1beta1_computeaddress.yaml b/config/samples/resources/alloydbinstance/primary-instance/compute_v1beta1_computeaddress.yaml new file mode 100644 index 0000000000..a891c39cd4 --- /dev/null +++ b/config/samples/resources/alloydbinstance/primary-instance/compute_v1beta1_computeaddress.yaml @@ -0,0 +1,25 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: alloydbinstance-dep-primary +spec: + location: global + addressType: INTERNAL + networkRef: + name: alloydbinstance-dep-primary + prefixLength: 16 + purpose: VPC_PEERING \ No newline at end of file diff --git a/config/samples/resources/alloydbinstance/primary-instance/compute_v1beta1_computenetwork.yaml b/config/samples/resources/alloydbinstance/primary-instance/compute_v1beta1_computenetwork.yaml new file mode 100644 index 0000000000..24771c51e0 --- /dev/null +++ b/config/samples/resources/alloydbinstance/primary-instance/compute_v1beta1_computenetwork.yaml @@ -0,0 +1,20 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: alloydbinstance-dep-primary + + diff --git a/config/samples/resources/alloydbinstance/primary-instance/servicenetworking_v1beta1_servicenetworkingconnection.yaml b/config/samples/resources/alloydbinstance/primary-instance/servicenetworking_v1beta1_servicenetworkingconnection.yaml new file mode 100644 index 0000000000..09f88be534 --- /dev/null +++ b/config/samples/resources/alloydbinstance/primary-instance/servicenetworking_v1beta1_servicenetworkingconnection.yaml @@ -0,0 +1,24 @@ +# Copyright 2023 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: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: alloydbinstance-dep-primary +spec: + networkRef: + name: alloydbinstance-dep-primary + reservedPeeringRanges: + - external: alloydbinstance-dep-primary + service: servicenetworking.googleapis.com \ No newline at end of file diff --git a/config/samples/resources/alloydbinstance/read-instance/alloydb_v1beta1_alloydbcluster.yaml b/config/samples/resources/alloydbinstance/read-instance/alloydb_v1beta1_alloydbcluster.yaml new file mode 100644 index 0000000000..2a57eb68e8 --- /dev/null +++ b/config/samples/resources/alloydbinstance/read-instance/alloydb_v1beta1_alloydbcluster.yaml @@ -0,0 +1,24 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbinstance-dep-read +spec: + location: us-central1 + networkRef: + external: projects/${PROJECT_ID?}/global/networks/alloydbinstance-dep-read + projectRef: + external: ${PROJECT_ID?} diff --git a/config/samples/resources/alloydbinstance/read-instance/alloydb_v1beta1_alloydbinstance.yaml b/config/samples/resources/alloydbinstance/read-instance/alloydb_v1beta1_alloydbinstance.yaml new file mode 100644 index 0000000000..3aa7f327ae --- /dev/null +++ b/config/samples/resources/alloydbinstance/read-instance/alloydb_v1beta1_alloydbinstance.yaml @@ -0,0 +1,38 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-dep-read +spec: + clusterRef: + external: projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbinstance-dep-read + instanceType: PRIMARY +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-sample-read +spec: + clusterRef: + external: projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbinstance-dep-read + instanceType: READ_POOL + availabilityType: REGIONAL + databaseFlags: + google_columnar_engine.enabled: "on" + machineConfig: + cpuCount: 2 + readPoolConfig: + nodeCount: 3 \ No newline at end of file diff --git a/config/samples/resources/alloydbinstance/read-instance/compute_v1beta1_computeaddress.yaml b/config/samples/resources/alloydbinstance/read-instance/compute_v1beta1_computeaddress.yaml new file mode 100644 index 0000000000..0336fe32e1 --- /dev/null +++ b/config/samples/resources/alloydbinstance/read-instance/compute_v1beta1_computeaddress.yaml @@ -0,0 +1,25 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: alloydbinstance-dep-read +spec: + location: global + addressType: INTERNAL + networkRef: + name: alloydbinstance-dep-read + prefixLength: 16 + purpose: VPC_PEERING \ No newline at end of file diff --git a/config/samples/resources/alloydbinstance/read-instance/compute_v1beta1_computenetwork.yaml b/config/samples/resources/alloydbinstance/read-instance/compute_v1beta1_computenetwork.yaml new file mode 100644 index 0000000000..86697419cb --- /dev/null +++ b/config/samples/resources/alloydbinstance/read-instance/compute_v1beta1_computenetwork.yaml @@ -0,0 +1,20 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: alloydbinstance-dep-read + + diff --git a/config/samples/resources/alloydbinstance/read-instance/servicenetworking_v1beta1_servicenetworkingconnection.yaml b/config/samples/resources/alloydbinstance/read-instance/servicenetworking_v1beta1_servicenetworkingconnection.yaml new file mode 100644 index 0000000000..23788f16c1 --- /dev/null +++ b/config/samples/resources/alloydbinstance/read-instance/servicenetworking_v1beta1_servicenetworkingconnection.yaml @@ -0,0 +1,24 @@ +# Copyright 2023 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: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: alloydbinstance-dep-read +spec: + networkRef: + name: alloydbinstance-dep-read + reservedPeeringRanges: + - name: alloydbinstance-dep-read + service: servicenetworking.googleapis.com \ No newline at end of file diff --git a/config/servicemappings/alloydb.yaml b/config/servicemappings/alloydb.yaml new file mode 100644 index 0000000000..d42e893df4 --- /dev/null +++ b/config/servicemappings/alloydb.yaml @@ -0,0 +1,155 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: core.cnrm.cloud.google.com/v1alpha1 +kind: ServiceMapping +metadata: + name: alloydb.cnrm.cloud.google.com + namespace: cnrm-system +spec: + name: AlloyDB + version: v1beta1 + serviceHostName: "alloydb.googleapis.com" + resources: + - name: google_alloydb_backup + kind: AlloyDBBackup + idTemplate: "projects/{{project}}/locations/{{location}}/backups/{{backup_id}}" + idTemplateCanBeUsedToMatchResourceName: false + resourceAvailableInAssetInventory: false + v1alpha1ToV1beta1: true + storageVersion: v1alpha1 + autoGenerated: false + metadataMapping: + name: backup_id + labels: labels + resourceID: + targetField: backup_id + hierarchicalReferences: + - type: project + key: projectRef + resourceReferences: + - tfField: project + description: "The project that this resource belongs to." + key: projectRef + gvk: + group: resourcemanager.cnrm.cloud.google.com + version: v1beta1 + kind: Project + - tfField: cluster_name + description: "The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId})." + key: clusterNameRef + gvk: + group: alloydb.cnrm.cloud.google.com + version: v1beta1 + kind: AlloyDBCluster + targetField: name + - name: google_alloydb_cluster + kind: AlloyDBCluster + idTemplate: "projects/{{project}}/locations/{{location}}/clusters/{{cluster_id}}" + idTemplateCanBeUsedToMatchResourceName: false + resourceAvailableInAssetInventory: false + v1alpha1ToV1beta1: true + storageVersion: v1alpha1 + autoGenerated: false + metadataMapping: + name: cluster_id + labels: labels + resourceID: + targetField: cluster_id + hierarchicalReferences: + - type: project + key: projectRef + resourceReferences: + - tfField: project + description: "The project that this resource belongs to." + key: projectRef + gvk: + group: resourcemanager.cnrm.cloud.google.com + version: v1beta1 + kind: Project + - tfField: encryption_config.kms_key_name + description: "(Optional) The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]." + key: kmsKeyNameRef + gvk: + group: kms.cnrm.cloud.google.com + version: v1beta1 + kind: KMSCryptoKey + targetField: self_link + - tfField: continuous_backup_config.encryption_config.kms_key_name + description: "(Optional) The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]." + key: kmsKeyNameRef + gvk: + group: kms.cnrm.cloud.google.com + version: v1beta1 + kind: KMSCryptoKey + targetField: self_link + - tfField: automated_backup_policy.encryption_config.kms_key_name + description: "(Optional) The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]." + key: kmsKeyNameRef + gvk: + group: kms.cnrm.cloud.google.com + version: v1beta1 + kind: KMSCryptoKey + targetField: self_link + - tfField: network + description: |- + Only `external` field is supported to configure the reference. + + (Required) The relative resource name of the VPC network on which + the instance can be accessed. It is specified in the following form: + projects/{projectNumber}/global/networks/{network_id}." + key: networkRef + gvk: + group: compute.cnrm.cloud.google.com + version: v1beta1 + kind: ComputeNetwork + targetField: self_link + - tfField: restore_backup_source.backup_name + description: "(Required) The name of the backup that this cluster is restored from." + key: backupNameRef + gvk: + group: alloydb.cnrm.cloud.google.com + version: v1beta1 + kind: AlloyDBBackup + targetField: name + - tfField: restore_continuous_backup_source.cluster + description: "(Required) The name of the source cluster that this cluster is restored from." + key: clusterRef + gvk: + group: alloydb.cnrm.cloud.google.com + version: v1beta1 + kind: AlloyDBCluster + targetField: name + - name: google_alloydb_instance + kind: AlloyDBInstance + autoGenerated: false + idTemplate: "{{cluster}}/instances/{{instance_id}}" + idTemplateCanBeUsedToMatchResourceName: false + resourceAvailableInAssetInventory: false + v1alpha1ToV1beta1: true + storageVersion: v1alpha1 + metadataMapping: + name: instance_id + labels: labels + resourceID: + targetField: instance_id + resourceReferences: + - tfField: cluster + key: clusterRef + targetField: name + gvk: + group: alloydb.cnrm.cloud.google.com + version: v1beta1 + kind: AlloyDBCluster + parent: true diff --git a/pkg/clients/generated/apis/alloydb/v1alpha1/alloydbbackup_types.go b/pkg/clients/generated/apis/alloydb/v1beta1/alloydbbackup_types.go similarity index 96% rename from pkg/clients/generated/apis/alloydb/v1alpha1/alloydbbackup_types.go rename to pkg/clients/generated/apis/alloydb/v1beta1/alloydbbackup_types.go index af26408f7d..bdf5d54f71 100644 --- a/pkg/clients/generated/apis/alloydb/v1alpha1/alloydbbackup_types.go +++ b/pkg/clients/generated/apis/alloydb/v1beta1/alloydbbackup_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" @@ -42,8 +42,8 @@ type BackupEncryptionConfig struct { } type AlloyDBBackupSpec struct { - /* Immutable. The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}). */ - ClusterName string `json:"clusterName"` + /* The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}). */ + ClusterNameRef v1alpha1.ResourceRef `json:"clusterNameRef"` /* Immutable. User-provided description of the backup. */ // +optional diff --git a/pkg/clients/generated/apis/alloydb/v1alpha1/alloydbcluster_types.go b/pkg/clients/generated/apis/alloydb/v1beta1/alloydbcluster_types.go similarity index 94% rename from pkg/clients/generated/apis/alloydb/v1alpha1/alloydbcluster_types.go rename to pkg/clients/generated/apis/alloydb/v1beta1/alloydbcluster_types.go index 2b5e7dd31d..73bca67476 100644 --- a/pkg/clients/generated/apis/alloydb/v1alpha1/alloydbcluster_types.go +++ b/pkg/clients/generated/apis/alloydb/v1beta1/alloydbcluster_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" @@ -90,9 +90,9 @@ type ClusterContinuousBackupConfig struct { } type ClusterEncryptionConfig struct { - /* Immutable. The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]. */ + /* (Optional) The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]. */ // +optional - KmsKeyName *string `json:"kmsKeyName,omitempty"` + KmsKeyNameRef *v1alpha1.ResourceRef `json:"kmsKeyNameRef,omitempty"` } type ClusterInitialUser struct { @@ -121,13 +121,13 @@ type ClusterQuantityBasedRetention struct { } type ClusterRestoreBackupSource struct { - /* Immutable. The name of the backup that this cluster is restored from. */ - BackupName string `json:"backupName"` + /* (Required) The name of the backup that this cluster is restored from. */ + BackupNameRef v1alpha1.ResourceRef `json:"backupNameRef"` } type ClusterRestoreContinuousBackupSource struct { - /* Immutable. The name of the source cluster that this cluster is restored from. */ - Cluster string `json:"cluster"` + /* (Required) The name of the source cluster that this cluster is restored from. */ + ClusterRef v1alpha1.ResourceRef `json:"clusterRef"` /* Immutable. The point in time that this cluster is restored to, in RFC 3339 format. */ PointInTime string `json:"pointInTime"` @@ -199,10 +199,12 @@ type AlloyDBClusterSpec struct { /* Immutable. The location where the alloydb cluster should reside. */ Location string `json:"location"` - /* The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: + /* Only `external` field is supported to configure the reference. - "projects/{projectNumber}/global/networks/{network_id}". */ - Network string `json:"network"` + (Required) The relative resource name of the VPC network on which + the instance can be accessed. It is specified in the following form: + projects/{projectNumber}/global/networks/{network_id}." */ + NetworkRef v1alpha1.ResourceRef `json:"networkRef"` /* The project that this resource belongs to. */ ProjectRef v1alpha1.ResourceRef `json:"projectRef"` diff --git a/pkg/clients/generated/apis/alloydb/v1alpha1/alloydbinstance_types.go b/pkg/clients/generated/apis/alloydb/v1beta1/alloydbinstance_types.go similarity index 97% rename from pkg/clients/generated/apis/alloydb/v1alpha1/alloydbinstance_types.go rename to pkg/clients/generated/apis/alloydb/v1beta1/alloydbinstance_types.go index a7f4138cb0..6be5ece880 100644 --- a/pkg/clients/generated/apis/alloydb/v1alpha1/alloydbinstance_types.go +++ b/pkg/clients/generated/apis/alloydb/v1beta1/alloydbinstance_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" @@ -61,9 +61,7 @@ type AlloyDBInstanceSpec struct { // +optional AvailabilityType *string `json:"availabilityType,omitempty"` - /* Immutable. Identifies the alloydb cluster. Must be in the format - 'projects/{project}/locations/{location}/clusters/{cluster_id}'. */ - Cluster string `json:"cluster"` + ClusterRef v1alpha1.ResourceRef `json:"clusterRef"` /* Database flags. Set at instance level. * They are copied from primary instance on read instance creation. * Read instances can set new or override existing flags that are relevant for reads, e.g. for enabling columnar cache on a read instance. Flags set on read instance may or may not be present on primary. */ // +optional diff --git a/pkg/clients/generated/apis/alloydb/v1alpha1/doc.go b/pkg/clients/generated/apis/alloydb/v1beta1/doc.go similarity index 91% rename from pkg/clients/generated/apis/alloydb/v1alpha1/doc.go rename to pkg/clients/generated/apis/alloydb/v1beta1/doc.go index c69eba0e60..6a64fbd239 100644 --- a/pkg/clients/generated/apis/alloydb/v1alpha1/doc.go +++ b/pkg/clients/generated/apis/alloydb/v1beta1/doc.go @@ -28,14 +28,14 @@ // 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 alloydb v1alpha1 API group. +// Package v1beta1 contains API Schema definitions for the alloydb v1beta1 API group. // +k8s:openapi-gen=true // +k8s:deepcopy-gen=package,register // +k8s:conversion-gen=github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/pkg/apis/alloydb // +k8s:defaulter-gen=TypeMeta // +groupName=alloydb.cnrm.cloud.google.com -// Generate deepcopy object for alloydb/v1alpha1 API group +// Generate deepcopy object for alloydb/v1beta1 API group // //go:generate go run ../../../../../../scripts/deepcopy-gen/main.go -O zz_generated.deepcopy -i . -h ../../../../../../hack/boilerplate_client_alpha.go.txt -package v1alpha1 +package v1beta1 diff --git a/pkg/clients/generated/apis/alloydb/v1alpha1/register.go b/pkg/clients/generated/apis/alloydb/v1beta1/register.go similarity index 96% rename from pkg/clients/generated/apis/alloydb/v1alpha1/register.go rename to pkg/clients/generated/apis/alloydb/v1beta1/register.go index 60627ffa1c..9222cb78a2 100644 --- a/pkg/clients/generated/apis/alloydb/v1alpha1/register.go +++ b/pkg/clients/generated/apis/alloydb/v1beta1/register.go @@ -28,13 +28,13 @@ // that future versions of the go-client may include breaking changes. // Please try it out and give us feedback! -// Package v1alpha1 contains API Schema definitions for the alloydb v1alpha1 API group. +// Package v1beta1 contains API Schema definitions for the alloydb v1beta1 API group. // +k8s:openapi-gen=true // +k8s:deepcopy-gen=package,register // +k8s:conversion-gen=github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/pkg/apis/alloydb // +k8s:defaulter-gen=TypeMeta // +groupName=alloydb.cnrm.cloud.google.com -package v1alpha1 +package v1beta1 import ( "reflect" diff --git a/pkg/clients/generated/apis/alloydb/v1alpha1/zz_generated.deepcopy.go b/pkg/clients/generated/apis/alloydb/v1beta1/zz_generated.deepcopy.go similarity index 98% rename from pkg/clients/generated/apis/alloydb/v1alpha1/zz_generated.deepcopy.go rename to pkg/clients/generated/apis/alloydb/v1beta1/zz_generated.deepcopy.go index c3acc96518..d0dfe3f713 100644 --- a/pkg/clients/generated/apis/alloydb/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/clients/generated/apis/alloydb/v1beta1/zz_generated.deepcopy.go @@ -22,10 +22,10 @@ // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( - k8sv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/k8s/v1alpha1" + v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/k8s/v1alpha1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -93,6 +93,7 @@ func (in *AlloyDBBackupList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AlloyDBBackupSpec) DeepCopyInto(out *AlloyDBBackupSpec) { *out = *in + out.ClusterNameRef = in.ClusterNameRef if in.Description != nil { in, out := &in.Description, &out.Description *out = new(string) @@ -127,7 +128,7 @@ func (in *AlloyDBBackupStatus) DeepCopyInto(out *AlloyDBBackupStatus) { *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.CreateTime != nil { @@ -279,6 +280,7 @@ func (in *AlloyDBClusterSpec) DeepCopyInto(out *AlloyDBClusterSpec) { *out = new(ClusterInitialUser) (*in).DeepCopyInto(*out) } + out.NetworkRef = in.NetworkRef out.ProjectRef = in.ProjectRef if in.ResourceID != nil { in, out := &in.ResourceID, &out.ResourceID @@ -313,7 +315,7 @@ func (in *AlloyDBClusterStatus) DeepCopyInto(out *AlloyDBClusterStatus) { *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.BackupSource != nil { @@ -453,6 +455,7 @@ func (in *AlloyDBInstanceSpec) DeepCopyInto(out *AlloyDBInstanceSpec) { *out = new(string) **out = **in } + out.ClusterRef = in.ClusterRef if in.DatabaseFlags != nil { in, out := &in.DatabaseFlags, &out.DatabaseFlags *out = make(map[string]string, len(*in)) @@ -503,7 +506,7 @@ func (in *AlloyDBInstanceStatus) DeepCopyInto(out *AlloyDBInstanceStatus) { *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.CreateTime != nil { @@ -757,9 +760,9 @@ func (in *ClusterContinuousBackupInfoStatus) DeepCopy() *ClusterContinuousBackup // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterEncryptionConfig) DeepCopyInto(out *ClusterEncryptionConfig) { *out = *in - if in.KmsKeyName != nil { - in, out := &in.KmsKeyName, &out.KmsKeyName - *out = new(string) + if in.KmsKeyNameRef != nil { + in, out := &in.KmsKeyNameRef, &out.KmsKeyNameRef + *out = new(v1alpha1.ResourceRef) **out = **in } return @@ -904,6 +907,7 @@ func (in *ClusterQuantityBasedRetention) DeepCopy() *ClusterQuantityBasedRetenti // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterRestoreBackupSource) DeepCopyInto(out *ClusterRestoreBackupSource) { *out = *in + out.BackupNameRef = in.BackupNameRef return } @@ -920,6 +924,7 @@ func (in *ClusterRestoreBackupSource) DeepCopy() *ClusterRestoreBackupSource { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterRestoreContinuousBackupSource) DeepCopyInto(out *ClusterRestoreContinuousBackupSource) { *out = *in + out.ClusterRef = in.ClusterRef return } @@ -995,7 +1000,7 @@ func (in *ClusterValueFrom) DeepCopyInto(out *ClusterValueFrom) { *out = *in if in.SecretKeyRef != nil { in, out := &in.SecretKeyRef, &out.SecretKeyRef - *out = new(k8sv1alpha1.ResourceRef) + *out = new(v1alpha1.ResourceRef) **out = **in } return diff --git a/pkg/clients/generated/client/clientset/versioned/clientset.go b/pkg/clients/generated/client/clientset/versioned/clientset.go index 83da0c4840..389eb18643 100644 --- a/pkg/clients/generated/client/clientset/versioned/clientset.go +++ b/pkg/clients/generated/client/clientset/versioned/clientset.go @@ -27,7 +27,7 @@ import ( accesscontextmanagerv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/accesscontextmanager/v1alpha1" accesscontextmanagerv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/accesscontextmanager/v1beta1" - alloydbv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1" + alloydbv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1" apigatewayv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/apigateway/v1alpha1" apigeev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/apigee/v1alpha1" apigeev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/apigee/v1beta1" @@ -144,7 +144,7 @@ type Interface interface { Discovery() discovery.DiscoveryInterface AccesscontextmanagerV1beta1() accesscontextmanagerv1beta1.AccesscontextmanagerV1beta1Interface AccesscontextmanagerV1alpha1() accesscontextmanagerv1alpha1.AccesscontextmanagerV1alpha1Interface - AlloydbV1alpha1() alloydbv1alpha1.AlloydbV1alpha1Interface + AlloydbV1beta1() alloydbv1beta1.AlloydbV1beta1Interface ApigatewayV1alpha1() apigatewayv1alpha1.ApigatewayV1alpha1Interface ApigeeV1alpha1() apigeev1alpha1.ApigeeV1alpha1Interface ApigeeV1beta1() apigeev1beta1.ApigeeV1beta1Interface @@ -260,7 +260,7 @@ type Clientset struct { *discovery.DiscoveryClient accesscontextmanagerV1beta1 *accesscontextmanagerv1beta1.AccesscontextmanagerV1beta1Client accesscontextmanagerV1alpha1 *accesscontextmanagerv1alpha1.AccesscontextmanagerV1alpha1Client - alloydbV1alpha1 *alloydbv1alpha1.AlloydbV1alpha1Client + alloydbV1beta1 *alloydbv1beta1.AlloydbV1beta1Client apigatewayV1alpha1 *apigatewayv1alpha1.ApigatewayV1alpha1Client apigeeV1alpha1 *apigeev1alpha1.ApigeeV1alpha1Client apigeeV1beta1 *apigeev1beta1.ApigeeV1beta1Client @@ -380,9 +380,9 @@ func (c *Clientset) AccesscontextmanagerV1alpha1() accesscontextmanagerv1alpha1. return c.accesscontextmanagerV1alpha1 } -// AlloydbV1alpha1 retrieves the AlloydbV1alpha1Client -func (c *Clientset) AlloydbV1alpha1() alloydbv1alpha1.AlloydbV1alpha1Interface { - return c.alloydbV1alpha1 +// AlloydbV1beta1 retrieves the AlloydbV1beta1Client +func (c *Clientset) AlloydbV1beta1() alloydbv1beta1.AlloydbV1beta1Interface { + return c.alloydbV1beta1 } // ApigatewayV1alpha1 retrieves the ApigatewayV1alpha1Client @@ -972,7 +972,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } - cs.alloydbV1alpha1, err = alloydbv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.alloydbV1beta1, err = alloydbv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -1427,7 +1427,7 @@ func New(c rest.Interface) *Clientset { var cs Clientset cs.accesscontextmanagerV1beta1 = accesscontextmanagerv1beta1.New(c) cs.accesscontextmanagerV1alpha1 = accesscontextmanagerv1alpha1.New(c) - cs.alloydbV1alpha1 = alloydbv1alpha1.New(c) + cs.alloydbV1beta1 = alloydbv1beta1.New(c) cs.apigatewayV1alpha1 = apigatewayv1alpha1.New(c) cs.apigeeV1alpha1 = apigeev1alpha1.New(c) cs.apigeeV1beta1 = apigeev1beta1.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 3a27629420..3f6ba0a5aa 100644 --- a/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go @@ -27,8 +27,8 @@ import ( fakeaccesscontextmanagerv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/accesscontextmanager/v1alpha1/fake" accesscontextmanagerv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/accesscontextmanager/v1beta1" fakeaccesscontextmanagerv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/accesscontextmanager/v1beta1/fake" - alloydbv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1" - fakealloydbv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake" + alloydbv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1" + fakealloydbv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake" apigatewayv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/apigateway/v1alpha1" fakeapigatewayv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/apigateway/v1alpha1/fake" apigeev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/apigee/v1alpha1" @@ -310,9 +310,9 @@ func (c *Clientset) AccesscontextmanagerV1alpha1() accesscontextmanagerv1alpha1. return &fakeaccesscontextmanagerv1alpha1.FakeAccesscontextmanagerV1alpha1{Fake: &c.Fake} } -// AlloydbV1alpha1 retrieves the AlloydbV1alpha1Client -func (c *Clientset) AlloydbV1alpha1() alloydbv1alpha1.AlloydbV1alpha1Interface { - return &fakealloydbv1alpha1.FakeAlloydbV1alpha1{Fake: &c.Fake} +// AlloydbV1beta1 retrieves the AlloydbV1beta1Client +func (c *Clientset) AlloydbV1beta1() alloydbv1beta1.AlloydbV1beta1Interface { + return &fakealloydbv1beta1.FakeAlloydbV1beta1{Fake: &c.Fake} } // ApigatewayV1alpha1 retrieves the ApigatewayV1alpha1Client diff --git a/pkg/clients/generated/client/clientset/versioned/fake/register.go b/pkg/clients/generated/client/clientset/versioned/fake/register.go index 90aee5c6fa..2bc4932196 100644 --- a/pkg/clients/generated/client/clientset/versioned/fake/register.go +++ b/pkg/clients/generated/client/clientset/versioned/fake/register.go @@ -24,7 +24,7 @@ package fake import ( accesscontextmanagerv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/accesscontextmanager/v1alpha1" accesscontextmanagerv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/accesscontextmanager/v1beta1" - alloydbv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1alpha1" + alloydbv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1beta1" apigatewayv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/apigateway/v1alpha1" apigeev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/apigee/v1alpha1" apigeev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/apigee/v1beta1" @@ -145,7 +145,7 @@ var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ accesscontextmanagerv1beta1.AddToScheme, accesscontextmanagerv1alpha1.AddToScheme, - alloydbv1alpha1.AddToScheme, + alloydbv1beta1.AddToScheme, apigatewayv1alpha1.AddToScheme, apigeev1alpha1.AddToScheme, apigeev1beta1.AddToScheme, diff --git a/pkg/clients/generated/client/clientset/versioned/scheme/register.go b/pkg/clients/generated/client/clientset/versioned/scheme/register.go index 5863d6bbb4..65ad52edd3 100644 --- a/pkg/clients/generated/client/clientset/versioned/scheme/register.go +++ b/pkg/clients/generated/client/clientset/versioned/scheme/register.go @@ -24,7 +24,7 @@ package scheme import ( accesscontextmanagerv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/accesscontextmanager/v1alpha1" accesscontextmanagerv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/accesscontextmanager/v1beta1" - alloydbv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1alpha1" + alloydbv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1beta1" apigatewayv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/apigateway/v1alpha1" apigeev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/apigee/v1alpha1" apigeev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/apigee/v1beta1" @@ -145,7 +145,7 @@ var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ accesscontextmanagerv1beta1.AddToScheme, accesscontextmanagerv1alpha1.AddToScheme, - alloydbv1alpha1.AddToScheme, + alloydbv1beta1.AddToScheme, apigatewayv1alpha1.AddToScheme, apigeev1alpha1.AddToScheme, apigeev1beta1.AddToScheme, diff --git a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/alloydb_client.go b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/alloydb_client.go similarity index 66% rename from pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/alloydb_client.go rename to pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/alloydb_client.go index 6aa3978123..89e50359e9 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/alloydb_client.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/alloydb_client.go @@ -19,44 +19,44 @@ // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "net/http" - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1beta1" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) -type AlloydbV1alpha1Interface interface { +type AlloydbV1beta1Interface interface { RESTClient() rest.Interface AlloyDBBackupsGetter AlloyDBClustersGetter AlloyDBInstancesGetter } -// AlloydbV1alpha1Client is used to interact with features provided by the alloydb.cnrm.cloud.google.com group. -type AlloydbV1alpha1Client struct { +// AlloydbV1beta1Client is used to interact with features provided by the alloydb.cnrm.cloud.google.com group. +type AlloydbV1beta1Client struct { restClient rest.Interface } -func (c *AlloydbV1alpha1Client) AlloyDBBackups(namespace string) AlloyDBBackupInterface { +func (c *AlloydbV1beta1Client) AlloyDBBackups(namespace string) AlloyDBBackupInterface { return newAlloyDBBackups(c, namespace) } -func (c *AlloydbV1alpha1Client) AlloyDBClusters(namespace string) AlloyDBClusterInterface { +func (c *AlloydbV1beta1Client) AlloyDBClusters(namespace string) AlloyDBClusterInterface { return newAlloyDBClusters(c, namespace) } -func (c *AlloydbV1alpha1Client) AlloyDBInstances(namespace string) AlloyDBInstanceInterface { +func (c *AlloydbV1beta1Client) AlloyDBInstances(namespace string) AlloyDBInstanceInterface { return newAlloyDBInstances(c, namespace) } -// NewForConfig creates a new AlloydbV1alpha1Client for the given config. +// NewForConfig creates a new AlloydbV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*AlloydbV1alpha1Client, error) { +func NewForConfig(c *rest.Config) (*AlloydbV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -68,9 +68,9 @@ func NewForConfig(c *rest.Config) (*AlloydbV1alpha1Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new AlloydbV1alpha1Client for the given config and http client. +// NewForConfigAndClient creates a new AlloydbV1beta1Client 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) (*AlloydbV1alpha1Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AlloydbV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -79,12 +79,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AlloydbV1alpha1Clie if err != nil { return nil, err } - return &AlloydbV1alpha1Client{client}, nil + return &AlloydbV1beta1Client{client}, nil } -// NewForConfigOrDie creates a new AlloydbV1alpha1Client for the given config and +// NewForConfigOrDie creates a new AlloydbV1beta1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *AlloydbV1alpha1Client { +func NewForConfigOrDie(c *rest.Config) *AlloydbV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -92,13 +92,13 @@ func NewForConfigOrDie(c *rest.Config) *AlloydbV1alpha1Client { return client } -// New creates a new AlloydbV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *AlloydbV1alpha1Client { - return &AlloydbV1alpha1Client{c} +// New creates a new AlloydbV1beta1Client for the given RESTClient. +func New(c rest.Interface) *AlloydbV1beta1Client { + return &AlloydbV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion + gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() @@ -112,7 +112,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *AlloydbV1alpha1Client) RESTClient() rest.Interface { +func (c *AlloydbV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/alloydbbackup.go b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/alloydbbackup.go similarity index 79% rename from pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/alloydbbackup.go rename to pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/alloydbbackup.go index 6bc1e2b4b0..597965ef52 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/alloydbbackup.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/alloydbbackup.go @@ -19,13 +19,13 @@ // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "context" "time" - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/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 AlloyDBBackupsGetter interface { // AlloyDBBackupInterface has methods to work with AlloyDBBackup resources. type AlloyDBBackupInterface interface { - Create(ctx context.Context, alloyDBBackup *v1alpha1.AlloyDBBackup, opts v1.CreateOptions) (*v1alpha1.AlloyDBBackup, error) - Update(ctx context.Context, alloyDBBackup *v1alpha1.AlloyDBBackup, opts v1.UpdateOptions) (*v1alpha1.AlloyDBBackup, error) - UpdateStatus(ctx context.Context, alloyDBBackup *v1alpha1.AlloyDBBackup, opts v1.UpdateOptions) (*v1alpha1.AlloyDBBackup, error) + Create(ctx context.Context, alloyDBBackup *v1beta1.AlloyDBBackup, opts v1.CreateOptions) (*v1beta1.AlloyDBBackup, error) + Update(ctx context.Context, alloyDBBackup *v1beta1.AlloyDBBackup, opts v1.UpdateOptions) (*v1beta1.AlloyDBBackup, error) + UpdateStatus(ctx context.Context, alloyDBBackup *v1beta1.AlloyDBBackup, opts v1.UpdateOptions) (*v1beta1.AlloyDBBackup, 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.AlloyDBBackup, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AlloyDBBackupList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.AlloyDBBackup, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.AlloyDBBackupList, 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.AlloyDBBackup, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AlloyDBBackup, err error) AlloyDBBackupExpansion } @@ -60,7 +60,7 @@ type alloyDBBackups struct { } // newAlloyDBBackups returns a AlloyDBBackups -func newAlloyDBBackups(c *AlloydbV1alpha1Client, namespace string) *alloyDBBackups { +func newAlloyDBBackups(c *AlloydbV1beta1Client, namespace string) *alloyDBBackups { return &alloyDBBackups{ client: c.RESTClient(), ns: namespace, @@ -68,8 +68,8 @@ func newAlloyDBBackups(c *AlloydbV1alpha1Client, namespace string) *alloyDBBacku } // Get takes name of the alloyDBBackup, and returns the corresponding alloyDBBackup object, and an error if there is any. -func (c *alloyDBBackups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AlloyDBBackup, err error) { - result = &v1alpha1.AlloyDBBackup{} +func (c *alloyDBBackups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AlloyDBBackup, err error) { + result = &v1beta1.AlloyDBBackup{} err = c.client.Get(). Namespace(c.ns). Resource("alloydbbackups"). @@ -81,12 +81,12 @@ func (c *alloyDBBackups) Get(ctx context.Context, name string, options v1.GetOpt } // List takes label and field selectors, and returns the list of AlloyDBBackups that match those selectors. -func (c *alloyDBBackups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AlloyDBBackupList, err error) { +func (c *alloyDBBackups) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.AlloyDBBackupList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.AlloyDBBackupList{} + result = &v1beta1.AlloyDBBackupList{} err = c.client.Get(). Namespace(c.ns). Resource("alloydbbackups"). @@ -113,8 +113,8 @@ func (c *alloyDBBackups) Watch(ctx context.Context, opts v1.ListOptions) (watch. } // Create takes the representation of a alloyDBBackup and creates it. Returns the server's representation of the alloyDBBackup, and an error, if there is any. -func (c *alloyDBBackups) Create(ctx context.Context, alloyDBBackup *v1alpha1.AlloyDBBackup, opts v1.CreateOptions) (result *v1alpha1.AlloyDBBackup, err error) { - result = &v1alpha1.AlloyDBBackup{} +func (c *alloyDBBackups) Create(ctx context.Context, alloyDBBackup *v1beta1.AlloyDBBackup, opts v1.CreateOptions) (result *v1beta1.AlloyDBBackup, err error) { + result = &v1beta1.AlloyDBBackup{} err = c.client.Post(). Namespace(c.ns). Resource("alloydbbackups"). @@ -126,8 +126,8 @@ func (c *alloyDBBackups) Create(ctx context.Context, alloyDBBackup *v1alpha1.All } // Update takes the representation of a alloyDBBackup and updates it. Returns the server's representation of the alloyDBBackup, and an error, if there is any. -func (c *alloyDBBackups) Update(ctx context.Context, alloyDBBackup *v1alpha1.AlloyDBBackup, opts v1.UpdateOptions) (result *v1alpha1.AlloyDBBackup, err error) { - result = &v1alpha1.AlloyDBBackup{} +func (c *alloyDBBackups) Update(ctx context.Context, alloyDBBackup *v1beta1.AlloyDBBackup, opts v1.UpdateOptions) (result *v1beta1.AlloyDBBackup, err error) { + result = &v1beta1.AlloyDBBackup{} err = c.client.Put(). Namespace(c.ns). Resource("alloydbbackups"). @@ -141,8 +141,8 @@ func (c *alloyDBBackups) Update(ctx context.Context, alloyDBBackup *v1alpha1.All // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *alloyDBBackups) UpdateStatus(ctx context.Context, alloyDBBackup *v1alpha1.AlloyDBBackup, opts v1.UpdateOptions) (result *v1alpha1.AlloyDBBackup, err error) { - result = &v1alpha1.AlloyDBBackup{} +func (c *alloyDBBackups) UpdateStatus(ctx context.Context, alloyDBBackup *v1beta1.AlloyDBBackup, opts v1.UpdateOptions) (result *v1beta1.AlloyDBBackup, err error) { + result = &v1beta1.AlloyDBBackup{} err = c.client.Put(). Namespace(c.ns). Resource("alloydbbackups"). @@ -183,8 +183,8 @@ func (c *alloyDBBackups) DeleteCollection(ctx context.Context, opts v1.DeleteOpt } // Patch applies the patch and returns the patched alloyDBBackup. -func (c *alloyDBBackups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AlloyDBBackup, err error) { - result = &v1alpha1.AlloyDBBackup{} +func (c *alloyDBBackups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AlloyDBBackup, err error) { + result = &v1beta1.AlloyDBBackup{} err = c.client.Patch(pt). Namespace(c.ns). Resource("alloydbbackups"). diff --git a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/alloydbcluster.go b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/alloydbcluster.go similarity index 79% rename from pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/alloydbcluster.go rename to pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/alloydbcluster.go index a4f039905c..ff70900428 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/alloydbcluster.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/alloydbcluster.go @@ -19,13 +19,13 @@ // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "context" "time" - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/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 AlloyDBClustersGetter interface { // AlloyDBClusterInterface has methods to work with AlloyDBCluster resources. type AlloyDBClusterInterface interface { - Create(ctx context.Context, alloyDBCluster *v1alpha1.AlloyDBCluster, opts v1.CreateOptions) (*v1alpha1.AlloyDBCluster, error) - Update(ctx context.Context, alloyDBCluster *v1alpha1.AlloyDBCluster, opts v1.UpdateOptions) (*v1alpha1.AlloyDBCluster, error) - UpdateStatus(ctx context.Context, alloyDBCluster *v1alpha1.AlloyDBCluster, opts v1.UpdateOptions) (*v1alpha1.AlloyDBCluster, error) + Create(ctx context.Context, alloyDBCluster *v1beta1.AlloyDBCluster, opts v1.CreateOptions) (*v1beta1.AlloyDBCluster, error) + Update(ctx context.Context, alloyDBCluster *v1beta1.AlloyDBCluster, opts v1.UpdateOptions) (*v1beta1.AlloyDBCluster, error) + UpdateStatus(ctx context.Context, alloyDBCluster *v1beta1.AlloyDBCluster, opts v1.UpdateOptions) (*v1beta1.AlloyDBCluster, 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.AlloyDBCluster, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AlloyDBClusterList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.AlloyDBCluster, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.AlloyDBClusterList, 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.AlloyDBCluster, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AlloyDBCluster, err error) AlloyDBClusterExpansion } @@ -60,7 +60,7 @@ type alloyDBClusters struct { } // newAlloyDBClusters returns a AlloyDBClusters -func newAlloyDBClusters(c *AlloydbV1alpha1Client, namespace string) *alloyDBClusters { +func newAlloyDBClusters(c *AlloydbV1beta1Client, namespace string) *alloyDBClusters { return &alloyDBClusters{ client: c.RESTClient(), ns: namespace, @@ -68,8 +68,8 @@ func newAlloyDBClusters(c *AlloydbV1alpha1Client, namespace string) *alloyDBClus } // Get takes name of the alloyDBCluster, and returns the corresponding alloyDBCluster object, and an error if there is any. -func (c *alloyDBClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AlloyDBCluster, err error) { - result = &v1alpha1.AlloyDBCluster{} +func (c *alloyDBClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AlloyDBCluster, err error) { + result = &v1beta1.AlloyDBCluster{} err = c.client.Get(). Namespace(c.ns). Resource("alloydbclusters"). @@ -81,12 +81,12 @@ func (c *alloyDBClusters) Get(ctx context.Context, name string, options v1.GetOp } // List takes label and field selectors, and returns the list of AlloyDBClusters that match those selectors. -func (c *alloyDBClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AlloyDBClusterList, err error) { +func (c *alloyDBClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.AlloyDBClusterList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.AlloyDBClusterList{} + result = &v1beta1.AlloyDBClusterList{} err = c.client.Get(). Namespace(c.ns). Resource("alloydbclusters"). @@ -113,8 +113,8 @@ func (c *alloyDBClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch } // Create takes the representation of a alloyDBCluster and creates it. Returns the server's representation of the alloyDBCluster, and an error, if there is any. -func (c *alloyDBClusters) Create(ctx context.Context, alloyDBCluster *v1alpha1.AlloyDBCluster, opts v1.CreateOptions) (result *v1alpha1.AlloyDBCluster, err error) { - result = &v1alpha1.AlloyDBCluster{} +func (c *alloyDBClusters) Create(ctx context.Context, alloyDBCluster *v1beta1.AlloyDBCluster, opts v1.CreateOptions) (result *v1beta1.AlloyDBCluster, err error) { + result = &v1beta1.AlloyDBCluster{} err = c.client.Post(). Namespace(c.ns). Resource("alloydbclusters"). @@ -126,8 +126,8 @@ func (c *alloyDBClusters) Create(ctx context.Context, alloyDBCluster *v1alpha1.A } // Update takes the representation of a alloyDBCluster and updates it. Returns the server's representation of the alloyDBCluster, and an error, if there is any. -func (c *alloyDBClusters) Update(ctx context.Context, alloyDBCluster *v1alpha1.AlloyDBCluster, opts v1.UpdateOptions) (result *v1alpha1.AlloyDBCluster, err error) { - result = &v1alpha1.AlloyDBCluster{} +func (c *alloyDBClusters) Update(ctx context.Context, alloyDBCluster *v1beta1.AlloyDBCluster, opts v1.UpdateOptions) (result *v1beta1.AlloyDBCluster, err error) { + result = &v1beta1.AlloyDBCluster{} err = c.client.Put(). Namespace(c.ns). Resource("alloydbclusters"). @@ -141,8 +141,8 @@ func (c *alloyDBClusters) Update(ctx context.Context, alloyDBCluster *v1alpha1.A // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *alloyDBClusters) UpdateStatus(ctx context.Context, alloyDBCluster *v1alpha1.AlloyDBCluster, opts v1.UpdateOptions) (result *v1alpha1.AlloyDBCluster, err error) { - result = &v1alpha1.AlloyDBCluster{} +func (c *alloyDBClusters) UpdateStatus(ctx context.Context, alloyDBCluster *v1beta1.AlloyDBCluster, opts v1.UpdateOptions) (result *v1beta1.AlloyDBCluster, err error) { + result = &v1beta1.AlloyDBCluster{} err = c.client.Put(). Namespace(c.ns). Resource("alloydbclusters"). @@ -183,8 +183,8 @@ func (c *alloyDBClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOp } // Patch applies the patch and returns the patched alloyDBCluster. -func (c *alloyDBClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AlloyDBCluster, err error) { - result = &v1alpha1.AlloyDBCluster{} +func (c *alloyDBClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AlloyDBCluster, err error) { + result = &v1beta1.AlloyDBCluster{} err = c.client.Patch(pt). Namespace(c.ns). Resource("alloydbclusters"). diff --git a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/alloydbinstance.go b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/alloydbinstance.go similarity index 79% rename from pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/alloydbinstance.go rename to pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/alloydbinstance.go index b57e15ab55..9961870a5e 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/alloydbinstance.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/alloydbinstance.go @@ -19,13 +19,13 @@ // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "context" "time" - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/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 AlloyDBInstancesGetter interface { // AlloyDBInstanceInterface has methods to work with AlloyDBInstance resources. type AlloyDBInstanceInterface interface { - Create(ctx context.Context, alloyDBInstance *v1alpha1.AlloyDBInstance, opts v1.CreateOptions) (*v1alpha1.AlloyDBInstance, error) - Update(ctx context.Context, alloyDBInstance *v1alpha1.AlloyDBInstance, opts v1.UpdateOptions) (*v1alpha1.AlloyDBInstance, error) - UpdateStatus(ctx context.Context, alloyDBInstance *v1alpha1.AlloyDBInstance, opts v1.UpdateOptions) (*v1alpha1.AlloyDBInstance, error) + Create(ctx context.Context, alloyDBInstance *v1beta1.AlloyDBInstance, opts v1.CreateOptions) (*v1beta1.AlloyDBInstance, error) + Update(ctx context.Context, alloyDBInstance *v1beta1.AlloyDBInstance, opts v1.UpdateOptions) (*v1beta1.AlloyDBInstance, error) + UpdateStatus(ctx context.Context, alloyDBInstance *v1beta1.AlloyDBInstance, opts v1.UpdateOptions) (*v1beta1.AlloyDBInstance, 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.AlloyDBInstance, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AlloyDBInstanceList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.AlloyDBInstance, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.AlloyDBInstanceList, 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.AlloyDBInstance, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AlloyDBInstance, err error) AlloyDBInstanceExpansion } @@ -60,7 +60,7 @@ type alloyDBInstances struct { } // newAlloyDBInstances returns a AlloyDBInstances -func newAlloyDBInstances(c *AlloydbV1alpha1Client, namespace string) *alloyDBInstances { +func newAlloyDBInstances(c *AlloydbV1beta1Client, namespace string) *alloyDBInstances { return &alloyDBInstances{ client: c.RESTClient(), ns: namespace, @@ -68,8 +68,8 @@ func newAlloyDBInstances(c *AlloydbV1alpha1Client, namespace string) *alloyDBIns } // Get takes name of the alloyDBInstance, and returns the corresponding alloyDBInstance object, and an error if there is any. -func (c *alloyDBInstances) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AlloyDBInstance, err error) { - result = &v1alpha1.AlloyDBInstance{} +func (c *alloyDBInstances) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AlloyDBInstance, err error) { + result = &v1beta1.AlloyDBInstance{} err = c.client.Get(). Namespace(c.ns). Resource("alloydbinstances"). @@ -81,12 +81,12 @@ func (c *alloyDBInstances) Get(ctx context.Context, name string, options v1.GetO } // List takes label and field selectors, and returns the list of AlloyDBInstances that match those selectors. -func (c *alloyDBInstances) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AlloyDBInstanceList, err error) { +func (c *alloyDBInstances) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.AlloyDBInstanceList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.AlloyDBInstanceList{} + result = &v1beta1.AlloyDBInstanceList{} err = c.client.Get(). Namespace(c.ns). Resource("alloydbinstances"). @@ -113,8 +113,8 @@ func (c *alloyDBInstances) Watch(ctx context.Context, opts v1.ListOptions) (watc } // Create takes the representation of a alloyDBInstance and creates it. Returns the server's representation of the alloyDBInstance, and an error, if there is any. -func (c *alloyDBInstances) Create(ctx context.Context, alloyDBInstance *v1alpha1.AlloyDBInstance, opts v1.CreateOptions) (result *v1alpha1.AlloyDBInstance, err error) { - result = &v1alpha1.AlloyDBInstance{} +func (c *alloyDBInstances) Create(ctx context.Context, alloyDBInstance *v1beta1.AlloyDBInstance, opts v1.CreateOptions) (result *v1beta1.AlloyDBInstance, err error) { + result = &v1beta1.AlloyDBInstance{} err = c.client.Post(). Namespace(c.ns). Resource("alloydbinstances"). @@ -126,8 +126,8 @@ func (c *alloyDBInstances) Create(ctx context.Context, alloyDBInstance *v1alpha1 } // Update takes the representation of a alloyDBInstance and updates it. Returns the server's representation of the alloyDBInstance, and an error, if there is any. -func (c *alloyDBInstances) Update(ctx context.Context, alloyDBInstance *v1alpha1.AlloyDBInstance, opts v1.UpdateOptions) (result *v1alpha1.AlloyDBInstance, err error) { - result = &v1alpha1.AlloyDBInstance{} +func (c *alloyDBInstances) Update(ctx context.Context, alloyDBInstance *v1beta1.AlloyDBInstance, opts v1.UpdateOptions) (result *v1beta1.AlloyDBInstance, err error) { + result = &v1beta1.AlloyDBInstance{} err = c.client.Put(). Namespace(c.ns). Resource("alloydbinstances"). @@ -141,8 +141,8 @@ func (c *alloyDBInstances) Update(ctx context.Context, alloyDBInstance *v1alpha1 // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *alloyDBInstances) UpdateStatus(ctx context.Context, alloyDBInstance *v1alpha1.AlloyDBInstance, opts v1.UpdateOptions) (result *v1alpha1.AlloyDBInstance, err error) { - result = &v1alpha1.AlloyDBInstance{} +func (c *alloyDBInstances) UpdateStatus(ctx context.Context, alloyDBInstance *v1beta1.AlloyDBInstance, opts v1.UpdateOptions) (result *v1beta1.AlloyDBInstance, err error) { + result = &v1beta1.AlloyDBInstance{} err = c.client.Put(). Namespace(c.ns). Resource("alloydbinstances"). @@ -183,8 +183,8 @@ func (c *alloyDBInstances) DeleteCollection(ctx context.Context, opts v1.DeleteO } // Patch applies the patch and returns the patched alloyDBInstance. -func (c *alloyDBInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AlloyDBInstance, err error) { - result = &v1alpha1.AlloyDBInstance{} +func (c *alloyDBInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AlloyDBInstance, err error) { + result = &v1beta1.AlloyDBInstance{} err = c.client.Patch(pt). Namespace(c.ns). Resource("alloydbinstances"). diff --git a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/doc.go b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/doc.go similarity index 98% rename from pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/doc.go rename to pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/doc.go index 61f2499ab1..0bf01d15b1 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/doc.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/doc.go @@ -20,4 +20,4 @@ // Code generated by main. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1alpha1 +package v1beta1 diff --git a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/doc.go b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/doc.go similarity index 100% rename from pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/doc.go rename to pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/doc.go diff --git a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/fake_alloydb_client.go b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/fake_alloydb_client.go similarity index 70% rename from pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/fake_alloydb_client.go rename to pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/fake_alloydb_client.go index 9fd6c84ce5..a7435ddda1 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/fake_alloydb_client.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/fake_alloydb_client.go @@ -22,30 +22,30 @@ package fake import ( - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeAlloydbV1alpha1 struct { +type FakeAlloydbV1beta1 struct { *testing.Fake } -func (c *FakeAlloydbV1alpha1) AlloyDBBackups(namespace string) v1alpha1.AlloyDBBackupInterface { +func (c *FakeAlloydbV1beta1) AlloyDBBackups(namespace string) v1beta1.AlloyDBBackupInterface { return &FakeAlloyDBBackups{c, namespace} } -func (c *FakeAlloydbV1alpha1) AlloyDBClusters(namespace string) v1alpha1.AlloyDBClusterInterface { +func (c *FakeAlloydbV1beta1) AlloyDBClusters(namespace string) v1beta1.AlloyDBClusterInterface { return &FakeAlloyDBClusters{c, namespace} } -func (c *FakeAlloydbV1alpha1) AlloyDBInstances(namespace string) v1alpha1.AlloyDBInstanceInterface { +func (c *FakeAlloydbV1beta1) AlloyDBInstances(namespace string) v1beta1.AlloyDBInstanceInterface { return &FakeAlloyDBInstances{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeAlloydbV1alpha1) RESTClient() rest.Interface { +func (c *FakeAlloydbV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/fake_alloydbbackup.go b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/fake_alloydbbackup.go similarity index 73% rename from pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/fake_alloydbbackup.go rename to pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/fake_alloydbbackup.go index eb5f8762e3..aac7992b64 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/fake_alloydbbackup.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/fake_alloydbbackup.go @@ -24,7 +24,7 @@ package fake import ( "context" - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -35,29 +35,29 @@ import ( // FakeAlloyDBBackups implements AlloyDBBackupInterface type FakeAlloyDBBackups struct { - Fake *FakeAlloydbV1alpha1 + Fake *FakeAlloydbV1beta1 ns string } -var alloydbbackupsResource = schema.GroupVersionResource{Group: "alloydb.cnrm.cloud.google.com", Version: "v1alpha1", Resource: "alloydbbackups"} +var alloydbbackupsResource = schema.GroupVersionResource{Group: "alloydb.cnrm.cloud.google.com", Version: "v1beta1", Resource: "alloydbbackups"} -var alloydbbackupsKind = schema.GroupVersionKind{Group: "alloydb.cnrm.cloud.google.com", Version: "v1alpha1", Kind: "AlloyDBBackup"} +var alloydbbackupsKind = schema.GroupVersionKind{Group: "alloydb.cnrm.cloud.google.com", Version: "v1beta1", Kind: "AlloyDBBackup"} // Get takes name of the alloyDBBackup, and returns the corresponding alloyDBBackup object, and an error if there is any. -func (c *FakeAlloyDBBackups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AlloyDBBackup, err error) { +func (c *FakeAlloyDBBackups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AlloyDBBackup, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(alloydbbackupsResource, c.ns, name), &v1alpha1.AlloyDBBackup{}) + Invokes(testing.NewGetAction(alloydbbackupsResource, c.ns, name), &v1beta1.AlloyDBBackup{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBBackup), err + return obj.(*v1beta1.AlloyDBBackup), err } // List takes label and field selectors, and returns the list of AlloyDBBackups that match those selectors. -func (c *FakeAlloyDBBackups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AlloyDBBackupList, err error) { +func (c *FakeAlloyDBBackups) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.AlloyDBBackupList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(alloydbbackupsResource, alloydbbackupsKind, c.ns, opts), &v1alpha1.AlloyDBBackupList{}) + Invokes(testing.NewListAction(alloydbbackupsResource, alloydbbackupsKind, c.ns, opts), &v1beta1.AlloyDBBackupList{}) if obj == nil { return nil, err @@ -67,8 +67,8 @@ func (c *FakeAlloyDBBackups) List(ctx context.Context, opts v1.ListOptions) (res if label == nil { label = labels.Everything() } - list := &v1alpha1.AlloyDBBackupList{ListMeta: obj.(*v1alpha1.AlloyDBBackupList).ListMeta} - for _, item := range obj.(*v1alpha1.AlloyDBBackupList).Items { + list := &v1beta1.AlloyDBBackupList{ListMeta: obj.(*v1beta1.AlloyDBBackupList).ListMeta} + for _, item := range obj.(*v1beta1.AlloyDBBackupList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -84,43 +84,43 @@ func (c *FakeAlloyDBBackups) Watch(ctx context.Context, opts v1.ListOptions) (wa } // Create takes the representation of a alloyDBBackup and creates it. Returns the server's representation of the alloyDBBackup, and an error, if there is any. -func (c *FakeAlloyDBBackups) Create(ctx context.Context, alloyDBBackup *v1alpha1.AlloyDBBackup, opts v1.CreateOptions) (result *v1alpha1.AlloyDBBackup, err error) { +func (c *FakeAlloyDBBackups) Create(ctx context.Context, alloyDBBackup *v1beta1.AlloyDBBackup, opts v1.CreateOptions) (result *v1beta1.AlloyDBBackup, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(alloydbbackupsResource, c.ns, alloyDBBackup), &v1alpha1.AlloyDBBackup{}) + Invokes(testing.NewCreateAction(alloydbbackupsResource, c.ns, alloyDBBackup), &v1beta1.AlloyDBBackup{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBBackup), err + return obj.(*v1beta1.AlloyDBBackup), err } // Update takes the representation of a alloyDBBackup and updates it. Returns the server's representation of the alloyDBBackup, and an error, if there is any. -func (c *FakeAlloyDBBackups) Update(ctx context.Context, alloyDBBackup *v1alpha1.AlloyDBBackup, opts v1.UpdateOptions) (result *v1alpha1.AlloyDBBackup, err error) { +func (c *FakeAlloyDBBackups) Update(ctx context.Context, alloyDBBackup *v1beta1.AlloyDBBackup, opts v1.UpdateOptions) (result *v1beta1.AlloyDBBackup, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(alloydbbackupsResource, c.ns, alloyDBBackup), &v1alpha1.AlloyDBBackup{}) + Invokes(testing.NewUpdateAction(alloydbbackupsResource, c.ns, alloyDBBackup), &v1beta1.AlloyDBBackup{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBBackup), err + return obj.(*v1beta1.AlloyDBBackup), 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 *FakeAlloyDBBackups) UpdateStatus(ctx context.Context, alloyDBBackup *v1alpha1.AlloyDBBackup, opts v1.UpdateOptions) (*v1alpha1.AlloyDBBackup, error) { +func (c *FakeAlloyDBBackups) UpdateStatus(ctx context.Context, alloyDBBackup *v1beta1.AlloyDBBackup, opts v1.UpdateOptions) (*v1beta1.AlloyDBBackup, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(alloydbbackupsResource, "status", c.ns, alloyDBBackup), &v1alpha1.AlloyDBBackup{}) + Invokes(testing.NewUpdateSubresourceAction(alloydbbackupsResource, "status", c.ns, alloyDBBackup), &v1beta1.AlloyDBBackup{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBBackup), err + return obj.(*v1beta1.AlloyDBBackup), err } // Delete takes name of the alloyDBBackup and deletes it. Returns an error if one occurs. func (c *FakeAlloyDBBackups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(alloydbbackupsResource, c.ns, name, opts), &v1alpha1.AlloyDBBackup{}) + Invokes(testing.NewDeleteActionWithOptions(alloydbbackupsResource, c.ns, name, opts), &v1beta1.AlloyDBBackup{}) return err } @@ -129,17 +129,17 @@ func (c *FakeAlloyDBBackups) Delete(ctx context.Context, name string, opts v1.De func (c *FakeAlloyDBBackups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionAction(alloydbbackupsResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha1.AlloyDBBackupList{}) + _, err := c.Fake.Invokes(action, &v1beta1.AlloyDBBackupList{}) return err } // Patch applies the patch and returns the patched alloyDBBackup. -func (c *FakeAlloyDBBackups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AlloyDBBackup, err error) { +func (c *FakeAlloyDBBackups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AlloyDBBackup, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(alloydbbackupsResource, c.ns, name, pt, data, subresources...), &v1alpha1.AlloyDBBackup{}) + Invokes(testing.NewPatchSubresourceAction(alloydbbackupsResource, c.ns, name, pt, data, subresources...), &v1beta1.AlloyDBBackup{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBBackup), err + return obj.(*v1beta1.AlloyDBBackup), err } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/fake_alloydbcluster.go b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/fake_alloydbcluster.go similarity index 73% rename from pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/fake_alloydbcluster.go rename to pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/fake_alloydbcluster.go index 421237c11f..eec8e75e2e 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/fake_alloydbcluster.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/fake_alloydbcluster.go @@ -24,7 +24,7 @@ package fake import ( "context" - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -35,29 +35,29 @@ import ( // FakeAlloyDBClusters implements AlloyDBClusterInterface type FakeAlloyDBClusters struct { - Fake *FakeAlloydbV1alpha1 + Fake *FakeAlloydbV1beta1 ns string } -var alloydbclustersResource = schema.GroupVersionResource{Group: "alloydb.cnrm.cloud.google.com", Version: "v1alpha1", Resource: "alloydbclusters"} +var alloydbclustersResource = schema.GroupVersionResource{Group: "alloydb.cnrm.cloud.google.com", Version: "v1beta1", Resource: "alloydbclusters"} -var alloydbclustersKind = schema.GroupVersionKind{Group: "alloydb.cnrm.cloud.google.com", Version: "v1alpha1", Kind: "AlloyDBCluster"} +var alloydbclustersKind = schema.GroupVersionKind{Group: "alloydb.cnrm.cloud.google.com", Version: "v1beta1", Kind: "AlloyDBCluster"} // Get takes name of the alloyDBCluster, and returns the corresponding alloyDBCluster object, and an error if there is any. -func (c *FakeAlloyDBClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AlloyDBCluster, err error) { +func (c *FakeAlloyDBClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AlloyDBCluster, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(alloydbclustersResource, c.ns, name), &v1alpha1.AlloyDBCluster{}) + Invokes(testing.NewGetAction(alloydbclustersResource, c.ns, name), &v1beta1.AlloyDBCluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBCluster), err + return obj.(*v1beta1.AlloyDBCluster), err } // List takes label and field selectors, and returns the list of AlloyDBClusters that match those selectors. -func (c *FakeAlloyDBClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AlloyDBClusterList, err error) { +func (c *FakeAlloyDBClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.AlloyDBClusterList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(alloydbclustersResource, alloydbclustersKind, c.ns, opts), &v1alpha1.AlloyDBClusterList{}) + Invokes(testing.NewListAction(alloydbclustersResource, alloydbclustersKind, c.ns, opts), &v1beta1.AlloyDBClusterList{}) if obj == nil { return nil, err @@ -67,8 +67,8 @@ func (c *FakeAlloyDBClusters) List(ctx context.Context, opts v1.ListOptions) (re if label == nil { label = labels.Everything() } - list := &v1alpha1.AlloyDBClusterList{ListMeta: obj.(*v1alpha1.AlloyDBClusterList).ListMeta} - for _, item := range obj.(*v1alpha1.AlloyDBClusterList).Items { + list := &v1beta1.AlloyDBClusterList{ListMeta: obj.(*v1beta1.AlloyDBClusterList).ListMeta} + for _, item := range obj.(*v1beta1.AlloyDBClusterList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -84,43 +84,43 @@ func (c *FakeAlloyDBClusters) Watch(ctx context.Context, opts v1.ListOptions) (w } // Create takes the representation of a alloyDBCluster and creates it. Returns the server's representation of the alloyDBCluster, and an error, if there is any. -func (c *FakeAlloyDBClusters) Create(ctx context.Context, alloyDBCluster *v1alpha1.AlloyDBCluster, opts v1.CreateOptions) (result *v1alpha1.AlloyDBCluster, err error) { +func (c *FakeAlloyDBClusters) Create(ctx context.Context, alloyDBCluster *v1beta1.AlloyDBCluster, opts v1.CreateOptions) (result *v1beta1.AlloyDBCluster, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(alloydbclustersResource, c.ns, alloyDBCluster), &v1alpha1.AlloyDBCluster{}) + Invokes(testing.NewCreateAction(alloydbclustersResource, c.ns, alloyDBCluster), &v1beta1.AlloyDBCluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBCluster), err + return obj.(*v1beta1.AlloyDBCluster), err } // Update takes the representation of a alloyDBCluster and updates it. Returns the server's representation of the alloyDBCluster, and an error, if there is any. -func (c *FakeAlloyDBClusters) Update(ctx context.Context, alloyDBCluster *v1alpha1.AlloyDBCluster, opts v1.UpdateOptions) (result *v1alpha1.AlloyDBCluster, err error) { +func (c *FakeAlloyDBClusters) Update(ctx context.Context, alloyDBCluster *v1beta1.AlloyDBCluster, opts v1.UpdateOptions) (result *v1beta1.AlloyDBCluster, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(alloydbclustersResource, c.ns, alloyDBCluster), &v1alpha1.AlloyDBCluster{}) + Invokes(testing.NewUpdateAction(alloydbclustersResource, c.ns, alloyDBCluster), &v1beta1.AlloyDBCluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBCluster), err + return obj.(*v1beta1.AlloyDBCluster), 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 *FakeAlloyDBClusters) UpdateStatus(ctx context.Context, alloyDBCluster *v1alpha1.AlloyDBCluster, opts v1.UpdateOptions) (*v1alpha1.AlloyDBCluster, error) { +func (c *FakeAlloyDBClusters) UpdateStatus(ctx context.Context, alloyDBCluster *v1beta1.AlloyDBCluster, opts v1.UpdateOptions) (*v1beta1.AlloyDBCluster, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(alloydbclustersResource, "status", c.ns, alloyDBCluster), &v1alpha1.AlloyDBCluster{}) + Invokes(testing.NewUpdateSubresourceAction(alloydbclustersResource, "status", c.ns, alloyDBCluster), &v1beta1.AlloyDBCluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBCluster), err + return obj.(*v1beta1.AlloyDBCluster), err } // Delete takes name of the alloyDBCluster and deletes it. Returns an error if one occurs. func (c *FakeAlloyDBClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(alloydbclustersResource, c.ns, name, opts), &v1alpha1.AlloyDBCluster{}) + Invokes(testing.NewDeleteActionWithOptions(alloydbclustersResource, c.ns, name, opts), &v1beta1.AlloyDBCluster{}) return err } @@ -129,17 +129,17 @@ func (c *FakeAlloyDBClusters) Delete(ctx context.Context, name string, opts v1.D func (c *FakeAlloyDBClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionAction(alloydbclustersResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha1.AlloyDBClusterList{}) + _, err := c.Fake.Invokes(action, &v1beta1.AlloyDBClusterList{}) return err } // Patch applies the patch and returns the patched alloyDBCluster. -func (c *FakeAlloyDBClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AlloyDBCluster, err error) { +func (c *FakeAlloyDBClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AlloyDBCluster, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(alloydbclustersResource, c.ns, name, pt, data, subresources...), &v1alpha1.AlloyDBCluster{}) + Invokes(testing.NewPatchSubresourceAction(alloydbclustersResource, c.ns, name, pt, data, subresources...), &v1beta1.AlloyDBCluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBCluster), err + return obj.(*v1beta1.AlloyDBCluster), err } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/fake_alloydbinstance.go b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/fake_alloydbinstance.go similarity index 72% rename from pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/fake_alloydbinstance.go rename to pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/fake_alloydbinstance.go index aeda29ea34..1b0ddebb36 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/fake/fake_alloydbinstance.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/fake/fake_alloydbinstance.go @@ -24,7 +24,7 @@ package fake import ( "context" - v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1alpha1" + v1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/alloydb/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -35,29 +35,29 @@ import ( // FakeAlloyDBInstances implements AlloyDBInstanceInterface type FakeAlloyDBInstances struct { - Fake *FakeAlloydbV1alpha1 + Fake *FakeAlloydbV1beta1 ns string } -var alloydbinstancesResource = schema.GroupVersionResource{Group: "alloydb.cnrm.cloud.google.com", Version: "v1alpha1", Resource: "alloydbinstances"} +var alloydbinstancesResource = schema.GroupVersionResource{Group: "alloydb.cnrm.cloud.google.com", Version: "v1beta1", Resource: "alloydbinstances"} -var alloydbinstancesKind = schema.GroupVersionKind{Group: "alloydb.cnrm.cloud.google.com", Version: "v1alpha1", Kind: "AlloyDBInstance"} +var alloydbinstancesKind = schema.GroupVersionKind{Group: "alloydb.cnrm.cloud.google.com", Version: "v1beta1", Kind: "AlloyDBInstance"} // Get takes name of the alloyDBInstance, and returns the corresponding alloyDBInstance object, and an error if there is any. -func (c *FakeAlloyDBInstances) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AlloyDBInstance, err error) { +func (c *FakeAlloyDBInstances) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AlloyDBInstance, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(alloydbinstancesResource, c.ns, name), &v1alpha1.AlloyDBInstance{}) + Invokes(testing.NewGetAction(alloydbinstancesResource, c.ns, name), &v1beta1.AlloyDBInstance{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBInstance), err + return obj.(*v1beta1.AlloyDBInstance), err } // List takes label and field selectors, and returns the list of AlloyDBInstances that match those selectors. -func (c *FakeAlloyDBInstances) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AlloyDBInstanceList, err error) { +func (c *FakeAlloyDBInstances) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.AlloyDBInstanceList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(alloydbinstancesResource, alloydbinstancesKind, c.ns, opts), &v1alpha1.AlloyDBInstanceList{}) + Invokes(testing.NewListAction(alloydbinstancesResource, alloydbinstancesKind, c.ns, opts), &v1beta1.AlloyDBInstanceList{}) if obj == nil { return nil, err @@ -67,8 +67,8 @@ func (c *FakeAlloyDBInstances) List(ctx context.Context, opts v1.ListOptions) (r if label == nil { label = labels.Everything() } - list := &v1alpha1.AlloyDBInstanceList{ListMeta: obj.(*v1alpha1.AlloyDBInstanceList).ListMeta} - for _, item := range obj.(*v1alpha1.AlloyDBInstanceList).Items { + list := &v1beta1.AlloyDBInstanceList{ListMeta: obj.(*v1beta1.AlloyDBInstanceList).ListMeta} + for _, item := range obj.(*v1beta1.AlloyDBInstanceList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -84,43 +84,43 @@ func (c *FakeAlloyDBInstances) Watch(ctx context.Context, opts v1.ListOptions) ( } // Create takes the representation of a alloyDBInstance and creates it. Returns the server's representation of the alloyDBInstance, and an error, if there is any. -func (c *FakeAlloyDBInstances) Create(ctx context.Context, alloyDBInstance *v1alpha1.AlloyDBInstance, opts v1.CreateOptions) (result *v1alpha1.AlloyDBInstance, err error) { +func (c *FakeAlloyDBInstances) Create(ctx context.Context, alloyDBInstance *v1beta1.AlloyDBInstance, opts v1.CreateOptions) (result *v1beta1.AlloyDBInstance, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(alloydbinstancesResource, c.ns, alloyDBInstance), &v1alpha1.AlloyDBInstance{}) + Invokes(testing.NewCreateAction(alloydbinstancesResource, c.ns, alloyDBInstance), &v1beta1.AlloyDBInstance{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBInstance), err + return obj.(*v1beta1.AlloyDBInstance), err } // Update takes the representation of a alloyDBInstance and updates it. Returns the server's representation of the alloyDBInstance, and an error, if there is any. -func (c *FakeAlloyDBInstances) Update(ctx context.Context, alloyDBInstance *v1alpha1.AlloyDBInstance, opts v1.UpdateOptions) (result *v1alpha1.AlloyDBInstance, err error) { +func (c *FakeAlloyDBInstances) Update(ctx context.Context, alloyDBInstance *v1beta1.AlloyDBInstance, opts v1.UpdateOptions) (result *v1beta1.AlloyDBInstance, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(alloydbinstancesResource, c.ns, alloyDBInstance), &v1alpha1.AlloyDBInstance{}) + Invokes(testing.NewUpdateAction(alloydbinstancesResource, c.ns, alloyDBInstance), &v1beta1.AlloyDBInstance{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBInstance), err + return obj.(*v1beta1.AlloyDBInstance), 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 *FakeAlloyDBInstances) UpdateStatus(ctx context.Context, alloyDBInstance *v1alpha1.AlloyDBInstance, opts v1.UpdateOptions) (*v1alpha1.AlloyDBInstance, error) { +func (c *FakeAlloyDBInstances) UpdateStatus(ctx context.Context, alloyDBInstance *v1beta1.AlloyDBInstance, opts v1.UpdateOptions) (*v1beta1.AlloyDBInstance, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(alloydbinstancesResource, "status", c.ns, alloyDBInstance), &v1alpha1.AlloyDBInstance{}) + Invokes(testing.NewUpdateSubresourceAction(alloydbinstancesResource, "status", c.ns, alloyDBInstance), &v1beta1.AlloyDBInstance{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBInstance), err + return obj.(*v1beta1.AlloyDBInstance), err } // Delete takes name of the alloyDBInstance and deletes it. Returns an error if one occurs. func (c *FakeAlloyDBInstances) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(alloydbinstancesResource, c.ns, name, opts), &v1alpha1.AlloyDBInstance{}) + Invokes(testing.NewDeleteActionWithOptions(alloydbinstancesResource, c.ns, name, opts), &v1beta1.AlloyDBInstance{}) return err } @@ -129,17 +129,17 @@ func (c *FakeAlloyDBInstances) Delete(ctx context.Context, name string, opts v1. func (c *FakeAlloyDBInstances) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionAction(alloydbinstancesResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha1.AlloyDBInstanceList{}) + _, err := c.Fake.Invokes(action, &v1beta1.AlloyDBInstanceList{}) return err } // Patch applies the patch and returns the patched alloyDBInstance. -func (c *FakeAlloyDBInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AlloyDBInstance, err error) { +func (c *FakeAlloyDBInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AlloyDBInstance, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(alloydbinstancesResource, c.ns, name, pt, data, subresources...), &v1alpha1.AlloyDBInstance{}) + Invokes(testing.NewPatchSubresourceAction(alloydbinstancesResource, c.ns, name, pt, data, subresources...), &v1beta1.AlloyDBInstance{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.AlloyDBInstance), err + return obj.(*v1beta1.AlloyDBInstance), err } diff --git a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/generated_expansion.go b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/generated_expansion.go similarity index 98% rename from pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/generated_expansion.go rename to pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/generated_expansion.go index 55ef3d9bfe..32c61663e8 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1alpha1/generated_expansion.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/alloydb/v1beta1/generated_expansion.go @@ -19,7 +19,7 @@ // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1beta1 type AlloyDBBackupExpansion interface{} diff --git a/pkg/resourceskeleton/testdata/asset-skeleton.yaml b/pkg/resourceskeleton/testdata/asset-skeleton.yaml index f40a425ae5..309d242c7a 100644 --- a/pkg/resourceskeleton/testdata/asset-skeleton.yaml +++ b/pkg/resourceskeleton/testdata/asset-skeleton.yaml @@ -19,6 +19,12 @@ # not supported by asset inventory - resourceConfigId: AccessContextManagerServicePerimeter # not supported by asset inventory +- resourceConfigId: AlloyDBBackup +# not supported by asset inventory +- resourceConfigId: AlloyDBCluster +# not supported by asset inventory +- resourceConfigId: AlloyDBInstance +# not supported by asset inventory - resourceConfigId: ArtifactRegistryRepository - asset: ancestors: diff --git a/pkg/resourceskeleton/testdata/uri-skeleton.yaml b/pkg/resourceskeleton/testdata/uri-skeleton.yaml index 16170cb6d9..7c81e07a92 100644 --- a/pkg/resourceskeleton/testdata/uri-skeleton.yaml +++ b/pkg/resourceskeleton/testdata/uri-skeleton.yaml @@ -82,6 +82,15 @@ - ExpectedSkeleton: null ResourceConfigId: FirestoreIndex URI: "" +- ExpectedSkeleton: null + ResourceConfigId: AlloyDBBackup + URI: "" +- ExpectedSkeleton: null + ResourceConfigId: AlloyDBCluster + URI: "" +- ExpectedSkeleton: null + ResourceConfigId: AlloyDBInstance + URI: "" - ExpectedSkeleton: apiVersion: artifactregistry.cnrm.cloud.google.com/v1beta1 kind: ArtifactRegistryRepository diff --git a/pkg/snippet/snippetgeneration/snippetgeneration.go b/pkg/snippet/snippetgeneration/snippetgeneration.go index 1feb05df53..45cee01749 100644 --- a/pkg/snippet/snippetgeneration/snippetgeneration.go +++ b/pkg/snippet/snippetgeneration/snippetgeneration.go @@ -32,6 +32,7 @@ import ( // generation for resources that have multiple samples. It is a map of // 'resource samples directory name' -> 'sample subdirectory name'. var preferredSampleForResource = map[string]string{ + "alloydbinstance": "primary-instance", "bigqueryjob": "query-bigquery-job", "bigtableappprofile": "multicluster-bigtable-app-profile", "bigtableinstance": "replicated-instance", diff --git a/pkg/test/constants/presubmitconstants.go b/pkg/test/constants/presubmitconstants.go index 10f9ae8489..299ab4b2f9 100644 --- a/pkg/test/constants/presubmitconstants.go +++ b/pkg/test/constants/presubmitconstants.go @@ -30,6 +30,7 @@ var ( // depedencies for more resource coverage in our presubmit-lite test. RepresentativeCRUDTestsForAllServices = map[string][]string{ "accesscontextmanager": {"accesscontextmanagerserviceperimeter"}, + "alloydb": {"fullalloydbcluster"}, "apigee": {"apigeeenvironment"}, "artifactregistry": {"artifactregistryrepository"}, "bigquery": {"bigqueryjob"}, diff --git a/pkg/test/resourcefixture/contexts/alloydb_context.go b/pkg/test/resourcefixture/contexts/alloydb_context.go new file mode 100644 index 0000000000..476d7e39b8 --- /dev/null +++ b/pkg/test/resourcefixture/contexts/alloydb_context.go @@ -0,0 +1,28 @@ +// Copyright 2023 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 contexts + +func init() { + + resourceContextMap["fullalloydbbackup"] = ResourceContext{ + ResourceKind: "AlloyDBBackup", + SkipUpdate: true, + } + + resourceContextMap["basicalloydbbackup"] = ResourceContext{ + ResourceKind: "AlloyDBBackup", + SkipUpdate: true, + } +} diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/basicalloydbbackup/create.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/basicalloydbbackup/create.yaml new file mode 100644 index 0000000000..23fbae4909 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/basicalloydbbackup/create.yaml @@ -0,0 +1,25 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBBackup +metadata: + name: alloydbbackup-${uniqueId} +spec: + clusterNameRef: + name: alloydbcluster-${uniqueId} + location: us-east1 + projectRef: + external: ${projectId} + resourceID: alloydbbackup${uniqueId} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/basicalloydbbackup/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/basicalloydbbackup/dependencies.yaml new file mode 100644 index 0000000000..81300b4c4a --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/basicalloydbbackup/dependencies.yaml @@ -0,0 +1,73 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: default + annotations: + cnrm.cloud.google.com/deletion-policy: "abandon" +spec: + description: Default network for the project +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbcluster-${uniqueId} +spec: + initialUser: + password: + value: alloydb-pg + location: us-east1 + networkRef: + external: projects/${projectId}/global/networks/default + projectRef: + external: ${projectId} + resourceID: alloydbcluster${uniqueId} +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: computeaddress-${uniqueId} +spec: + location: global + addressType: INTERNAL + networkRef: + name: default + prefixLength: 16 + purpose: VPC_PEERING + resourceID: computeaddress${uniqueId} +--- +apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: servicenetworkingconnection-${uniqueId} +spec: + networkRef: + name: default + reservedPeeringRanges: + - name: computeaddress-${uniqueId} + service: servicenetworking.googleapis.com +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-${uniqueId} +spec: + clusterRef: + name: alloydbcluster-${uniqueId} + instanceType: PRIMARY + machineConfig: + cpuCount: 2 + resourceID: alloydbinstance${uniqueId} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/fullalloydbbackup/create.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/fullalloydbbackup/create.yaml new file mode 100644 index 0000000000..38e19c7046 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/fullalloydbbackup/create.yaml @@ -0,0 +1,27 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBBackup +metadata: + name: alloydbbackup-${uniqueId} +spec: + clusterName: "projects/${projectId}/locations/us-east1/clusters/alloydbcluster${uniqueId}" + location: us-east1 + encryptionConfig: + kmsKeyNameRef: + external: "projects/${projectId}/locations/us-east1/keyRings/kmskeyring-${uniqueId}/cryptoKeys/kmscryptokey-${uniqueId}" + projectRef: + external: ${projectId} + resourceID: alloydbbackup${uniqueId} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/fullalloydbbackup/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/fullalloydbbackup/dependencies.yaml new file mode 100644 index 0000000000..ee54e5fc2d --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbbackup/fullalloydbbackup/dependencies.yaml @@ -0,0 +1,118 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: default + annotations: + cnrm.cloud.google.com/deletion-policy: "abandon" +spec: + description: Default network for the project +--- +apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1 +kind: ServiceIdentity +metadata: + name: serviceidentity-${uniqueId} + annotations: + cnrm.cloud.google.com/deletion-policy: "abandon" +spec: + projectRef: + external: ${projectId} + resourceID: alloydb.googleapis.com +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbcluster-${uniqueId} +spec: + initialUser: + password: + value: alloydb-pg + location: us-east1 + networkRef: + external: projects/${projectId}/global/networks/default + projectRef: + external: ${projectId} + resourceID: alloydbcluster${uniqueId} +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: computeaddress-${uniqueId} +spec: + location: global + addressType: INTERNAL + networkRef: + name: default + prefixLength: 16 + purpose: VPC_PEERING + resourceID: computeaddress${uniqueId} +--- +apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: servicenetworkingconnection-${uniqueId} +spec: + networkRef: + name: default + reservedPeeringRanges: + - external: computeaddress${uniqueId} + service: servicenetworking.googleapis.com +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-${uniqueId} +spec: + clusterRef: + external: projects/${projectId}/locations/us-east1/clusters/alloydbcluster${uniqueId} + instanceType: PRIMARY + machineConfig: + cpuCount: 2 + resourceID: alloydbinstance${uniqueId} +--- +apiVersion: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSKeyRing +metadata: + name: kmskeyring-${uniqueId} +spec: + location: us-east1 +--- +apiVersion: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSCryptoKey +metadata: + labels: + key-one: value-one + name: kmscryptokey-${uniqueId} +spec: + keyRingRef: + name: kmskeyring-${uniqueId} +--- +apiVersion: iam.cnrm.cloud.google.com/v1beta1 +kind: IAMPolicy +metadata: + name: iampolicy-${uniqueId} +spec: + resourceRef: + apiVersion: kms.cnrm.cloud.google.com/v1beta1 + kind: KMSCryptoKey + name: kmscryptokey-${uniqueId} + bindings: + - role: roles/cloudkms.cryptoKeyEncrypterDecrypterViaDelegation + members: + - serviceAccount:service-${projectNumber}@gcp-sa-alloydb.iam.gserviceaccount.com + - role: roles/cloudkms.cryptoKeyEncrypterDecrypter + members: + - serviceAccount:service-${projectNumber}@gcp-sa-alloydb.iam.gserviceaccount.com \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/create.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/create.yaml new file mode 100644 index 0000000000..2062906dc1 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/create.yaml @@ -0,0 +1,25 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbcluster-${uniqueId} +spec: + location: us-central1 + networkRef: + external: projects/${projectId}/global/networks/default + projectRef: + external: ${projectId} + resourceID: alloydbcluster${uniqueId} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/dependencies.yaml new file mode 100644 index 0000000000..f7609e1927 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/dependencies.yaml @@ -0,0 +1,29 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#apiVersion: compute.cnrm.cloud.google.com/v1beta1 +#kind: ComputeNetwork +#metadata: +# name: computenetwork-${uniqueId} +#spec: +# resourceID: computenetwork${uniqueId} + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: default + annotations: + cnrm.cloud.google.com/deletion-policy: "abandon" +spec: + description: Default network for the project diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/update.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/update.yaml new file mode 100644 index 0000000000..49a82da28d --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/basicalloydbcluster/update.yaml @@ -0,0 +1,28 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbcluster-${uniqueId} +spec: + location: us-central1 + networkRef: + external: projects/${projectId}/global/networks/default + projectRef: + external: ${projectId} + automatedBackupPolicy: + labels: + source: kcc-test + resourceID: alloydbcluster${uniqueId} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/fullalloydbcluster/create.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/fullalloydbcluster/create.yaml new file mode 100644 index 0000000000..d7b0b6d88f --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/fullalloydbcluster/create.yaml @@ -0,0 +1,47 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbcluster-${uniqueId} +spec: + location: us-central1 + networkRef: + external: projects/${projectId}/global/networks/default + projectRef: + external: ${projectId} + + automatedBackupPolicy: + backupWindow: 7200s + enabled: true + encryptionConfig: + kmsKeyNameRef: + name: kmscryptokey-${uniqueId} + labels: + source: kcc-test + location: us-central1 + timeBasedRetention: + retentionPeriod: 86400s + weeklySchedule: + daysOfWeek: [MONDAY] + startTimes: + - hours: 4 + minutes: 0 + seconds: 0 + nanos: 0 + + encryptionConfig: + kmsKeyNameRef: + name: kmscryptokey-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/fullalloydbcluster/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/fullalloydbcluster/dependencies.yaml new file mode 100644 index 0000000000..cf71ce9f78 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/fullalloydbcluster/dependencies.yaml @@ -0,0 +1,66 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: default + annotations: + cnrm.cloud.google.com/deletion-policy: "abandon" +spec: + description: Default network for the project +--- +apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1 +kind: ServiceIdentity +metadata: + name: serviceidentity-${uniqueId} + annotations: + cnrm.cloud.google.com/deletion-policy: "abandon" +spec: + projectRef: + external: ${projectId} + resourceID: alloydb.googleapis.com +--- +apiVersion: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSKeyRing +metadata: + name: kmskeyring-${uniqueId} +spec: + location: us-central1 +--- +apiVersion: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSCryptoKey +metadata: + labels: + key-one: value-one + name: kmscryptokey-${uniqueId} +spec: + keyRingRef: + name: kmskeyring-${uniqueId} +--- +apiVersion: iam.cnrm.cloud.google.com/v1beta1 +kind: IAMPartialPolicy +metadata: + name: iampartialpolicy-${uniqueId} +spec: + resourceRef: + apiVersion: kms.cnrm.cloud.google.com/v1beta1 + kind: KMSCryptoKey + name: kmscryptokey-${uniqueId} + bindings: + - role: roles/cloudkms.cryptoKeyEncrypterDecrypter + members: + - memberFrom: + serviceIdentityRef: + name: serviceidentity-${uniqueId} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/fullalloydbcluster/update.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/fullalloydbcluster/update.yaml new file mode 100644 index 0000000000..1f03c95969 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbcluster/fullalloydbcluster/update.yaml @@ -0,0 +1,38 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbcluster-${uniqueId} +spec: + location: us-central1 + networkRef: + external: projects/${projectId}/global/networks/default + projectRef: + external: ${projectId} + + automatedBackupPolicy: + backupWindow: 3600s + enabled: true + location: us-central1 + timeBasedRetention: + retentionPeriod: 43200s + weeklySchedule: + daysOfWeek: [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY] + startTimes: + - hours: 10 + minutes: 0 + seconds: 0 + nanos: 0 \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/create.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/create.yaml new file mode 100644 index 0000000000..5783494982 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/create.yaml @@ -0,0 +1,25 @@ +# Copyright 2023 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. +# external: projects/${projectId}/locations/us-west1/clusters/alloydbcluster-${uniqueId} + +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-${uniqueId} +spec: + clusterRef: + name: alloydbcluster-${uniqueId} + instanceType: PRIMARY + machineConfig: + cpuCount: 2 \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/dependencies.yaml new file mode 100644 index 0000000000..01fa737362 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/dependencies.yaml @@ -0,0 +1,59 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: default + annotations: + cnrm.cloud.google.com/deletion-policy: "abandon" +spec: + description: Default network for the project +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbcluster-${uniqueId} +spec: + initialUser: + password: + value: alloydb-pg + location: us-west1 + networkRef: + external: projects/${projectId}/global/networks/default + projectRef: + external: ${projectId} +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: computeaddress-${uniqueId} +spec: + location: global + addressType: INTERNAL + networkRef: + name: default + prefixLength: 16 + purpose: VPC_PEERING +--- +apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: servicenetworkingconnection-${uniqueId} +spec: + networkRef: + name: default + reservedPeeringRanges: + - name: computeaddress-${uniqueId} + service: servicenetworking.googleapis.com diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/update.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/update.yaml new file mode 100644 index 0000000000..e582ef2c6a --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/basicalloydbinstance/update.yaml @@ -0,0 +1,25 @@ +# Copyright 2023 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. +# external: projects/${projectId}/locations/us-west1/clusters/alloydbcluster${uniqueId} + +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-${uniqueId} +spec: + clusterRef: + name: alloydbcluster-${uniqueId} + instanceType: PRIMARY + databaseFlags: + enable_google_adaptive_autovacuum: "off" \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/create.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/create.yaml new file mode 100644 index 0000000000..bc467c9292 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/create.yaml @@ -0,0 +1,25 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-${uniqueId} +spec: + clusterRef: + external: projects/${projectId}/locations/us-west1/clusters/alloydbcluster${uniqueId} + instanceType: PRIMARY + machineConfig: + cpuCount: 2 + resourceID: alloydbinstance${uniqueId} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/dependencies.yaml new file mode 100644 index 0000000000..3db79111b9 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/dependencies.yaml @@ -0,0 +1,61 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: default + annotations: + cnrm.cloud.google.com/deletion-policy: "abandon" +spec: + description: Default network for the project +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbcluster-${uniqueId} +spec: + initialUser: + password: + value: alloydb-pg + location: us-west1 + networkRef: + external: projects/${projectId}/global/networks/default + projectRef: + external: ${projectId} + resourceID: alloydbcluster${uniqueId} +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: computeaddress-${uniqueId} +spec: + location: global + addressType: INTERNAL + networkRef: + name: default + prefixLength: 16 + purpose: VPC_PEERING + resourceID: computeaddress${uniqueId} +--- +apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: servicenetworkingconnection-${uniqueId} +spec: + networkRef: + name: default + reservedPeeringRanges: + - external: computeaddress${uniqueId} + service: servicenetworking.googleapis.com diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/update.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/update.yaml new file mode 100644 index 0000000000..cf13fd565d --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/fullalloydbinstance/update.yaml @@ -0,0 +1,27 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-${uniqueId} +spec: + clusterRef: + external: projects/${projectId}/locations/us-west1/clusters/alloydbcluster${uniqueId} + instanceType: PRIMARY + databaseFlags: + enable_google_adaptive_autovacuum: "off" + machineConfig: + cpuCount: 4 + resourceID: alloydbinstance${uniqueId} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/create.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/create.yaml new file mode 100644 index 0000000000..3548489f44 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/create.yaml @@ -0,0 +1,27 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbreadinstance-${uniqueId} +spec: + clusterRef: + name: alloydbcluster-${uniqueId} + instanceType: READ_POOL + readPoolConfig: + nodeCount: 1 + machineConfig: + cpuCount: 2 + resourceID: alloydbreadinstance${uniqueId} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/dependencies.yaml new file mode 100644 index 0000000000..58c64ac425 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/dependencies.yaml @@ -0,0 +1,80 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# apiVersion: compute.cnrm.cloud.google.com/v1beta1 +# kind: ComputeNetwork +# metadata: +# name: default +# annotations: +# cnrm.cloud.google.com/deletion-policy: "abandon" +# spec: +# description: Default network for the project + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: computenetwork-${uniqueId} +spec: + resourceID: computenetwork${uniqueId} +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbcluster-${uniqueId} +spec: + initialUser: + password: + value: alloydb-pg + location: us-west1 + networkRef: + external: projects/${projectId}/global/networks/computenetwork${uniqueId} + projectRef: + external: ${projectId} + resourceID: alloydbcluster${uniqueId} +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: computeaddress-${uniqueId} +spec: + location: global + addressType: INTERNAL + networkRef: + name: computenetwork-${uniqueId} + prefixLength: 16 + purpose: VPC_PEERING + resourceID: computeaddress${uniqueId} +--- +apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: servicenetworkingconnection-${uniqueId} +spec: + networkRef: + name: computenetwork-${uniqueId} + reservedPeeringRanges: + - name: computeaddress-${uniqueId} + service: servicenetworking.googleapis.com +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-${uniqueId} +spec: + clusterRef: + name: alloydbcluster-${uniqueId} + instanceType: PRIMARY + machineConfig: + cpuCount: 2 + resourceID: alloydbinstance${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/update.yaml b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/update.yaml new file mode 100644 index 0000000000..4f9279fb4b --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/alloydb/v1beta1/alloydbinstance/readalloydbinstance/update.yaml @@ -0,0 +1,25 @@ +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbreadinstance-${uniqueId} +spec: + clusterRef: + name: alloydbcluster-${uniqueId} + instanceType: READ_POOL + readPoolConfig: + nodeCount: 3 + resourceID: alloydbreadinstance${uniqueId} \ No newline at end of file diff --git a/scripts/environment-setup/gcp-setup.sh b/scripts/environment-setup/gcp-setup.sh index 250361ed64..235d9fad24 100755 --- a/scripts/environment-setup/gcp-setup.sh +++ b/scripts/environment-setup/gcp-setup.sh @@ -45,20 +45,15 @@ if [[ ! $(gcloud beta container clusters list | grep ${CLUSTER_NAME}) ]]; then --workload-pool=${PROJECT_ID}.svc.id.goog fi -GCLOUD_PKG="google-cloud-sdk-gke-gcloud-auth-plugin" -if apt list $GCLOUD_PKG --installed | grep $GCLOUD_PKG; then - printf "GCloud already installed, skipping install" -else - echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \ - | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list +echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \ + | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list - curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key \ - --keyring /usr/share/keyrings/cloud.google.gpg add - +curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key \ + --keyring /usr/share/keyrings/cloud.google.gpg add - - sudo apt-get update && sudo apt-get install google-cloud-cli +sudo apt-get update && sudo apt-get install google-cloud-cli - sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin -fi +sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin # Configure kubectl to communicate with the cluster. gcloud container clusters get-credentials ${CLUSTER_NAME} diff --git a/scripts/generate-google3-docs/resource-reference/_toc.yaml b/scripts/generate-google3-docs/resource-reference/_toc.yaml index 40d2abdc04..37956a3893 100644 --- a/scripts/generate-google3-docs/resource-reference/_toc.yaml +++ b/scripts/generate-google3-docs/resource-reference/_toc.yaml @@ -21,6 +21,14 @@ toc: path: /config-connector/docs/reference/resource-docs/accesscontextmanager/accesscontextmanageraccesspolicy.md - title: "AccessContextManagerServicePerimeter" path: /config-connector/docs/reference/resource-docs/accesscontextmanager/accesscontextmanagerserviceperimeter.md +- title: "AlloyDB" + section: + - title: "AlloyDBBackup" + path: /config-connector/docs/reference/resource-docs/alloydb/alloydbbackup.md + - title: "AlloyDBCluster" + path: /config-connector/docs/reference/resource-docs/alloydb/alloydbcluster.md + - title: "AlloyDBInstance" + path: /config-connector/docs/reference/resource-docs/alloydb/alloydbinstance.md - title: "Apigee" section: - title: "ApigeeEnvironment" diff --git a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbbackup.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbbackup.md new file mode 100644 index 0000000000..fd759b4202 --- /dev/null +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbbackup.md @@ -0,0 +1,525 @@ +{# AUTOGENERATED. DO NOT EDIT. #} + +{% extends "config-connector/_base.html" %} + +{% block page_title %}AlloyDBBackup{% endblock %} +{% block body %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyValue
{{gcp_name_short}} Service NameAlloyDB for PostgreSQL
{{gcp_name_short}} Service Documentation/alloydb/docs/
{{gcp_name_short}} REST Resource Namev1.projects.locations.backups
{{gcp_name_short}} REST Resource Documentation/alloydb/docs/reference/rest/v1/projects.locations.clusters
{{product_name_short}} Resource Short Namesgcpalloydbbackup
gcpalloydbbackups
alloydbbackup
{{product_name_short}} Service Namealloydb.googleapis.com
{{product_name_short}} Resource Fully Qualified Namealloydbbackups.alloydb.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMemberNo
{{product_name_short}} Default Average Reconcile Interval In Seconds600
+ +## Custom Resource Definition Properties + + +### Annotations + + + + + + + + + + + +
Fields
cnrm.cloud.google.com/state-into-spec
+ + +### Spec +#### Schema +```yaml +clusterNameRef: + external: string + name: string + namespace: string +description: string +encryptionConfig: + kmsKeyName: string +location: string +projectRef: + external: string + name: string + namespace: string +resourceID: string +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fields
+

clusterNameRef

+

Required

+
+

object

+

{% verbatim %}The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).{% endverbatim %}

+
+

clusterNameRef.external

+

Optional

+
+

string

+

{% verbatim %}Allowed value: The `name` field of an `AlloyDBCluster` resource.{% endverbatim %}

+
+

clusterNameRef.name

+

Optional

+
+

string

+

{% verbatim %}Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names{% endverbatim %}

+
+

clusterNameRef.namespace

+

Optional

+
+

string

+

{% verbatim %}Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/{% endverbatim %}

+
+

description

+

Optional

+
+

string

+

{% verbatim %}Immutable. User-provided description of the backup.{% endverbatim %}

+
+

encryptionConfig

+

Optional

+
+

object

+

{% verbatim %}EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key).{% endverbatim %}

+
+

encryptionConfig.kmsKeyName

+

Optional

+
+

string

+

{% verbatim %}Immutable. The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].{% endverbatim %}

+
+

location

+

Required

+
+

string

+

{% verbatim %}Immutable. The location where the alloydb backup should reside.{% endverbatim %}

+
+

projectRef

+

Required

+
+

object

+

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

+
+

projectRef.external

+

Optional

+
+

string

+

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

+
+

projectRef.name

+

Optional

+
+

string

+

{% verbatim %}Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names{% endverbatim %}

+
+

projectRef.namespace

+

Optional

+
+

string

+

{% verbatim %}Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/{% endverbatim %}

+
+

resourceID

+

Optional

+
+

string

+

{% verbatim %}Immutable. Optional. The backupId of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default.{% endverbatim %}

+
+ + + +### Status +#### Schema +```yaml +conditions: +- lastTransitionTime: string + message: string + reason: string + status: string + type: string +createTime: string +encryptionInfo: +- encryptionType: string + kmsKeyVersions: + - string +etag: string +name: string +observedGeneration: integer +reconciling: boolean +state: string +uid: string +updateTime: string +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fields
conditions +

list (object)

+

{% verbatim %}Conditions represent the latest available observation of the resource'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 %}

+
createTime +

string

+

{% verbatim %}Time the Backup was created in UTC.{% endverbatim %}

+
encryptionInfo +

list (object)

+

{% verbatim %}EncryptionInfo describes the encryption information of a cluster or a backup.{% endverbatim %}

+
encryptionInfo[] +

object

+

{% verbatim %}{% endverbatim %}

+
encryptionInfo[].encryptionType +

string

+

{% verbatim %}Output only. Type of encryption.{% endverbatim %}

+
encryptionInfo[].kmsKeyVersions +

list (string)

+

{% verbatim %}Output only. Cloud KMS key versions that are being used to protect the database or the backup.{% endverbatim %}

+
encryptionInfo[].kmsKeyVersions[] +

string

+

{% verbatim %}{% endverbatim %}

+
etag +

string

+

{% verbatim %}A hash of the resource.{% endverbatim %}

+
name +

string

+

{% verbatim %}Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backupId}.{% 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 %}

+
reconciling +

boolean

+

{% verbatim %}If true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.{% endverbatim %}

+
state +

string

+

{% verbatim %}The current state of the backup.{% endverbatim %}

+
uid +

string

+

{% verbatim %}Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.{% endverbatim %}

+
updateTime +

string

+

{% verbatim %}Time the Backup was updated in UTC.{% endverbatim %}

+
+ +## Sample YAML(s) + +### Typical Use Case +```yaml +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBBackup +metadata: + name: alloydbbackup-sample +spec: + clusterNameRef: + external: "projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbbackup-dep" + location: us-central1 + encryptionConfig: + kmsKeyNameRef: + external: "projects/${PROJECT_ID?}/locations/us-central1/keyRings/alloydbbackup-dep/cryptoKeys/alloydbbackup-dep" + projectRef: + external: ${PROJECT_ID?} +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbbackup-dep +spec: + location: us-central1 + networkRef: + external: projects/${PROJECT_ID?}/global/networks/alloydbbackup-dep + projectRef: + external: ${PROJECT_ID?} +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbbackup-dep +spec: + clusterRef: + external: projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbbackup-dep + instanceType: PRIMARY +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: alloydbbackup-dep +spec: + location: global + addressType: INTERNAL + networkRef: + name: alloydbbackup-dep + prefixLength: 16 + purpose: VPC_PEERING +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: alloydbbackup-dep +--- +apiVersion: iam.cnrm.cloud.google.com/v1beta1 +kind: IAMPartialPolicy +metadata: + name: alloydbbackup-dep +spec: + resourceRef: + apiVersion: kms.cnrm.cloud.google.com/v1beta1 + kind: KMSCryptoKey + name: alloydbbackup-dep + bindings: + - role: roles/cloudkms.cryptoKeyEncrypterDecrypter + members: + - member: serviceAccount:service-${PROJECT_NUMBER?}@gcp-sa-alloydb.iam.gserviceaccount.com +--- +apiVersion: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSCryptoKey +metadata: + labels: + source: kcc-alloydbbackup-sample + name: alloydbbackup-dep +spec: + keyRingRef: + name: alloydbbackup-dep +--- +apiVersion: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSKeyRing +metadata: + name: alloydbbackup-dep +spec: + location: us-central1 +--- +apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: alloydbbackup-dep +spec: + networkRef: + name: alloydbbackup-dep + reservedPeeringRanges: + - external: alloydbbackup-dep + service: servicenetworking.googleapis.com +``` + + +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/generated/resource-docs/alloydb/alloydbcluster.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbcluster.md new file mode 100644 index 0000000000..1795e23b8f --- /dev/null +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbcluster.md @@ -0,0 +1,1252 @@ +{# AUTOGENERATED. DO NOT EDIT. #} + +{% extends "config-connector/_base.html" %} + +{% block page_title %}AlloyDBCluster{% endblock %} +{% block body %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyValue
{{gcp_name_short}} Service NameAlloyDB for PostgreSQL
{{gcp_name_short}} Service Documentation/alloydb/docs/
{{gcp_name_short}} REST Resource Namev1.projects.locations.clusters
{{gcp_name_short}} REST Resource Documentation/alloydb/docs/reference/rest/v1/projects.locations.clusters
{{product_name_short}} Resource Short Namesgcpalloydbcluster
gcpalloydbclusters
alloydbcluster
{{product_name_short}} Service Namealloydb.googleapis.com
{{product_name_short}} Resource Fully Qualified Namealloydbclusters.alloydb.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMemberNo
{{product_name_short}} Default Average Reconcile Interval In Seconds600
+ +## Custom Resource Definition Properties + + +### Annotations + + + + + + + + + + + +
Fields
cnrm.cloud.google.com/state-into-spec
+ + +### Spec +#### Schema +```yaml +automatedBackupPolicy: + backupWindow: string + enabled: boolean + encryptionConfig: + kmsKeyNameRef: + external: string + name: string + namespace: string + labels: + string: string + location: string + quantityBasedRetention: + count: integer + timeBasedRetention: + retentionPeriod: string + weeklySchedule: + daysOfWeek: + - string + startTimes: + - hours: integer + minutes: integer + nanos: integer + seconds: integer +continuousBackupConfig: + enabled: boolean + encryptionConfig: + kmsKeyNameRef: + external: string + name: string + namespace: string + recoveryWindowDays: integer +displayName: string +encryptionConfig: + kmsKeyNameRef: + external: string + name: string + namespace: string +initialUser: + password: + value: string + valueFrom: + secretKeyRef: + key: string + name: string + user: string +location: string +networkRef: + external: string + name: string + namespace: string +projectRef: + external: string + name: string + namespace: string +resourceID: string +restoreBackupSource: + backupNameRef: + external: string + name: string + namespace: string +restoreContinuousBackupSource: + clusterRef: + external: string + name: string + namespace: string + pointInTime: string +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fields
+

automatedBackupPolicy

+

Optional

+
+

object

+

{% verbatim %}The automated backup policy for this cluster. AutomatedBackupPolicy is disabled by default.{% endverbatim %}

+
+

automatedBackupPolicy.backupWindow

+

Optional

+
+

string

+

{% verbatim %}The length of the time window during which a backup can be taken. If a backup does not succeed within this time window, it will be canceled and considered failed. + +The backup window must be at least 5 minutes long. There is no upper bound on the window. If not set, it will default to 1 hour. + +A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".{% endverbatim %}

+
+

automatedBackupPolicy.enabled

+

Optional

+
+

boolean

+

{% verbatim %}Whether automated backups are enabled.{% endverbatim %}

+
+

automatedBackupPolicy.encryptionConfig

+

Optional

+
+

object

+

{% verbatim %}EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key).{% endverbatim %}

+
+

automatedBackupPolicy.encryptionConfig.kmsKeyNameRef

+

Optional

+
+

object

+

{% verbatim %}(Optional) The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].{% endverbatim %}

+
+

automatedBackupPolicy.encryptionConfig.kmsKeyNameRef.external

+

Optional

+
+

string

+

{% verbatim %}Allowed value: The `selfLink` field of a `KMSCryptoKey` resource.{% endverbatim %}

+
+

automatedBackupPolicy.encryptionConfig.kmsKeyNameRef.name

+

Optional

+
+

string

+

{% verbatim %}Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names{% endverbatim %}

+
+

automatedBackupPolicy.encryptionConfig.kmsKeyNameRef.namespace

+

Optional

+
+

string

+

{% verbatim %}Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/{% endverbatim %}

+
+

automatedBackupPolicy.labels

+

Optional

+
+

map (key: string, value: string)

+

{% verbatim %}Labels to apply to backups created using this configuration.{% endverbatim %}

+
+

automatedBackupPolicy.location

+

Optional

+
+

string

+

{% verbatim %}The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster.{% endverbatim %}

+
+

automatedBackupPolicy.quantityBasedRetention

+

Optional

+
+

object

+

{% verbatim %}Quantity-based Backup retention policy to retain recent backups. Conflicts with 'time_based_retention', both can't be set together.{% endverbatim %}

+
+

automatedBackupPolicy.quantityBasedRetention.count

+

Optional

+
+

integer

+

{% verbatim %}The number of backups to retain.{% endverbatim %}

+
+

automatedBackupPolicy.timeBasedRetention

+

Optional

+
+

object

+

{% verbatim %}Time-based Backup retention policy. Conflicts with 'quantity_based_retention', both can't be set together.{% endverbatim %}

+
+

automatedBackupPolicy.timeBasedRetention.retentionPeriod

+

Optional

+
+

string

+

{% verbatim %}The retention period. +A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".{% endverbatim %}

+
+

automatedBackupPolicy.weeklySchedule

+

Optional

+
+

object

+

{% verbatim %}Weekly schedule for the Backup.{% endverbatim %}

+
+

automatedBackupPolicy.weeklySchedule.daysOfWeek

+

Optional

+
+

list (string)

+

{% verbatim %}The days of the week to perform a backup. At least one day of the week must be provided. Possible values: ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"].{% endverbatim %}

+
+

automatedBackupPolicy.weeklySchedule.daysOfWeek[]

+

Optional

+
+

string

+

{% verbatim %}{% endverbatim %}

+
+

automatedBackupPolicy.weeklySchedule.startTimes

+

Required*

+
+

list (object)

+

{% verbatim %}The times during the day to start a backup. At least one start time must be provided. The start times are assumed to be in UTC and to be an exact hour (e.g., 04:00:00).{% endverbatim %}

+
+

automatedBackupPolicy.weeklySchedule.startTimes[]

+

Required*

+
+

object

+

{% verbatim %}{% endverbatim %}

+
+

automatedBackupPolicy.weeklySchedule.startTimes[].hours

+

Optional

+
+

integer

+

{% verbatim %}Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.{% endverbatim %}

+
+

automatedBackupPolicy.weeklySchedule.startTimes[].minutes

+

Optional

+
+

integer

+

{% verbatim %}Minutes of hour of day. Currently, only the value 0 is supported.{% endverbatim %}

+
+

automatedBackupPolicy.weeklySchedule.startTimes[].nanos

+

Optional

+
+

integer

+

{% verbatim %}Fractions of seconds in nanoseconds. Currently, only the value 0 is supported.{% endverbatim %}

+
+

automatedBackupPolicy.weeklySchedule.startTimes[].seconds

+

Optional

+
+

integer

+

{% verbatim %}Seconds of minutes of the time. Currently, only the value 0 is supported.{% endverbatim %}

+
+

continuousBackupConfig

+

Optional

+
+

object

+

{% verbatim %}The continuous backup config for this cluster. + +If no policy is provided then the default policy will be used. The default policy takes one backup a day and retains backups for 14 days.{% endverbatim %}

+
+

continuousBackupConfig.enabled

+

Optional

+
+

boolean

+

{% verbatim %}Whether continuous backup recovery is enabled. If not set, defaults to true.{% endverbatim %}

+
+

continuousBackupConfig.encryptionConfig

+

Optional

+
+

object

+

{% verbatim %}EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key).{% endverbatim %}

+
+

continuousBackupConfig.encryptionConfig.kmsKeyNameRef

+

Optional

+
+

object

+

{% verbatim %}(Optional) The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].{% endverbatim %}

+
+

continuousBackupConfig.encryptionConfig.kmsKeyNameRef.external

+

Optional

+
+

string

+

{% verbatim %}Allowed value: The `selfLink` field of a `KMSCryptoKey` resource.{% endverbatim %}

+
+

continuousBackupConfig.encryptionConfig.kmsKeyNameRef.name

+

Optional

+
+

string

+

{% verbatim %}Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names{% endverbatim %}

+
+

continuousBackupConfig.encryptionConfig.kmsKeyNameRef.namespace

+

Optional

+
+

string

+

{% verbatim %}Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/{% endverbatim %}

+
+

continuousBackupConfig.recoveryWindowDays

+

Optional

+
+

integer

+

{% verbatim %}The numbers of days that are eligible to restore from using PITR. To support the entire recovery window, backups and logs are retained for one day more than the recovery window. + +If not set, defaults to 14 days.{% endverbatim %}

+
+

displayName

+

Optional

+
+

string

+

{% verbatim %}User-settable and human-readable display name for the Cluster.{% endverbatim %}

+
+

encryptionConfig

+

Optional

+
+

object

+

{% verbatim %}EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key).{% endverbatim %}

+
+

encryptionConfig.kmsKeyNameRef

+

Optional

+
+

object

+

{% verbatim %}(Optional) The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].{% endverbatim %}

+
+

encryptionConfig.kmsKeyNameRef.external

+

Optional

+
+

string

+

{% verbatim %}Allowed value: The `selfLink` field of a `KMSCryptoKey` resource.{% endverbatim %}

+
+

encryptionConfig.kmsKeyNameRef.name

+

Optional

+
+

string

+

{% verbatim %}Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names{% endverbatim %}

+
+

encryptionConfig.kmsKeyNameRef.namespace

+

Optional

+
+

string

+

{% verbatim %}Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/{% endverbatim %}

+
+

initialUser

+

Optional

+
+

object

+

{% verbatim %}Initial user to setup during cluster creation.{% endverbatim %}

+
+

initialUser.password

+

Required*

+
+

object

+

{% verbatim %}The initial password for the user.{% endverbatim %}

+
+

initialUser.password.value

+

Optional

+
+

string

+

{% verbatim %}Value of the field. Cannot be used if 'valueFrom' is specified.{% endverbatim %}

+
+

initialUser.password.valueFrom

+

Optional

+
+

object

+

{% verbatim %}Source for the field's value. Cannot be used if 'value' is specified.{% endverbatim %}

+
+

initialUser.password.valueFrom.secretKeyRef

+

Optional

+
+

object

+

{% verbatim %}Reference to a value with the given key in the given Secret in the resource's namespace.{% endverbatim %}

+
+

initialUser.password.valueFrom.secretKeyRef.key

+

Required*

+
+

string

+

{% verbatim %}Key that identifies the value to be extracted.{% endverbatim %}

+
+

initialUser.password.valueFrom.secretKeyRef.name

+

Required*

+
+

string

+

{% verbatim %}Name of the Secret to extract a value from.{% endverbatim %}

+
+

initialUser.user

+

Optional

+
+

string

+

{% verbatim %}The database username.{% endverbatim %}

+
+

location

+

Required

+
+

string

+

{% verbatim %}Immutable. The location where the alloydb cluster should reside.{% endverbatim %}

+
+

networkRef

+

Required

+
+

object

+

{% verbatim %}Only `external` field is supported to configure the reference. + +(Required) The relative resource name of the VPC network on which +the instance can be accessed. It is specified in the following form: +projects/{projectNumber}/global/networks/{network_id}."{% endverbatim %}

+
+

networkRef.external

+

Optional

+
+

string

+

{% verbatim %}Allowed value: The `selfLink` field of a `ComputeNetwork` resource.{% endverbatim %}

+
+

networkRef.name

+

Optional

+
+

string

+

{% verbatim %}Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names{% endverbatim %}

+
+

networkRef.namespace

+

Optional

+
+

string

+

{% verbatim %}Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/{% endverbatim %}

+
+

projectRef

+

Required

+
+

object

+

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

+
+

projectRef.external

+

Optional

+
+

string

+

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

+
+

projectRef.name

+

Optional

+
+

string

+

{% verbatim %}Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names{% endverbatim %}

+
+

projectRef.namespace

+

Optional

+
+

string

+

{% verbatim %}Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/{% endverbatim %}

+
+

resourceID

+

Optional

+
+

string

+

{% verbatim %}Immutable. Optional. The clusterId of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default.{% endverbatim %}

+
+

restoreBackupSource

+

Optional

+
+

object

+

{% verbatim %}Immutable. The source when restoring from a backup. Conflicts with 'restore_continuous_backup_source', both can't be set together.{% endverbatim %}

+
+

restoreBackupSource.backupNameRef

+

Required*

+
+

object

+

{% verbatim %}(Required) The name of the backup that this cluster is restored from.{% endverbatim %}

+
+

restoreBackupSource.backupNameRef.external

+

Optional

+
+

string

+

{% verbatim %}Allowed value: The `name` field of an `AlloyDBBackup` resource.{% endverbatim %}

+
+

restoreBackupSource.backupNameRef.name

+

Optional

+
+

string

+

{% verbatim %}Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names{% endverbatim %}

+
+

restoreBackupSource.backupNameRef.namespace

+

Optional

+
+

string

+

{% verbatim %}Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/{% endverbatim %}

+
+

restoreContinuousBackupSource

+

Optional

+
+

object

+

{% verbatim %}Immutable. The source when restoring via point in time recovery (PITR). Conflicts with 'restore_backup_source', both can't be set together.{% endverbatim %}

+
+

restoreContinuousBackupSource.clusterRef

+

Required*

+
+

object

+

{% verbatim %}(Required) The name of the source cluster that this cluster is restored from.{% endverbatim %}

+
+

restoreContinuousBackupSource.clusterRef.external

+

Optional

+
+

string

+

{% verbatim %}Allowed value: The `name` field of an `AlloyDBCluster` resource.{% endverbatim %}

+
+

restoreContinuousBackupSource.clusterRef.name

+

Optional

+
+

string

+

{% verbatim %}Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names{% endverbatim %}

+
+

restoreContinuousBackupSource.clusterRef.namespace

+

Optional

+
+

string

+

{% verbatim %}Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/{% endverbatim %}

+
+

restoreContinuousBackupSource.pointInTime

+

Required*

+
+

string

+

{% verbatim %}Immutable. The point in time that this cluster is restored to, in RFC 3339 format.{% endverbatim %}

+
+ + +

{% verbatim %}* Field is required when parent field is specified{% endverbatim %}

+ + +### Status +#### Schema +```yaml +backupSource: +- backupName: string +conditions: +- lastTransitionTime: string + message: string + reason: string + status: string + type: string +continuousBackupInfo: +- earliestRestorableTime: string + enabledTime: string + encryptionInfo: + - encryptionType: string + kmsKeyVersions: + - string + schedule: + - string +databaseVersion: string +encryptionInfo: +- encryptionType: string + kmsKeyVersions: + - string +migrationSource: +- hostPort: string + referenceId: string + sourceType: string +name: string +observedGeneration: integer +uid: string +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fields
backupSource +

list (object)

+

{% verbatim %}Cluster created from backup.{% endverbatim %}

+
backupSource[] +

object

+

{% verbatim %}{% endverbatim %}

+
backupSource[].backupName +

string

+

{% verbatim %}The name of the backup resource.{% endverbatim %}

+
conditions +

list (object)

+

{% verbatim %}Conditions represent the latest available observation of the resource'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 %}

+
continuousBackupInfo +

list (object)

+

{% verbatim %}ContinuousBackupInfo describes the continuous backup properties of a cluster.{% endverbatim %}

+
continuousBackupInfo[] +

object

+

{% verbatim %}{% endverbatim %}

+
continuousBackupInfo[].earliestRestorableTime +

string

+

{% verbatim %}The earliest restorable time that can be restored to. Output only field.{% endverbatim %}

+
continuousBackupInfo[].enabledTime +

string

+

{% verbatim %}When ContinuousBackup was most recently enabled. Set to null if ContinuousBackup is not enabled.{% endverbatim %}

+
continuousBackupInfo[].encryptionInfo +

list (object)

+

{% verbatim %}Output only. The encryption information for the WALs and backups required for ContinuousBackup.{% endverbatim %}

+
continuousBackupInfo[].encryptionInfo[] +

object

+

{% verbatim %}{% endverbatim %}

+
continuousBackupInfo[].encryptionInfo[].encryptionType +

string

+

{% verbatim %}Output only. Type of encryption.{% endverbatim %}

+
continuousBackupInfo[].encryptionInfo[].kmsKeyVersions +

list (string)

+

{% verbatim %}Output only. Cloud KMS key versions that are being used to protect the database or the backup.{% endverbatim %}

+
continuousBackupInfo[].encryptionInfo[].kmsKeyVersions[] +

string

+

{% verbatim %}{% endverbatim %}

+
continuousBackupInfo[].schedule +

list (string)

+

{% verbatim %}Days of the week on which a continuous backup is taken. Output only field. Ignored if passed into the request.{% endverbatim %}

+
continuousBackupInfo[].schedule[] +

string

+

{% verbatim %}{% endverbatim %}

+
databaseVersion +

string

+

{% verbatim %}The database engine major version. This is an output-only field and it's populated at the Cluster creation time. This field cannot be changed after cluster creation.{% endverbatim %}

+
encryptionInfo +

list (object)

+

{% verbatim %}EncryptionInfo describes the encryption information of a cluster or a backup.{% endverbatim %}

+
encryptionInfo[] +

object

+

{% verbatim %}{% endverbatim %}

+
encryptionInfo[].encryptionType +

string

+

{% verbatim %}Output only. Type of encryption.{% endverbatim %}

+
encryptionInfo[].kmsKeyVersions +

list (string)

+

{% verbatim %}Output only. Cloud KMS key versions that are being used to protect the database or the backup.{% endverbatim %}

+
encryptionInfo[].kmsKeyVersions[] +

string

+

{% verbatim %}{% endverbatim %}

+
migrationSource +

list (object)

+

{% verbatim %}Cluster created via DMS migration.{% endverbatim %}

+
migrationSource[] +

object

+

{% verbatim %}{% endverbatim %}

+
migrationSource[].hostPort +

string

+

{% verbatim %}The host and port of the on-premises instance in host:port format.{% endverbatim %}

+
migrationSource[].referenceId +

string

+

{% verbatim %}Place holder for the external source identifier(e.g DMS job name) that created the cluster.{% endverbatim %}

+
migrationSource[].sourceType +

string

+

{% verbatim %}Type of migration source.{% endverbatim %}

+
name +

string

+

{% verbatim %}The name of the cluster resource.{% 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 %}

+
uid +

string

+

{% verbatim %}The system-generated UID of the resource.{% endverbatim %}

+
+ +## Sample YAML(s) + +### Typical Use Case +```yaml +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbcluster-sample +spec: + location: us-central1 + networkRef: + external: projects/${PROJECT_ID?}/global/networks/alloydbcluster-dep + projectRef: + external: ${PROJECT_ID?} + automatedBackupPolicy: + backupWindow: 3600s + encryptionConfig: + kmsKeyNameRef: + name: alloydbcluster-dep + enabled: true + labels: + source: kcc + location: us-central1 + timeBasedRetention: + retentionPeriod: 43200s + weeklySchedule: + daysOfWeek: [MONDAY] + startTimes: + - hours: 4 + minutes: 0 + seconds: 0 + nanos: 0 + encryptionConfig: + kmsKeyNameRef: + name: alloydbcluster-dep + initialUser: + user: "postgres" + password: + value: "postgres" +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: alloydbcluster-dep +spec: + location: global + addressType: INTERNAL + networkRef: + name: alloydbcluster-dep + prefixLength: 16 + purpose: VPC_PEERING +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: alloydbcluster-dep +--- +apiVersion: iam.cnrm.cloud.google.com/v1beta1 +kind: IAMPartialPolicy +metadata: + name: alloydbcluster-dep +spec: + resourceRef: + apiVersion: kms.cnrm.cloud.google.com/v1beta1 + kind: KMSCryptoKey + name: alloydbcluster-dep + bindings: + - role: roles/cloudkms.cryptoKeyEncrypterDecrypter + members: + - memberFrom: + serviceIdentityRef: + name: alloydbcluster-dep +--- +apiVersion: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSCryptoKey +metadata: + labels: + source: kcc-alloydbcluster-sample + name: alloydbcluster-dep +spec: + keyRingRef: + name: alloydbcluster-dep +--- +apiVersion: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSKeyRing +metadata: + name: alloydbcluster-dep +spec: + location: us-central1 +--- +apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: alloydbcluster-dep +spec: + networkRef: + name: alloydbcluster-dep + reservedPeeringRanges: + - external: alloydbcluster-dep + service: servicenetworking.googleapis.com +--- +apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1 +kind: ServiceIdentity +metadata: + name: alloydbcluster-dep +spec: + projectRef: + external: ${PROJECT_ID?} + resourceID: alloydb.googleapis.com +``` + + +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/generated/resource-docs/alloydb/alloydbinstance.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbinstance.md new file mode 100644 index 0000000000..159d7b10c4 --- /dev/null +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbinstance.md @@ -0,0 +1,555 @@ +{# AUTOGENERATED. DO NOT EDIT. #} + +{% extends "config-connector/_base.html" %} + +{% block page_title %}AlloyDBInstance{% endblock %} +{% block body %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyValue
{{gcp_name_short}} Service NameAlloyDB for PostgreSQL
{{gcp_name_short}} Service Documentation/alloydb/docs/
{{gcp_name_short}} REST Resource Namev1.projects.locations.clusters.instances
{{gcp_name_short}} REST Resource Documentation/alloydb/docs/reference/rest/v1/projects.locations.clusters.instances
{{product_name_short}} Resource Short Namesgcpalloydbinstance
gcpalloydbinstances
alloydbinstance
{{product_name_short}} Service Namealloydb.googleapis.com
{{product_name_short}} Resource Fully Qualified Namealloydbinstances.alloydb.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMemberNo
{{product_name_short}} Default Average Reconcile Interval In Seconds600
+ +## Custom Resource Definition Properties + + +### Annotations + + + + + + + + + + + +
Fields
cnrm.cloud.google.com/state-into-spec
+ + +### Spec +#### Schema +```yaml +annotations: + string: string +availabilityType: string +clusterRef: + external: string + name: string + namespace: string +databaseFlags: + string: string +displayName: string +gceZone: string +instanceType: string +machineConfig: + cpuCount: integer +readPoolConfig: + nodeCount: integer +resourceID: string +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fields
+

annotations

+

Optional

+
+

map (key: string, value: string)

+

{% verbatim %}Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.{% endverbatim %}

+
+

availabilityType

+

Optional

+
+

string

+

{% verbatim %}'Availability type of an Instance. Defaults to REGIONAL for both primary and read instances. +Note that primary and read instances can have different availability types. +Only READ_POOL instance supports ZONAL type. Users can't specify the zone for READ_POOL instance. +Zone is automatically chosen from the list of zones in the region specified. +Read pool of size 1 can only have zonal availability. Read pools with node count of 2 or more +can have regional availability (nodes are present in 2 or more zones in a region).' Possible values: ["AVAILABILITY_TYPE_UNSPECIFIED", "ZONAL", "REGIONAL"].{% endverbatim %}

+
+

clusterRef

+

Required

+
+

object

+

{% verbatim %}{% endverbatim %}

+
+

clusterRef.external

+

Optional

+
+

string

+

{% verbatim %}Allowed value: The `name` field of an `AlloyDBCluster` resource.{% endverbatim %}

+
+

clusterRef.name

+

Optional

+
+

string

+

{% verbatim %}Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names{% endverbatim %}

+
+

clusterRef.namespace

+

Optional

+
+

string

+

{% verbatim %}Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/{% endverbatim %}

+
+

databaseFlags

+

Optional

+
+

map (key: string, value: string)

+

{% verbatim %}Database flags. Set at instance level. * They are copied from primary instance on read instance creation. * Read instances can set new or override existing flags that are relevant for reads, e.g. for enabling columnar cache on a read instance. Flags set on read instance may or may not be present on primary.{% endverbatim %}

+
+

displayName

+

Optional

+
+

string

+

{% verbatim %}User-settable and human-readable display name for the Instance.{% endverbatim %}

+
+

gceZone

+

Optional

+
+

string

+

{% verbatim %}The Compute Engine zone that the instance should serve from, per https://cloud.google.com/compute/docs/regions-zones This can ONLY be specified for ZONAL instances. If present for a REGIONAL instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity.{% endverbatim %}

+
+

instanceType

+

Required

+
+

string

+

{% verbatim %}Immutable. The type of the instance. If the instance type is READ_POOL, provide the associated PRIMARY instance in the 'depends_on' meta-data attribute. Possible values: ["PRIMARY", "READ_POOL"].{% endverbatim %}

+
+

machineConfig

+

Optional

+
+

object

+

{% verbatim %}Configurations for the machines that host the underlying database engine.{% endverbatim %}

+
+

machineConfig.cpuCount

+

Optional

+
+

integer

+

{% verbatim %}The number of CPU's in the VM instance.{% endverbatim %}

+
+

readPoolConfig

+

Optional

+
+

object

+

{% verbatim %}Read pool specific config. If the instance type is READ_POOL, this configuration must be provided.{% endverbatim %}

+
+

readPoolConfig.nodeCount

+

Optional

+
+

integer

+

{% verbatim %}Read capacity, i.e. number of nodes in a read pool instance.{% endverbatim %}

+
+

resourceID

+

Optional

+
+

string

+

{% verbatim %}Immutable. Optional. The instanceId of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default.{% endverbatim %}

+
+ + + +### Status +#### Schema +```yaml +conditions: +- lastTransitionTime: string + message: string + reason: string + status: string + type: string +createTime: string +ipAddress: string +name: string +observedGeneration: integer +reconciling: boolean +state: string +uid: string +updateTime: string +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fields
conditions +

list (object)

+

{% verbatim %}Conditions represent the latest available observation of the resource'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 %}

+
createTime +

string

+

{% verbatim %}Time the Instance was created in UTC.{% endverbatim %}

+
ipAddress +

string

+

{% verbatim %}The IP address for the Instance. This is the connection endpoint for an end-user application.{% endverbatim %}

+
name +

string

+

{% verbatim %}The name of the instance resource.{% 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 %}

+
reconciling +

boolean

+

{% verbatim %}Set to true if the current state of Instance does not match the user's intended state, and the service is actively updating the resource to reconcile them. This can happen due to user-triggered updates or system actions like failover or maintenance.{% endverbatim %}

+
state +

string

+

{% verbatim %}The current state of the alloydb instance.{% endverbatim %}

+
uid +

string

+

{% verbatim %}The system-generated UID of the resource.{% endverbatim %}

+
updateTime +

string

+

{% verbatim %}Time the Instance was updated in UTC.{% endverbatim %}

+
+ +## Sample YAML(s) + +### Primary Instance +```yaml +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-sample-primary +spec: + clusterRef: + name: alloydbinstance-dep-primary + instanceType: PRIMARY + databaseFlags: + enable_google_adaptive_autovacuum: "off" + machineConfig: + cpuCount: 2 +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbinstance-dep-primary +spec: + location: us-central1 + networkRef: + external: projects/${PROJECT_ID?}/global/networks/alloydbinstance-dep-primary + projectRef: + external: ${PROJECT_ID?} +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: alloydbinstance-dep-primary +spec: + location: global + addressType: INTERNAL + networkRef: + name: alloydbinstance-dep-primary + prefixLength: 16 + purpose: VPC_PEERING +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: alloydbinstance-dep-primary +--- +apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: alloydbinstance-dep-primary +spec: + networkRef: + name: alloydbinstance-dep-primary + reservedPeeringRanges: + - external: alloydbinstance-dep-primary + service: servicenetworking.googleapis.com +``` + +### Read Instance +```yaml +# Copyright 2023 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: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-dep-read +spec: + clusterRef: + external: projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbinstance-dep-read + instanceType: PRIMARY +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-sample-read +spec: + clusterRef: + external: projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbinstance-dep-read + instanceType: READ_POOL + availabilityType: REGIONAL + databaseFlags: + google_columnar_engine.enabled: "on" + machineConfig: + cpuCount: 2 + readPoolConfig: + nodeCount: 3 +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbinstance-dep-read +spec: + location: us-central1 + networkRef: + external: projects/${PROJECT_ID?}/global/networks/alloydbinstance-dep-read + projectRef: + external: ${PROJECT_ID?} +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: alloydbinstance-dep-read +spec: + location: global + addressType: INTERNAL + networkRef: + name: alloydbinstance-dep-read + prefixLength: 16 + purpose: VPC_PEERING +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: alloydbinstance-dep-read +--- +apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: alloydbinstance-dep-read +spec: + networkRef: + name: alloydbinstance-dep-read + reservedPeeringRanges: + - name: alloydbinstance-dep-read + service: servicenetworking.googleapis.com +``` + + +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 9c6df17cb8..b22559f9a6 100644 --- a/scripts/generate-google3-docs/resource-reference/overview.md +++ b/scripts/generate-google3-docs/resource-reference/overview.md @@ -36,6 +36,18 @@ Custom Resource Definitions in the GitHub repository. For example, this {{acm_name}} AccessContextManagerServicePerimeter + + {{alloydb_name}} + AlloyDBBackup + + + {{alloydb_name}} + AlloyDBCluster + + + {{alloydb_name}} + AlloyDBInstance + {{ar_name}} ArtifactRegistryRepository diff --git a/scripts/generate-google3-docs/resource-reference/templates/alloydb_alloydbbackup.tmpl b/scripts/generate-google3-docs/resource-reference/templates/alloydb_alloydbbackup.tmpl new file mode 100644 index 0000000000..48362cc722 --- /dev/null +++ b/scripts/generate-google3-docs/resource-reference/templates/alloydb_alloydbbackup.tmpl @@ -0,0 +1,54 @@ +{{template "headercomment.tmpl" .}} + +{% extends "config-connector/_base.html" %} + +{% block page_title %}{{ .Kind}}{% endblock %} +{% block body %} +{{template "alphadisclaimer.tmpl" .}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{{template "iamsupport.tmpl" .}} + + + + + +
PropertyValue
{{"{{gcp_name_short}}"}} Service NameAlloyDB for PostgreSQL
{{"{{gcp_name_short}}"}} Service Documentation/alloydb/docs/
{{"{{gcp_name_short}}"}} REST Resource Namev1.projects.locations.backups
{{"{{gcp_name_short}}"}} REST Resource Documentation/alloydb/docs/reference/rest/v1/projects.locations.clusters
{{"{{product_name_short}}"}} Resource Short Names{{ .ShortNames}}
{{"{{product_name_short}}"}} Service Namealloydb.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 %} diff --git a/scripts/generate-google3-docs/resource-reference/templates/alloydb_alloydbcluster.tmpl b/scripts/generate-google3-docs/resource-reference/templates/alloydb_alloydbcluster.tmpl new file mode 100644 index 0000000000..4c2d98a991 --- /dev/null +++ b/scripts/generate-google3-docs/resource-reference/templates/alloydb_alloydbcluster.tmpl @@ -0,0 +1,54 @@ +{{template "headercomment.tmpl" .}} + +{% extends "config-connector/_base.html" %} + +{% block page_title %}{{ .Kind}}{% endblock %} +{% block body %} +{{template "alphadisclaimer.tmpl" .}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{{template "iamsupport.tmpl" .}} + + + + + +
PropertyValue
{{"{{gcp_name_short}}"}} Service NameAlloyDB for PostgreSQL
{{"{{gcp_name_short}}"}} Service Documentation/alloydb/docs/
{{"{{gcp_name_short}}"}} REST Resource Namev1.projects.locations.clusters
{{"{{gcp_name_short}}"}} REST Resource Documentation/alloydb/docs/reference/rest/v1/projects.locations.clusters
{{"{{product_name_short}}"}} Resource Short Names{{ .ShortNames}}
{{"{{product_name_short}}"}} Service Namealloydb.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 %} diff --git a/scripts/generate-google3-docs/resource-reference/templates/alloydb_alloydbinstance.tmpl b/scripts/generate-google3-docs/resource-reference/templates/alloydb_alloydbinstance.tmpl new file mode 100644 index 0000000000..3e3b75c593 --- /dev/null +++ b/scripts/generate-google3-docs/resource-reference/templates/alloydb_alloydbinstance.tmpl @@ -0,0 +1,54 @@ +{{template "headercomment.tmpl" .}} + +{% extends "config-connector/_base.html" %} + +{% block page_title %}{{ .Kind}}{% endblock %} +{% block body %} +{{template "alphadisclaimer.tmpl" .}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{{template "iamsupport.tmpl" .}} + + + + + +
PropertyValue
{{"{{gcp_name_short}}"}} Service NameAlloyDB for PostgreSQL
{{"{{gcp_name_short}}"}} Service Documentation/alloydb/docs/
{{"{{gcp_name_short}}"}} REST Resource Namev1.projects.locations.clusters.instances
{{"{{gcp_name_short}}"}} REST Resource Documentation/alloydb/docs/reference/rest/v1/projects.locations.clusters.instances
{{"{{product_name_short}}"}} Resource Short Names{{ .ShortNames}}
{{"{{product_name_short}}"}} Service Namealloydb.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 %} diff --git a/scripts/shared-vars-public.sh b/scripts/shared-vars-public.sh index 56f3c08bae..698b64d8a1 100644 --- a/scripts/shared-vars-public.sh +++ b/scripts/shared-vars-public.sh @@ -28,3 +28,64 @@ KUBEBUILDER_VERSION=2.3.1 KUBEAPISERVER_VERSION=1.21.0 KUSTOMIZE_VERSION=3.5.4 +# Supported GCP services API endpoints in Config Connector +SUPPORTED_SERVICES=( + accesscontextmanager.googleapis.com + alloydb.googleapis.com + apigee.googleapis.com + appengine.googleapis.com + artifactregistry.googleapis.com + bigquery.googleapis.com + bigtableadmin.googleapis.com + billingbudgets.googleapis.com + binaryauthorization.googleapis.com + certificatemanager.googleapis.com + cloudasset.googleapis.com + cloudbilling.googleapis.com + cloudbuild.googleapis.com + cloudidentity.googleapis.com + cloudfunctions.googleapis.com + cloudkms.googleapis.com + cloudresourcemanager.googleapis.com + cloudscheduler.googleapis.com + compute.googleapis.com + container.googleapis.com + containeranalysis.googleapis.com + datacatalog.googleapis.com + dataflow.googleapis.com + datafusion.googleapis.com + dataproc.googleapis.com + dlp.googleapis.com + dns.googleapis.com + eventarc.googleapis.com + file.googleapis.com + gkehub.googleapis.com + iap.googleapis.com + identitytoolkit.googleapis.com + krmapihosting.googleapis.com + logging.googleapis.com + monitoring.googleapis.com + memcache.googleapis.com + networkconnectivity.googleapis.com + networksecurity.googleapis.com + networkservices.googleapis.com + osconfig.googleapis.com + privateca.googleapis.com + pubsub.googleapis.com + pubsublite.googleapis.com + recaptchaenterprise.googleapis.com + redis.googleapis.com + run.googleapis.com + secretmanager.googleapis.com + servicedirectory.googleapis.com + servicenetworking.googleapis.com + sourcerepo.googleapis.com + spanner.googleapis.com + sqladmin.googleapis.com + storagetransfer.googleapis.com + vpcaccess.googleapis.com +) + +# Regex used to match long running tests cases (10m+ runtime). Any new +# long-running tests should be added to this regex in alphabetical order. +LONG_RUNNING_CRUD_TESTS_REGEX="alloydbbackup|alloydbinstance|cidrconnector|configcontrollerinstance|containercluster|containernodepool|datafusioninstance|filestorebackup|filestoreinstance|gkehubmembership|memcacheinstance|redisinstance|removedefaultnodepool|subnetconnector"