Skip to content

Commit d6fcbb7

Browse files
committed
Added AWS dedicated host tests
1 parent f83229a commit d6fcbb7

File tree

9 files changed

+113
-30
lines changed

9 files changed

+113
-30
lines changed

pkg/conversion/capi2mapi/aws_fuzz_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
conversiontest "github.com/openshift/cluster-capi-operator/pkg/conversion/test/fuzz"
3030

3131
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
32+
"k8s.io/utils/ptr"
3233
awsv1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
3334
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
3435
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -158,6 +159,7 @@ func awsMachineFuzzerFuncs(codecs runtimeserializer.CodecFactory) []interface{}
158159

159160
fuzzAWSMachineSpecTenancy(&spec.Tenancy, c)
160161
fuzzAWSMachineSpecMarketType(&spec.MarketType, c)
162+
fuzzAWSMachineSpecHostPlacement(spec, c)
161163

162164
// Fields not required for our use case can be ignored.
163165
spec.ImageLookupFormat = ""
@@ -206,6 +208,18 @@ func fuzzAWSMachineSpecMarketType(marketType *awsv1.MarketType, c randfill.Conti
206208
}
207209
}
208210

211+
func fuzzAWSMachineSpecHostPlacement(spec *awsv1.AWSMachineSpec, c randfill.Continue) {
212+
switch c.Int31n(3) {
213+
case 0:
214+
spec.HostAffinity = nil
215+
case 1:
216+
spec.HostAffinity = ptr.To("default")
217+
case 2:
218+
spec.HostAffinity = ptr.To("host")
219+
spec.HostID = ptr.To("h-0123456789abcdef0")
220+
}
221+
}
222+
209223
func awsMachineTemplateFuzzerFuncs(codecs runtimeserializer.CodecFactory) []interface{} {
210224
return []interface{}{
211225
func(m *awsv1.AWSMachineTemplate, c randfill.Continue) {

pkg/conversion/capi2mapi/aws_test.go

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,33 @@ var _ = Describe("capi2mapi AWS conversion", func() {
6969
expectedErrors: []string{},
7070
expectedWarnings: []string{},
7171
}),
72+
Entry("With HostAffinity default", awsCAPI2MAPIMachineConversionInput{
73+
awsClusterBuilder: awsCAPIAWSClusterBase,
74+
awsMachineBuilder: awsCAPIAWSMachineBase.
75+
WithHostAffinity(ptr.To("default")),
76+
machineBuilder: awsCAPIMachineBase,
77+
expectedErrors: []string{},
78+
expectedWarnings: []string{},
79+
}),
80+
Entry("With HostAffinity host and HostID", awsCAPI2MAPIMachineConversionInput{
81+
awsClusterBuilder: awsCAPIAWSClusterBase,
82+
awsMachineBuilder: awsCAPIAWSMachineBase.
83+
WithHostAffinity(ptr.To("host")).
84+
WithHostID(ptr.To("h-1234567890abcdef0")),
85+
machineBuilder: awsCAPIMachineBase,
86+
expectedErrors: []string{},
87+
expectedWarnings: []string{},
88+
}),
89+
Entry("With unsupported HostAffinity", awsCAPI2MAPIMachineConversionInput{
90+
awsClusterBuilder: awsCAPIAWSClusterBase,
91+
awsMachineBuilder: awsCAPIAWSMachineBase.
92+
WithHostAffinity(ptr.To("unsupported")),
93+
machineBuilder: awsCAPIMachineBase,
94+
expectedErrors: []string{
95+
"spec.hostAffinity: Invalid value: \"unsupported\": unable to convert hostAffinity, unknown value",
96+
},
97+
expectedWarnings: []string{},
98+
}),
7299
Entry("With unsupported EKSOptimizedLookupType", awsCAPI2MAPIMachineConversionInput{
73100
awsClusterBuilder: awsCAPIAWSClusterBase,
74101
awsMachineBuilder: capabuilder.AWSMachine().
@@ -108,7 +135,7 @@ var _ = Describe("capi2mapi AWS conversion", func() {
108135
awsClusterBuilder: awsCAPIAWSClusterBase,
109136
awsMachineBuilder: awsCAPIAWSMachineBase.WithSecurityGroupOverrides(map[awsv1.SecurityGroupRole]string{"sg-1": "sg-2"}),
110137
machineBuilder: awsCAPIMachineBase,
111-
expectedErrors: []string{"spec.securityGroupOverrides: Invalid value: map[v1beta2.SecurityGroupRole]string{\"sg-1\":\"sg-2\"}: securityGroupOverrides are not supported"},
138+
expectedErrors: []string{"spec.securityGroupOverrides: Invalid value: {\"sg-1\":\"sg-2\"}: securityGroupOverrides are not supported"},
112139
expectedWarnings: []string{},
113140
}),
114141

@@ -117,7 +144,7 @@ var _ = Describe("capi2mapi AWS conversion", func() {
117144
awsMachineBuilder: awsCAPIAWSMachineBase.
118145
WithNetworkInterfaces([]string{"eni-12345", "eni-67890"}),
119146
machineBuilder: awsCAPIMachineBase,
120-
expectedErrors: []string{"spec.networkInterfaces: Invalid value: []string{\"eni-12345\", \"eni-67890\"}: networkInterfaces are not supported"},
147+
expectedErrors: []string{"spec.networkInterfaces: Invalid value: [\"eni-12345\",\"eni-67890\"]: networkInterfaces are not supported"},
121148
expectedWarnings: []string{},
122149
}),
123150

@@ -141,15 +168,15 @@ var _ = Describe("capi2mapi AWS conversion", func() {
141168
awsClusterBuilder: awsCAPIAWSClusterBase,
142169
awsMachineBuilder: awsCAPIAWSMachineBase.WithCloudInit(awsv1.CloudInit{InsecureSkipSecretsManager: true}),
143170
machineBuilder: awsCAPIMachineBase,
144-
expectedErrors: []string{"spec.cloudInit: Invalid value: v1beta2.CloudInit{InsecureSkipSecretsManager:true, SecretCount:0, SecretPrefix:\"\", SecureSecretsBackend:\"\"}: cloudInit is not supported"},
171+
expectedErrors: []string{"spec.cloudInit: Invalid value: {\"insecureSkipSecretsManager\":true}: cloudInit is not supported"},
145172
expectedWarnings: []string{},
146173
}),
147174

148175
Entry("With unsupported PrivateDNSName", awsCAPI2MAPIMachineConversionInput{
149176
awsClusterBuilder: awsCAPIAWSClusterBase,
150177
awsMachineBuilder: awsCAPIAWSMachineBase.WithPrivateDNSName(&awsv1.PrivateDNSName{}),
151178
machineBuilder: awsCAPIMachineBase,
152-
expectedErrors: []string{"spec.privateDNSName: Invalid value: v1beta2.PrivateDNSName{EnableResourceNameDNSAAAARecord:(*bool)(nil), EnableResourceNameDNSARecord:(*bool)(nil), HostnameType:(*string)(nil)}: privateDNSName is not supported"},
179+
expectedErrors: []string{"spec.privateDNSName: Invalid value: {}: privateDNSName is not supported"},
153180
expectedWarnings: []string{},
154181
}),
155182

@@ -160,7 +187,7 @@ var _ = Describe("capi2mapi AWS conversion", func() {
160187
Proxy: &awsv1.IgnitionProxy{},
161188
}),
162189
machineBuilder: awsCAPIMachineBase,
163-
expectedErrors: []string{"spec.ignition.proxy: Invalid value: v1beta2.IgnitionProxy{HTTPProxy:(*string)(nil), HTTPSProxy:(*string)(nil), NoProxy:[]v1beta2.IgnitionNoProxy(nil)}: ignition proxy is not supported"},
190+
expectedErrors: []string{"spec.ignition.proxy: Invalid value: {}: ignition proxy is not supported"},
164191
expectedWarnings: []string{},
165192
}),
166193

@@ -173,7 +200,7 @@ var _ = Describe("capi2mapi AWS conversion", func() {
173200
},
174201
}),
175202
machineBuilder: awsCAPIMachineBase,
176-
expectedErrors: []string{"spec.ignition.tls: Invalid value: v1beta2.IgnitionTLS{CASources:[]v1beta2.IgnitionCASource{\"a\", \"b\"}}: ignition tls is not supported"},
203+
expectedErrors: []string{"spec.ignition.tls: Invalid value: {\"certificateAuthorities\":[\"a\",\"b\"]}: ignition tls is not supported"},
177204
expectedWarnings: []string{},
178205
}),
179206
Entry("With unsupported httpEndpoint", awsCAPI2MAPIMachineConversionInput{

pkg/conversion/capi2mapi/machine_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,17 @@ var _ = Describe("capi2mapi Machine conversion", func() {
7474
}),
7575
Entry("With unsupported NodeDrainTimeout", capi2MAPIMachineConversionInput{
7676
machineBuilder: capiMachineBase.WithNodeDrainTimeout(ptr.To(metav1.Duration{Duration: 1 * time.Second})),
77-
expectedErrors: []string{"spec.nodeDrainTimeout: Invalid value: v1.Duration{Duration:1000000000}: nodeDrainTimeout is not supported"},
77+
expectedErrors: []string{"spec.nodeDrainTimeout: Invalid value: \"1s\": nodeDrainTimeout is not supported"},
7878
expectedWarnings: []string{},
7979
}),
8080
Entry("With unsupported NodeVolumeDetachTimeout", capi2MAPIMachineConversionInput{
8181
machineBuilder: capiMachineBase.WithNodeVolumeDetachTimeout(ptr.To(metav1.Duration{Duration: 1 * time.Second})),
82-
expectedErrors: []string{"spec.nodeVolumeDetachTimeout: Invalid value: v1.Duration{Duration:1000000000}: nodeVolumeDetachTimeout is not supported"},
82+
expectedErrors: []string{"spec.nodeVolumeDetachTimeout: Invalid value: \"1s\": nodeVolumeDetachTimeout is not supported"},
8383
expectedWarnings: []string{},
8484
}),
8585
Entry("With unsupported NodeDeletionTimeout", capi2MAPIMachineConversionInput{
8686
machineBuilder: capiMachineBase.WithNodeDeletionTimeout(ptr.To(metav1.Duration{Duration: 1 * time.Second})),
87-
expectedErrors: []string{"spec.nodeDeletionTimeout: Invalid value: v1.Duration{Duration:1000000000}: nodeDeletionTimeout is not supported"},
87+
expectedErrors: []string{"spec.nodeDeletionTimeout: Invalid value: \"1s\": nodeDeletionTimeout is not supported"},
8888
expectedWarnings: []string{},
8989
}),
9090
Entry("With delete-machine annotation", capi2MAPIMachineConversionInput{

pkg/conversion/capi2mapi/openstack_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ var _ = Describe("capi2mapi OpenStack conversion", func() {
118118
),
119119
machineBuilder: openstackCAPIMachineBase,
120120
expectedErrors: []string{
121-
"spec.image.imageRef: Invalid value: v1beta1.ResourceReference{Name:\"my-orc-image\"}: MAPO only supports defining images by names",
121+
"spec.image.imageRef: Invalid value: {\"name\":\"my-orc-image\"}: MAPO only supports defining images by names",
122122
},
123123
expectedWarnings: []string{},
124124
}),
@@ -175,7 +175,7 @@ var _ = Describe("capi2mapi OpenStack conversion", func() {
175175
expectedErrors: []string{
176176
"spec.ports[0].fixedIPs[0].subnet.id: Required value: MAPO only supports defining subnets via IDs",
177177
"spec.ports[0].fixedIPs[1].subnet.id: Required value: MAPO only supports defining subnets via IDs",
178-
"spec.ports[0].fixedIPs[2].subnet.filter: Invalid value: v1beta1.SubnetFilter{Name:\"my-subnet\", Description:\"\", ProjectID:\"\", IPVersion:0, GatewayIP:\"\", CIDR:\"\", IPv6AddressMode:\"\", IPv6RAMode:\"\", FilterByNeutronTags:v1beta1.FilterByNeutronTags{Tags:[]v1beta1.NeutronTag(nil), TagsAny:[]v1beta1.NeutronTag(nil), NotTags:[]v1beta1.NeutronTag(nil), NotTagsAny:[]v1beta1.NeutronTag(nil)}}: MAPO only supports defining subnets via IDs",
178+
"spec.ports[0].fixedIPs[2].subnet.filter: Invalid value: {\"name\":\"my-subnet\"}: MAPO only supports defining subnets via IDs",
179179
},
180180
expectedWarnings: []string{},
181181
}),
@@ -208,7 +208,7 @@ var _ = Describe("capi2mapi OpenStack conversion", func() {
208208
),
209209
machineBuilder: openstackCAPIMachineBase,
210210
expectedErrors: []string{
211-
"spec.securityGroups[0]: Invalid value: v1beta1.SecurityGroupParam{ID:(optional.String)(nil), Filter:(*v1beta1.SecurityGroupFilter)(nil)}: A security group must be referenced by a UUID or filter",
211+
"spec.securityGroups[0]: Invalid value: {}: A security group must be referenced by a UUID or filter",
212212
},
213213
expectedWarnings: []string{},
214214
}),
@@ -219,7 +219,7 @@ var _ = Describe("capi2mapi OpenStack conversion", func() {
219219
),
220220
machineBuilder: openstackCAPIMachineBase,
221221
expectedErrors: []string{
222-
"spec.serverGroup: Invalid value: v1beta1.ServerGroupParam{ID:(optional.String)(nil), Filter:(*v1beta1.ServerGroupFilter)(nil)}: A server group must be referenced by a UUID or filter",
222+
"spec.serverGroup: Invalid value: {}: A server group must be referenced by a UUID or filter",
223223
},
224224
expectedWarnings: []string{},
225225
}),
@@ -238,7 +238,7 @@ var _ = Describe("capi2mapi OpenStack conversion", func() {
238238
machineBuilder: openstackCAPIMachineBase,
239239
expectedErrors: []string{},
240240
expectedWarnings: []string{
241-
"spec.image.filter.tags: Invalid value: []string{\"tag-a\", \"tag-b\"}: MAPO does not support filtering image by tags",
241+
"spec.image.filter.tags: Invalid value: [\"tag-a\",\"tag-b\"]: MAPO does not support filtering image by tags",
242242
},
243243
}),
244244
Entry("warns with a port using unsupported fields", openstackCAPI2MAPIMachineConversionInput{
@@ -260,7 +260,7 @@ var _ = Describe("capi2mapi OpenStack conversion", func() {
260260
expectedWarnings: []string{
261261
"spec.ports[0].hostID: Invalid value: \"my-host\": The hostID field has no equivalent in MAPO and is not supported",
262262
"spec.ports[0].propagateUplinkStatus: Invalid value: true: The propagateUplinkStatus field has no equivalent in MAPO and is not supported",
263-
"spec.ports[0].valueSpecs: Invalid value: []v1beta1.ValueSpec{v1beta1.ValueSpec{Name:\"\", Key:\"\", Value:\"\"}}: The valueSpecs field has no equivalent in MAPO and is not supported",
263+
"spec.ports[0].valueSpecs: Invalid value: [{\"name\":\"\",\"key\":\"\",\"value\":\"\"}]: The valueSpecs field has no equivalent in MAPO and is not supported",
264264
},
265265
}),
266266
)

pkg/conversion/capi2mapi/powervs_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ var _ = Describe("capi2mapi PowerVS conversion", func() {
9797
return &pvsMachine
9898
},
9999
powerVSCluster: powerVSCluster,
100-
expectedErrors: []string{"spec.serviceInstance: Invalid value: \"null\": unable to convert service instance, service instance is nil"},
100+
expectedErrors: []string{"spec.serviceInstance: Invalid value: null: unable to convert service instance, service instance is nil"},
101101
}),
102102

103103
Entry("With service instance id, without service instance", powerVSCAPI2MAPIMachineConversionInput{
@@ -122,7 +122,7 @@ var _ = Describe("capi2mapi PowerVS conversion", func() {
122122
return &pvsMachine
123123
},
124124
powerVSCluster: powerVSCluster,
125-
expectedErrors: []string{"spec.image: Invalid value: \"null\": unable to convert image, image and imageref is nil"},
125+
expectedErrors: []string{"spec.image: Invalid value: null: unable to convert image, image and imageref is nil"},
126126
}),
127127

128128
Entry("Without imageref, with image", powerVSCAPI2MAPIMachineConversionInput{
@@ -147,7 +147,7 @@ var _ = Describe("capi2mapi PowerVS conversion", func() {
147147
return &pvsMachine
148148
},
149149
powerVSCluster: powerVSCluster,
150-
expectedErrors: []string{"spec.network: Invalid value: v1beta2.IBMPowerVSResourceReference{ID:(*string)(nil), Name:(*string)(nil), RegEx:(*string)(nil)}: unable to convert network to MAPI"},
150+
expectedErrors: []string{"spec.network: Invalid value: {}: unable to convert network to MAPI"},
151151
}),
152152
)
153153

pkg/conversion/mapi2capi/aws_fuzz_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ func (f *awsProviderFuzzer) fuzzProviderConfig(ps *mapiv1beta1.AWSMachineProvide
137137
ps.DeviceIndex = 0
138138
ps.LoadBalancers = nil
139139
ps.ObjectMeta = metav1.ObjectMeta{}
140+
ps.CPUOptions = nil
140141

141142
// At least one device mapping must have no device name.
142143
rootFound := false
@@ -163,6 +164,21 @@ func (f *awsProviderFuzzer) fuzzProviderConfig(ps *mapiv1beta1.AWSMachineProvide
163164
f.MAPIMachineFuzzer.Zone = ps.Placement.AvailabilityZone
164165
}
165166

167+
func (f *awsProviderFuzzer) fuzzHostPlacement(placement *mapiv1beta1.HostPlacement, c randfill.Continue) {
168+
c.FillNoCustom(placement)
169+
170+
switch c.Int31n(2) {
171+
case 0:
172+
placement.Affinity = ptr.To(mapiv1beta1.HostAffinityAnyAvailable)
173+
placement.DedicatedHost = nil
174+
case 1:
175+
placement.Affinity = ptr.To(mapiv1beta1.HostAffinityDedicatedHost)
176+
placement.DedicatedHost = &mapiv1beta1.DedicatedHost{
177+
ID: "h-0123456789abcdef0",
178+
}
179+
}
180+
}
181+
166182
//nolint:funlen
167183
func (f *awsProviderFuzzer) FuzzerFuncsMachineSet(codecs runtimeserializer.CodecFactory) []interface{} {
168184
return []interface{}{
@@ -257,6 +273,7 @@ func (f *awsProviderFuzzer) FuzzerFuncsMachineSet(codecs runtimeserializer.Codec
257273
// resulting in a documented lossy rountrip conversion, which would make the test to fail.
258274
}
259275
},
276+
f.fuzzHostPlacement,
260277
f.fuzzProviderConfig,
261278
}
262279
}

pkg/conversion/mapi2capi/aws_test.go

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,32 @@ var _ = Describe("mapi2capi AWS conversion", func() {
9393
expectedErrors: []string{},
9494
expectedWarnings: []string{},
9595
}),
96+
// Dedicated host positive/negative cases
97+
Entry("With HostPlacement AnyAvailable", awsMAPI2CAPIConversionInput{
98+
machineBuilder: awsMAPIMachineBase.WithProviderSpecBuilder(
99+
awsBaseProviderSpec.
100+
WithHostPlacement(&mapiv1beta1.HostPlacement{
101+
Affinity: ptr.To(mapiv1beta1.HostAffinityAnyAvailable),
102+
}),
103+
),
104+
infra: infra,
105+
expectedErrors: []string{},
106+
expectedWarnings: []string{},
107+
}),
108+
Entry("With HostPlacement DedicatedHost", awsMAPI2CAPIConversionInput{
109+
machineBuilder: awsMAPIMachineBase.WithProviderSpecBuilder(
110+
awsBaseProviderSpec.
111+
WithHostPlacement(&mapiv1beta1.HostPlacement{
112+
Affinity: ptr.To(mapiv1beta1.HostAffinityDedicatedHost),
113+
DedicatedHost: &mapiv1beta1.DedicatedHost{
114+
ID: "h-0123456789abcdef0",
115+
},
116+
}),
117+
),
118+
infra: infra,
119+
expectedErrors: []string{},
120+
expectedWarnings: []string{},
121+
}),
96122

97123
// Only Error.
98124
Entry("With LoadBalancers on worker machine", awsMAPI2CAPIConversionInput{
@@ -103,7 +129,7 @@ var _ = Describe("mapi2capi AWS conversion", func() {
103129
),
104130
infra: infra,
105131
expectedErrors: []string{
106-
"spec.providerSpec.value.loadBalancers: Invalid value: []v1beta1.LoadBalancerReference{v1beta1.LoadBalancerReference{Name:\"a\", Type:\"classic\"}}: loadBalancers are not supported for non-control plane machines",
132+
"spec.providerSpec.value.loadBalancers: Invalid value: [{\"name\":\"a\",\"type\":\"classic\"}]: loadBalancers are not supported for non-control plane machines",
107133
},
108134
expectedWarnings: []string{},
109135
}),
@@ -182,10 +208,7 @@ var _ = Describe("mapi2capi AWS conversion", func() {
182208
}),
183209
infra: infra,
184210
expectedErrors: []string{
185-
"spec.providerSpec.value.metadata: Invalid value: v1.ObjectMeta{Name:\"test\", GenerateName:\"\", Namespace:\"\", SelfLink:\"\", UID:\"\"," +
186-
" ResourceVersion:\"\", Generation:0, CreationTimestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), DeletionTimestamp:<nil>," +
187-
" DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil)," +
188-
" OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ManagedFields:[]v1.ManagedFieldsEntry(nil)}: metadata is not supported",
211+
"spec.providerSpec.value.metadata: Invalid value: {\"name\":\"test\"}: metadata is not supported",
189212
"spec.providerSpec.value.ami.arn: Invalid value: \"arn:aws:ec2:us-east-1::image/ami-1234567890abcdef0\": unable to convert AMI ARN reference. Not supported in CAPI",
190213
},
191214
expectedWarnings: []string{},
@@ -220,7 +243,7 @@ var _ = Describe("mapi2capi AWS conversion", func() {
220243
),
221244
infra: infra,
222245
expectedErrors: []string{
223-
"spec.providerSpec.value.ami.filters: Invalid value: []v1beta1.Filter{v1beta1.Filter{Name:\"name\", Values:[]string{\"test\"}}}: unable to convert AMI Filters reference. Not supported in CAPI",
246+
"spec.providerSpec.value.ami.filters: Invalid value: [{\"name\":\"name\",\"values\":[\"test\"]}]: unable to convert AMI Filters reference. Not supported in CAPI",
224247
},
225248
expectedWarnings: []string{},
226249
}),
@@ -232,7 +255,7 @@ var _ = Describe("mapi2capi AWS conversion", func() {
232255
),
233256
infra: infra,
234257
expectedErrors: []string{
235-
"spec.providerSpec.value.ami: Invalid value: v1beta1.AWSResourceReference{ID:(*string)(nil), ARN:(*string)(nil), Filters:[]v1beta1.Filter(nil)}: unable to find a valid AMI resource reference",
258+
"spec.providerSpec.value.ami: Invalid value: {}: unable to find a valid AMI resource reference",
236259
},
237260
expectedWarnings: []string{},
238261
}),
@@ -322,7 +345,7 @@ var _ = Describe("mapi2capi AWS conversion", func() {
322345
"spec.providerSpec.value.blockDevices[0].virtualName: Invalid value: \"test\": virtualName is not supported",
323346
},
324347
expectedWarnings: []string{
325-
"spec.providerSpec.value.blockDevices[0].ebs: Invalid value: \"null\": missing ebs configuration for block device",
348+
"spec.providerSpec.value.blockDevices[0].ebs: Invalid value: null: missing ebs configuration for block device",
326349
},
327350
}),
328351
Entry("With VirtualName specified and root Volume not deleted on termination", awsMAPI2CAPIConversionInput{
@@ -368,7 +391,7 @@ var _ = Describe("mapi2capi AWS conversion", func() {
368391
infra: infra,
369392
expectedErrors: []string{},
370393
expectedWarnings: []string{
371-
"spec.providerSpec.value.blockDevices[0].ebs: Invalid value: \"null\": missing ebs configuration for block device",
394+
"spec.providerSpec.value.blockDevices[0].ebs: Invalid value: null: missing ebs configuration for block device",
372395
},
373396
}),
374397
Entry("With root Volume not deleted on termination", awsMAPI2CAPIConversionInput{
@@ -403,4 +426,6 @@ var _ = Describe("mapi2capi AWS conversion", func() {
403426
}),
404427
)
405428

429+
// Dedicated host mapping tests were moved into the DescribeTable as Entry() tests above.
430+
406431
})

pkg/conversion/mapi2capi/machine_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ var _ = Describe("mapi2capi Machine conversion", func() {
127127
Value: "value1",
128128
Effect: corev1.TaintEffectNoSchedule,
129129
}}),
130-
expectedErrors: []string{"spec.taints: Invalid value: []v1.Taint{v1.Taint{Key:\"key1\", Value:\"value1\", Effect:\"NoSchedule\", TimeAdded:<nil>}}: taints are not currently supported"},
130+
expectedErrors: []string{"spec.taints: Invalid value: [{\"key\":\"key1\",\"value\":\"value1\",\"effect\":\"NoSchedule\"}]: taints are not currently supported"},
131131
expectedWarnings: []string{},
132132
}),
133133

0 commit comments

Comments
 (0)