Skip to content

Commit 9913c08

Browse files
Merge pull request #28232 from stbenjam/revert-28224-auto-ocp12339
Revert "created persistent volume claims can not exceed the limitation"
2 parents f05820a + 5bf2951 commit 9913c08

File tree

2 files changed

+0
-70
lines changed

2 files changed

+0
-70
lines changed

test/extended/quota/resourcequota.go

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -85,74 +85,6 @@ var _ = g.Describe("[sig-api-machinery][Feature:ResourceQuota]", func() {
8585
})
8686
o.Expect(err).NotTo(o.HaveOccurred())
8787
})
88-
89-
g.It("The number of created persistent volume claims can not exceed the limitation", func() {
90-
testProject := oc.SetupProject()
91-
testResourceQuotaName := "my-resource-quota-" + testProject
92-
pvcName := "myclaim-" + testProject
93-
clusterAdminKubeClient := oc.AdminKubeClient()
94-
95-
rq := &corev1.ResourceQuota{
96-
ObjectMeta: metav1.ObjectMeta{Name: testResourceQuotaName, Namespace: testProject},
97-
Spec: corev1.ResourceQuotaSpec{
98-
Hard: corev1.ResourceList{
99-
"persistentvolumeclaims": resource.MustParse("1"),
100-
},
101-
},
102-
}
103-
104-
pvc := &corev1.PersistentVolumeClaim{
105-
ObjectMeta: metav1.ObjectMeta{
106-
Name: pvcName,
107-
},
108-
Spec: corev1.PersistentVolumeClaimSpec{
109-
AccessModes: []corev1.PersistentVolumeAccessMode{
110-
corev1.ReadWriteOnce,
111-
},
112-
Resources: corev1.ResourceRequirements{
113-
Requests: corev1.ResourceList{
114-
corev1.ResourceStorage: resource.MustParse("3Gi"),
115-
},
116-
},
117-
},
118-
}
119-
120-
g.By("Create the persistent volume and checking the usage")
121-
_, err := clusterAdminKubeClient.CoreV1().ResourceQuotas(testProject).Create(context.Background(), rq, metav1.CreateOptions{})
122-
o.Expect(err).NotTo(o.HaveOccurred())
123-
124-
_, err = clusterAdminKubeClient.CoreV1().PersistentVolumeClaims(testProject).Create(context.Background(), pvc, metav1.CreateOptions{})
125-
o.Expect(err).NotTo(o.HaveOccurred())
126-
127-
err = waitForResourceQuotaStatus(clusterAdminKubeClient, testResourceQuotaName, testProject, func(actualResourceQuota *corev1.ResourceQuota) error {
128-
expectedUsedStatus := corev1.ResourceList{
129-
"persistentvolumeclaims": resource.MustParse("1"),
130-
}
131-
if !equality.Semantic.DeepEqual(actualResourceQuota.Status.Used, expectedUsedStatus) {
132-
return fmt.Errorf("unexpected current total usage: actual: %v, expected: %v", actualResourceQuota.Status.Used, expectedUsedStatus)
133-
}
134-
return nil
135-
})
136-
o.Expect(err).NotTo(o.HaveOccurred())
137-
138-
_, err = clusterAdminKubeClient.CoreV1().PersistentVolumeClaims(testProject).Create(context.Background(), pvc, metav1.CreateOptions{})
139-
o.Expect(err).To(o.HaveOccurred())
140-
o.Expect(err.Error()).To(o.MatchRegexp(pvcName + `.*forbidden.*[Ee]xceeded quota`))
141-
142-
g.By("Deleting the persistent volume and checking the usage")
143-
err = clusterAdminKubeClient.CoreV1().PersistentVolumeClaims(testProject).Delete(context.Background(), pvcName, metav1.DeleteOptions{})
144-
o.Expect(err).NotTo(o.HaveOccurred())
145-
err = waitForResourceQuotaStatus(clusterAdminKubeClient, testResourceQuotaName, testProject, func(actualResourceQuota *corev1.ResourceQuota) error {
146-
expectedUsedStatus := corev1.ResourceList{
147-
"persistentvolumeclaims": resource.MustParse("0"),
148-
}
149-
if !equality.Semantic.DeepEqual(actualResourceQuota.Status.Used, expectedUsedStatus) {
150-
return fmt.Errorf("unexpected current total usage: actual: %v, expected: %v", actualResourceQuota.Status.Used, expectedUsedStatus)
151-
}
152-
return nil
153-
})
154-
o.Expect(err).NotTo(o.HaveOccurred())
155-
})
15688
})
15789
})
15890

test/extended/util/annotate/generated/zz_generated.annotations.go

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)