From 0cb909530384ee45fbe311befa6fcac9864eab3e Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Wed, 1 Jul 2020 16:53:51 +0200 Subject: [PATCH] Fix up CRDs and add better openapiv3 schema validation --- k8s/{coffee-2.yaml => coffee-3.yaml} | 6 ++++-- k8s/coffees.yaml | 15 ++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) rename k8s/{coffee-2.yaml => coffee-3.yaml} (88%) diff --git a/k8s/coffee-2.yaml b/k8s/coffee-3.yaml similarity index 88% rename from k8s/coffee-2.yaml rename to k8s/coffee-3.yaml index 5736a58f..199265fe 100644 --- a/k8s/coffee-2.yaml +++ b/k8s/coffee-3.yaml @@ -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 diff --git a/k8s/coffees.yaml b/k8s/coffees.yaml index 8adf4f35..d7ace970 100644 --- a/k8s/coffees.yaml +++ b/k8s/coffees.yaml @@ -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