From 535e79b9b917fc1fd36d398f4ef5a572a57aa75b Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Sun, 21 Apr 2024 22:45:31 +0300 Subject: [PATCH] Fix NodePool.container example manifests - Import tests for NodePool.container are disabled because its Terraform ID is not stable, i.e., it acquires an ID in a different syntax after it's successfully imported. - Set the deletion protection for the Cluster.container dependency to false. - Git ignore kubeconfig files at the repo root. - Add BucketObject.v1beta2.storage example manifest. Signed-off-by: Alper Rifat Ulucinar --- .gitignore | 3 +- examples/container/v1beta1/nodepool.yaml | 2 ++ examples/container/v1beta2/nodepool.yaml | 8 +++-- examples/storage/v1beta2/bucketobject.yaml | 35 ++++++++++++++++++++++ go.mod | 2 +- go.sum | 4 +-- 6 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 examples/storage/v1beta2/bucketobject.yaml diff --git a/.gitignore b/.gitignore index 00d9b235d..dfdc480b9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,10 +10,11 @@ cover.out /.vendor-new .DS_Store .history +kubeconfig # ignore IDE folders .vscode/ .idea/ # packages -*.xpkg \ No newline at end of file +*.xpkg diff --git a/examples/container/v1beta1/nodepool.yaml b/examples/container/v1beta1/nodepool.yaml index 840cf17a5..d985f4c83 100644 --- a/examples/container/v1beta1/nodepool.yaml +++ b/examples/container/v1beta1/nodepool.yaml @@ -6,6 +6,7 @@ apiVersion: container.gcp.upbound.io/v1beta1 kind: NodePool metadata: annotations: + uptest.upbound.io/disable-import: "true" meta.upbound.io/example-id: container/v1beta1/nodepool labels: testing.upbound.io/example-name: nodepool @@ -40,6 +41,7 @@ spec: initialNodeCount: 1 location: us-central1-a removeDefaultNodePool: true + deletionProtection: false --- diff --git a/examples/container/v1beta2/nodepool.yaml b/examples/container/v1beta2/nodepool.yaml index f2b90783a..154b666d2 100644 --- a/examples/container/v1beta2/nodepool.yaml +++ b/examples/container/v1beta2/nodepool.yaml @@ -6,7 +6,8 @@ apiVersion: container.gcp.upbound.io/v1beta2 kind: NodePool metadata: annotations: - meta.upbound.io/example-id: container/v1beta1/nodepool + uptest.upbound.io/disable-import: "true" + meta.upbound.io/example-id: container/v1beta2/nodepool labels: testing.upbound.io/example-name: nodepool name: nodepool @@ -31,7 +32,7 @@ apiVersion: container.gcp.upbound.io/v1beta2 kind: Cluster metadata: annotations: - meta.upbound.io/example-id: container/v1beta1/cluster + meta.upbound.io/example-id: container/v1beta2/cluster labels: testing.upbound.io/example-name: nodepool name: nodepool @@ -40,6 +41,7 @@ spec: initialNodeCount: 1 location: us-central1-a removeDefaultNodePool: true + deletionProtection: false --- @@ -47,7 +49,7 @@ apiVersion: cloudplatform.gcp.upbound.io/v1beta1 kind: ServiceAccount metadata: annotations: - meta.upbound.io/example-id: container/v1beta1/nodepool + meta.upbound.io/example-id: container/v1beta2/nodepool labels: testing.upbound.io/example-name: nodepool name: nodepool diff --git a/examples/storage/v1beta2/bucketobject.yaml b/examples/storage/v1beta2/bucketobject.yaml new file mode 100644 index 000000000..076cd1365 --- /dev/null +++ b/examples/storage/v1beta2/bucketobject.yaml @@ -0,0 +1,35 @@ +# SPDX-FileCopyrightText: 2024 The Crossplane Authors +# +# SPDX-License-Identifier: CC0-1.0 + +apiVersion: storage.gcp.upbound.io/v1beta2 +kind: BucketObject +metadata: + annotations: + meta.upbound.io/example-id: storage/v1beta2/bucketobject + labels: + testing.upbound.io/example-name: bucket-object + name: bucket-object +spec: + forProvider: + bucketSelector: + matchLabels: + testing.upbound.io/example-name: bucket-object + name: bucket-object + content: "Upbound!" + contentType: text/plain + +--- + +apiVersion: storage.gcp.upbound.io/v1beta2 +kind: Bucket +metadata: + annotations: + meta.upbound.io/example-id: storage/v1beta2/bucketobject + labels: + testing.upbound.io/example-name: bucket-object + name: bucket-object-${Rand.RFC1123Subdomain} +spec: + forProvider: + location: US + storageClass: MULTI_REGIONAL diff --git a/go.mod b/go.mod index 6374c5081..a68164407 100644 --- a/go.mod +++ b/go.mod @@ -179,4 +179,4 @@ require ( sigs.k8s.io/yaml v1.4.0 // indirect ) -replace github.com/crossplane/upjet => github.com/ulucinar/upbound-upjet v0.0.0-20240421001949-b0089fb1a6d5 +replace github.com/crossplane/upjet => github.com/ulucinar/upbound-upjet v0.0.0-20240421181917-d6c4f0830109 diff --git a/go.sum b/go.sum index 08d7ccd0f..2cc56ab58 100644 --- a/go.sum +++ b/go.sum @@ -384,8 +384,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tmccombs/hcl2json v0.3.3 h1:+DLNYqpWE0CsOQiEZu+OZm5ZBImake3wtITYxQ8uLFQ= github.com/tmccombs/hcl2json v0.3.3/go.mod h1:Y2chtz2x9bAeRTvSibVRVgbLJhLJXKlUeIvjeVdnm4w= -github.com/ulucinar/upbound-upjet v0.0.0-20240421001949-b0089fb1a6d5 h1:01eG3WG4KKNOvYZIm0BlZJHKpUW41EVaR+2ItgDJU6U= -github.com/ulucinar/upbound-upjet v0.0.0-20240421001949-b0089fb1a6d5/go.mod h1:0bHLtnejZ9bDeyXuBb9MSOQLvKo3+aoTeUBO8N0dGSA= +github.com/ulucinar/upbound-upjet v0.0.0-20240421181917-d6c4f0830109 h1:O8G2Hv9g5su53VdHxhJmTT6OXHyO+sJck5yJ9W+IIEs= +github.com/ulucinar/upbound-upjet v0.0.0-20240421181917-d6c4f0830109/go.mod h1:0bHLtnejZ9bDeyXuBb9MSOQLvKo3+aoTeUBO8N0dGSA= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=