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 @@