From f296c9c39f6b7fe74314d4c0cc12004736ba818d Mon Sep 17 00:00:00 2001 From: Gemma Hou Date: Mon, 30 Oct 2023 17:09:39 +0000 Subject: [PATCH 1/2] Add one more test case for Attached Cluster and fix link in doc --- .../dependencies.yaml | 2 +- .../create.yaml | 33 +++++++++++++++++++ .../dependencies.yaml | 25 ++++++++++++++ .../update.yaml | 33 +++++++++++++++++++ .../containerattachedcluster.md | 2 +- ...inerattached_containerattachedcluster.tmpl | 2 +- 6 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/create.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/dependencies.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/update.yaml diff --git a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedcluster/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedcluster/dependencies.yaml index b6749d71ff..c71925074f 100644 --- a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedcluster/dependencies.yaml +++ b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedcluster/dependencies.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# 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. diff --git a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/create.yaml b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/create.yaml new file mode 100644 index 0000000000..10b1cb25e2 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/create.yaml @@ -0,0 +1,33 @@ +# 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: containerattached.cnrm.cloud.google.com/v1beta1 +kind: ContainerAttachedCluster +metadata: + name: containerattachedcluster-${uniqueId} +spec: + # The resourceID needs to match the name of the eks cluster to be attached + resourceID: kcc-attached-cluster-upgrade + location: us-west1 + projectRef: + external: ${KCC_ATTACHED_CLUSTER_TEST_PROJECT} + description: "Test attached cluster" + distribution: "eks" + oidcConfig: + issuerUrl: https://oidc.eks.us-west-2.amazonaws.com/id/1A28F40F93F84300B727321CA0D1285B + platformVersion: 1.27.0-gke.2 + fleet: + projectRef: + name: project-${uniqueId} + deletionPolicy: "DELETE_IGNORE_ERRORS" \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/dependencies.yaml new file mode 100644 index 0000000000..c71925074f --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/dependencies.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: resourcemanager.cnrm.cloud.google.com/v1beta1 +kind: Project +metadata: + name: project-${uniqueId} + annotations: + cnrm.cloud.google.com/deletion-policy: abandon +spec: + resourceID: ${KCC_ATTACHED_CLUSTER_TEST_PROJECT} + organizationRef: + external: ${TEST_ORG_ID} + name: ${KCC_ATTACHED_CLUSTER_TEST_PROJECT} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/update.yaml b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/update.yaml new file mode 100644 index 0000000000..24010e84bc --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/update.yaml @@ -0,0 +1,33 @@ +# 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: containerattached.cnrm.cloud.google.com/v1beta1 +kind: ContainerAttachedCluster +metadata: + name: containerattachedcluster-${uniqueId} +spec: + # The resourceID needs to match the name of the eks cluster to be attached + resourceID: kcc-attached-cluster-upgrade + location: us-west1 + projectRef: + external: ${KCC_ATTACHED_CLUSTER_TEST_PROJECT} + description: "Test attached cluster update" + distribution: "eks" + oidcConfig: + issuerUrl: https://oidc.eks.us-west-2.amazonaws.com/id/1A28F40F93F84300B727321CA0D1285B + platformVersion: 1.27.0-gke.2 + fleet: + projectRef: + name: project-${uniqueId} + deletionPolicy: "DELETE_IGNORE_ERRORS" \ No newline at end of file diff --git a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/containerattached/containerattachedcluster.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/containerattached/containerattachedcluster.md index 6734b30330..62a8e1d5ce 100644 --- a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/containerattached/containerattachedcluster.md +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/containerattached/containerattachedcluster.md @@ -23,7 +23,7 @@ Note: Before using this resource, make sure you review and complete the steps in {{gcp_name_short}} Service Documentation -/anthos/clusters/docs/multi-cloud/attached +/anthos/clusters/docs/multi-cloud/attached {{gcp_name_short}} REST Resource Name diff --git a/scripts/generate-google3-docs/resource-reference/templates/containerattached_containerattachedcluster.tmpl b/scripts/generate-google3-docs/resource-reference/templates/containerattached_containerattachedcluster.tmpl index fe8373ab67..c870607249 100644 --- a/scripts/generate-google3-docs/resource-reference/templates/containerattached_containerattachedcluster.tmpl +++ b/scripts/generate-google3-docs/resource-reference/templates/containerattached_containerattachedcluster.tmpl @@ -22,7 +22,7 @@ Note: Before using this resource, make sure you review and complete the steps in {{"{{gcp_name_short}}"}} Service Documentation -/anthos/clusters/docs/multi-cloud/attached +/anthos/clusters/docs/multi-cloud/attached {{"{{gcp_name_short}}"}} REST Resource Name From 59d7386984ed0fb182a935bf7b9bd226ad7f2747 Mon Sep 17 00:00:00 2001 From: Gemma Hou Date: Wed, 1 Nov 2023 21:54:44 +0000 Subject: [PATCH 2/2] update current containerattached tests --- .../containerattachedcluster/create.yaml | 6 ++-- .../containerattachedcluster/update.yaml | 6 ++-- .../create.yaml | 33 ------------------- .../dependencies.yaml | 25 -------------- .../update.yaml | 33 ------------------- 5 files changed, 6 insertions(+), 97 deletions(-) delete mode 100644 pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/create.yaml delete mode 100644 pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/dependencies.yaml delete mode 100644 pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/update.yaml diff --git a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedcluster/create.yaml b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedcluster/create.yaml index 5cc790d7f8..a18f45e702 100644 --- a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedcluster/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedcluster/create.yaml @@ -18,15 +18,15 @@ metadata: name: containerattachedcluster-${uniqueId} spec: # The resourceID needs to match the name of the eks cluster to be attached - resourceID: kcc-attached-cluster + resourceID: kcc-attached-cluster-127 location: us-west1 projectRef: external: ${KCC_ATTACHED_CLUSTER_TEST_PROJECT} description: "Test attached cluster" distribution: "eks" oidcConfig: - issuerUrl: https://oidc.eks.us-west-2.amazonaws.com/id/17F5DD7A27C5CA2B2B626B94C0752B37 - platformVersion: 1.25.0-gke.5 + issuerUrl: https://oidc.eks.us-west-2.amazonaws.com/id/A115FE1C770C2452C75219524036FC0F + platformVersion: 1.27.0-gke.2 fleet: projectRef: name: project-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedcluster/update.yaml b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedcluster/update.yaml index 0ffcf55e2a..14440fc06e 100644 --- a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedcluster/update.yaml +++ b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedcluster/update.yaml @@ -18,15 +18,15 @@ metadata: name: containerattachedcluster-${uniqueId} spec: # The resourceID needs to match the name of the eks cluster to be attached - resourceID: kcc-attached-cluster + resourceID: kcc-attached-cluster-127 location: us-west1 projectRef: external: ${KCC_ATTACHED_CLUSTER_TEST_PROJECT} description: "Test attached cluster update" distribution: "eks" oidcConfig: - issuerUrl: https://oidc.eks.us-west-2.amazonaws.com/id/17F5DD7A27C5CA2B2B626B94C0752B37 - platformVersion: 1.25.0-gke.5 + issuerUrl: https://oidc.eks.us-west-2.amazonaws.com/id/A115FE1C770C2452C75219524036FC0F + platformVersion: 1.27.0-gke.2 fleet: projectRef: name: project-${uniqueId} diff --git a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/create.yaml b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/create.yaml deleted file mode 100644 index 10b1cb25e2..0000000000 --- a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/create.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# 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: containerattached.cnrm.cloud.google.com/v1beta1 -kind: ContainerAttachedCluster -metadata: - name: containerattachedcluster-${uniqueId} -spec: - # The resourceID needs to match the name of the eks cluster to be attached - resourceID: kcc-attached-cluster-upgrade - location: us-west1 - projectRef: - external: ${KCC_ATTACHED_CLUSTER_TEST_PROJECT} - description: "Test attached cluster" - distribution: "eks" - oidcConfig: - issuerUrl: https://oidc.eks.us-west-2.amazonaws.com/id/1A28F40F93F84300B727321CA0D1285B - platformVersion: 1.27.0-gke.2 - fleet: - projectRef: - name: project-${uniqueId} - deletionPolicy: "DELETE_IGNORE_ERRORS" \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/dependencies.yaml b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/dependencies.yaml deleted file mode 100644 index c71925074f..0000000000 --- a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/dependencies.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# 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: resourcemanager.cnrm.cloud.google.com/v1beta1 -kind: Project -metadata: - name: project-${uniqueId} - annotations: - cnrm.cloud.google.com/deletion-policy: abandon -spec: - resourceID: ${KCC_ATTACHED_CLUSTER_TEST_PROJECT} - organizationRef: - external: ${TEST_ORG_ID} - name: ${KCC_ATTACHED_CLUSTER_TEST_PROJECT} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/update.yaml b/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/update.yaml deleted file mode 100644 index 24010e84bc..0000000000 --- a/pkg/test/resourcefixture/testdata/basic/containerattached/v1beta1/containerattachedclusterupgrade/update.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# 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: containerattached.cnrm.cloud.google.com/v1beta1 -kind: ContainerAttachedCluster -metadata: - name: containerattachedcluster-${uniqueId} -spec: - # The resourceID needs to match the name of the eks cluster to be attached - resourceID: kcc-attached-cluster-upgrade - location: us-west1 - projectRef: - external: ${KCC_ATTACHED_CLUSTER_TEST_PROJECT} - description: "Test attached cluster update" - distribution: "eks" - oidcConfig: - issuerUrl: https://oidc.eks.us-west-2.amazonaws.com/id/1A28F40F93F84300B727321CA0D1285B - platformVersion: 1.27.0-gke.2 - fleet: - projectRef: - name: project-${uniqueId} - deletionPolicy: "DELETE_IGNORE_ERRORS" \ No newline at end of file