Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions e2e/machineset_migration_capi_authoritative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] Ma
verifyMachineSetPausedCondition(mapiMachineSet, mapiv1beta1.MachineAuthorityClusterAPI)
})

// bug https://issues.redhat.com/browse/OCPBUGS-55337
PIt("should verify that the non-authoritative MAPI MachineSet providerSpec has been updated to reflect the authoritative CAPI MachineSet mirror values", func() {
It("should verify that the non-authoritative MAPI MachineSet providerSpec has been updated to reflect the authoritative CAPI MachineSet mirror values", func() {
verifyMAPIMachineSetProviderSpec(mapiMachineSet, HaveField("InstanceType", Equal(instanceType)))
})
})
Expand Down
16 changes: 12 additions & 4 deletions e2e/machineset_migration_mapi_authoritative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] Ma
})
})

// https://issues.redhat.com/browse/OCPCLOUD-3188
PIt("should reject creation of MAPI MachineSet with same name as existing CAPI MachineSet", func() {
By("Creating a same name MAPI MachineSet")
createMAPIMachineSetWithAuthoritativeAPI(ctx, cl, 0, existingCAPIMSAuthorityMAPIName, mapiv1beta1.MachineAuthorityMachineAPI, mapiv1beta1.MachineAuthorityMachineAPI)
It("should reject creation of MAPI MachineSet with same name as existing CAPI MachineSet", func() {
By("Attempting to create a MAPI MachineSet with the same name as existing CAPI MachineSet")
machineSetParams := mapiframework.BuildMachineSetParams(ctx, cl, 0)
machineSetParams.Name = existingCAPIMSAuthorityMAPIName
machineSetParams.Labels[mapiframework.MachineSetKey] = existingCAPIMSAuthorityMAPIName
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question/non-blocking nit: why are we setting this? IIUC we don't read any labels to determine VAP enforcement

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I copied this from the existing implementation for consistency. I assumed we had reviewed that pattern before. If it's not needed for VAP enforcement, happy to remove it.

machineSetParams.MachinesetAuthoritativeAPI = mapiv1beta1.MachineAuthorityMachineAPI
machineSetParams.MachineAuthoritativeAPI = mapiv1beta1.MachineAuthorityMachineAPI
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate line?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, one for MachineSet (spec.authoritativeAPI) and the other for Machine (spec.template.spec.authoritativeAPI)


By("Verifying creation is rejected by ValidatingAdmissionPolicy")
_, err := mapiframework.CreateMachineSet(cl, machineSetParams)
Expect(err).To(HaveOccurred(), "MAPI MachineSet creation should be rejected when CAPI MachineSet with same name exists")
Expect(err.Error()).To(ContainSubstring("openshift-prevent-authoritative-mapi-machineset-create-when-capi-exists"))
})
})

Expand Down