Skip to content

Commit f004f42

Browse files
authored
Merge pull request #17826 from hakman/fix-cloud-labels
kubetest2: Fix cloud-labels for non-Azure providers
2 parents b9b5481 + a801010 commit f004f42

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

tests/e2e/kubetest2-kops/deployer/deployer.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ type deployer struct {
7979
SSHPublicKeyPath string `flag:"ssh-public-key" desc:"The path to the public key passed to the cloud provider"`
8080
SSHUser string `flag:"ssh-user" desc:"The SSH user to use for SSH access to instances"`
8181

82-
Tags []string `flag:"tags" desc:"Tags to apply to the cluster resources in key=value format"`
83-
8482
TerraformVersion string `flag:"terraform-version" desc:"The version of terraform to use for applying the cluster"`
8583

8684
ArtifactsDir string `flag:"-"`
@@ -143,12 +141,6 @@ func New(opts types.Options) (types.Deployer, *pflag.FlagSet) {
143141
BoskosResourceType: "gce-project",
144142
BoskosAcquireTimeout: 5 * time.Minute,
145143
BoskosHeartbeatInterval: 5 * time.Minute,
146-
Tags: []string{
147-
"group=sig-cluster-lifecycle",
148-
"subproject=kops",
149-
// Ensure https://github.com/Azure/rg-cleanup deletes removes resources
150-
"creationTimestamp=" + time.Now().Format(time.RFC3339),
151-
},
152144
}
153145
dir, err := defaultArtifactsDir()
154146
if err != nil {

tests/e2e/kubetest2-kops/deployer/up.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@ func (d *deployer) createCluster(zones []string, adminAccess string, yes bool) e
175175
args = append(args, "--yes")
176176
}
177177

178+
tags := []string{
179+
"group=sig-cluster-lifecycle",
180+
"subproject=kops",
181+
}
182+
if d.CloudProvider == "azure" {
183+
// Ensure https://github.com/Azure/rg-cleanup deletes removes resources
184+
tags = append(tags, "creationTimestamp="+time.Now().Format(time.RFC3339))
185+
}
186+
args = appendIfUnset(args, "--cloud-labels", strings.Join(tags, ","))
187+
178188
isArm := false
179189
if d.CreateArgs != "" {
180190
if strings.Contains(d.CreateArgs, "arm64") {
@@ -186,7 +196,6 @@ func (d *deployer) createCluster(zones []string, adminAccess string, yes bool) e
186196
}
187197
args = append(args, createArgs...)
188198
}
189-
args = appendIfUnset(args, "--cloud-labels", strings.Join(d.Tags, ","))
190199
args = appendIfUnset(args, "--admin-access", adminAccess)
191200

192201
// Dont set --master-count if either --control-plane-count or --master-count

0 commit comments

Comments
 (0)