blog-structual-schema: fix oneOf in example spec (#15816)

This commit is contained in:
Dr. Stefan Schimanski
2019-08-14 06:48:24 +02:00
committed by Kubernetes Prow Robot
parent ac7cd02a6f
commit d1ce52703e
@@ -68,6 +68,8 @@ properties:
properties properties
command: command:
type: string type: string
shell:
type: string
machines: machines:
type: array type: array
items: items:
@@ -92,14 +94,14 @@ properties:
shell: shell:
type: string type: string
minLength: 1 # value validation minLength: 1 # value validation
oneOf: # value validation
- required: [“command”] # value validation
- required: [“shell”] # value validation
machines: machines:
type: array type: array
items: items:
type: string type: string
pattern: “^[a-z0-9]+(-[a-z0-9]+)*$” # value validation pattern: “^[a-z0-9]+(-[a-z0-9]+)*$” # value validation
oneOf: # value validation
- required: [“command”] # value validation
- required: [“shell”] # value validation
required: [“spec”] # value validation required: [“spec”] # value validation
``` ```
@@ -130,16 +132,20 @@ properties:
shell: shell:
type: string type: string
minLength: 1 minLength: 1
oneOf:
- type: string
required: [“command”]
- type: string
required: [“shell”]
machines: machines:
type: array type: array
items: items:
type: string type: string
pattern: “^[a-z0-9]+(-[a-z0-9]+)*$” pattern: “^[a-z0-9]+(-[a-z0-9]+)*$”
oneOf:
- properties:
command:
type: string
required: [“command”]
- properties:
shell:
type: string
required: [“shell”]
not: not:
properties: properties:
privileged: {} privileged: {}