From 554d57f9c5938ad5c9d37ecf2dc1bb7612ff4299 Mon Sep 17 00:00:00 2001 From: Edgar Garcia <63310723+edgarulg@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:01:54 -0600 Subject: [PATCH] feat(gce): support resourceManagerTags in instance template (#10146) * feat(gce): add resourceManagerTags option in config * feat(gce): add resourceManagerTags option in config * feat(gce): avoid empty tags --- .../configure/serverGroupCommandBuilder.service.js | 11 +++++++++++ .../advancedSettings.directive.html | 7 +++++++ .../advancedSettingsSelector.directive.spec.js | 2 +- yarn.lock | 13 ++++--------- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/packages/google/src/serverGroup/configure/serverGroupCommandBuilder.service.js b/packages/google/src/serverGroup/configure/serverGroupCommandBuilder.service.js index 29548845a3b..7c34e0c55bc 100644 --- a/packages/google/src/serverGroup/configure/serverGroupCommandBuilder.service.js +++ b/packages/google/src/serverGroup/configure/serverGroupCommandBuilder.service.js @@ -285,6 +285,12 @@ angular } } + function populateResourceManagerTags(instanceTemplateResourceManagerTags, command) { + if (instanceTemplateResourceManagerTags) { + Object.assign(command.resourceManagerTags, instanceTemplateResourceManagerTags); + } + } + function populateLabels(instanceTemplateLabels, command) { if (instanceTemplateLabels) { Object.assign(command.labels, instanceTemplateLabels); @@ -363,6 +369,7 @@ angular instanceMetadata: {}, tags: [], labels: {}, + resourceManagerTags: {}, enableSecureBoot: false, enableVtpm: false, enableIntegrityMonitoring: false, @@ -441,6 +448,7 @@ angular instanceMetadata: {}, tags: [], labels: {}, + resourceManagerTags: {}, availabilityZones: [], enableSecureBoot: serverGroup.enableSecureBoot, enableVtpm: serverGroup.enableVtpm, @@ -574,6 +582,9 @@ angular extendedCommand.tags = []; populateTags(instanceTemplateTags, extendedCommand); + const resourceManagerTags = extendedCommand.resourceManagerTags; + populateResourceManagerTags(resourceManagerTags, extendedCommand); + return extendedCommand; }); }); diff --git a/packages/google/src/serverGroup/configure/wizard/advancedSettings/advancedSettings.directive.html b/packages/google/src/serverGroup/configure/wizard/advancedSettings/advancedSettings.directive.html index bd0bed64bd5..53c505a0200 100644 --- a/packages/google/src/serverGroup/configure/wizard/advancedSettings/advancedSettings.directive.html +++ b/packages/google/src/serverGroup/configure/wizard/advancedSettings/advancedSettings.directive.html @@ -87,6 +87,13 @@ +
+
+ Resource Manager Tags + +
+ +
Shielded VMs diff --git a/packages/google/src/serverGroup/configure/wizard/advancedSettings/advancedSettingsSelector.directive.spec.js b/packages/google/src/serverGroup/configure/wizard/advancedSettings/advancedSettingsSelector.directive.spec.js index c7e4815284d..a9f5e902b3d 100644 --- a/packages/google/src/serverGroup/configure/wizard/advancedSettings/advancedSettingsSelector.directive.spec.js +++ b/packages/google/src/serverGroup/configure/wizard/advancedSettings/advancedSettingsSelector.directive.spec.js @@ -18,7 +18,7 @@ describe('Directive: GCE Group Advanced Settings Selector', function () { ); this.gceTagManager = gceTagManager; this.scope = $rootScope.$new(); - this.scope.command = { instanceMetadata: [], tags: [], labels: [], authScopes: [] }; + this.scope.command = { instanceMetadata: [], tags: [], labels: [], authScopes: [], resourceManagerTags: [] }; this.elem = angular.element( '', ); diff --git a/yarn.lock b/yarn.lock index 3fc590fc47a..908977fe948 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5828,15 +5828,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001248: - version "1.0.30001251" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001251.tgz#6853a606ec50893115db660f82c094d18f096d85" - integrity sha512-HOe1r+9VkU4TFmnU70z+r7OLmtR+/chB1rdcJUeQlAinjEeb0cKL20tlAtOagNZhbrtLnCvV19B4FmF1rgzl6A== - -caniuse-lite@^1.0.30001370, caniuse-lite@^1.0.30001373: - version "1.0.30001373" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001373.tgz#2dc3bc3bfcb5d5a929bec11300883040d7b4b4be" - integrity sha512-pJYArGHrPp3TUqQzFYRmP/lwJlj8RCbVe3Gd3eJQkAV8SAC6b19XS9BjMvRdvaS8RMkaTN8ZhoHP6S1y8zzwEQ== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001248, caniuse-lite@^1.0.30001370, caniuse-lite@^1.0.30001373: + version "1.0.30001662" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001662.tgz" + integrity sha512-sgMUVwLmGseH8ZIrm1d51UbrhqMCH3jvS7gF/M6byuHOnKyLOBL7W8yz5V02OHwgLGA36o/AFhWzzh4uc5aqTA== capital-case@^1.0.4: version "1.0.4"