+45
-30
@@ -318,7 +318,7 @@ func TestExampleObjectSchemas(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"../docs/concepts/services-networking": {
|
"../docs/concepts/services-networking": {
|
||||||
"curlpod": {&extensions.Deployment{}},
|
"curlpod": {&extensions.Deployment{}},
|
||||||
"custom-dns": {&api.Pod{}},
|
"custom-dns": {&api.Pod{}},
|
||||||
"hostaliases-pod": {&api.Pod{}},
|
"hostaliases-pod": {&api.Pod{}},
|
||||||
"ingress": {&extensions.Ingress{}},
|
"ingress": {&extensions.Ingress{}},
|
||||||
"nginx-secure-app": {&api.Service{}, &extensions.Deployment{}},
|
"nginx-secure-app": {&api.Service{}, &extensions.Deployment{}},
|
||||||
@@ -343,6 +343,7 @@ func TestExampleObjectSchemas(t *testing.T) {
|
|||||||
"two-container-pod": {&api.Pod{}},
|
"two-container-pod": {&api.Pod{}},
|
||||||
},
|
},
|
||||||
"../docs/tasks/administer-cluster": {
|
"../docs/tasks/administer-cluster": {
|
||||||
|
"busybox": {&api.Pod{}},
|
||||||
"cloud-controller-manager-daemonset-example": {&api.ServiceAccount{}, &rbac.ClusterRoleBinding{}, &extensions.DaemonSet{}},
|
"cloud-controller-manager-daemonset-example": {&api.ServiceAccount{}, &rbac.ClusterRoleBinding{}, &extensions.DaemonSet{}},
|
||||||
"cpu-constraints": {&api.LimitRange{}},
|
"cpu-constraints": {&api.LimitRange{}},
|
||||||
"cpu-constraints-pod": {&api.Pod{}},
|
"cpu-constraints-pod": {&api.Pod{}},
|
||||||
@@ -381,35 +382,37 @@ func TestExampleObjectSchemas(t *testing.T) {
|
|||||||
"quota-pvc-2": {&api.PersistentVolumeClaim{}},
|
"quota-pvc-2": {&api.PersistentVolumeClaim{}},
|
||||||
},
|
},
|
||||||
"../docs/tasks/configure-pod-container": {
|
"../docs/tasks/configure-pod-container": {
|
||||||
"cpu-request-limit": {&api.Pod{}},
|
"cpu-request-limit": {&api.Pod{}},
|
||||||
"cpu-request-limit-2": {&api.Pod{}},
|
"cpu-request-limit-2": {&api.Pod{}},
|
||||||
"exec-liveness": {&api.Pod{}},
|
"exec-liveness": {&api.Pod{}},
|
||||||
"http-liveness": {&api.Pod{}},
|
"extended-resource-pod": {&api.Pod{}},
|
||||||
"init-containers": {&api.Pod{}},
|
"extended-resource-pod-2": {&api.Pod{}},
|
||||||
"lifecycle-events": {&api.Pod{}},
|
"http-liveness": {&api.Pod{}},
|
||||||
"mem-limit-range": {&api.LimitRange{}},
|
"init-containers": {&api.Pod{}},
|
||||||
"memory-request-limit": {&api.Pod{}},
|
"lifecycle-events": {&api.Pod{}},
|
||||||
"memory-request-limit-2": {&api.Pod{}},
|
"mem-limit-range": {&api.LimitRange{}},
|
||||||
"memory-request-limit-3": {&api.Pod{}},
|
"memory-request-limit": {&api.Pod{}},
|
||||||
"oir-pod": {&api.Pod{}},
|
"memory-request-limit-2": {&api.Pod{}},
|
||||||
"oir-pod-2": {&api.Pod{}},
|
"memory-request-limit-3": {&api.Pod{}},
|
||||||
"pod": {&api.Pod{}},
|
"oir-pod": {&api.Pod{}},
|
||||||
"pod-redis": {&api.Pod{}},
|
"oir-pod-2": {&api.Pod{}},
|
||||||
"private-reg-pod": {&api.Pod{}},
|
"pod": {&api.Pod{}},
|
||||||
"projected-volume": {&api.Pod{}},
|
"pod-redis": {&api.Pod{}},
|
||||||
"qos-pod": {&api.Pod{}},
|
"private-reg-pod": {&api.Pod{}},
|
||||||
"qos-pod-2": {&api.Pod{}},
|
"projected-volume": {&api.Pod{}},
|
||||||
"qos-pod-3": {&api.Pod{}},
|
"qos-pod": {&api.Pod{}},
|
||||||
"qos-pod-4": {&api.Pod{}},
|
"qos-pod-2": {&api.Pod{}},
|
||||||
"rq-compute-resources": {&api.ResourceQuota{}},
|
"qos-pod-3": {&api.Pod{}},
|
||||||
"security-context": {&api.Pod{}},
|
"qos-pod-4": {&api.Pod{}},
|
||||||
"security-context-2": {&api.Pod{}},
|
"rq-compute-resources": {&api.ResourceQuota{}},
|
||||||
"security-context-3": {&api.Pod{}},
|
"security-context": {&api.Pod{}},
|
||||||
"security-context-4": {&api.Pod{}},
|
"security-context-2": {&api.Pod{}},
|
||||||
"task-pv-claim": {&api.PersistentVolumeClaim{}},
|
"security-context-3": {&api.Pod{}},
|
||||||
"task-pv-pod": {&api.Pod{}},
|
"security-context-4": {&api.Pod{}},
|
||||||
"task-pv-volume": {&api.PersistentVolume{}},
|
"task-pv-claim": {&api.PersistentVolumeClaim{}},
|
||||||
"tcp-liveness-readiness": {&api.Pod{}},
|
"task-pv-pod": {&api.Pod{}},
|
||||||
|
"task-pv-volume": {&api.PersistentVolume{}},
|
||||||
|
"tcp-liveness-readiness": {&api.Pod{}},
|
||||||
},
|
},
|
||||||
"../docs/tasks/debug-application-cluster": {
|
"../docs/tasks/debug-application-cluster": {
|
||||||
"counter-pod": {&api.Pod{}},
|
"counter-pod": {&api.Pod{}},
|
||||||
@@ -460,6 +463,7 @@ func TestExampleObjectSchemas(t *testing.T) {
|
|||||||
"deployment-patch-demo": {&extensions.Deployment{}},
|
"deployment-patch-demo": {&extensions.Deployment{}},
|
||||||
"deployment-scale": {&extensions.Deployment{}},
|
"deployment-scale": {&extensions.Deployment{}},
|
||||||
"deployment-update": {&extensions.Deployment{}},
|
"deployment-update": {&extensions.Deployment{}},
|
||||||
|
"hpa-php-apache": {&autoscaling.HorizontalPodAutoscaler{}},
|
||||||
"mysql-configmap": {&api.ConfigMap{}},
|
"mysql-configmap": {&api.ConfigMap{}},
|
||||||
"mysql-deployment": {&api.Service{}, &api.PersistentVolumeClaim{}, &extensions.Deployment{}},
|
"mysql-deployment": {&api.Service{}, &api.PersistentVolumeClaim{}, &extensions.Deployment{}},
|
||||||
"mysql-services": {&api.Service{}, &api.Service{}},
|
"mysql-services": {&api.Service{}, &api.Service{}},
|
||||||
@@ -602,6 +606,11 @@ func TestExampleObjectSchemas(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filesIgnore := map[string]map[string]bool{
|
||||||
|
"../docs/tasks/debug-application-cluster": {
|
||||||
|
"audit-policy": true,
|
||||||
|
},
|
||||||
|
}
|
||||||
capabilities.SetForTests(capabilities.Capabilities{
|
capabilities.SetForTests(capabilities.Capabilities{
|
||||||
AllowPrivileged: true,
|
AllowPrivileged: true,
|
||||||
})
|
})
|
||||||
@@ -612,6 +621,12 @@ func TestExampleObjectSchemas(t *testing.T) {
|
|||||||
err := walkConfigFiles(path, func(name, path string, docs [][]byte) {
|
err := walkConfigFiles(path, func(name, path string, docs [][]byte) {
|
||||||
expectedTypes, found := expected[name]
|
expectedTypes, found := expected[name]
|
||||||
if !found {
|
if !found {
|
||||||
|
p := filepath.Dir(path)
|
||||||
|
if files, ok := filesIgnore[p]; ok {
|
||||||
|
if files[name] {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
t.Errorf("%s: %s does not have a test case defined", path, name)
|
t.Errorf("%s: %s does not have a test case defined", path, name)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user