Skip to content

Commit 8defd12

Browse files
committed
Added lables and removed comments
e2 instances do not support onHostMaintenance=TERMINATE Removed GPU case for now
1 parent 2d5d9fb commit 8defd12

File tree

2 files changed

+4
-56
lines changed

2 files changed

+4
-56
lines changed

pkg/capi/gcp.go

+3-56
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
)
2121

2222
const (
23-
infraAPIVersion = "infrastructure.cluster.x-k8s.io/v1beta1"
2423
gcpMachineTemplateName = "gcp-machine-template"
2524
OnHostMaintenanceTerminate = "Terminate"
2625
OnHostMaintenanceMigrate = "Migrate"
@@ -71,17 +70,12 @@ var _ = Describe("Cluster API GCP MachineSet", framework.LabelCAPI, framework.La
7170
framework.WaitForCAPIMachineSetsDeleted(ctx, cl, machineSet)
7271
framework.DeleteObjects(ctx, cl, gcpMachineTemplate)
7372
})
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",
73+
DescribeTable("should be able to run a machine with disk types", framework.LabelCAPI, framework.LabelDisruptive,
7774
func(expectedDiskType gcpv1.DiskType) {
7875
mapiProviderSpec := getGCPMAPIProviderSpec(cl)
7976
Expect(mapiProviderSpec).ToNot(BeNil())
8077
gcpMachineTemplate = createGCPMachineTemplate(mapiProviderSpec)
8178
gcpMachineTemplate.Spec.Template.Spec.RootDeviceType = &expectedDiskType
82-
mapiProviderSpec.OnHostMaintenance = OnHostMaintenanceTerminate
83-
gcpMachineTemplate.Spec.Template.Spec.OnHostMaintenance = (*gcpv1.HostMaintenancePolicy)(&mapiProviderSpec.OnHostMaintenance)
84-
8579
if err := cl.Create(ctx, gcpMachineTemplate); err != nil && !apierrors.IsAlreadyExists(err) {
8680
Expect(err).ToNot(HaveOccurred())
8781
}
@@ -103,10 +97,7 @@ var _ = Describe("Cluster API GCP MachineSet", framework.LabelCAPI, framework.La
10397
Entry("Disk type pd-standard", gcpv1.PdStandardDiskType),
10498
Entry("Disk type pd-ssd", gcpv1.PdSsdDiskType),
10599
)
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",
100+
DescribeTable("should configure Shielded VM options correctly", framework.LabelCAPI, framework.LabelDisruptive,
110101
func(enableSecureBoot gcpv1.SecureBootPolicy, enableVtpm gcpv1.VirtualizedTrustedPlatformModulePolicy, enableIntegrityMonitoring gcpv1.IntegrityMonitoringPolicy) {
111102
mapiProviderSpec := getGCPMAPIProviderSpec(cl)
112103
Expect(mapiProviderSpec).ToNot(BeNil())
@@ -158,12 +149,10 @@ var _ = Describe("Cluster API GCP MachineSet", framework.LabelCAPI, framework.La
158149
Entry("all Shielded VM options disabled", gcpv1.SecureBootPolicyDisabled, gcpv1.VirtualizedTrustedPlatformModulePolicyDisabled, gcpv1.IntegrityMonitoringPolicyDisabled),
159150
*/
160151
)
161-
// OCP-74703 - Create confidential compute VMs on gcp
162-
// author: [email protected]
163152
// Define constants as variable for this case to pass values properly
164153
confidentialComputeEnabled := gcpv1.ConfidentialComputePolicyEnabled
165154
confidentialComputeDisabled := gcpv1.ConfidentialComputePolicyDisabled
166-
DescribeTable("should configure Confidential VM correctly",
155+
DescribeTable("should configure Confidential VM correctly", framework.LabelCAPI, framework.LabelDisruptive,
167156
func(confidentialCompute *gcpv1.ConfidentialComputePolicy) {
168157
mapiProviderSpec := getGCPMAPIProviderSpec(cl)
169158
Expect(mapiProviderSpec).ToNot(BeNil())
@@ -211,48 +200,6 @@ var _ = Describe("Cluster API GCP MachineSet", framework.LabelCAPI, framework.La
211200
Entry("Confidential Compute enabled", &confidentialComputeEnabled),
212201
Entry("Confidential Compute disabled", &confidentialComputeDisabled),
213202
)
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]
256203
It("should provision Preemptible machine successfully", func() {
257204
mapiProviderSpec := getGCPMAPIProviderSpec(cl)
258205
Expect(mapiProviderSpec).ToNot(BeNil())

pkg/e2e_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func init() {
5454
if err := awsv1.AddToScheme(scheme.Scheme); err != nil {
5555
klog.Fatal(err)
5656
}
57+
5758
if err := gcpv1.AddToScheme(scheme.Scheme); err != nil {
5859
klog.Fatal(err)
5960
}

0 commit comments

Comments
 (0)