@@ -24,7 +24,7 @@ import (
24
24
appsv1 "k8s.io/api/apps/v1"
25
25
v1 "k8s.io/api/core/v1"
26
26
schedulingv1 "k8s.io/api/scheduling/v1"
27
- "k8s.io/apimachinery/pkg/api/errors"
27
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
28
28
"k8s.io/apimachinery/pkg/api/resource"
29
29
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
30
30
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -886,7 +886,7 @@ var _ = SIGDescribe("ResourceQuota", func() {
886
886
887
887
ginkgo .By ("Verifying the deleted ResourceQuota" )
888
888
_ , err = client .CoreV1 ().ResourceQuotas (ns ).Get (quotaName , metav1.GetOptions {})
889
- framework .ExpectEqual (errors .IsNotFound (err ), true )
889
+ framework .ExpectEqual (apierrors .IsNotFound (err ), true )
890
890
})
891
891
})
892
892
@@ -1076,7 +1076,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() {
1076
1076
ginkgo .It ("should verify ResourceQuota's priority class scope (quota set to pod count: 1) against a pod with same priority class." , func () {
1077
1077
1078
1078
_ , err := f .ClientSet .SchedulingV1 ().PriorityClasses ().Create (& schedulingv1.PriorityClass {ObjectMeta : metav1.ObjectMeta {Name : "pclass1" }, Value : int32 (1000 )})
1079
- framework .ExpectEqual (err == nil || errors .IsAlreadyExists (err ), true )
1079
+ framework .ExpectEqual (err == nil || apierrors .IsAlreadyExists (err ), true )
1080
1080
1081
1081
hard := v1.ResourceList {}
1082
1082
hard [v1 .ResourcePods ] = resource .MustParse ("1" )
@@ -1115,7 +1115,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() {
1115
1115
ginkgo .It ("should verify ResourceQuota's priority class scope (quota set to pod count: 1) against 2 pods with same priority class." , func () {
1116
1116
1117
1117
_ , err := f .ClientSet .SchedulingV1 ().PriorityClasses ().Create (& schedulingv1.PriorityClass {ObjectMeta : metav1.ObjectMeta {Name : "pclass2" }, Value : int32 (1000 )})
1118
- framework .ExpectEqual (err == nil || errors .IsAlreadyExists (err ), true )
1118
+ framework .ExpectEqual (err == nil || apierrors .IsAlreadyExists (err ), true )
1119
1119
1120
1120
hard := v1.ResourceList {}
1121
1121
hard [v1 .ResourcePods ] = resource .MustParse ("1" )
@@ -1160,7 +1160,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() {
1160
1160
ginkgo .It ("should verify ResourceQuota's priority class scope (quota set to pod count: 1) against 2 pods with different priority class." , func () {
1161
1161
1162
1162
_ , err := f .ClientSet .SchedulingV1 ().PriorityClasses ().Create (& schedulingv1.PriorityClass {ObjectMeta : metav1.ObjectMeta {Name : "pclass3" }, Value : int32 (1000 )})
1163
- framework .ExpectEqual (err == nil || errors .IsAlreadyExists (err ), true )
1163
+ framework .ExpectEqual (err == nil || apierrors .IsAlreadyExists (err ), true )
1164
1164
1165
1165
hard := v1.ResourceList {}
1166
1166
hard [v1 .ResourcePods ] = resource .MustParse ("1" )
@@ -1206,10 +1206,10 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() {
1206
1206
1207
1207
ginkgo .It ("should verify ResourceQuota's multiple priority class scope (quota set to pod count: 2) against 2 pods with same priority classes." , func () {
1208
1208
_ , err := f .ClientSet .SchedulingV1 ().PriorityClasses ().Create (& schedulingv1.PriorityClass {ObjectMeta : metav1.ObjectMeta {Name : "pclass5" }, Value : int32 (1000 )})
1209
- framework .ExpectEqual (err == nil || errors .IsAlreadyExists (err ), true )
1209
+ framework .ExpectEqual (err == nil || apierrors .IsAlreadyExists (err ), true )
1210
1210
1211
1211
_ , err = f .ClientSet .SchedulingV1 ().PriorityClasses ().Create (& schedulingv1.PriorityClass {ObjectMeta : metav1.ObjectMeta {Name : "pclass6" }, Value : int32 (1000 )})
1212
- framework .ExpectEqual (err == nil || errors .IsAlreadyExists (err ), true )
1212
+ framework .ExpectEqual (err == nil || apierrors .IsAlreadyExists (err ), true )
1213
1213
1214
1214
hard := v1.ResourceList {}
1215
1215
hard [v1 .ResourcePods ] = resource .MustParse ("2" )
@@ -1261,7 +1261,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() {
1261
1261
ginkgo .It ("should verify ResourceQuota's priority class scope (quota set to pod count: 1) against a pod with different priority class (ScopeSelectorOpNotIn)." , func () {
1262
1262
1263
1263
_ , err := f .ClientSet .SchedulingV1 ().PriorityClasses ().Create (& schedulingv1.PriorityClass {ObjectMeta : metav1.ObjectMeta {Name : "pclass7" }, Value : int32 (1000 )})
1264
- framework .ExpectEqual (err == nil || errors .IsAlreadyExists (err ), true )
1264
+ framework .ExpectEqual (err == nil || apierrors .IsAlreadyExists (err ), true )
1265
1265
1266
1266
hard := v1.ResourceList {}
1267
1267
hard [v1 .ResourcePods ] = resource .MustParse ("1" )
@@ -1295,7 +1295,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() {
1295
1295
ginkgo .It ("should verify ResourceQuota's priority class scope (quota set to pod count: 1) against a pod with different priority class (ScopeSelectorOpExists)." , func () {
1296
1296
1297
1297
_ , err := f .ClientSet .SchedulingV1 ().PriorityClasses ().Create (& schedulingv1.PriorityClass {ObjectMeta : metav1.ObjectMeta {Name : "pclass8" }, Value : int32 (1000 )})
1298
- framework .ExpectEqual (err == nil || errors .IsAlreadyExists (err ), true )
1298
+ framework .ExpectEqual (err == nil || apierrors .IsAlreadyExists (err ), true )
1299
1299
1300
1300
hard := v1.ResourceList {}
1301
1301
hard [v1 .ResourcePods ] = resource .MustParse ("1" )
@@ -1334,7 +1334,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() {
1334
1334
ginkgo .It ("should verify ResourceQuota's priority class scope (cpu, memory quota set) against a pod with same priority class." , func () {
1335
1335
1336
1336
_ , err := f .ClientSet .SchedulingV1 ().PriorityClasses ().Create (& schedulingv1.PriorityClass {ObjectMeta : metav1.ObjectMeta {Name : "pclass9" }, Value : int32 (1000 )})
1337
- framework .ExpectEqual (err == nil || errors .IsAlreadyExists (err ), true )
1337
+ framework .ExpectEqual (err == nil || apierrors .IsAlreadyExists (err ), true )
1338
1338
1339
1339
hard := v1.ResourceList {}
1340
1340
hard [v1 .ResourcePods ] = resource .MustParse ("1" )
@@ -1714,7 +1714,7 @@ func updateResourceQuotaUntilUsageAppears(c clientset.Interface, ns, quotaName s
1714
1714
resourceQuota .Spec .Hard [resourceName ] = current
1715
1715
_ , err = c .CoreV1 ().ResourceQuotas (ns ).Update (resourceQuota )
1716
1716
// ignoring conflicts since someone else may already updated it.
1717
- if errors .IsConflict (err ) {
1717
+ if apierrors .IsConflict (err ) {
1718
1718
return false , nil
1719
1719
}
1720
1720
return false , err
0 commit comments