Make CRD w/ webhook conversion strategy example usable (#16105)

- Sample CRD will not work due to apiextensions.k8s.io/v1beta1 setting preserveUnknownFields to true by default. Set to `false`.
- Provide required `type: object` at `openAPIV3Schema` root for both versions to avoid `schema.openAPIV3Schema.type: Required value: must not be empty at the root` error.
pull/16227/head
Matt Dorn 2019-09-04 22:06:51 -05:00 committed by Kubernetes Prow Robot
parent f8439cbe69
commit e05483d771
1 changed files with 4 additions and 0 deletions

View File

@ -217,6 +217,8 @@ metadata:
spec:
# group name to use for REST API: /apis/<group>/<version>
group: example.com
# prunes object fields that are not specified in OpenAPI schemas below.
preserveUnknownFields: false
# list of versions supported by this CustomResourceDefinition
versions:
- name: v1beta1
@ -228,6 +230,7 @@ spec:
# schema is defined.
schema:
openAPIV3Schema:
type: object
properties:
hostPort:
type: string
@ -236,6 +239,7 @@ spec:
storage: false
schema:
openAPIV3Schema:
type: object
properties:
host:
type: string