Skip to content

Commit 23f7ee1

Browse files
Merge pull request #168 from soltysh/crd-validation
Add CRD openapi definitions
2 parents faf524c + 6750bf4 commit 23f7ee1

File tree

252 files changed

+34157
-1097
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+34157
-1097
lines changed

Gopkg.lock

Lines changed: 78 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
required = [ "k8s.io/code-generator/cmd/client-gen", "k8s.io/gengo/types" ]
1+
required = [ "k8s.io/code-generator/cmd/client-gen", "k8s.io/gengo/types", "github.com/openshift/library-go/cmd/crd-schema-gen" ]
22

33
[prune]
44
non-go = true
@@ -15,6 +15,11 @@ required = [ "k8s.io/code-generator/cmd/client-gen", "k8s.io/gengo/types" ]
1515
non-go = false
1616
unused-packages = false
1717

18+
[[prune.project]]
19+
name = "github.com/openshift/library-go"
20+
non-go = false
21+
unused-packages = false
22+
1823
[[constraint]]
1924
name = "github.com/golang/glog"
2025
revision = "3c92600d7533018d216b534fe894ad60a1e6d5bf"
@@ -32,11 +37,11 @@ required = [ "k8s.io/code-generator/cmd/client-gen", "k8s.io/gengo/types" ]
3237
name = "k8s.io/client-go"
3338
version = "kubernetes-1.13.4"
3439

35-
[[constraint]]
40+
[[override]]
3641
name = "k8s.io/apiextensions-apiserver"
3742
# use origin fork with nullable support.
3843
# TODO(sttts, sig-master): switch back to upstream version in 1.14
39-
branch = "origin-4.0-kubernetes-1.12.4"
44+
branch = "origin-4.1-kubernetes-1.13.4"
4045
source = "https://github.com/openshift/kubernetes-apiextensions-apiserver"
4146

4247
[[constraint]]
@@ -70,3 +75,14 @@ required = [ "k8s.io/code-generator/cmd/client-gen", "k8s.io/gengo/types" ]
7075
[[constraint]]
7176
name = "github.com/openshift/client-go"
7277
branch = "master"
78+
79+
[[override]]
80+
name = "github.com/openshift/library-go"
81+
branch = "master"
82+
83+
[[override]]
84+
name = "sigs.k8s.io/controller-tools"
85+
# use origin fork with nullable support.
86+
# TODO(soltysh, sig-master): switch back to upstream version in 1.14
87+
branch = "origin-4.1-kubernetes-1.13.4"
88+
source = "https://github.com/openshift/kubernetes-sigs-controller-tools"

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1+
all: build
2+
.PHONY: all
3+
14
build:
25
hack/build-go.sh
36
.PHONY: build
47

58
test:
69
go test ./...
710
.PHONY: test
11+
12+
clean:
13+
rm -rf _output/
14+
.PHONY: clean
15+
16+
update-codegen-crds:
17+
go run ./vendor/github.com/openshift/library-go/cmd/crd-schema-gen/main.go --domain openshift.io --apis-dir vendor/github.com/openshift/api --manifests-dir install/
18+
update-codegen: update-codegen-crds
19+
verify-codegen-crds:
20+
go run ./vendor/github.com/openshift/library-go/cmd/crd-schema-gen/main.go --domain openshift.io --apis-dir vendor/github.com/openshift/api --manifests-dir install/ --verify-only
21+
verify-codegen: verify-codegen-crds
22+
verify: verify-codegen
23+
.PHONY: update-codegen-crds update-codegen verify-codegen-crds verify-codegen verify

install/0000_00_cluster-version-operator_01_clusteroperator.crd.yaml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,99 @@ spec:
4040
- name: v1
4141
served: true
4242
storage: true
43+
validation:
44+
openAPIV3Schema:
45+
properties:
46+
apiVersion:
47+
description: 'APIVersion defines the versioned schema of this representation
48+
of an object. Servers should convert recognized schemas to the latest
49+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
50+
type: string
51+
kind:
52+
description: 'Kind is a string value representing the REST resource this
53+
object represents. Servers may infer this from the endpoint the client
54+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
55+
type: string
56+
metadata:
57+
type: object
58+
spec:
59+
description: spec hold the intent of how this operator should behave.
60+
type: object
61+
status:
62+
description: status holds the information about the state of an operator. It
63+
is consistent with status information across the kube ecosystem.
64+
properties:
65+
conditions:
66+
description: conditions describes the state of the operator's reconciliation
67+
functionality. +patchMergeKey=type +patchStrategy=merge
68+
items:
69+
properties:
70+
lastTransitionTime:
71+
description: lastTransitionTime is the time of the last update
72+
to the current status object.
73+
format: date-time
74+
type: string
75+
message:
76+
description: message provides additional information about the
77+
current condition. This is only to be consumed by humans.
78+
type: string
79+
reason:
80+
description: reason is the reason for the condition's last transition. Reasons
81+
are CamelCase
82+
type: string
83+
status:
84+
description: status of the condition, one of True, False, Unknown.
85+
type: string
86+
type:
87+
description: type specifies the state of the operator's reconciliation
88+
functionality.
89+
type: string
90+
type: object
91+
type: array
92+
extension:
93+
description: extension contains any additional status information specific
94+
to the operator which owns this status object.
95+
nullable: true
96+
type: object
97+
relatedObjects:
98+
description: 'relatedObjects is a list of objects that are "interesting"
99+
or related to this operator. Common uses are: 1. the detailed resource
100+
driving the operator 2. operator namespaces 3. operand namespaces'
101+
items:
102+
properties:
103+
group:
104+
description: group of the referent.
105+
type: string
106+
name:
107+
description: name of the referent.
108+
type: string
109+
namespace:
110+
description: namespace of the referent.
111+
type: string
112+
resource:
113+
description: resource of the referent.
114+
type: string
115+
type: object
116+
type: array
117+
versions:
118+
description: versions is a slice of operand version tuples. Operators
119+
which manage multiple operands will have multiple entries in the array. If
120+
an operator is Available, it must have at least one entry. You must
121+
report the version of the operator itself with the name "operator".
122+
items:
123+
properties:
124+
name:
125+
description: name is the name of the particular operand this version
126+
is for. It usually matches container images, not operators.
127+
type: string
128+
version:
129+
description: version indicates which version of a particular operand
130+
is currently being manage. It must always match the Available
131+
condition. If 1.0.0 is Available, then this must indicate 1.0.0
132+
even if the operator is trying to rollout 1.1.0
133+
type: string
134+
type: object
135+
type: array
136+
type: object
137+
required:
138+
- spec

0 commit comments

Comments
 (0)