openapi: Use "group" to look for resources

This commit is contained in:
Antoine Pelisse
2017-08-11 09:39:12 -07:00
parent b7b5457050
commit aa1c79f32b
2 changed files with 25 additions and 2 deletions

View File

@@ -41,6 +41,28 @@ var _ = Describe("resource validation using OpenAPI Schema", func() {
Expect(validator).ToNot(BeNil())
})
It("finds Deployment in Schema and validates it", func() {
err := validator.ValidateBytes([]byte(`
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
name: redis-master
name: name
spec:
replicas: 1
template:
metadata:
labels:
app: redis
spec:
containers:
- image: redis
name: redis
`))
Expect(err).To(BeNil())
})
It("validates a valid pod", func() {
err := validator.ValidateBytes([]byte(`
apiVersion: v1