Merge pull request #6778 from tengqm/fix-ci

Fix CI gate
This commit is contained in:
Qiming
2017-12-27 20:45:41 +08:00
committed by GitHub
+15
View File
@@ -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{}},
@@ -384,6 +385,8 @@ func TestExampleObjectSchemas(t *testing.T) {
"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{}},
"extended-resource-pod": {&api.Pod{}},
"extended-resource-pod-2": {&api.Pod{}},
"http-liveness": {&api.Pod{}}, "http-liveness": {&api.Pod{}},
"init-containers": {&api.Pod{}}, "init-containers": {&api.Pod{}},
"lifecycle-events": {&api.Pod{}}, "lifecycle-events": {&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
} }