openapi: Use "group" to look for resources
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user