Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the namespace_labels field to the GKE Hub Scope resource #9972

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions mmv1/products/gkehub2/Scope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ properties:
- :READY
- :DELETING
- :UPDATING
- !ruby/object:Api::Type::KeyValuePairs
name: 'namespaceLabels'
description: |
Scope-level cluster namespace labels. For the member clusters bound
to the Scope, these labels are applied to each namespace under the
Scope. Scope-level labels take precedence over Namespace-level
labels (`namespace_labels` in the Fleet Namespace resource) if they
share a key. Keys and values must be Kubernetes-conformant.
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: |
Expand Down
5 changes: 5 additions & 0 deletions mmv1/templates/terraform/examples/gkehub_scope_basic.tf.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
resource "google_gke_hub_scope" "<%= ctx[:primary_resource_id] %>" {
scope_id = "<%= ctx[:vars]['resource_name'] %>"
namespace_labels = {
keyb = "valueb"
keya = "valuea"
keyc = "valuec"
}
labels = {
keyb = "valueb"
keya = "valuea"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ func testAccGKEHub2Scope_gkehubScopeBasicExample_basic(context map[string]interf
return acctest.Nprintf(`
resource "google_gke_hub_scope" "scope" {
scope_id = "tf-test-scope%{random_suffix}"
namespace_labels = {
keyb = "valueb"
keya = "valuea"
keyc = "valuec"
}
labels = {
keyb = "valueb"
keya = "valuea"
Expand All @@ -60,6 +65,11 @@ func testAccGKEHub2Scope_gkehubScopeBasicExample_update(context map[string]inter
return acctest.Nprintf(`
resource "google_gke_hub_scope" "scope" {
scope_id = "tf-test-scope%{random_suffix}"
namespace_labels = {
updated_keyb = "updated_valueb"
updated_keya = "updated_valuea"
updated_keyc = "updated_valuec"
}
labels = {
updated_keyb = "updated_valueb"
updated_keya = "updated_valuea"
Expand Down
Loading