Fix up CRDs and add better openapiv3 schema validation

This commit is contained in:
Jerome Petazzoni
2020-07-01 16:53:51 +02:00
parent ffded8469b
commit 0cb9095303
2 changed files with 14 additions and 7 deletions

View File

@@ -17,14 +17,16 @@ spec:
storage: true
schema:
openAPIV3Schema:
type: object
required: [ spec ]
properties:
spec:
required:
- taste
type: object
properties:
taste:
description: Subjective taste of that kind of coffee bean
type: string
required: [ taste ]
additionalPrinterColumns:
- jsonPath: .spec.taste
description: Subjective taste of that kind of coffee bean

View File

@@ -9,9 +9,9 @@ spec:
kind: Coffee
apiVersion: container.training/v1alpha1
metadata:
name: robusta
name: excelsa
spec:
taste: stronger
taste: fruity
---
kind: Coffee
apiVersion: container.training/v1alpha1
@@ -23,7 +23,12 @@ spec:
kind: Coffee
apiVersion: container.training/v1alpha1
metadata:
name: excelsa
name: robusta
spec:
taste: fruity
taste: stronger
bitterness: high
---
kind: Coffee
apiVersion: container.training/v1alpha1
metadata:
name: java