You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expect(err).NotTo(HaveOccurred(), "Should have successfully listed MAPI machines")
142
+
Expect(machineList).NotTo(BeEmpty(), "Should have found MAPI machines in the openshift-machine-api namespace to use as a reference for creating a new one")
143
+
144
+
referenceMachine:=machineList[0]
145
+
By(fmt.Sprintf("Using MAPI machine %s as a reference", referenceMachine.Name))
146
+
147
+
newMachine:=&mapiv1beta1.Machine{
148
+
TypeMeta: metav1.TypeMeta{
149
+
Kind: "Machine",
150
+
APIVersion: mapiv1beta1.GroupVersion.String(),
151
+
},
152
+
ObjectMeta: metav1.ObjectMeta{
153
+
Name: machineName,
154
+
Namespace: referenceMachine.Namespace,
155
+
},
156
+
Spec: *referenceMachine.Spec.DeepCopy(),
157
+
}
158
+
159
+
newMachine.Spec.ProviderID=nil
160
+
newMachine.ObjectMeta.Labels=nil
161
+
newMachine.Status= mapiv1beta1.MachineStatus{}
162
+
newMachine.Spec.AuthoritativeAPI=authority
163
+
164
+
By(fmt.Sprintf("Attempting to create a MAPI machine (expecting failure) with AuthoritativeAPI: %s in namespace: %s", authority, newMachine.Namespace))
165
+
err=cl.Create(ctx, newMachine)
166
+
Expect(err).To(HaveOccurred(), "MAPI Machine %s creation should fail", machineName)
167
+
Expect(err.Error()).To(ContainSubstring(expectedErrorMessage), "Error message should contain expected text: %s", expectedErrorMessage)
168
+
}
169
+
131
170
// verifyMachineRunning verifies that a machine reaches Running state using the machine object directly.
It("should reject creation of MAPI Machine with same name as existing CAPI Machine", func() {
48
+
createSameNameMachineBlockedByVAPAuthMapi(ctx, cl, mapiMachineAuthMAPIName, mapiv1beta1.MachineAuthorityMachineAPI, "a Cluster API Machine with the same name already exists")
49
+
})
50
+
})
51
+
32
52
Context("With spec.authoritativeAPI: MachineAPI and no existing CAPI Machine with that name", func() {
PIt("should verify that the non-authoritative MAPI MachineSet providerSpec has been updated to reflect the authoritative CAPI MachineSet mirror values", func() {
61
+
It("should verify that the non-authoritative MAPI MachineSet providerSpec has been updated to reflect the authoritative CAPI MachineSet mirror values", func() {
It("should reject creation of MAPI MachineSet with same name as existing CAPI MachineSet", func() {
59
+
createSameNameMachineSetBlockedByVAPAuthMapi(ctx, cl, 0, existingCAPIMSAuthorityMAPIName, mapiv1beta1.MachineAuthorityMachineAPI, mapiv1beta1.MachineAuthorityMachineAPI, "a Cluster API MachineSet with the same name already exists")
0 commit comments