Skip to content

Commit b665e74

Browse files
committed
Added lables and removed comments
e2 instances do not support onHostMaintenance=TERMINATE Removed GPU case for now
1 parent 33dd8af commit b665e74

File tree

1 file changed

+3
-55
lines changed

1 file changed

+3
-55
lines changed

pkg/capi/gcp.go

+3-55
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,12 @@ var _ = Describe("Cluster API GCP MachineSet", framework.LabelCAPI, framework.La
7171
framework.WaitForCAPIMachineSetsDeleted(ctx, cl, machineSet)
7272
framework.DeleteObjects(ctx, cl, gcpMachineTemplate)
7373
})
74-
// OCP-77825 capi created instances support disks pd-ssd and pd-standard
75-
// author: [email protected]
76-
DescribeTable("should be able to run a machine with disk types",
74+
DescribeTable("should be able to run a machine with disk types", framework.LabelCAPI, framework.LabelDisruptive,
7775
func(expectedDiskType gcpv1.DiskType) {
7876
mapiProviderSpec := getGCPMAPIProviderSpec(cl)
7977
Expect(mapiProviderSpec).ToNot(BeNil())
8078
gcpMachineTemplate = createGCPMachineTemplate(mapiProviderSpec)
8179
gcpMachineTemplate.Spec.Template.Spec.RootDeviceType = &expectedDiskType
82-
mapiProviderSpec.OnHostMaintenance = OnHostMaintenanceTerminate
83-
gcpMachineTemplate.Spec.Template.Spec.OnHostMaintenance = (*gcpv1.HostMaintenancePolicy)(&mapiProviderSpec.OnHostMaintenance)
84-
8580
if err := cl.Create(ctx, gcpMachineTemplate); err != nil && !apierrors.IsAlreadyExists(err) {
8681
Expect(err).ToNot(HaveOccurred())
8782
}
@@ -103,10 +98,7 @@ var _ = Describe("Cluster API GCP MachineSet", framework.LabelCAPI, framework.La
10398
Entry("Disk type pd-standard", gcpv1.PdStandardDiskType),
10499
Entry("Disk type pd-ssd", gcpv1.PdSsdDiskType),
105100
)
106-
// OCP-74795 - add support for shielded VMs - It takes defaults if configs are not supported; eg-vtpm alone set to Enabled will result in IntergrityMonitoring also as Enabled
107-
// doesn't matter what we pass - all enabled/secureboot only disabled(default) are valid changes which we can apply
108-
// author: [email protected]
109-
DescribeTable("should configure Shielded VM options correctly",
101+
DescribeTable("should configure Shielded VM options correctly", framework.LabelCAPI, framework.LabelDisruptive,
110102
func(enableSecureBoot gcpv1.SecureBootPolicy, enableVtpm gcpv1.VirtualizedTrustedPlatformModulePolicy, enableIntegrityMonitoring gcpv1.IntegrityMonitoringPolicy) {
111103
mapiProviderSpec := getGCPMAPIProviderSpec(cl)
112104
Expect(mapiProviderSpec).ToNot(BeNil())
@@ -158,12 +150,10 @@ var _ = Describe("Cluster API GCP MachineSet", framework.LabelCAPI, framework.La
158150
Entry("all Shielded VM options disabled", gcpv1.SecureBootPolicyDisabled, gcpv1.VirtualizedTrustedPlatformModulePolicyDisabled, gcpv1.IntegrityMonitoringPolicyDisabled),
159151
*/
160152
)
161-
// OCP-74703 - Create confidential compute VMs on gcp
162-
// author: [email protected]
163153
// Define constants as variable for this case to pass values properly
164154
confidentialComputeEnabled := gcpv1.ConfidentialComputePolicyEnabled
165155
confidentialComputeDisabled := gcpv1.ConfidentialComputePolicyDisabled
166-
DescribeTable("should configure Confidential VM correctly",
156+
DescribeTable("should configure Confidential VM correctly", framework.LabelCAPI, framework.LabelDisruptive,
167157
func(confidentialCompute *gcpv1.ConfidentialComputePolicy) {
168158
mapiProviderSpec := getGCPMAPIProviderSpec(cl)
169159
Expect(mapiProviderSpec).ToNot(BeNil())
@@ -211,48 +201,6 @@ var _ = Describe("Cluster API GCP MachineSet", framework.LabelCAPI, framework.La
211201
Entry("Confidential Compute enabled", &confidentialComputeEnabled),
212202
Entry("Confidential Compute disabled", &confidentialComputeDisabled),
213203
)
214-
// OCP-74732 GPU machine can be provisioned successfully by capi machineset
215-
// author: [email protected]
216-
It("should provision GPU machine successfully", func() {
217-
mapiProviderSpec := getGCPMAPIProviderSpec(cl)
218-
Expect(mapiProviderSpec).ToNot(BeNil())
219-
gcpMachineTemplate = createGCPMachineTemplate(mapiProviderSpec)
220-
gcpMachineTemplate.Spec.Template.Spec.InstanceType = "a2-highgpu-1g"
221-
mapiProviderSpec.OnHostMaintenance = OnHostMaintenanceTerminate
222-
gcpMachineTemplate.Spec.Template.Spec.OnHostMaintenance = (*gcpv1.HostMaintenancePolicy)(&mapiProviderSpec.OnHostMaintenance)
223-
224-
if err := cl.Create(ctx, gcpMachineTemplate); err != nil && !apierrors.IsAlreadyExists(err) {
225-
Expect(err).ToNot(HaveOccurred())
226-
}
227-
228-
By("Creating a MachineSet for GPU machine")
229-
machineSet, err = framework.CreateCAPIMachineSet(ctx, cl, framework.NewCAPIMachineSetParams(
230-
"gcp-machineset-gpu-74732",
231-
clusterName,
232-
mapiProviderSpec.Zone,
233-
1,
234-
corev1.ObjectReference{
235-
Kind: "GCPMachineTemplate",
236-
APIVersion: infraAPIVersion,
237-
Name: gcpMachineTemplateName,
238-
},
239-
))
240-
Expect(err).ToNot(HaveOccurred(), "Failed to create CAPI MachineSet with GPU instanceType")
241-
242-
framework.WaitForCAPIMachinesRunning(ctx, cl, machineSet.Name)
243-
244-
By("Verifying the GPU machinetype configuration on the created GCP MachineTemplate")
245-
createdTemplate := &gcpv1.GCPMachineTemplate{}
246-
Expect(cl.Get(framework.GetContext(), client.ObjectKey{
247-
Namespace: framework.ClusterAPINamespace,
248-
Name: gcpMachineTemplateName,
249-
}, createdTemplate)).To(Succeed())
250-
var machineType = createdTemplate.Spec.Template.Spec.InstanceType
251-
Expect(machineType).To(Equal("a2-highgpu-1g"))
252-
},
253-
)
254-
// OCP-75792 Preemptible machines can be provisioned successfully by capi machineset
255-
// author: [email protected]
256204
It("should provision Preemptible machine successfully", func() {
257205
mapiProviderSpec := getGCPMAPIProviderSpec(cl)
258206
Expect(mapiProviderSpec).ToNot(BeNil())

0 commit comments

Comments
 (0)