Skip to content

Commit

Permalink
Remove openAPIV3Schema validation
Browse files Browse the repository at this point in the history
When we were using kubebuilder, it generated openAPIV3schema validation
for us in our CRD declarations. However:

1. No other knative projects use this
2. Continuing to use this is forcing us to diverge from the other
   Knative projects, specifically I found that `Status` fields, although
   optional, were being required by the validation (as described at
   kubernetes/apiextensions-apiserver#25), and
   the best way to work around it seemed to be to make them nullable (as
   per
   https://stackoverflow.com/questions/18088294/how-to-not-marshal-an-empty-struct-into-json-with-go)
   i.e. pointers, which is different from how Knative works, and
   introduces new problems (such as handling when these fields are null)
3. We (or at least @pivotal-nader-ziada and @shashwathi for sure!) were
   maintaining these fiels manually :O
  • Loading branch information
bobcatfish authored and knative-prow-robot committed Oct 5, 2018
1 parent 462cbd6 commit 716612a
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 637 deletions.
110 changes: 0 additions & 110 deletions config/300-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,116 +11,6 @@ spec:
kind: Pipeline
plural: pipelines
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
tasks:
items:
properties:
clusterBindings:
items:
properties:
inputName:
type: string
key:
type: string
required:
- key
- inputName
type: object
type: array
inputSourceBindings:
items:
properties:
key:
type: string
name:
type: string
resourceRef:
properties:
apiVersion:
type: string
name:
type: string
required:
- name
type: object
passedConstraints:
items:
type: string
type: array
required:
- name
- key
type: object
type: array
name:
type: string
outputSourceBindings:
items:
properties:
key:
type: string
name:
type: string
resourceRef:
properties:
apiVersion:
type: string
name:
type: string
required:
- name
type: object
passedConstraints:
items:
type: string
type: array
required:
- name
- key
type: object
type: array
params:
items:
properties:
name:
type: string
value:
type: string
required:
- name
- value
type: object
type: array
taskRef:
properties:
apiVersion:
type: string
name:
type: string
required:
- name
type: object
required:
- name
- taskRef
type: object
type: array
required:
- tasks
type: object
status:
type: object
type: object
version: v1alpha1
status:
acceptedNames:
Expand Down
80 changes: 0 additions & 80 deletions config/300-pipelineparams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,86 +11,6 @@ spec:
kind: PipelineParams
plural: pipelineparams
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
clusters:
items:
properties:
endpoint:
type: string
name:
type: string
type:
type: string
required:
- name
- type
- endpoint
type: object
type: array
results:
properties:
logs:
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
runs:
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
tests:
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
required:
- runs
- logs
type: object
serviceAccount:
type: string
required:
- serviceAccount
- results
type: object
status:
type: object
type: object
version: v1alpha1
status:
acceptedNames:
Expand Down
97 changes: 0 additions & 97 deletions config/300-pipelinerun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,103 +11,6 @@ spec:
kind: PipelineRun
plural: pipelineruns
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
pipelineParamsRef:
properties:
apiVersion:
type: string
name:
type: string
required:
- name
type: object
pipelineRef:
properties:
apiVersion:
type: string
name:
type: string
required:
- name
type: object
triggerRef:
properties:
name:
type: string
type:
type: string
required:
- type
type: object
required:
- pipelineRef
- pipelineParamsRef
- triggerRef
type: object
status:
properties:
conditions:
items:
properties:
lastTransitionTime:
format: date-time
type: string
message:
type: string
reason:
type: string
status:
type: string
type:
type: string
required:
- type
- status
- lastTransitionTime
type: object
type: array
resourceVersion:
items:
properties:
resourceRef:
properties:
apiVersion:
type: string
name:
type: string
required:
- name
type: object
version:
type: string
required:
- resourceRef
- version
type: object
type: array
taskRuns:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
required:
- conditions
type: object
type: object
version: v1alpha1
status:
acceptedNames:
Expand Down
34 changes: 0 additions & 34 deletions config/300-resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,6 @@ spec:
kind: Resource
plural: resources
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
name:
type: string
params:
items:
properties:
name:
type: string
value:
type: string
required:
- name
- value
type: object
type: array
type:
type: string
required:
- type
- params
type: object
status:
type: object
type: object
version: v1alpha1
status:
acceptedNames:
Expand Down
Loading

0 comments on commit 716612a

Please sign in to comment.