|
| 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