Skip to content
This repository was archived by the owner on Oct 2, 2025. It is now read-only.

Commit 638ef9a

Browse files
committed
feat(gce): add resourceManagerTags in input
1 parent f86151c commit 638ef9a

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/deploy/GCEUtil.groovy

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,10 @@ class GCEUtil {
827827
return new Tags(items: tagsList)
828828
}
829829

830+
static Map<String, String> buildResourceManagerTagsFromMap(Map<String, String> tagsMap) {
831+
return tagsMap
832+
}
833+
830834

831835
static Autoscaler buildAutoscaler(String serverGroupName,
832836
String targetLink,
@@ -938,23 +942,23 @@ class GCEUtil {
938942
return scheduling
939943
}
940944

941-
static ShieldedVmConfig buildShieldedVmConfig(BaseGoogleInstanceDescription description) {
942-
def shieldedVmConfig = new ShieldedVmConfig()
943-
944-
if (description.enableSecureBoot != null) {
945-
shieldedVmConfig.enableSecureBoot = description.enableSecureBoot
946-
}
947-
948-
if (description.enableVtpm != null) {
949-
shieldedVmConfig.enableVtpm = description.enableVtpm
950-
}
951-
952-
if (description.enableIntegrityMonitoring != null) {
953-
shieldedVmConfig.enableIntegrityMonitoring = description.enableIntegrityMonitoring
954-
}
955-
956-
return shieldedVmConfig
957-
}
945+
// static ShieldedVmConfig buildShieldedVmConfig(BaseGoogleInstanceDescription description) {
946+
// def shieldedVmConfig = new ShieldedVmConfig()
947+
//
948+
// if (description.enableSecureBoot != null) {
949+
// shieldedVmConfig.enableSecureBoot = description.enableSecureBoot
950+
// }
951+
//
952+
// if (description.enableVtpm != null) {
953+
// shieldedVmConfig.enableVtpm = description.enableVtpm
954+
// }
955+
//
956+
// if (description.enableIntegrityMonitoring != null) {
957+
// shieldedVmConfig.enableIntegrityMonitoring = description.enableIntegrityMonitoring
958+
// }
959+
//
960+
// return shieldedVmConfig
961+
// }
958962

959963
static void updateStatusAndThrowNotFoundException(String errorMsg, Task task, String phase) {
960964
task.updateStatus phase, errorMsg

clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/deploy/description/BaseGoogleInstanceDescription.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class BaseGoogleInstanceDescription extends AbstractGoogleCredentialsDescription
6868

6969
String accountName
7070

71+
Map<String, String> resourceManagerTags
72+
7173
// The source of the image to deploy
7274
// ARTIFACT: An artifact of type gce/image stored in imageArtifact
7375
// STRING: A string representing a GCE image name in the current

clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/deploy/handlers/BasicGoogleDeployHandler.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ class BasicGoogleDeployHandler implements DeployHandler<BasicGoogleDeployDescrip
415415
checkArgument(!description.regional || description.selectZones,
416416
"Accelerators are only supported with regional server groups if the zones are specified by the user.");
417417
}
418+
def resourceManagerTags = GCEUtil.buildResourceManagerTagsFromMap(description.resourceManagerTags)
418419

419420
def instanceProperties = new InstanceProperties(machineType: machineTypeName,
420421
disks: attachedDisks,
@@ -425,7 +426,8 @@ class BasicGoogleDeployHandler implements DeployHandler<BasicGoogleDeployDescrip
425426
tags: tags,
426427
labels: labels,
427428
scheduling: scheduling,
428-
serviceAccounts: serviceAccount)
429+
serviceAccounts: serviceAccount,
430+
resourceManagerTags: resourceManagerTags)
429431

430432
if (GCEUtil.isShieldedVmCompatible(bootImage)) {
431433
def shieldedVmConfig = GCEUtil.buildShieldedVmConfig(description)

0 commit comments

Comments
 (0)