Skip to content

Commit 38e790a

Browse files
committed
Delete templateReference from e2e remediation test
Signed-off-by: peppi-lotta <[email protected]>
1 parent 4dd81bf commit 38e790a

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

test/e2e/remediation.go

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ func remediation(ctx context.Context, inputGetter func() RemediationInput) {
251251
ListMachines(ctx, bootstrapClient, client.InNamespace(input.Namespace))
252252
ListNodes(ctx, targetClient)
253253

254-
By("Testing Metal3DataTemplate reference")
255-
Logf("Creating a new Metal3DataTemplate")
254+
By("Creating a new Metal3DataTemplate")
256255
m3dataTemplate := infrav1.Metal3DataTemplate{}
257256
m3dataTemplateName := fmt.Sprintf("%s-workers-template", input.ClusterName)
258257
newM3dataTemplateName := "test-new-m3dt"
@@ -264,7 +263,6 @@ func remediation(ctx context.Context, inputGetter func() RemediationInput) {
264263
newM3DataTemplate.Spec.MetaData = m3dataTemplate.Spec.MetaData
265264
newM3DataTemplate.Spec.NetworkData = m3dataTemplate.Spec.NetworkData
266265
newM3DataTemplate.Spec.ClusterName = input.ClusterName
267-
newM3DataTemplate.Spec.TemplateReference = m3dataTemplateName
268266

269267
newM3DataTemplate.ObjectMeta.Name = newM3dataTemplateName
270268
newM3DataTemplate.ObjectMeta.Namespace = m3dataTemplate.Namespace
@@ -309,13 +307,12 @@ func remediation(ctx context.Context, inputGetter func() RemediationInput) {
309307
Replicas: 2,
310308
Intervals: input.E2EConfig.GetIntervals(input.SpecName, "wait-machine-remediation"),
311309
})
312-
313-
By("Waiting for single Metal3Data to refer to the old template")
310+
311+
By("Waiting for single new worker to become provisioned")
314312
Eventually(func(g Gomega) {
315313
datas := infrav1.Metal3DataList{}
316314
g.Expect(bootstrapClient.List(ctx, &datas, client.InNamespace(input.Namespace))).To(Succeed())
317-
filtered := filterM3DataByReference(datas.Items, m3dataTemplateName)
318-
g.Expect(filtered).To(HaveLen(1))
315+
g.Expect(datas.Items).NotTo(BeEmpty())
319316
}, input.E2EConfig.GetIntervals(input.SpecName, "wait-deployment")...).Should(Succeed())
320317

321318
ListMetal3Machines(ctx, bootstrapClient, client.InNamespace(input.Namespace))
@@ -416,15 +413,6 @@ func listVms(state vmState) []string {
416413
return lines[:i]
417414
}
418415

419-
func filterM3DataByReference(datas []infrav1.Metal3Data, referenceName string) (result []infrav1.Metal3Data) {
420-
for _, data := range datas {
421-
if data.Spec.TemplateReference == referenceName {
422-
result = append(result, data)
423-
}
424-
}
425-
return
426-
}
427-
428416
func waitForVmsState(vmNames []string, state vmState, _ string, interval ...interface{}) {
429417
Byf("Waiting for VMs %v to become '%s'", vmNames, state)
430418
Eventually(func() []string {

0 commit comments

Comments
 (0)