Skip to content

Commit

Permalink
feat(gce): support resourceManagerTags in instance template (#10146)
Browse files Browse the repository at this point in the history
* feat(gce): add resourceManagerTags option in config

* feat(gce): add resourceManagerTags option in config

* feat(gce): avoid empty tags
  • Loading branch information
edgarulg authored Sep 27, 2024
1 parent 08b95df commit 554d57f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -363,6 +369,7 @@ angular
instanceMetadata: {},
tags: [],
labels: {},
resourceManagerTags: {},
enableSecureBoot: false,
enableVtpm: false,
enableIntegrityMonitoring: false,
Expand Down Expand Up @@ -441,6 +448,7 @@ angular
instanceMetadata: {},
tags: [],
labels: {},
resourceManagerTags: {},
availabilityZones: [],
enableSecureBoot: serverGroup.enableSecureBoot,
enableVtpm: serverGroup.enableVtpm,
Expand Down Expand Up @@ -574,6 +582,9 @@ angular
extendedCommand.tags = [];
populateTags(instanceTemplateTags, extendedCommand);

const resourceManagerTags = extendedCommand.resourceManagerTags;
populateResourceManagerTags(resourceManagerTags, extendedCommand);

return extendedCommand;
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@
</div>
<map-editor model="vm.command.labels" add-button-label="Add New Label" allow-empty="true"></map-editor>
</div>
<div class="form-group">
<div class="sm-label-left">
<b>Resource Manager Tags</b>
<help-field key="gce.serverGroup.resourceManagerTags"></help-field>
</div>
<map-editor model="vm.command.resourceManagerTags" add-button-label="Add New Tag" allow-empty="false"></map-editor>
</div>
<div class="form-group">
<div class="sm-label-left">
Shielded VMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
'<gce-server-group-advanced-settings-selector command="command"></gce-server-group-advanced-settings-selector>',
);
Expand Down
13 changes: 4 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 554d57f

Please sign in to comment.