Skip to content

Commit 433fc5a

Browse files
committed
add tags to vSphere provider spec builder
1 parent 1681225 commit 433fc5a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

testutils/resourcebuilder/machine/v1beta1/vsphere_provider_spec.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ type VSphereProviderSpecBuilder struct {
4242
failureDomainName string
4343
infrastructure *configv1.Infrastructure
4444
ippool bool
45+
tags []string
4546
}
4647

4748
// Build builds a new VSphere machine config based on the configuration provided.
@@ -122,6 +123,7 @@ func (v VSphereProviderSpecBuilder) Build() *machinev1beta1.VSphereMachineProvid
122123
Network: machinev1beta1.NetworkSpec{
123124
Devices: networkDevices,
124125
},
126+
TagIDs: v.tags,
125127
Workspace: workspace,
126128
NumCPUs: 4,
127129
Template: template,
@@ -164,6 +166,12 @@ func (v VSphereProviderSpecBuilder) WithTemplate(template string) VSphereProvide
164166
return v
165167
}
166168

169+
// WithTags sets the tags for the VSphere machine config builder.
170+
func (v VSphereProviderSpecBuilder) WithTags(tags []string) VSphereProviderSpecBuilder {
171+
v.tags = tags
172+
return v
173+
}
174+
167175
// WithZone sets the zone for the VSphere machine config builder.
168176
func (v VSphereProviderSpecBuilder) WithZone(zone string) VSphereProviderSpecBuilder {
169177
v.failureDomainName = zone

0 commit comments

Comments
 (0)