Skip to content

Commit 8fa319e

Browse files
authored
Merge pull request #36832 from tengqm/fix-example-test
Fix examples test
2 parents dc8299c + 6730a53 commit 8fa319e

File tree

4 files changed

+174
-1311
lines changed

4 files changed

+174
-1311
lines changed

content/en/examples/examples_test.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,6 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
156156
AllowExpandedDNSConfig: true,
157157
}
158158

159-
quotaValidationOptions := validation.ResourceQuotaValidationOptions{
160-
AllowPodAffinityNamespaceSelector: true,
161-
}
162-
163159
// Enable CustomPodDNS for testing
164160
// feature.DefaultFeatureGate.Set("CustomPodDNS=true")
165161
switch t := obj.(type) {
@@ -220,7 +216,7 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
220216
if t.Namespace == "" {
221217
t.Namespace = api.NamespaceDefault
222218
}
223-
errors = validation.ValidateResourceQuota(t, quotaValidationOptions)
219+
errors = validation.ValidateResourceQuota(t)
224220
case *api.Secret:
225221
if t.Namespace == "" {
226222
t.Namespace = api.NamespaceDefault
@@ -303,7 +299,7 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
303299
if t.Namespace == "" {
304300
t.Namespace = api.NamespaceDefault
305301
}
306-
errors = batch_validation.ValidateCronJob(t, podValidationOptions)
302+
errors = batch_validation.ValidateCronJobCreate(t, podValidationOptions)
307303
case *networking.NetworkPolicy:
308304
if t.Namespace == "" {
309305
t.Namespace = api.NamespaceDefault
@@ -519,17 +515,20 @@ func TestExampleObjectSchemas(t *testing.T) {
519515
"configmap-multikeys": {&api.ConfigMap{}},
520516
},
521517
"controllers": {
522-
"daemonset": {&apps.DaemonSet{}},
523-
"fluentd-daemonset": {&apps.DaemonSet{}},
524-
"fluentd-daemonset-update": {&apps.DaemonSet{}},
525-
"frontend": {&apps.ReplicaSet{}},
526-
"hpa-rs": {&autoscaling.HorizontalPodAutoscaler{}},
527-
"job": {&batch.Job{}},
528-
"replicaset": {&apps.ReplicaSet{}},
529-
"replication": {&api.ReplicationController{}},
530-
"replication-nginx-1.14.2": {&api.ReplicationController{}},
531-
"replication-nginx-1.16.1": {&api.ReplicationController{}},
532-
"nginx-deployment": {&apps.Deployment{}},
518+
"daemonset": {&apps.DaemonSet{}},
519+
"fluentd-daemonset": {&apps.DaemonSet{}},
520+
"fluentd-daemonset-update": {&apps.DaemonSet{}},
521+
"frontend": {&apps.ReplicaSet{}},
522+
"hpa-rs": {&autoscaling.HorizontalPodAutoscaler{}},
523+
"job": {&batch.Job{}},
524+
"job-pod-failure-policy-example": {&batch.Job{}},
525+
"job-pod-failure-policy-failjob": {&batch.Job{}},
526+
"job-pod-failure-policy-ignore": {&batch.Job{}},
527+
"replicaset": {&apps.ReplicaSet{}},
528+
"replication": {&api.ReplicationController{}},
529+
"replication-nginx-1.14.2": {&api.ReplicationController{}},
530+
"replication-nginx-1.16.1": {&api.ReplicationController{}},
531+
"nginx-deployment": {&apps.Deployment{}},
533532
},
534533
"debug": {
535534
"counter-pod": {&api.Pod{}},
@@ -564,6 +563,7 @@ func TestExampleObjectSchemas(t *testing.T) {
564563
"share-process-namespace": {&api.Pod{}},
565564
"simple-pod": {&api.Pod{}},
566565
"two-container-pod": {&api.Pod{}},
566+
"user-namespaces-stateless": {&api.Pod{}},
567567
},
568568
"pods/config": {
569569
"redis-pod": {&api.Pod{}},

0 commit comments

Comments
 (0)