Skip to content
This repository was archived by the owner on Feb 16, 2024. It is now read-only.

Commit b257788

Browse files
committed
fix crd generation
Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>
1 parent b40a0f6 commit b257788

File tree

6 files changed

+628
-3
lines changed

6 files changed

+628
-3
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ ifneq ($(shell go list -f '{{.Version}}' -m sigs.k8s.io/controller-tools), $(she
9494
go install sigs.k8s.io/controller-tools/cmd/controller-gen@$$(go list -f '{{.Version}}' -m sigs.k8s.io/controller-tools)
9595
go mod tidy
9696
endif
97-
controller-gen crd paths=./pkg/apis/... output:crd:dir=config/crds output:stdout
97+
controller-gen crd paths=./pkg/apis/... output:crd:dir=config/crd/bases output:stdout
9898
./hack/update_codegen.sh
9999

100100

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.9.2
7+
creationTimestamp: null
8+
name: testasserts.kuttl.dev
9+
spec:
10+
group: kuttl.dev
11+
names:
12+
kind: TestAssert
13+
listKind: TestAssertList
14+
plural: testasserts
15+
singular: testassert
16+
scope: Namespaced
17+
versions:
18+
- name: v1beta1
19+
schema:
20+
openAPIV3Schema:
21+
description: TestAssert represents the settings needed to verify the result
22+
of a test step.
23+
properties:
24+
apiVersion:
25+
description: 'APIVersion defines the versioned schema of this representation
26+
of an object. Servers should convert recognized schemas to the latest
27+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
28+
type: string
29+
collectors:
30+
description: Collectors is a set of pod log collectors fired on an assert
31+
failure
32+
items:
33+
description: TestCollector are post assert / error commands that allow
34+
for the collection of information sent to the test log. Type can be
35+
pod, command or event. For backward compatibility, pod is default
36+
and doesn't need to be specified For pod, At least one of `pod` or
37+
`selector` is required. For command, Command must be specified and
38+
Type can be == "command" but no other fields are valid For event,
39+
Type must be == "events" and Namespace and Name can be specified,
40+
if no ns or name, the default events are provided. If no name, than
41+
all events for that ns are provided.
42+
properties:
43+
command:
44+
description: Cmd is a command to run for collection. It requires
45+
an empty Type or Type=command
46+
type: string
47+
container:
48+
description: Container in pod to get logs from else --all-containers
49+
is used.
50+
type: string
51+
namespace:
52+
description: namespace to use. The current test namespace will be
53+
used by default.
54+
type: string
55+
pod:
56+
description: The pod name to access logs.
57+
type: string
58+
selector:
59+
description: Selector is a label query to select pod.
60+
type: string
61+
tail:
62+
description: Tail is the number of last lines to collect from pods.
63+
If omitted or zero, then the default is 10 if you use a selector,
64+
or -1 (all) if you use a pod name. This matches default behavior
65+
of `kubectl logs`.
66+
type: integer
67+
type:
68+
description: Type is a collector type which is pod, command or events
69+
command is default type if command field is not empty misconfiguration
70+
will lead to warning message in the logs
71+
type: string
72+
type: object
73+
type: array
74+
commands:
75+
description: Commands is a set of commands to be run as assertions for
76+
the current step
77+
items:
78+
description: TestAssertCommand an assertion based on the result of the
79+
execution of a command
80+
properties:
81+
command:
82+
description: The command and argument to run as a string.
83+
type: string
84+
namespaced:
85+
description: If set, the `--namespace` flag will be appended to
86+
the command with the namespace to use.
87+
type: boolean
88+
script:
89+
description: Ability to run a shell script from TestStep (without
90+
a script file) namespaced and command should not be used with
91+
script. namespaced is ignored and command is an error. env expansion
92+
is depended upon the shell but ENV is passed to the runtime env.
93+
type: string
94+
skipLogOutput:
95+
description: If set, the output from the command is NOT logged. Useful
96+
for sensitive logs or to reduce noise.
97+
type: boolean
98+
required:
99+
- command
100+
- namespaced
101+
- script
102+
- skipLogOutput
103+
type: object
104+
type: array
105+
kind:
106+
description: 'Kind is a string value representing the REST resource this
107+
object represents. Servers may infer this from the endpoint the client
108+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
109+
type: string
110+
metadata:
111+
type: object
112+
timeout:
113+
description: Override the default timeout of 30 seconds (in seconds).
114+
type: integer
115+
required:
116+
- timeout
117+
type: object
118+
served: true
119+
storage: true
+257
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.9.2
7+
creationTimestamp: null
8+
name: teststeps.kuttl.dev
9+
spec:
10+
group: kuttl.dev
11+
names:
12+
kind: TestStep
13+
listKind: TestStepList
14+
plural: teststeps
15+
singular: teststep
16+
scope: Namespaced
17+
versions:
18+
- name: v1beta1
19+
schema:
20+
openAPIV3Schema:
21+
description: TestStep settings to apply to a test step.go
22+
properties:
23+
apiVersion:
24+
description: 'APIVersion defines the versioned schema of this representation
25+
of an object. Servers should convert recognized schemas to the latest
26+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
27+
type: string
28+
apply:
29+
description: Apply, Assert and Error lists of files or directories to
30+
use in the test step. Useful to reuse a number of applies across tests
31+
/ test steps. all relative paths are relative to the folder the TestStep
32+
is defined in.
33+
items:
34+
description: Apply holds infos for an apply statement
35+
properties:
36+
file:
37+
type: string
38+
shouldFail:
39+
type: boolean
40+
type: object
41+
type: array
42+
assert:
43+
items:
44+
properties:
45+
file:
46+
description: File specifies the relative or full path to the YAML
47+
containing the expected content.
48+
type: string
49+
options:
50+
properties:
51+
arrays:
52+
items:
53+
description: AssertArray specifies conditions for verifying
54+
content within a YAML against a Kubernetes resource.
55+
properties:
56+
match:
57+
description: PartialObjectMetadata is a generic representation
58+
of any object with ObjectMeta. It allows clients to
59+
get access to a particular ObjectMeta schema without
60+
knowing the details of the version.
61+
properties:
62+
apiVersion:
63+
description: 'APIVersion defines the versioned schema
64+
of this representation of an object. Servers should
65+
convert recognized schemas to the latest internal
66+
value, and may reject unrecognized values. More
67+
info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
68+
type: string
69+
kind:
70+
description: 'Kind is a string value representing
71+
the REST resource this object represents. Servers
72+
may infer this from the endpoint the client submits
73+
requests to. Cannot be updated. In CamelCase. More
74+
info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
75+
type: string
76+
metadata:
77+
description: 'Standard object''s metadata. More info:
78+
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
79+
type: object
80+
type: object
81+
path:
82+
description: Path indicates the location within the YAML
83+
file to extract data for verification.
84+
type: string
85+
strategy:
86+
description: Strategy defines how the extracted data should
87+
be compared against the Kubernetes resource.
88+
type: string
89+
required:
90+
- path
91+
- strategy
92+
type: object
93+
type: array
94+
type: object
95+
required:
96+
- file
97+
type: object
98+
type: array
99+
commands:
100+
description: Commands to run prior at the beginning of the test step.
101+
items:
102+
description: Command describes a command to run as a part of a test
103+
step or suite.
104+
properties:
105+
background:
106+
description: If set, the command is run in the background.
107+
type: boolean
108+
command:
109+
description: The command and argument to run as a string.
110+
type: string
111+
ignoreFailure:
112+
description: If set, exit failures (`exec.ExitError`) will be ignored.
113+
`exec.Error` are NOT ignored.
114+
type: boolean
115+
namespaced:
116+
description: If set, the `--namespace` flag will be appended to
117+
the command with the namespace to use.
118+
type: boolean
119+
output:
120+
description: Output defines the expected output criteria for the
121+
command. It can check if the command's output equals or contains
122+
specific strings.
123+
properties:
124+
stderr:
125+
description: Stderr contains the expected output criteria for
126+
the standard error.
127+
properties:
128+
expected:
129+
description: Value is the expected value or pattern that
130+
should be matched against the command's output.
131+
type: string
132+
match:
133+
description: MatchType is the type of match that should
134+
be applied for validation. This could be "Equals", "Contains",
135+
or "Wildcard".
136+
type: string
137+
required:
138+
- expected
139+
- match
140+
type: object
141+
stdout:
142+
description: Stdout contains the expected output criteria for
143+
the standard output.
144+
properties:
145+
expected:
146+
description: Value is the expected value or pattern that
147+
should be matched against the command's output.
148+
type: string
149+
match:
150+
description: MatchType is the type of match that should
151+
be applied for validation. This could be "Equals", "Contains",
152+
or "Wildcard".
153+
type: string
154+
required:
155+
- expected
156+
- match
157+
type: object
158+
type: object
159+
script:
160+
description: Ability to run a shell script from TestStep (without
161+
a script file) namespaced and command should not be used with
162+
script. namespaced is ignored and command is an error. env expansion
163+
is depended upon the shell but ENV is passed to the runtime env.
164+
type: string
165+
skipLogOutput:
166+
description: If set, the output from the command is NOT logged. Useful
167+
for sensitive logs or to reduce noise.
168+
type: boolean
169+
timeout:
170+
description: Override the TestSuite timeout for this command (in
171+
seconds).
172+
type: integer
173+
required:
174+
- background
175+
- command
176+
- ignoreFailure
177+
- namespaced
178+
- script
179+
- skipLogOutput
180+
- timeout
181+
type: object
182+
type: array
183+
delete:
184+
description: Objects to delete at the beginning of the test step.
185+
items:
186+
description: ObjectReference is a Kubernetes object reference with added
187+
labels to allow referencing objects by label.
188+
properties:
189+
apiVersion:
190+
description: API version of the referent.
191+
type: string
192+
fieldPath:
193+
description: 'If referring to a piece of an object instead of an
194+
entire object, this string should contain a valid JSON/Go field
195+
access statement, such as desiredState.manifest.containers[2].
196+
For example, if the object reference is to a container within
197+
a pod, this would take on a value like: "spec.containers{name}"
198+
(where "name" refers to the name of the container that triggered
199+
the event) or if no container name is specified "spec.containers[2]"
200+
(container with index 2 in this pod). This syntax is chosen only
201+
to have some well-defined way of referencing a part of an object.
202+
TODO: this design is not final and this field is subject to change
203+
in the future.'
204+
type: string
205+
kind:
206+
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
207+
type: string
208+
labels:
209+
additionalProperties:
210+
type: string
211+
description: Labels to match on.
212+
type: object
213+
name:
214+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
215+
type: string
216+
namespace:
217+
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
218+
type: string
219+
resourceVersion:
220+
description: 'Specific resourceVersion to which this reference is
221+
made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
222+
type: string
223+
uid:
224+
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
225+
type: string
226+
required:
227+
- labels
228+
type: object
229+
x-kubernetes-map-type: atomic
230+
type: array
231+
error:
232+
items:
233+
type: string
234+
type: array
235+
index:
236+
format: int64
237+
type: integer
238+
kind:
239+
description: 'Kind is a string value representing the REST resource this
240+
object represents. Servers may infer this from the endpoint the client
241+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
242+
type: string
243+
kubeconfig:
244+
description: Kubeconfig to use when applying and asserting for this step.
245+
type: string
246+
metadata:
247+
type: object
248+
unitTest:
249+
description: Indicates that this is a unit test - safe to run without
250+
a real Kubernetes cluster.
251+
type: boolean
252+
required:
253+
- commands
254+
- unitTest
255+
type: object
256+
served: true
257+
storage: true

0 commit comments

Comments
 (0)