mirror of https://github.com/kyverno/chainsaw.git
Compare commits
343 Commits
main
...
v0.2.10-be
Author | SHA1 | Date |
---|---|---|
|
c6440e1b26 | |
|
41029f5cda | |
|
b46f9871fb | |
|
feb26abec4 | |
|
3a1125a4fd | |
|
2d4a31890d | |
|
a9035ca12c | |
|
9ecfefffe3 | |
|
6ec1ea1470 | |
|
903101868c | |
|
6a74f2784b | |
|
6704586709 | |
|
f6a14c008b | |
|
66e954b648 | |
|
d38d401e83 | |
|
a5b478de2a | |
|
f36ca881cc | |
|
b744df6eda | |
|
d570a302d5 | |
|
e9ae364f86 | |
|
b68fb9bc61 | |
|
dd57c01152 | |
|
a8feb9605e | |
|
3f19159363 | |
|
c4e0650584 | |
|
00727540cb | |
|
2c806616f2 | |
|
b054a82dae | |
|
a635f6a2ec | |
|
20862ce29f | |
|
6fce6107f6 | |
|
0c73b672c6 | |
|
1baaa3e9b9 | |
|
2fa87d495e | |
|
6e77b67fc2 | |
|
9af0813fff | |
|
d213e84192 | |
|
0a04e9e2af | |
|
85c25d769b | |
|
132d1cf8d3 | |
|
8ab1d385ba | |
|
a418f8e624 | |
|
923674f019 | |
|
52b78bba17 | |
|
30857057ba | |
|
b5504a50d1 | |
|
0576885791 | |
|
663ec62ff1 | |
|
7d97818ce0 | |
|
af6a5c9e5a | |
|
b9e3491f9c | |
|
68814db110 | |
|
7b709b442f | |
|
99f5d62390 | |
|
c1faf47b19 | |
|
4ae8f11bbf | |
|
9abd6a7ec2 | |
|
180f8c22f2 | |
|
84260de140 | |
|
df3a774ed7 | |
|
5a959cc0a8 | |
|
94cd2118eb | |
|
0d6f9a57e2 | |
|
73c3380af7 | |
|
33b798c3ee | |
|
752d0b2a93 | |
|
81566dd8c3 | |
|
51207b9dc8 | |
|
7bd4223d93 | |
|
22cbf8a396 | |
|
0e0b4475ba | |
|
4294c5126e | |
|
f0a55bb268 | |
|
b2cc92cece | |
|
db549d5b40 | |
|
7c19c94b19 | |
|
dc6070d90d | |
|
01cfd2b61f | |
|
0ccb5c5997 | |
|
2891392bdf | |
|
4c8575d585 | |
|
d0a7cb9362 | |
|
42944af08a | |
|
8bc0eae6cd | |
|
2d5b3ef95f | |
|
18dcdcbdb9 | |
|
fec064b123 | |
|
a5c2d4053b | |
|
ec1126a9d0 | |
|
2581e5de89 | |
|
90d07f7c11 | |
|
ce26036fc3 | |
|
0a88123a6f | |
|
d5dfecc310 | |
|
7ecf185147 | |
|
75fe4e2bce | |
|
636cc0c051 | |
|
00796b5304 | |
|
67c3be86d2 | |
|
defac86b44 | |
|
fc4290b4b2 | |
|
7c9e952e20 | |
|
2be494bae8 | |
|
09efa13cd9 | |
|
65098eb5b1 | |
|
0d439ae38a | |
|
a96d6fdbf2 | |
|
46e788c0a1 | |
|
e0faaa21d6 | |
|
668fcc0b39 | |
|
128d7db74c | |
|
b77fb57522 | |
|
8d9c3516b4 | |
|
effdb79fd8 | |
|
365151e564 | |
|
85bb85ded7 | |
|
f3138ab3b8 | |
|
7c2b1a67aa | |
|
fffcf31384 | |
|
d2f9657ddd | |
|
32ce9b4cf0 | |
|
596c220296 | |
|
b6cbebc4a8 | |
|
04518ee2f4 | |
|
e8a18918f7 | |
|
1cbbbb98d7 | |
|
dada3e6d16 | |
|
54e34e5d78 | |
|
ef374d6f0d | |
|
82e7ffbea9 | |
|
e16bcb19e4 | |
|
6fa8c5ca7f | |
|
5b7275ac81 | |
|
e1ec6299b0 | |
|
d0a6d47b9f | |
|
4b91ad296a | |
|
0bf667cdc7 | |
|
cdc5be8fb0 | |
|
8efda7f9a1 | |
|
a7b93a6cda | |
|
8a48313717 | |
|
2a2bd7a808 | |
|
0bcb6b4e0c | |
|
7b854d009b | |
|
0365dee1ab | |
|
ea7886a85c | |
|
8e2ba663f2 | |
|
7dfa881538 | |
|
792de8a1d1 | |
|
62539800f0 | |
|
6f2a18b88f | |
|
f0af1aae8e | |
|
60078c01b9 | |
|
48a338f5cb | |
|
8002960436 | |
|
437c781cab | |
|
18899b42b0 | |
|
39ca8895a5 | |
|
2811d18080 | |
|
0c5fae8e97 | |
|
7d1727148e | |
|
d78dca6886 | |
|
310302dc22 | |
|
63d0e49c68 | |
|
7374cf7111 | |
|
b13553b948 | |
|
91ca4dc0e0 | |
|
0d26b59ee6 | |
|
9951fe49ae | |
|
15cebcb4f0 | |
|
4fd2081054 | |
|
4fec1e5954 | |
|
3c91d0daa3 | |
|
d23688208c | |
|
bf8ffe7467 | |
|
6d5444a027 | |
|
216cd86837 | |
|
82b2504e93 | |
|
813e10e9fd | |
|
0805301f6a | |
|
99373ca197 | |
|
4b42a99474 | |
|
362749b645 | |
|
f6d484ed83 | |
|
60545e5b54 | |
|
55d5bb8ace | |
|
2c097c4087 | |
|
05ba99f6e6 | |
|
ee6520bf95 | |
|
0fdf5cddd9 | |
|
423692c22d | |
|
013ec08958 | |
|
ee8e1f1825 | |
|
7a241ad029 | |
|
4a82481aab | |
|
b305f4f348 | |
|
f1e9450194 | |
|
aed1f4307b | |
|
56f7b12c31 | |
|
558ab42ade | |
|
60623e67fc | |
|
093c9e37b0 | |
|
18d99b5e9f | |
|
fa19a76cf7 | |
|
9b05a247d5 | |
|
a27c25512a | |
|
a99022371b | |
|
e337ce6c77 | |
|
a215bb2ef4 | |
|
6f81e73441 | |
|
be87640044 | |
|
05aefe91df | |
|
a301cb7c9c | |
|
dc507c2315 | |
|
bac32f71fd | |
|
bcbff46a1e | |
|
94d92efe85 | |
|
ea600f38a7 | |
|
fd4609ddc6 | |
|
b70ab1e301 | |
|
27971133cb | |
|
26589f3206 | |
|
de919e9612 | |
|
07eb449842 | |
|
cf2c77e95c | |
|
20e426e34f | |
|
9ba295143d | |
|
64bd2fe1b7 | |
|
0514dc2d38 | |
|
693c0d9c16 | |
|
5e45e98ab0 | |
|
a5a8d5c53e | |
|
e0abec8381 | |
|
46d6e5e105 | |
|
bd0bba7ef5 | |
|
31c043659a | |
|
8fa8726974 | |
|
b53fbef960 | |
|
79749433c4 | |
|
082e83eb41 | |
|
a26c3f3cea | |
|
f17e00fd68 | |
|
231ea9a79c | |
|
fe176c0000 | |
|
f5eec08361 | |
|
13a0cf9082 | |
|
08787c49df | |
|
6a0605684f | |
|
0c62ea7eb1 | |
|
68c3faaaa7 | |
|
7431f1c37b | |
|
ce155eeae5 | |
|
42ee5aaa77 | |
|
8bd9b98394 | |
|
afcb015385 | |
|
bcfd85a2f0 | |
|
a5732f01bc | |
|
44b22d0e36 | |
|
6773dc8cd3 | |
|
8bed4698ac | |
|
1c5e38e88d | |
|
180ae170ee | |
|
eefb4482df | |
|
384132c04d | |
|
63c0b6a5d7 | |
|
78b71a0eef | |
|
e80ebb20a4 | |
|
feb61e03fa | |
|
38dc40a360 | |
|
1d4741a01c | |
|
35e0abe471 | |
|
56bf5af759 | |
|
fa6ba2e721 | |
|
99f37cadd2 | |
|
3679a1dd43 | |
|
02ec44faf9 | |
|
f3fd620429 | |
|
78a1d00f05 | |
|
f27c7756de | |
|
955eabef77 | |
|
9fabf9c33f | |
|
4fe68214e4 | |
|
f91cb71a43 | |
|
0b235f4851 | |
|
77ae277e86 | |
|
50e5a45b85 | |
|
90176eb538 | |
|
da759b6b2b | |
|
7771f24a27 | |
|
649f593f0a | |
|
119d34696b | |
|
9585468a14 | |
|
e968e662ba | |
|
ed0bdae4bc | |
|
0bae442d66 | |
|
7613418576 | |
|
010db9c13b | |
|
29ebd16a57 | |
|
f9065d761f | |
|
6db661cf41 | |
|
218e978bd4 | |
|
23a5913303 | |
|
efb3eb4ec0 | |
|
5449554481 | |
|
4915642163 | |
|
39adbf6274 | |
|
c8fad0663b | |
|
57d9440577 | |
|
6be49603ec | |
|
534afdaf90 | |
|
b70a6ce0c1 | |
|
fd0339b146 | |
|
584ecf7f7b | |
|
6b8c3bd757 | |
|
661554179e | |
|
6bb2b2e6e1 | |
|
c7a4964904 | |
|
596041226a | |
|
0734d549f5 | |
|
09792c70de | |
|
967bf17146 | |
|
8fb7732137 | |
|
f073726899 | |
|
6c60e5a3d9 | |
|
3c6932648d | |
|
7ff7ea7488 | |
|
ed0cc751fb | |
|
363b246e91 | |
|
48b069b499 | |
|
0ae5dd936f | |
|
dcc6d45e50 | |
|
97a925baf9 | |
|
037f62bdd8 | |
|
a6082dbe7d | |
|
fa8ddf5369 | |
|
1bf3caf7df | |
|
bd765c8fa9 | |
|
a38de0f688 | |
|
c4efea83f1 | |
|
382d7c6beb | |
|
931fd161d9 | |
|
453007813e | |
|
5a17bd4e96 |
|
@ -81,13 +81,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -103,6 +96,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -135,13 +129,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -161,15 +148,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -183,10 +164,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -201,13 +178,6 @@ spec:
|
|||
required:
|
||||
- entrypoint
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
delete:
|
||||
description: Delete represents a deletion operation.
|
||||
not:
|
||||
|
@ -221,13 +191,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -282,9 +245,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -582,13 +547,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -604,6 +562,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -637,13 +596,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -663,15 +615,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -685,10 +631,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -831,13 +773,6 @@ spec:
|
|||
description: Clusters holds a registry to clusters to support multi-cluster
|
||||
tests.
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when evaluating
|
||||
expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
delayBeforeCleanup:
|
||||
description: DelayBeforeCleanup adds a delay between the time a test
|
||||
ends and the time cleanup starts.
|
||||
|
@ -881,14 +816,8 @@ spec:
|
|||
namespaceTemplate:
|
||||
description: NamespaceTemplate defines a template to create the test
|
||||
namespace.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
namespaceTemplateCompiler:
|
||||
description: NamespaceTemplateCompiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
parallel:
|
||||
description: The maximum number of tests to run at once.
|
||||
format: int
|
||||
|
@ -902,7 +831,7 @@ spec:
|
|||
type: integer
|
||||
reportFormat:
|
||||
description: |-
|
||||
ReportFormat determines test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION, nil) nil == no report.
|
||||
ReportFormat determines test report format (JSON|XML|JUNIT-TEST|JUNIT-STEP|JUNIT-OPERATION|nil) nil == no report.
|
||||
maps to report.Type, however we don't want generated.deepcopy to have reference to it.
|
||||
enum:
|
||||
- JSON
|
||||
|
@ -1108,13 +1037,6 @@ spec:
|
|||
description: Binding represents a key/value set as
|
||||
a binding in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1130,6 +1052,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate
|
||||
the operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will
|
||||
|
@ -1163,13 +1086,6 @@ spec:
|
|||
description: Binding represents a key/value set as
|
||||
a binding in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1189,15 +1105,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -1211,10 +1121,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the
|
||||
command. Useful for sensitive logs or to reduce noise.
|
||||
|
@ -1229,13 +1135,6 @@ spec:
|
|||
required:
|
||||
- entrypoint
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use
|
||||
when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
delete:
|
||||
description: Delete represents a deletion operation.
|
||||
not:
|
||||
|
@ -1249,13 +1148,6 @@ spec:
|
|||
description: Binding represents a key/value set as
|
||||
a binding in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1310,9 +1202,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -1613,13 +1507,6 @@ spec:
|
|||
description: Binding represents a key/value set as
|
||||
a binding in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1635,6 +1522,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate
|
||||
the operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will
|
||||
|
@ -1668,13 +1556,6 @@ spec:
|
|||
description: Binding represents a key/value set as
|
||||
a binding in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1694,15 +1575,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -1716,10 +1591,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the
|
||||
command. Useful for sensitive logs or to reduce noise.
|
||||
|
@ -1877,13 +1748,6 @@ spec:
|
|||
description: Namespace contains properties for the namespace to use
|
||||
for tests.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: |-
|
||||
Name defines the namespace to use for tests.
|
||||
|
@ -1892,6 +1756,7 @@ spec:
|
|||
type: string
|
||||
template:
|
||||
description: Template defines a template to create the test namespace.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type: object
|
||||
report:
|
||||
|
@ -1899,8 +1764,7 @@ spec:
|
|||
properties:
|
||||
format:
|
||||
default: JSON
|
||||
description: ReportFormat determines test report format (JSON,
|
||||
XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION).
|
||||
description: ReportFormat determines test report format (JSON|XML|JUNIT-TEST|JUNIT-STEP|JUNIT-OPERATION).
|
||||
enum:
|
||||
- JSON
|
||||
- XML
|
||||
|
@ -1921,13 +1785,6 @@ spec:
|
|||
default: {}
|
||||
description: Templating contains the templating config.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
enabled:
|
||||
default: true
|
||||
description: Enabled determines whether resources should be considered
|
||||
|
|
|
@ -45,13 +45,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding in
|
||||
an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -104,13 +97,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -126,6 +112,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -158,13 +145,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -184,15 +164,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -206,10 +180,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -224,13 +194,6 @@ spec:
|
|||
required:
|
||||
- entrypoint
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
delete:
|
||||
description: Delete represents a deletion operation.
|
||||
not:
|
||||
|
@ -244,13 +207,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -305,9 +261,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -605,13 +563,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -627,6 +578,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -660,13 +612,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -686,15 +631,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -708,10 +647,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -878,13 +813,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -900,6 +828,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -932,13 +861,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -958,15 +880,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -980,10 +896,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -998,13 +910,6 @@ spec:
|
|||
required:
|
||||
- entrypoint
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
delete:
|
||||
description: Delete represents a deletion operation.
|
||||
not:
|
||||
|
@ -1018,13 +923,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1079,9 +977,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -1379,13 +1279,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1401,6 +1294,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -1434,13 +1328,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1460,15 +1347,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -1482,10 +1363,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -1652,13 +1529,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1674,6 +1544,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -1706,13 +1577,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1732,15 +1596,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -1754,10 +1612,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -1772,13 +1626,6 @@ spec:
|
|||
required:
|
||||
- entrypoint
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
delete:
|
||||
description: Delete represents a deletion operation.
|
||||
not:
|
||||
|
@ -1792,13 +1639,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1853,9 +1693,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -2153,13 +1995,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2175,6 +2010,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -2208,13 +2044,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2234,15 +2063,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -2256,10 +2079,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -2438,13 +2257,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2493,9 +2305,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -2514,15 +2328,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -2564,13 +2372,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2613,6 +2414,7 @@ spec:
|
|||
type: string
|
||||
resource:
|
||||
description: Check provides a check used in assertions.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
template:
|
||||
description: Template determines whether resources should
|
||||
|
@ -2637,13 +2439,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2659,6 +2454,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -2691,13 +2487,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2717,15 +2506,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -2739,10 +2522,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -2757,13 +2536,6 @@ spec:
|
|||
required:
|
||||
- entrypoint
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
continueOnError:
|
||||
description: |-
|
||||
ContinueOnError determines whether a test should continue or not in case the operation was not successful.
|
||||
|
@ -2782,13 +2554,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2837,9 +2602,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -2858,15 +2625,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -2907,13 +2668,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2968,9 +2722,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -3102,13 +2858,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -3151,6 +2900,7 @@ spec:
|
|||
type: string
|
||||
resource:
|
||||
description: Check provides a check used in assertions.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
template:
|
||||
description: Template determines whether resources should
|
||||
|
@ -3289,13 +3039,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -3344,9 +3087,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -3365,15 +3110,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -3508,15 +3247,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -3555,13 +3288,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -3577,6 +3303,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -3610,13 +3337,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -3636,15 +3356,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -3658,10 +3372,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -3696,13 +3406,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -3751,9 +3454,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -3772,15 +3477,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -14,9 +14,6 @@ body:
|
|||
label: chainsaw version Version
|
||||
description: What version of chainsaw are you running?
|
||||
options:
|
||||
- v0.2.12
|
||||
- v0.2.11
|
||||
- v0.2.10
|
||||
- v0.2.9
|
||||
- v0.2.8
|
||||
- v0.2.7
|
||||
|
|
|
@ -23,9 +23,6 @@ body:
|
|||
label: chainsaw version Version
|
||||
description: What version of chainsaw are you running?
|
||||
options:
|
||||
- v0.2.12
|
||||
- v0.2.11
|
||||
- v0.2.10
|
||||
- v0.2.9
|
||||
- v0.2.8
|
||||
- v0.2.7
|
||||
|
|
|
@ -23,9 +23,9 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Ensure SHA pinned actions
|
||||
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@fc87bb5b5a97953d987372e74478de634726b3e5 # v3.0.25
|
||||
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@0901cf7b71c7ea6261ec69a3dc2bd3f9264f893e # v3.0.12
|
||||
with:
|
||||
# slsa-github-generator requires using a semver tag for reusable workflows.
|
||||
# See: https://github.com/slsa-framework/slsa-github-generator#referencing-slsa-builders-and-generators
|
||||
|
|
|
@ -23,9 +23,9 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
|
|
|
@ -25,11 +25,11 @@ jobs:
|
|||
security-events: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Run Trivy vulnerability scanner in repo mode
|
||||
uses: aquasecurity/trivy-action@dc5a429b52fcf669ce959baa2c2dd26090d2a6c4 # v0.32.0
|
||||
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # v0.24.0
|
||||
with:
|
||||
scan-type: fs
|
||||
ignore-unfixed: false
|
||||
|
@ -39,10 +39,8 @@ jobs:
|
|||
scanners: vuln,secret
|
||||
exit-code: '0'
|
||||
vuln-type: os,library
|
||||
env:
|
||||
TRIVY_DB_REPOSITORY: 'public.ecr.aws/aquasecurity/trivy-db:2'
|
||||
- name: Upload Trivy scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.5
|
||||
uses: github/codeql-action/upload-sarif@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7
|
||||
with:
|
||||
sarif_file: trivy-results.sarif
|
||||
category: code
|
||||
category: code
|
|
@ -20,9 +20,9 @@ jobs:
|
|||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
|
|
|
@ -23,9 +23,9 @@ jobs:
|
|||
version_extractor_regex: '^docs-v(.*)$'
|
||||
- name: Checkout
|
||||
if: ${{ steps.semver.outputs.prerelease == '' }}
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
if: ${{ steps.semver.outputs.prerelease == '' }}
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
|
|
@ -23,13 +23,13 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
|
||||
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v3.7.1
|
||||
with:
|
||||
skip-cache: true
|
||||
|
|
|
@ -44,6 +44,7 @@ concurrency:
|
|||
jobs:
|
||||
check-semantic-pr:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.actor != 'gcp-cherry-pick-bot' }}
|
||||
steps:
|
||||
- name: Validate Pull Request
|
||||
uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017
|
||||
|
|
|
@ -33,7 +33,7 @@ jobs:
|
|||
docker-images: true
|
||||
swap-storage: false
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Fetch all tags
|
||||
|
@ -41,19 +41,19 @@ jobs:
|
|||
set -e
|
||||
git fetch --force --tags
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
- name: Install Cosign
|
||||
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
|
||||
uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6.0
|
||||
- name: Install Syft
|
||||
uses: anchore/sbom-action/download-syft@7b36ad622f042cab6f59a75c2ac24ccb256e9b45 # v0.20.4
|
||||
uses: anchore/sbom-action/download-syft@61119d458adab75f756bc0b9e4bde25725f86a7a # v0.17.2
|
||||
- name: Install Ko
|
||||
uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
|
||||
uses: ko-build/setup-ko@3aebd0597dc1e9d1a26bcfdb7cbeb19c131d3037 # v0.7
|
||||
- name: Run GoReleaser
|
||||
id: goreleaser
|
||||
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
|
||||
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
|
||||
with:
|
||||
distribution: goreleaser
|
||||
version: latest
|
||||
|
@ -61,14 +61,14 @@ jobs:
|
|||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Upload artifacts.json
|
||||
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # 2.11.2
|
||||
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # 2.9.0
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: dist/artifacts.json
|
||||
asset_name: artifacts.json
|
||||
tag: ${{ github.ref }}
|
||||
- name: Upload metadata.json
|
||||
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # 2.11.2
|
||||
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # 2.9.0
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: dist/metadata.json
|
||||
|
@ -102,7 +102,7 @@ jobs:
|
|||
actions: read
|
||||
id-token: write
|
||||
contents: write
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
|
||||
with:
|
||||
base64-subjects: "${{ needs.goreleaser.outputs.hashes }}"
|
||||
upload-assets: true
|
||||
|
@ -114,7 +114,7 @@ jobs:
|
|||
actions: read
|
||||
id-token: write
|
||||
packages: write
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
|
||||
with:
|
||||
image: ${{ needs.goreleaser.outputs.image }}
|
||||
digest: ${{ needs.goreleaser.outputs.digest }}
|
||||
|
|
|
@ -23,9 +23,9 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
|
@ -38,7 +38,7 @@ jobs:
|
|||
set -e
|
||||
make tests
|
||||
- name: Upload coverage
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||
with:
|
||||
name: coverage.out
|
||||
path: coverage.out
|
||||
|
@ -51,11 +51,11 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download coverage
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||
with:
|
||||
name: coverage.out
|
||||
- name: Upload Report to Codecov
|
||||
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
|
||||
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
|
||||
with:
|
||||
files: ./coverage.out
|
||||
fail_ci_if_error: true
|
||||
|
@ -67,9 +67,9 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
|
@ -82,33 +82,18 @@ jobs:
|
|||
set -e
|
||||
make e2e-tests
|
||||
|
||||
e2e-tests-no-cluster:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
- name: Run tests
|
||||
run: |
|
||||
set -e
|
||||
make e2e-tests-no-cluster
|
||||
|
||||
e2e-test-ko:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
- name: Install ko
|
||||
uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d #v0.9
|
||||
uses: ko-build/setup-ko@3aebd0597dc1e9d1a26bcfdb7cbeb19c131d3037 #v0.7
|
||||
- name: Create test cluster
|
||||
run: |
|
||||
set -e
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
version: "2"
|
||||
linters:
|
||||
enable:
|
||||
- asasalint
|
||||
|
@ -6,49 +5,46 @@ linters:
|
|||
- bidichk
|
||||
- bodyclose
|
||||
- containedctx
|
||||
- copyloopvar
|
||||
- decorder
|
||||
- dogsled
|
||||
- durationcheck
|
||||
- errcheck
|
||||
- errname
|
||||
- exportloopref
|
||||
- gci
|
||||
- gochecknoinits
|
||||
- gofmt
|
||||
- gofumpt
|
||||
- goimports
|
||||
- goprintffuncname
|
||||
- gosec
|
||||
- gosimple
|
||||
- govet
|
||||
- grouper
|
||||
- importas
|
||||
- ineffassign
|
||||
- makezero
|
||||
- misspell
|
||||
- noctx
|
||||
- nolintlint
|
||||
- nosprintfhostport
|
||||
# - paralleltest
|
||||
- staticcheck
|
||||
- tenv
|
||||
- thelper
|
||||
- tparallel
|
||||
- typecheck
|
||||
- unconvert
|
||||
- usetesting
|
||||
- unused
|
||||
- wastedassign
|
||||
- whitespace
|
||||
exclusions:
|
||||
generated: lax
|
||||
presets:
|
||||
- comments
|
||||
- common-false-positives
|
||||
- legacy
|
||||
- std-error-handling
|
||||
paths:
|
||||
- .+\.generated.go
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
formatters:
|
||||
enable:
|
||||
- gci
|
||||
- gofmt
|
||||
- gofumpt
|
||||
- goimports
|
||||
exclusions:
|
||||
generated: lax
|
||||
paths:
|
||||
- .+\.generated.go
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
|
||||
run:
|
||||
timeout: 15m
|
||||
|
||||
output:
|
||||
sort-results: true
|
||||
|
||||
issues:
|
||||
exclude-files:
|
||||
- ".+\\.generated.go"
|
||||
|
|
|
@ -13,13 +13,11 @@ Release notes for `TODO`.
|
|||
|
||||
## ⛵ Tutorials ⛵
|
||||
|
||||
## 🔧 Fixes 🔧
|
||||
|
||||
## 📚 Docs 📚
|
||||
|
||||
## 🎸 Misc 🎸
|
||||
-->
|
||||
|
||||
## 💫 New features 💫
|
||||
## 🔧 Fixes 🔧
|
||||
|
||||
- Continue tests when an error happens when computing the test name
|
||||
- Fixed default report name not set correctly
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
# Release notes
|
||||
|
||||
Release notes for `v0.2.10`.
|
||||
|
||||
## 💫 New features 💫
|
||||
|
||||
- Added bindings support when referencing step templates
|
||||
- Restructured the reports system
|
||||
- Added reports in JSON format back
|
||||
- Added new JUnit report formats with different granularity (`JUNIT-TEST`, `JUNIT-STEP`, `JUNIT-OPERATION`)
|
||||
- `XML` report format should be considered deprecated and replaced with one of the `JUNIT-*` format
|
||||
|
||||
## 🔧 Fixes 🔧
|
||||
|
||||
- Fixed default report name not set correctly
|
||||
- Made `template` required when referencing a step template
|
||||
|
||||
## 📚 Docs 📚
|
||||
|
||||
- Started a JMESPath function example page in the docs (only `x_k8s_get` is available at this time)
|
||||
|
||||
## 🎸 Misc 🎸
|
||||
|
||||
- Removed test `v1alpha2` API for now
|
|
@ -1,17 +0,0 @@
|
|||
# Release notes
|
||||
|
||||
Release notes for `v0.2.11`.
|
||||
|
||||
## 💫 New features 💫
|
||||
|
||||
- Added CEL support everywhere (bindings, assertion trees, projection trees, outputs...)
|
||||
- Added test sharding support
|
||||
|
||||
## 🔧 Fixes 🔧
|
||||
|
||||
- Fixed exit code when failing in root test run
|
||||
- Fixed `--no-cluster` flag not working
|
||||
|
||||
## 📚 Docs 📚
|
||||
|
||||
- Added most JMESPath functions docs and examples
|
|
@ -1,15 +0,0 @@
|
|||
# Release notes
|
||||
|
||||
Release notes for `v0.2.12`.
|
||||
|
||||
## 💫 New features 💫
|
||||
|
||||
- Registered Kubernetes CEL libs, optional types, and various other std libs
|
||||
- Support conditions in labels in assertion templates
|
||||
- Added `skipCommandOutput` support to not log the `command` and `script` being executed
|
||||
|
||||
## 🔧 Fixes 🔧
|
||||
|
||||
- Allow escaping dollar sign in `command` and `script`
|
||||
- Fixed `chainsaw build docs` rendering invalid yaml
|
||||
- Fixed step template bindings registered in the wrong order
|
|
@ -96,7 +96,6 @@
|
|||
],
|
||||
"default": ""
|
||||
},
|
||||
"x-kubernetes-list-type": "set",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
"generateName": {
|
||||
|
@ -208,8 +207,7 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"x-kubernetes-list-type": "atomic"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names",
|
||||
|
@ -287,10 +285,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"x-kubernetes-list-map-keys": [
|
||||
"uid"
|
||||
],
|
||||
"x-kubernetes-list-type": "map",
|
||||
"x-kubernetes-patch-merge-key": "uid",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
|
@ -427,17 +421,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -453,6 +436,10 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -514,17 +501,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -555,19 +531,12 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -583,13 +552,6 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"skipCommandOutput": {
|
||||
"description": "SkipCommandOutput removes the command from the output logs.",
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"skipLogOutput": {
|
||||
"description": "SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise.",
|
||||
"type": [
|
||||
|
@ -614,17 +576,6 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"description": "Delete represents a deletion operation.",
|
||||
"type": [
|
||||
|
@ -655,17 +606,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -747,10 +687,15 @@
|
|||
"properties": {
|
||||
"check": {
|
||||
"description": "Check defines the verification statement.",
|
||||
"type": "object",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
}
|
||||
},
|
||||
|
@ -1250,17 +1195,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -1276,6 +1210,10 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -1340,17 +1278,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -1381,19 +1308,12 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -1409,13 +1329,6 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"skipCommandOutput": {
|
||||
"description": "SkipCommandOutput removes the command from the output logs.",
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"skipLogOutput": {
|
||||
"description": "SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise.",
|
||||
"type": [
|
||||
|
@ -1657,17 +1570,6 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"delayBeforeCleanup": {
|
||||
"description": "DelayBeforeCleanup adds a delay between the time a test ends and the time cleanup starts.",
|
||||
"type": [
|
||||
|
@ -1732,18 +1634,11 @@
|
|||
},
|
||||
"namespaceTemplate": {
|
||||
"description": "NamespaceTemplate defines a template to create the test namespace.",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"namespaceTemplateCompiler": {
|
||||
"description": "NamespaceTemplateCompiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"parallel": {
|
||||
"description": "The maximum number of tests to run at once.",
|
||||
|
@ -1764,7 +1659,7 @@
|
|||
"minimum": 1
|
||||
},
|
||||
"reportFormat": {
|
||||
"description": "ReportFormat determines test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION, nil) nil == no report.\nmaps to report.Type, however we don't want generated.deepcopy to have reference to it.",
|
||||
"description": "ReportFormat determines test report format (JSON|XML|JUNIT-TEST|JUNIT-STEP|JUNIT-OPERATION|nil) nil == no report.\nmaps to report.Type, however we don't want generated.deepcopy to have reference to it.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
|
|
|
@ -96,7 +96,6 @@
|
|||
],
|
||||
"default": ""
|
||||
},
|
||||
"x-kubernetes-list-type": "set",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
"generateName": {
|
||||
|
@ -208,8 +207,7 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"x-kubernetes-list-type": "atomic"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names",
|
||||
|
@ -287,10 +285,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"x-kubernetes-list-map-keys": [
|
||||
"uid"
|
||||
],
|
||||
"x-kubernetes-list-type": "map",
|
||||
"x-kubernetes-patch-merge-key": "uid",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
|
@ -555,17 +549,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -581,6 +564,10 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -642,17 +629,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -683,19 +659,12 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -711,13 +680,6 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"skipCommandOutput": {
|
||||
"description": "SkipCommandOutput removes the command from the output logs.",
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"skipLogOutput": {
|
||||
"description": "SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise.",
|
||||
"type": [
|
||||
|
@ -742,17 +704,6 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"description": "Delete represents a deletion operation.",
|
||||
"type": [
|
||||
|
@ -783,17 +734,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -875,10 +815,15 @@
|
|||
"properties": {
|
||||
"check": {
|
||||
"description": "Check defines the verification statement.",
|
||||
"type": "object",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
}
|
||||
},
|
||||
|
@ -1378,17 +1323,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -1404,6 +1338,10 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -1468,17 +1406,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -1509,19 +1436,12 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -1537,13 +1457,6 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"skipCommandOutput": {
|
||||
"description": "SkipCommandOutput removes the command from the output logs.",
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"skipLogOutput": {
|
||||
"description": "SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise.",
|
||||
"type": [
|
||||
|
@ -1808,17 +1721,6 @@
|
|||
],
|
||||
"default": {},
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name defines the namespace to use for tests.\nIf not specified, every test will execute in a random ephemeral namespace\nunless the namespace is overridden in a the test spec.",
|
||||
"type": [
|
||||
|
@ -1828,6 +1730,10 @@
|
|||
},
|
||||
"template": {
|
||||
"description": "Template defines a template to create the test namespace.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
}
|
||||
},
|
||||
|
@ -1841,7 +1747,7 @@
|
|||
],
|
||||
"properties": {
|
||||
"format": {
|
||||
"description": "ReportFormat determines test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION).",
|
||||
"description": "ReportFormat determines test report format (JSON|XML|JUNIT-TEST|JUNIT-STEP|JUNIT-OPERATION).",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
|
@ -1881,17 +1787,6 @@
|
|||
],
|
||||
"default": {},
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"enabled": {
|
||||
"description": "Enabled determines whether resources should be considered for templating.",
|
||||
"type": [
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -16,7 +16,6 @@
|
|||
"./testdata/e2e/examples",
|
||||
"--config",
|
||||
"./testdata/e2e/config.yaml",
|
||||
"--remarshal",
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -9,7 +9,6 @@ The list of organizations that have publicly shared the usage of Chainsaw:
|
|||
| Organization | Success Story |
|
||||
|:--|:--|
|
||||
| [Keptn](https://github.com/keptn/lifecycle-toolkit)| Chainsaw replaced Kuttl, and helped us get rid of many unreadable bash scripts |
|
||||
| [OpenFeature](https://github.com/open-feature/open-feature-operator)| Chainsaw replaced Kuttl, helped us improve logging and remove native kubectl calls |
|
||||
| [Kyverno](https://kyverno.io) | Running all end to end tests for both Kyverno and the policies catalog |
|
||||
| [Nirmata](https://nirmata.com/) | Using Chainsaw extensively to test curated Kyverno policies, Kyverno Operator and other e2e internal testing |
|
||||
| [Redis-operator](https://github.com/OT-CONTAINER-KIT/redis-operator) | Chainsaw helped a lot for declarative assertion of Redis Cluster state against various e2e test |
|
||||
|
@ -21,7 +20,6 @@ The list of organizations that have publicly shared the usage of Chainsaw:
|
|||
| [Provider-ceph](https://github.com/linode/provider-ceph) | Chainsaw replaced Kuttl and made our e2e tests much more readable and easier to debug |
|
||||
| [Linode CAPI provider](https://github.com/linode/cluster-api-provider-linode) | Chainsaw replaced Kuttl and made our e2e tests much more readable and easier to debug. 🙏 @eddycharly |
|
||||
| [Linode COSI driver](https://github.com/linode/linode-cosi-driver) | Running all end to end tests for object store driver |
|
||||
| [Odigos](https://github.com/odigos-io/odigos) | Chainsaw helps us run complex e2e tests confidently, ensuring project reliability. |
|
||||
|
||||
|
||||
<!-- append the line below to the table
|
||||
|
|
58
Makefile
58
Makefile
|
@ -7,6 +7,9 @@
|
|||
GIT_SHA := $(shell git rev-parse HEAD)
|
||||
ORG ?= kyverno
|
||||
PACKAGE ?= github.com/$(ORG)/chainsaw
|
||||
GOPATH_SHIM := ${PWD}/.gopath
|
||||
PACKAGE_SHIM := $(GOPATH_SHIM)/src/$(PACKAGE)
|
||||
INPUT_DIRS := $(PACKAGE)/pkg/apis/v1alpha1,$(PACKAGE)/pkg/apis/v1alpha2
|
||||
CRDS_PATH := ${PWD}/.crds
|
||||
CLI_BIN := chainsaw
|
||||
CGO_ENABLED ?= 0
|
||||
|
@ -18,7 +21,7 @@ LD_FLAGS := "-s -w"
|
|||
endif
|
||||
KO_REGISTRY := ko.local
|
||||
KO_TAGS := $(GIT_SHA)
|
||||
KIND_IMAGE ?= kindest/node:v1.33.2
|
||||
KIND_IMAGE ?= kindest/node:v1.29.2
|
||||
|
||||
#########
|
||||
# TOOLS #
|
||||
|
@ -29,13 +32,13 @@ CONTROLLER_GEN := $(TOOLS_DIR)/controller-gen
|
|||
REGISTER_GEN := $(TOOLS_DIR)/register-gen
|
||||
DEEPCOPY_GEN := $(TOOLS_DIR)/deepcopy-gen
|
||||
CONVERSION_GEN := $(TOOLS_DIR)/conversion-gen
|
||||
CODE_GEN_VERSION := v0.33.3
|
||||
CODE_GEN_VERSION := v0.28.0
|
||||
REFERENCE_DOCS := $(TOOLS_DIR)/genref
|
||||
REFERENCE_DOCS_VERSION := latest
|
||||
KIND := $(TOOLS_DIR)/kind
|
||||
KIND_VERSION := v0.29.0
|
||||
KIND_VERSION := v0.22.0
|
||||
KO ?= $(TOOLS_DIR)/ko
|
||||
KO_VERSION ?= v0.18.0
|
||||
KO_VERSION ?= v0.15.1
|
||||
TOOLS := $(CONTROLLER_GEN) $(REGISTER_GEN) $(DEEPCOPY_GEN) $(CONVERSION_GEN) $(REFERENCE_DOCS) $(KIND) $(KO)
|
||||
PIP ?= "pip"
|
||||
ifeq ($(GOOS), darwin)
|
||||
|
@ -47,7 +50,7 @@ COMMA := ,
|
|||
|
||||
$(CONTROLLER_GEN):
|
||||
@echo Install controller-gen... >&2
|
||||
@cd ./hack/controller-gen && GOBIN=$(TOOLS_DIR) go install -buildvcs=false
|
||||
@cd ./hack/controller-gen && GOBIN=$(TOOLS_DIR) go install
|
||||
|
||||
$(REGISTER_GEN):
|
||||
@echo Install register-gen... >&2
|
||||
|
@ -86,42 +89,54 @@ clean-tools: ## Remove installed tools
|
|||
# CODEGEN #
|
||||
###########
|
||||
|
||||
$(GOPATH_SHIM):
|
||||
@echo Create gopath shim... >&2
|
||||
@mkdir -p $(GOPATH_SHIM)
|
||||
|
||||
.INTERMEDIATE: $(PACKAGE_SHIM)
|
||||
$(PACKAGE_SHIM): $(GOPATH_SHIM)
|
||||
@echo Create package shim... >&2
|
||||
@mkdir -p $(GOPATH_SHIM)/src/github.com/$(ORG) && ln -s -f ${PWD} $(PACKAGE_SHIM)
|
||||
|
||||
.PHONY: codegen-register
|
||||
codegen-register: ## Generate types registrations
|
||||
codegen-register: $(PACKAGE_SHIM)
|
||||
codegen-register: $(REGISTER_GEN)
|
||||
@echo Generate registration... >&2
|
||||
@$(REGISTER_GEN) \
|
||||
@GOPATH=$(GOPATH_SHIM) $(REGISTER_GEN) \
|
||||
--go-header-file=./hack/boilerplate.go.txt \
|
||||
--output-file zz_generated.register.go \
|
||||
./pkg/apis/...
|
||||
--input-dirs=$(INPUT_DIRS)
|
||||
|
||||
.PHONY: codegen-deepcopy
|
||||
codegen-deepcopy: ## Generate deep copy functions
|
||||
codegen-deepcopy: $(PACKAGE_SHIM)
|
||||
codegen-deepcopy: $(DEEPCOPY_GEN)
|
||||
@echo Generate deep copy functions... >&2
|
||||
@$(DEEPCOPY_GEN) \
|
||||
@GOPATH=$(GOPATH_SHIM) $(DEEPCOPY_GEN) \
|
||||
--go-header-file=./hack/boilerplate.go.txt \
|
||||
--output-file=zz_generated.deepcopy.go \
|
||||
./pkg/apis/...
|
||||
--input-dirs=$(INPUT_DIRS) \
|
||||
--output-file-base=zz_generated.deepcopy
|
||||
|
||||
.PHONY: codegen-conversion
|
||||
codegen-conversion: ## Generate conversion functions
|
||||
codegen-conversion: $(PACKAGE_SHIM)
|
||||
codegen-conversion: $(CONVERSION_GEN)
|
||||
@echo Generate conversion functions... >&2
|
||||
@$(CONVERSION_GEN) \
|
||||
@GOPATH=$(GOPATH_SHIM) $(CONVERSION_GEN) \
|
||||
--go-header-file=./hack/boilerplate.go.txt \
|
||||
--output-file=zz_generated.conversion.go \
|
||||
./pkg/apis/...
|
||||
--input-dirs=$(INPUT_DIRS) \
|
||||
--output-file-base=zz_generated.conversion
|
||||
|
||||
.PHONY: codegen-crds
|
||||
codegen-crds: ## Generate CRDs
|
||||
codegen-crds: $(PACKAGE_SHIM)
|
||||
codegen-crds: $(CONTROLLER_GEN)
|
||||
codegen-crds: codegen-deepcopy
|
||||
codegen-crds: codegen-register
|
||||
codegen-crds: codegen-conversion
|
||||
@echo Generate crds... >&2
|
||||
@rm -rf $(CRDS_PATH)
|
||||
@$(CONTROLLER_GEN) paths=./pkg/apis/... crd:crdVersions=v1,ignoreUnexportedFields=true,generateEmbeddedObjectMeta=false output:dir=$(CRDS_PATH)
|
||||
@GOPATH=$(GOPATH_SHIM) $(CONTROLLER_GEN) paths=./pkg/apis/... crd:crdVersions=v1,ignoreUnexportedFields=true,generateEmbeddedObjectMeta=false output:dir=$(CRDS_PATH)
|
||||
@echo Copy generated CRDs to embed in the CLI... >&2
|
||||
@rm -rf pkg/data/crds && mkdir -p pkg/data/crds
|
||||
@cp $(CRDS_PATH)/* pkg/data/crds
|
||||
|
@ -130,7 +145,7 @@ codegen-crds: codegen-conversion
|
|||
codegen-cli-docs: ## Generate CLI docs
|
||||
codegen-cli-docs: build
|
||||
@echo Generate cli docs... >&2
|
||||
@rm -rf website/docs/reference/commands && mkdir -p website/docs/reference/commands
|
||||
@rm -rf website/docs/reference/commands && mkdir -p website/reference/docs/commands
|
||||
@./$(CLI_BIN) docs -o website/docs/reference/commands --autogenTag=false
|
||||
|
||||
.PHONY: codegen-api-docs
|
||||
|
@ -226,7 +241,7 @@ verify-codegen: codegen
|
|||
|
||||
.PHONY: mkdocs-serve
|
||||
mkdocs-serve: ## Generate and serve mkdocs website
|
||||
@echo Generate and serve mkdocs website... >&2
|
||||
@echo Generate and servemkdocs website... >&2
|
||||
@$(PIP) install -r requirements.txt
|
||||
@mkdocs serve -f ./website/mkdocs.yaml
|
||||
|
||||
|
@ -283,14 +298,7 @@ tests: $(CLI_BIN)
|
|||
e2e-tests: ## Run e2e tests
|
||||
e2e-tests: $(CLI_BIN)
|
||||
@echo Running e2e tests... >&2
|
||||
@./$(CLI_BIN) test ./testdata/e2e --remarshal --config ./testdata/e2e/config.yaml --values ./testdata/e2e/values.yaml
|
||||
|
||||
.PHONY: e2e-tests-no-cluster
|
||||
e2e-tests-no-cluster: ## Run e2e tests with --no-cluster
|
||||
e2e-tests-no-cluster: $(CLI_BIN)
|
||||
@echo Running e2e tests with --no-cluster... >&2
|
||||
@./$(CLI_BIN) test testdata/e2e/examples/script-env --no-cluster --remarshal --config ./testdata/e2e/config.yaml --values ./testdata/e2e/values.yaml
|
||||
@./$(CLI_BIN) test testdata/e2e/examples/dynamic-clusters --no-cluster --remarshal --config ./testdata/e2e/config.yaml --values ./testdata/e2e/values.yaml
|
||||
@./$(CLI_BIN) test --test-dir ./testdata/e2e --remarshal --config ./testdata/e2e/config.yaml --values ./testdata/e2e/values.yaml
|
||||
|
||||
.PHONY: e2e-tests-ko
|
||||
e2e-tests-ko: ## Run e2e tests from a docker container
|
||||
|
|
|
@ -51,7 +51,7 @@ To attend our community meetings, join the [Chainsaw group](https://groups.googl
|
|||
You will then be sent a meeting invite and will have access to the agenda and meeting notes.
|
||||
Any member may suggest topics for discussion.
|
||||
|
||||
This is a public, weekly meeting for Kyverno-Chainsaw maintainers to make announcements and provide project updates, and request input and feedback.
|
||||
This is a public, weekly for Kyverno-Chainsaw maintainers to make announcements and provide project updates, and request input and feedback.
|
||||
This forum allows community members to raise agenda items of any sort, including but not limited to any PRs or issues on which they are working.
|
||||
|
||||
Weekly every Thursday at 2:00 PM UTC
|
||||
|
|
38
chainsaw.rb
38
chainsaw.rb
|
@ -5,20 +5,20 @@
|
|||
class Chainsaw < Formula
|
||||
desc "Declarative Kubernetes end-to-end testing."
|
||||
homepage "https://kyverno.github.io/chainsaw"
|
||||
version "0.2.12"
|
||||
version "0.1.9"
|
||||
|
||||
on_macos do
|
||||
on_intel do
|
||||
url "https://github.com/kyverno/chainsaw/releases/download/v0.2.12/chainsaw_darwin_amd64.tar.gz"
|
||||
sha256 "b49dba1214b32024567b1edc7653498a644fbef18111bcc3e1c46dc52e1d194e"
|
||||
if Hardware::CPU.arm?
|
||||
url "https://github.com/kyverno/chainsaw/releases/download/v0.1.9/chainsaw_darwin_arm64.tar.gz"
|
||||
sha256 "4187956ba26fd5dadf6552bfa77e769afdac48c08e5741c46a8e38b07ca708bc"
|
||||
|
||||
def install
|
||||
bin.install "chainsaw"
|
||||
end
|
||||
end
|
||||
on_arm do
|
||||
url "https://github.com/kyverno/chainsaw/releases/download/v0.2.12/chainsaw_darwin_arm64.tar.gz"
|
||||
sha256 "717a07fcc4d781fff967b287880fed1d8b1e6af9fbecc7650a714c467f296d33"
|
||||
if Hardware::CPU.intel?
|
||||
url "https://github.com/kyverno/chainsaw/releases/download/v0.1.9/chainsaw_darwin_amd64.tar.gz"
|
||||
sha256 "8c65f3ee952aa04754d644f2ef3d5f489153638de4e71de6348d4628e5af0378"
|
||||
|
||||
def install
|
||||
bin.install "chainsaw"
|
||||
|
@ -27,24 +27,20 @@ class Chainsaw < Formula
|
|||
end
|
||||
|
||||
on_linux do
|
||||
on_intel do
|
||||
if Hardware::CPU.is_64_bit?
|
||||
url "https://github.com/kyverno/chainsaw/releases/download/v0.2.12/chainsaw_linux_amd64.tar.gz"
|
||||
sha256 "d6bfb17ba47af2db85edc0365288f92b5e1a4566f7ff130ec9b326f96856e209"
|
||||
if Hardware::CPU.intel?
|
||||
url "https://github.com/kyverno/chainsaw/releases/download/v0.1.9/chainsaw_linux_amd64.tar.gz"
|
||||
sha256 "4080d3bb5ea6de6f85198e413e24a5c7aee941f027ba8b545f7a1ddbaa2e2856"
|
||||
|
||||
def install
|
||||
bin.install "chainsaw"
|
||||
end
|
||||
def install
|
||||
bin.install "chainsaw"
|
||||
end
|
||||
end
|
||||
on_arm do
|
||||
if Hardware::CPU.is_64_bit?
|
||||
url "https://github.com/kyverno/chainsaw/releases/download/v0.2.12/chainsaw_linux_arm64.tar.gz"
|
||||
sha256 "72a6273d6da16a04e29e0fae232631b084852d21ddf25f88ed3d3de480125d30"
|
||||
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
url "https://github.com/kyverno/chainsaw/releases/download/v0.1.9/chainsaw_linux_arm64.tar.gz"
|
||||
sha256 "05f2cdce3f34989e71f47cd30e005a49fa8d7abefbede20311f96eed016a34b8"
|
||||
|
||||
def install
|
||||
bin.install "chainsaw"
|
||||
end
|
||||
def install
|
||||
bin.install "chainsaw"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
164
go.mod
164
go.mod
|
@ -1,104 +1,96 @@
|
|||
module github.com/kyverno/chainsaw
|
||||
|
||||
go 1.24.2
|
||||
go 1.23.0
|
||||
|
||||
require (
|
||||
github.com/Masterminds/sprig v2.22.0+incompatible
|
||||
github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0
|
||||
github.com/evanphx/json-patch v5.9.11+incompatible
|
||||
github.com/fatih/color v1.18.0
|
||||
github.com/go-logr/logr v1.4.3
|
||||
github.com/google/cel-go v0.23.2
|
||||
github.com/evanphx/json-patch v5.9.0+incompatible
|
||||
github.com/fatih/color v1.17.0
|
||||
github.com/go-logr/logr v1.4.2
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
||||
github.com/hashicorp/go-getter v1.7.8
|
||||
github.com/jmespath-community/go-jmespath v1.1.2-0.20240930152130-6eb5a346873f
|
||||
github.com/hashicorp/go-getter v1.7.6
|
||||
github.com/jmespath-community/go-jmespath v1.1.2-0.20240627155901-bdbb290f571e
|
||||
github.com/jstemmer/go-junit-report/v2 v2.1.0
|
||||
github.com/kudobuilder/kuttl v0.20.0
|
||||
github.com/kyverno/kyverno-json v0.0.4-0.20241008103124-b294ee72a2bf
|
||||
github.com/kudobuilder/kuttl v0.19.0
|
||||
github.com/kyverno/kyverno-json v0.0.4-0.20240730143747-aade3d42fc0e
|
||||
github.com/kyverno/pkg/ext v0.0.0-20240418121121-df8add26c55c
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
|
||||
github.com/prometheus/common v0.65.0
|
||||
github.com/spf13/cobra v1.9.1
|
||||
github.com/spf13/pflag v1.0.7
|
||||
github.com/stretchr/testify v1.10.0
|
||||
github.com/prometheus/common v0.59.1
|
||||
github.com/spf13/cobra v1.8.1
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/stretchr/testify v1.9.0
|
||||
github.com/xeipuuv/gojsonschema v1.2.0
|
||||
go.uber.org/multierr v1.11.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
k8s.io/api v0.33.3
|
||||
k8s.io/apimachinery v0.33.3
|
||||
k8s.io/apiserver v0.33.3
|
||||
k8s.io/client-go v0.33.3
|
||||
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
|
||||
sigs.k8s.io/controller-runtime v0.21.0
|
||||
sigs.k8s.io/kubectl-validate v0.0.5-0.20241223122011-eb064d2f92d5
|
||||
sigs.k8s.io/yaml v1.6.0
|
||||
k8s.io/api v0.31.1
|
||||
k8s.io/apimachinery v0.31.1
|
||||
k8s.io/client-go v0.31.1
|
||||
k8s.io/utils v0.0.0-20240821151609-f90d01438635
|
||||
sigs.k8s.io/controller-runtime v0.19.0
|
||||
sigs.k8s.io/kubectl-validate v0.0.5-0.20240827210056-ce13d95db263
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
require (
|
||||
cel.dev/expr v0.19.1 // indirect
|
||||
cloud.google.com/go v0.115.1 // indirect
|
||||
cloud.google.com/go/auth v0.9.7 // indirect
|
||||
cloud.google.com/go/auth v0.9.1 // indirect
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.5.2 // indirect
|
||||
cloud.google.com/go/iam v1.2.1 // indirect
|
||||
cloud.google.com/go/monitoring v1.21.1 // indirect
|
||||
cloud.google.com/go/storage v1.44.0 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.1 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.5.0 // indirect
|
||||
cloud.google.com/go/iam v1.2.0 // indirect
|
||||
cloud.google.com/go/storage v1.43.0 // indirect
|
||||
github.com/IGLOU-EU/go-wildcard v1.0.3 // indirect
|
||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||
github.com/Masterminds/semver v1.5.0 // indirect
|
||||
github.com/NYTimes/gziphandler v1.1.1 // indirect
|
||||
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
|
||||
github.com/aquilax/truncate v1.0.1 // indirect
|
||||
github.com/aws/aws-sdk-go v1.55.6 // indirect
|
||||
github.com/aquilax/truncate v1.0.0 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/aws/aws-sdk-go v1.55.5 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
|
||||
github.com/blang/semver/v4 v4.0.0 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42 // indirect
|
||||
github.com/coreos/go-semver v0.3.1 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
|
||||
github.com/envoyproxy/go-control-plane/envoy v1.32.3 // indirect
|
||||
github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 // indirect
|
||||
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
|
||||
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
|
||||
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||
github.com/fsnotify/fsnotify v1.8.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/google/btree v1.1.3 // indirect
|
||||
github.com/google/gnostic-models v0.6.9 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/google/cel-go v0.20.1 // indirect
|
||||
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/google/s2a-go v0.1.8 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.3 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
|
||||
github.com/gopherjs/gopherjs v1.17.2 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20210315223345-82c243799c99 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-safetemp v1.0.0 // indirect
|
||||
github.com/hashicorp/go-version v1.7.0 // indirect
|
||||
github.com/huandu/xstrings v1.5.0 // indirect
|
||||
github.com/imdario/mergo v0.3.16 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jinzhu/copier v0.4.0 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/jtolds/gls v4.20.0+incompatible // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/klauspost/compress v1.17.9 // indirect
|
||||
github.com/kylelemons/godebug v1.1.0 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
|
@ -110,10 +102,10 @@ require (
|
|||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/onsi/gomega v1.34.1 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
|
||||
github.com/prometheus/client_golang v1.22.0 // indirect
|
||||
github.com/prometheus/client_model v0.6.2 // indirect
|
||||
github.com/prometheus/client_golang v1.20.2 // indirect
|
||||
github.com/prometheus/client_model v0.6.1 // indirect
|
||||
github.com/prometheus/procfs v0.15.1 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/stoewer/go-strcase v1.3.0 // indirect
|
||||
|
@ -122,48 +114,44 @@ require (
|
|||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
github.com/zach-klippenstein/goregen v0.0.0-20160303162051-795b5e3961ea // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.5.21 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.21 // indirect
|
||||
go.etcd.io/etcd/client/v3 v3.5.21 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.5.15 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.15 // indirect
|
||||
go.etcd.io/etcd/client/v3 v3.5.15 // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.29.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect
|
||||
go.opentelemetry.io/otel v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.33.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.4.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
|
||||
go.opentelemetry.io/otel v1.29.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.29.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.29.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.29.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
||||
golang.org/x/crypto v0.38.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
|
||||
golang.org/x/net v0.40.0 // indirect
|
||||
golang.org/x/oauth2 v0.30.0 // indirect
|
||||
golang.org/x/sync v0.14.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/term v0.32.0 // indirect
|
||||
golang.org/x/text v0.25.0 // indirect
|
||||
golang.org/x/time v0.11.0 // indirect
|
||||
google.golang.org/api v0.199.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20241007155032-5fefd90f89a9 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
|
||||
google.golang.org/grpc v1.68.1 // indirect
|
||||
google.golang.org/grpc/stats/opentelemetry v0.0.0-20240907200651-3ffb98b2c93a // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
golang.org/x/crypto v0.26.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect
|
||||
golang.org/x/net v0.28.0 // indirect
|
||||
golang.org/x/oauth2 v0.22.0 // indirect
|
||||
golang.org/x/sync v0.8.0 // indirect
|
||||
golang.org/x/sys v0.24.0 // indirect
|
||||
golang.org/x/term v0.23.0 // indirect
|
||||
golang.org/x/text v0.17.0 // indirect
|
||||
golang.org/x/time v0.6.0 // indirect
|
||||
google.golang.org/api v0.194.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20240827150818-7e3bb234dfed // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect
|
||||
google.golang.org/grpc v1.65.0 // indirect
|
||||
google.golang.org/protobuf v1.34.2 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
k8s.io/apiextensions-apiserver v0.33.0 // indirect
|
||||
k8s.io/component-base v0.33.3 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
k8s.io/apiextensions-apiserver v0.31.0 // indirect
|
||||
k8s.io/apiserver v0.31.0 // indirect
|
||||
k8s.io/component-base v0.31.0 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
|
||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20240827152857-f7e401e7b4c2 // indirect
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
|
||||
)
|
||||
|
|
|
@ -1,39 +1,37 @@
|
|||
module github.com/kyverno/chainsaw/hack/controller-gen
|
||||
|
||||
go 1.24.0
|
||||
go 1.22.0
|
||||
|
||||
require (
|
||||
github.com/spf13/cobra v1.9.1
|
||||
k8s.io/apiextensions-apiserver v0.33.3
|
||||
sigs.k8s.io/controller-tools v0.17.2
|
||||
github.com/spf13/cobra v1.8.1
|
||||
k8s.io/apiextensions-apiserver v0.31.1
|
||||
sigs.k8s.io/controller-tools v0.16.3
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/gobuffalo/flect v1.0.3 // indirect
|
||||
github.com/gobuffalo/flect v1.0.2 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/kr/pretty v0.3.1 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/rogpeppe/go-internal v1.14.1 // indirect
|
||||
github.com/spf13/pflag v1.0.6 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
golang.org/x/mod v0.24.0 // indirect
|
||||
golang.org/x/net v0.38.0 // indirect
|
||||
golang.org/x/sync v0.12.0 // indirect
|
||||
golang.org/x/text v0.23.0 // indirect
|
||||
golang.org/x/tools v0.31.0 // indirect
|
||||
golang.org/x/mod v0.20.0 // indirect
|
||||
golang.org/x/net v0.28.0 // indirect
|
||||
golang.org/x/sync v0.8.0 // indirect
|
||||
golang.org/x/text v0.17.0 // indirect
|
||||
golang.org/x/tools v0.24.0 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
k8s.io/apimachinery v0.33.3 // indirect
|
||||
k8s.io/apimachinery v0.31.1 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e // indirect
|
||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
|
||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
|
||||
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
|
||||
)
|
||||
|
|
|
@ -1,22 +1,25 @@
|
|||
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
|
||||
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4=
|
||||
github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
|
||||
github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA=
|
||||
github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
|
@ -39,19 +42,18 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
|||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
|
||||
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
|
||||
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
|
||||
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
|
||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8=
|
||||
github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
|
||||
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
|
||||
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
|
||||
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
|
||||
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
|
||||
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
|
@ -59,8 +61,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
|
|||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
|
||||
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
|
@ -70,34 +72,34 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
|
|||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
|
||||
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
|
||||
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
|
||||
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
|
||||
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
|
||||
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
|
||||
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
|
||||
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
|
||||
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
|
||||
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
|
||||
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
|
||||
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
|
||||
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
|
||||
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
|
||||
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
@ -109,27 +111,25 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
|||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
k8s.io/apiextensions-apiserver v0.33.3 h1:qmOcAHN6DjfD0v9kxL5udB27SRP6SG/MTopmge3MwEs=
|
||||
k8s.io/apiextensions-apiserver v0.33.3/go.mod h1:oROuctgo27mUsyp9+Obahos6CWcMISSAPzQ77CAQGz8=
|
||||
k8s.io/apimachinery v0.33.3 h1:4ZSrmNa0c/ZpZJhAgRdcsFcZOw1PQU1bALVQ0B3I5LA=
|
||||
k8s.io/apimachinery v0.33.3/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM=
|
||||
k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40=
|
||||
k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ=
|
||||
k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U=
|
||||
k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
|
||||
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
||||
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e h1:KqK5c/ghOm8xkHYhlodbp6i6+r+ChV2vuAuVRdFbLro=
|
||||
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
sigs.k8s.io/controller-tools v0.17.2 h1:jNFOKps8WnaRKZU2R+4vRCHnXyJanVmXBWqkuUPFyFg=
|
||||
sigs.k8s.io/controller-tools v0.17.2/go.mod h1:4q5tZG2JniS5M5bkiXY2/potOiXyhoZVw/U48vLkXk0=
|
||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
|
||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
|
||||
sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
|
||||
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
|
||||
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 h1:IUA9nvMmnKWcj5jl84xn+T5MnlZKThmUW1TdblaLVAc=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps=
|
||||
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
|
||||
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
sigs.k8s.io/controller-tools v0.16.3 h1:z48C5/d4jCVQQvtiSBL5MYyZ3EO2eFIOXrIKMgHVhFY=
|
||||
sigs.k8s.io/controller-tools v0.16.3/go.mod h1:AEj6k+w1kYpLZv2einOH3mj52ips4W/6FUjnB5tkJGs=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
package apis
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
gocel "github.com/google/cel-go/cel"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/engine/functions"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers/cel"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers/jp"
|
||||
"k8s.io/apiserver/pkg/cel/library"
|
||||
)
|
||||
|
||||
var (
|
||||
env = sync.OnceValues(func() (*gocel.Env, error) {
|
||||
env, err := cel.DefaultEnv()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return env.Extend(
|
||||
library.URLs(),
|
||||
library.Regex(),
|
||||
library.Lists(),
|
||||
library.Authz(),
|
||||
library.Quantity(),
|
||||
library.IP(),
|
||||
library.CIDR(),
|
||||
library.Format(),
|
||||
library.AuthzSelectors(),
|
||||
)
|
||||
})
|
||||
defaultCompilers = compilers.Compilers{
|
||||
Jp: jp.NewCompiler(jp.WithFunctionCaller(functions.Caller())),
|
||||
Cel: cel.NewCompiler(env),
|
||||
}
|
||||
DefaultCompilers = defaultCompilers.WithDefaultCompiler(compilers.CompilerJP)
|
||||
)
|
||||
|
||||
type Bindings = binding.Bindings
|
||||
|
||||
var (
|
||||
NewBinding = binding.NewBinding
|
||||
NewBindings = binding.NewBindings
|
||||
)
|
|
@ -22,14 +22,12 @@ func Convert_v1alpha2_ConfigurationSpec_To_v1alpha1_ConfigurationSpec(in *v1alph
|
|||
out.ForceTerminationGracePeriod = in.Execution.ForceTerminationGracePeriod
|
||||
out.Namespace = in.Namespace.Name
|
||||
out.NamespaceTemplate = in.Namespace.Template
|
||||
out.NamespaceTemplateCompiler = in.Namespace.Compiler
|
||||
if in := in.Report; in != nil {
|
||||
out.ReportFormat = v1alpha1.ReportFormatType(in.Format)
|
||||
out.ReportPath = in.Path
|
||||
out.ReportName = in.Name
|
||||
}
|
||||
out.Template = in.Templating.Enabled
|
||||
out.Compiler = in.Templating.Compiler
|
||||
out.Timeouts = in.Timeouts
|
||||
return nil
|
||||
}
|
||||
|
@ -60,7 +58,6 @@ func Convert_v1alpha1_ConfigurationSpec_To_v1alpha2_ConfigurationSpec(in *v1alph
|
|||
}
|
||||
out.Namespace = v1alpha2.NamespaceOptions{
|
||||
Name: in.Namespace,
|
||||
Compiler: in.NamespaceTemplateCompiler,
|
||||
Template: in.NamespaceTemplate,
|
||||
}
|
||||
out.Report = &v1alpha2.ReportOptions{
|
||||
|
@ -69,8 +66,7 @@ func Convert_v1alpha1_ConfigurationSpec_To_v1alpha2_ConfigurationSpec(in *v1alph
|
|||
Name: in.ReportName,
|
||||
}
|
||||
out.Templating = v1alpha2.TemplatingOptions{
|
||||
Enabled: in.Template,
|
||||
Compiler: in.Compiler,
|
||||
Enabled: in.Template,
|
||||
}
|
||||
out.Timeouts = in.Timeouts
|
||||
return nil
|
||||
|
|
|
@ -26,7 +26,7 @@ type ActionCheckRef struct {
|
|||
|
||||
// Check provides a check used in assertions.
|
||||
// +optional
|
||||
Check *Projection `json:"resource,omitempty"`
|
||||
Check *Check `json:"resource,omitempty"`
|
||||
|
||||
// Template determines whether resources should be considered for templating.
|
||||
// +optional
|
||||
|
@ -60,10 +60,6 @@ type ActionEnv struct {
|
|||
// SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise.
|
||||
// +optional
|
||||
SkipLogOutput bool `json:"skipLogOutput,omitempty"`
|
||||
|
||||
// SkipCommandOutput removes the command from the output logs.
|
||||
// +optional
|
||||
SkipCommandOutput bool `json:"skipCommandOutput,omitempty"`
|
||||
}
|
||||
|
||||
// ActionExpectations contains expectations for an action.
|
||||
|
|
|
@ -15,10 +15,6 @@ type CatchFinally struct {
|
|||
// +optional
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// Compiler defines the default compiler to use when evaluating expressions.
|
||||
// +optional
|
||||
Compiler *Compiler `json:"compiler,omitempty"`
|
||||
|
||||
// PodLogs determines the pod logs collector to execute.
|
||||
// +optional
|
||||
PodLogs *PodLogs `json:"podLogs,omitempty"`
|
||||
|
|
|
@ -25,14 +25,14 @@ func TestFinally_Bindings(t *testing.T) {
|
|||
}{{
|
||||
fields: fields{
|
||||
Command: &Command{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
}, {
|
||||
fields: fields{
|
||||
Delete: &Delete{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -55,7 +55,7 @@ func TestFinally_Bindings(t *testing.T) {
|
|||
}, {
|
||||
fields: fields{
|
||||
Script: &Script{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -107,7 +107,7 @@ func TestFinally_Outputs(t *testing.T) {
|
|||
}{{
|
||||
fields: fields{
|
||||
Command: &Command{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -134,7 +134,7 @@ func TestFinally_Outputs(t *testing.T) {
|
|||
}, {
|
||||
fields: fields{
|
||||
Script: &Script{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
|
|
@ -37,10 +37,6 @@ type ConfigurationSpec struct {
|
|||
// +kubebuilder:default:=true
|
||||
Template bool `json:"template"`
|
||||
|
||||
// Compiler defines the default compiler to use when evaluating expressions.
|
||||
// +optional
|
||||
Compiler *Compiler `json:"compiler,omitempty"`
|
||||
|
||||
// FailFast determines whether the test should stop upon encountering the first failure.
|
||||
// +optional
|
||||
FailFast bool `json:"failFast,omitempty"`
|
||||
|
@ -58,7 +54,7 @@ type ConfigurationSpec struct {
|
|||
// +kubebuilder:default:=Background
|
||||
DeletionPropagationPolicy metav1.DeletionPropagation `json:"deletionPropagationPolicy,omitempty"`
|
||||
|
||||
// ReportFormat determines test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION, nil) nil == no report.
|
||||
// ReportFormat determines test report format (JSON|XML|JUNIT-TEST|JUNIT-STEP|JUNIT-OPERATION|nil) nil == no report.
|
||||
// maps to report.Type, however we don't want generated.deepcopy to have reference to it.
|
||||
// +optional
|
||||
// +kubebuilder:validation:Enum:=JSON;XML;JUNIT-TEST;JUNIT-STEP;JUNIT-OPERATION;
|
||||
|
@ -79,13 +75,9 @@ type ConfigurationSpec struct {
|
|||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
|
||||
// NamespaceTemplateCompiler defines the default compiler to use when evaluating expressions.
|
||||
// +optional
|
||||
NamespaceTemplateCompiler *Compiler `json:"namespaceTemplateCompiler,omitempty"`
|
||||
|
||||
// NamespaceTemplate defines a template to create the test namespace.
|
||||
// +optional
|
||||
NamespaceTemplate *Projection `json:"namespaceTemplate,omitempty"`
|
||||
NamespaceTemplate *Any `json:"namespaceTemplate,omitempty"`
|
||||
|
||||
// FullName makes use of the full test case folder path instead of the folder name.
|
||||
// +optional
|
||||
|
|
|
@ -10,10 +10,6 @@ type OperationBase struct {
|
|||
// Even if the test continues executing, it will still be reported as failed.
|
||||
// +optional
|
||||
ContinueOnError *bool `json:"continueOnError,omitempty"`
|
||||
|
||||
// Compiler defines the default compiler to use when evaluating expressions.
|
||||
// +optional
|
||||
Compiler *Compiler `json:"compiler,omitempty"`
|
||||
}
|
||||
|
||||
// Operation defines a single operation, only one action is permitted for a given operation.
|
||||
|
|
|
@ -14,35 +14,35 @@ func TestOperation_Bindings(t *testing.T) {
|
|||
}{{
|
||||
operation: Operation{
|
||||
Apply: &Apply{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
}, {
|
||||
operation: Operation{
|
||||
Assert: &Assert{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
}, {
|
||||
operation: Operation{
|
||||
Command: &Command{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
}, {
|
||||
operation: Operation{
|
||||
Create: &Create{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
}, {
|
||||
operation: Operation{
|
||||
Delete: &Delete{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -54,7 +54,7 @@ func TestOperation_Bindings(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Error: &Error{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -71,7 +71,7 @@ func TestOperation_Bindings(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Patch: &Patch{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -88,7 +88,7 @@ func TestOperation_Bindings(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Script: &Script{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -99,7 +99,7 @@ func TestOperation_Bindings(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Update: &Update{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -125,7 +125,7 @@ func TestOperation_Outputs(t *testing.T) {
|
|||
}{{
|
||||
operation: Operation{
|
||||
Apply: &Apply{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -136,14 +136,14 @@ func TestOperation_Outputs(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Command: &Command{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
}, {
|
||||
operation: Operation{
|
||||
Create: &Create{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -170,7 +170,7 @@ func TestOperation_Outputs(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Patch: &Patch{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -185,7 +185,7 @@ func TestOperation_Outputs(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Script: &Script{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -196,7 +196,7 @@ func TestOperation_Outputs(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Update: &Update{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/kyverno/kyverno-json/pkg/utils/copy"
|
||||
)
|
||||
|
||||
// Projection can be any type.
|
||||
// +k8s:deepcopy-gen=false
|
||||
// +kubebuilder:validation:XPreserveUnknownFields
|
||||
// +kubebuilder:validation:Type:=""
|
||||
type Projection struct {
|
||||
_value any
|
||||
}
|
||||
|
||||
func NewProjection(value any) Projection {
|
||||
return Projection{
|
||||
_value: value,
|
||||
}
|
||||
}
|
||||
|
||||
func (a *Projection) Value() any {
|
||||
return a._value
|
||||
}
|
||||
|
||||
func (a *Projection) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(a._value)
|
||||
}
|
||||
|
||||
func (a *Projection) UnmarshalJSON(data []byte) error {
|
||||
var v any
|
||||
err := json.Unmarshal(data, &v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
a._value = v
|
||||
return nil
|
||||
}
|
||||
|
||||
func (in *Projection) DeepCopyInto(out *Projection) {
|
||||
out._value = copy.DeepCopy(in._value)
|
||||
}
|
||||
|
||||
func (in *Projection) DeepCopy() *Projection {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Projection)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
|
@ -110,10 +110,6 @@ type TestStepSpec struct {
|
|||
// +optional
|
||||
Template *bool `json:"template,omitempty"`
|
||||
|
||||
// Compiler defines the default compiler to use when evaluating expressions.
|
||||
// +optional
|
||||
Compiler *Compiler `json:"compiler,omitempty"`
|
||||
|
||||
// Bindings defines additional binding key/values.
|
||||
// +optional
|
||||
Bindings []Binding `json:"bindings,omitempty"`
|
||||
|
|
|
@ -60,21 +60,13 @@ type TestSpec struct {
|
|||
// +optional
|
||||
Template *bool `json:"template,omitempty"`
|
||||
|
||||
// Compiler defines the default compiler to use when evaluating expressions.
|
||||
// +optional
|
||||
Compiler *Compiler `json:"compiler,omitempty"`
|
||||
|
||||
// Namespace determines whether the test should run in a random ephemeral namespace or not.
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
|
||||
// NamespaceTemplate defines a template to create the test namespace.
|
||||
// +optional
|
||||
NamespaceTemplate *Projection `json:"namespaceTemplate,omitempty"`
|
||||
|
||||
// NamespaceTemplateCompiler defines the default compiler to use when evaluating expressions.
|
||||
// +optional
|
||||
NamespaceTemplateCompiler *Compiler `json:"namespaceTemplateCompiler,omitempty"`
|
||||
NamespaceTemplate *Any `json:"namespaceTemplate,omitempty"`
|
||||
|
||||
// Scenarios defines test scenarios.
|
||||
// +optional
|
||||
|
|
|
@ -6,27 +6,17 @@ import (
|
|||
"fmt"
|
||||
"regexp"
|
||||
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/parsing"
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/kyverno/chainsaw/pkg/expressions"
|
||||
"github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
EngineJP = v1alpha1.EngineJP
|
||||
EngineCEL = v1alpha1.EngineCEL
|
||||
)
|
||||
var identifier = regexp.MustCompile(`^(?:\w+|\(.+\))$`)
|
||||
|
||||
var (
|
||||
identifier = regexp.MustCompile(`^(?:\w+|\(.+\))$`)
|
||||
NewAny = v1alpha1.NewAny
|
||||
NewCheck = v1alpha1.NewAssertionTree
|
||||
NewMatch = v1alpha1.NewAssertionTree
|
||||
)
|
||||
|
||||
type Compiler = v1alpha1.Compiler
|
||||
// Any represents any type.
|
||||
type Any = v1alpha1.Any
|
||||
|
||||
// Binding represents a key/value set as a binding in an executing test.
|
||||
type Binding struct {
|
||||
|
@ -35,12 +25,10 @@ type Binding struct {
|
|||
// +kubebuilder:validation:Pattern:=`^(?:\w+|\(.+\))$`
|
||||
Name Expression `json:"name"`
|
||||
|
||||
// Compiler defines the default compiler to use when evaluating expressions.
|
||||
// +optional
|
||||
Compiler *Compiler `json:"compiler,omitempty"`
|
||||
|
||||
// Value value of the binding.
|
||||
Value Projection `json:"value"`
|
||||
// +kubebuilder:validation:Schemaless
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Value Any `json:"value"`
|
||||
}
|
||||
|
||||
func (b Binding) CheckName() error {
|
||||
|
@ -51,7 +39,7 @@ func (b Binding) CheckName() error {
|
|||
}
|
||||
|
||||
// Check represents a check to be applied on the result of an operation.
|
||||
type Check = v1alpha1.AssertionTree
|
||||
type Check = Any
|
||||
|
||||
// Cluster defines cluster config and context.
|
||||
type Cluster struct {
|
||||
|
@ -108,8 +96,8 @@ func (e *Expression) UnmarshalJSON(data []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (e Expression) Value(ctx context.Context, compilers compilers.Compilers, bindings apis.Bindings) (string, error) {
|
||||
return expressions.String(ctx, compilers, string(e), bindings)
|
||||
func (e Expression) Value(ctx context.Context, bindings binding.Bindings) (string, error) {
|
||||
return expressions.String(ctx, string(e), bindings)
|
||||
}
|
||||
|
||||
// Format determines the output format (json or yaml).
|
||||
|
@ -118,7 +106,7 @@ func (e Expression) Value(ctx context.Context, compilers compilers.Compilers, bi
|
|||
type Format Expression
|
||||
|
||||
// Match represents a match condition against an evaluated object.
|
||||
type Match = v1alpha1.AssertionTree
|
||||
type Match = Any
|
||||
|
||||
// ObjectName represents an object namespace and name.
|
||||
type ObjectName struct {
|
||||
|
@ -198,6 +186,31 @@ type DefaultTimeouts struct {
|
|||
Exec metav1.Duration `json:"exec"`
|
||||
}
|
||||
|
||||
func (t DefaultTimeouts) Combine(override *Timeouts) DefaultTimeouts {
|
||||
if override == nil {
|
||||
return t
|
||||
}
|
||||
if override.Apply != nil {
|
||||
t.Apply = *override.Apply
|
||||
}
|
||||
if override.Assert != nil {
|
||||
t.Assert = *override.Assert
|
||||
}
|
||||
if override.Error != nil {
|
||||
t.Error = *override.Error
|
||||
}
|
||||
if override.Delete != nil {
|
||||
t.Delete = *override.Delete
|
||||
}
|
||||
if override.Cleanup != nil {
|
||||
t.Cleanup = *override.Cleanup
|
||||
}
|
||||
if override.Exec != nil {
|
||||
t.Exec = *override.Exec
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
// Timeouts contains timeouts per operation.
|
||||
type Timeouts struct {
|
||||
// Apply defines the timeout for the apply operation
|
||||
|
|
|
@ -2,15 +2,17 @@ package v1alpha1
|
|||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
func TestBinding_CheckName(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
bindingName Expression
|
||||
bindingValue Projection
|
||||
bindingValue Any
|
||||
wantErr bool
|
||||
}{{
|
||||
name: "empty",
|
||||
|
@ -55,3 +57,51 @@ func TestBinding_CheckName(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestTimeouts_Combine(t *testing.T) {
|
||||
base := DefaultTimeouts{
|
||||
Apply: metav1.Duration{Duration: 1 * time.Minute},
|
||||
Assert: metav1.Duration{Duration: 1 * time.Minute},
|
||||
Cleanup: metav1.Duration{Duration: 1 * time.Minute},
|
||||
Delete: metav1.Duration{Duration: 1 * time.Minute},
|
||||
Error: metav1.Duration{Duration: 1 * time.Minute},
|
||||
Exec: metav1.Duration{Duration: 1 * time.Minute},
|
||||
}
|
||||
override := Timeouts{
|
||||
Apply: &metav1.Duration{Duration: 2 * time.Minute},
|
||||
Assert: &metav1.Duration{Duration: 2 * time.Minute},
|
||||
Cleanup: &metav1.Duration{Duration: 2 * time.Minute},
|
||||
Delete: &metav1.Duration{Duration: 2 * time.Minute},
|
||||
Error: &metav1.Duration{Duration: 2 * time.Minute},
|
||||
Exec: &metav1.Duration{Duration: 2 * time.Minute},
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
base DefaultTimeouts
|
||||
override *Timeouts
|
||||
want DefaultTimeouts
|
||||
}{{
|
||||
name: "nil",
|
||||
base: base,
|
||||
override: nil,
|
||||
want: base,
|
||||
}, {
|
||||
name: "override",
|
||||
base: base,
|
||||
override: &override,
|
||||
want: DefaultTimeouts{
|
||||
Apply: metav1.Duration{Duration: 2 * time.Minute},
|
||||
Assert: metav1.Duration{Duration: 2 * time.Minute},
|
||||
Cleanup: metav1.Duration{Duration: 2 * time.Minute},
|
||||
Delete: metav1.Duration{Duration: 2 * time.Minute},
|
||||
Error: metav1.Duration{Duration: 2 * time.Minute},
|
||||
Exec: metav1.Duration{Duration: 2 * time.Minute},
|
||||
},
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got := tt.base.Combine(tt.override)
|
||||
assert.Equal(t, tt.want, got)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ limitations under the License.
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
policyv1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
@ -378,11 +377,6 @@ func (in *Assert) DeepCopy() *Assert {
|
|||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Binding) DeepCopyInto(out *Binding) {
|
||||
*out = *in
|
||||
if in.Compiler != nil {
|
||||
in, out := &in.Compiler, &out.Compiler
|
||||
*out = new(policyv1alpha1.Compiler)
|
||||
**out = **in
|
||||
}
|
||||
in.Value.DeepCopyInto(&out.Value)
|
||||
return
|
||||
}
|
||||
|
@ -400,11 +394,6 @@ func (in *Binding) DeepCopy() *Binding {
|
|||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CatchFinally) DeepCopyInto(out *CatchFinally) {
|
||||
*out = *in
|
||||
if in.Compiler != nil {
|
||||
in, out := &in.Compiler, &out.Compiler
|
||||
*out = new(policyv1alpha1.Compiler)
|
||||
**out = **in
|
||||
}
|
||||
if in.PodLogs != nil {
|
||||
in, out := &in.PodLogs, &out.PodLogs
|
||||
*out = new(PodLogs)
|
||||
|
@ -564,21 +553,11 @@ func (in *Configuration) DeepCopyObject() runtime.Object {
|
|||
func (in *ConfigurationSpec) DeepCopyInto(out *ConfigurationSpec) {
|
||||
*out = *in
|
||||
out.Timeouts = in.Timeouts
|
||||
if in.Compiler != nil {
|
||||
in, out := &in.Compiler, &out.Compiler
|
||||
*out = new(policyv1alpha1.Compiler)
|
||||
**out = **in
|
||||
}
|
||||
if in.Parallel != nil {
|
||||
in, out := &in.Parallel, &out.Parallel
|
||||
*out = new(int)
|
||||
**out = **in
|
||||
}
|
||||
if in.NamespaceTemplateCompiler != nil {
|
||||
in, out := &in.NamespaceTemplateCompiler, &out.NamespaceTemplateCompiler
|
||||
*out = new(policyv1alpha1.Compiler)
|
||||
**out = **in
|
||||
}
|
||||
if in.NamespaceTemplate != nil {
|
||||
in, out := &in.NamespaceTemplate, &out.NamespaceTemplate
|
||||
*out = (*in).DeepCopy()
|
||||
|
@ -988,11 +967,6 @@ func (in *OperationBase) DeepCopyInto(out *OperationBase) {
|
|||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.Compiler != nil {
|
||||
in, out := &in.Compiler, &out.Compiler
|
||||
*out = new(policyv1alpha1.Compiler)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1312,20 +1286,10 @@ func (in *TestSpec) DeepCopyInto(out *TestSpec) {
|
|||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.Compiler != nil {
|
||||
in, out := &in.Compiler, &out.Compiler
|
||||
*out = new(policyv1alpha1.Compiler)
|
||||
**out = **in
|
||||
}
|
||||
if in.NamespaceTemplate != nil {
|
||||
in, out := &in.NamespaceTemplate, &out.NamespaceTemplate
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
if in.NamespaceTemplateCompiler != nil {
|
||||
in, out := &in.NamespaceTemplateCompiler, &out.NamespaceTemplateCompiler
|
||||
*out = new(policyv1alpha1.Compiler)
|
||||
**out = **in
|
||||
}
|
||||
if in.Scenarios != nil {
|
||||
in, out := &in.Scenarios, &out.Scenarios
|
||||
*out = make([]Scenario, len(*in))
|
||||
|
@ -1439,11 +1403,6 @@ func (in *TestStepSpec) DeepCopyInto(out *TestStepSpec) {
|
|||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.Compiler != nil {
|
||||
in, out := &in.Compiler, &out.Compiler
|
||||
*out = new(policyv1alpha1.Compiler)
|
||||
**out = **in
|
||||
}
|
||||
if in.Bindings != nil {
|
||||
in, out := &in.Bindings, &out.Bindings
|
||||
*out = make([]Binding, len(*in))
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
|
@ -23,8 +20,8 @@ package v1alpha1
|
|||
|
||||
import (
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// GroupName specifies the group name used to register the objects.
|
||||
|
@ -46,7 +43,7 @@ var (
|
|||
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// Deprecated: use Install instead
|
||||
// Depreciated: use Install instead
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
Install = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
|
|
@ -2,6 +2,7 @@ package v1alpha2
|
|||
|
||||
import (
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
_ "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
|
@ -86,13 +87,9 @@ type NamespaceOptions struct {
|
|||
// +optional
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// Compiler defines the default compiler to use when evaluating expressions.
|
||||
// +optional
|
||||
Compiler *Compiler `json:"compiler,omitempty"`
|
||||
|
||||
// Template defines a template to create the test namespace.
|
||||
// +optional
|
||||
Template *Projection `json:"template,omitempty"`
|
||||
Template *Any `json:"template,omitempty"`
|
||||
}
|
||||
|
||||
type ReportFormatType string
|
||||
|
@ -107,7 +104,7 @@ const (
|
|||
|
||||
// ReportOptions contains the configuration used for reporting.
|
||||
type ReportOptions struct {
|
||||
// ReportFormat determines test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION).
|
||||
// ReportFormat determines test report format (JSON|XML|JUNIT-TEST|JUNIT-STEP|JUNIT-OPERATION).
|
||||
// +optional
|
||||
// +kubebuilder:validation:Enum:=JSON;XML;JUNIT-TEST;JUNIT-STEP;JUNIT-OPERATION
|
||||
// +kubebuilder:default:="JSON"
|
||||
|
@ -129,8 +126,4 @@ type TemplatingOptions struct {
|
|||
// +optional
|
||||
// +kubebuilder:default:=true
|
||||
Enabled bool `json:"enabled"`
|
||||
|
||||
// Compiler defines the default compiler to use when evaluating expressions.
|
||||
// +optional
|
||||
Compiler *Compiler `json:"compiler,omitempty"`
|
||||
}
|
||||
|
|
|
@ -5,14 +5,8 @@ import (
|
|||
_ "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1"
|
||||
)
|
||||
|
||||
const (
|
||||
EngineJP = v1alpha1.EngineJP
|
||||
EngineCEL = v1alpha1.EngineCEL
|
||||
)
|
||||
|
||||
type (
|
||||
Any = v1alpha1.Any
|
||||
Clusters = v1alpha1.Clusters
|
||||
Compiler = v1alpha1.Compiler
|
||||
DefaultTimeouts = v1alpha1.DefaultTimeouts
|
||||
Projection = v1alpha1.Projection
|
||||
)
|
||||
|
|
|
@ -23,7 +23,6 @@ package v1alpha2
|
|||
|
||||
import (
|
||||
v1alpha1 "github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
policyv1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
@ -97,7 +96,7 @@ func (in *ConfigurationSpec) DeepCopyInto(out *ConfigurationSpec) {
|
|||
*out = new(ReportOptions)
|
||||
**out = **in
|
||||
}
|
||||
in.Templating.DeepCopyInto(&out.Templating)
|
||||
out.Templating = in.Templating
|
||||
out.Timeouts = in.Timeouts
|
||||
return
|
||||
}
|
||||
|
@ -201,11 +200,6 @@ func (in *ExecutionOptions) DeepCopy() *ExecutionOptions {
|
|||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NamespaceOptions) DeepCopyInto(out *NamespaceOptions) {
|
||||
*out = *in
|
||||
if in.Compiler != nil {
|
||||
in, out := &in.Compiler, &out.Compiler
|
||||
*out = new(policyv1alpha1.Compiler)
|
||||
**out = **in
|
||||
}
|
||||
if in.Template != nil {
|
||||
in, out := &in.Template, &out.Template
|
||||
*out = (*in).DeepCopy()
|
||||
|
@ -242,11 +236,6 @@ func (in *ReportOptions) DeepCopy() *ReportOptions {
|
|||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TemplatingOptions) DeepCopyInto(out *TemplatingOptions) {
|
||||
*out = *in
|
||||
if in.Compiler != nil {
|
||||
in, out := &in.Compiler, &out.Compiler
|
||||
*out = new(policyv1alpha1.Compiler)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
|
@ -23,8 +20,8 @@ package v1alpha2
|
|||
|
||||
import (
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// GroupName specifies the group name used to register the objects.
|
||||
|
@ -46,7 +43,7 @@ var (
|
|||
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// Deprecated: use Install instead
|
||||
// Depreciated: use Install instead
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
Install = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
|
|
@ -73,11 +73,8 @@ func (c *cleaner) Run(ctx context.Context, stepReport *model.StepReport) []error
|
|||
}
|
||||
|
||||
func (c *cleaner) delete(ctx context.Context, entry cleanupEntry) error {
|
||||
if c.timeout != 0 {
|
||||
_ctx, cancel := context.WithTimeout(ctx, c.timeout)
|
||||
defer cancel()
|
||||
ctx = _ctx
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(ctx, c.timeout)
|
||||
defer cancel()
|
||||
if err := entry.client.Delete(ctx, entry.object, client.PropagationPolicy(c.propagation)); err != nil {
|
||||
if !kerrors.IsNotFound(err) {
|
||||
return err
|
||||
|
|
|
@ -8,7 +8,6 @@ import (
|
|||
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
tclient "github.com/kyverno/chainsaw/pkg/client/testing"
|
||||
"github.com/kyverno/chainsaw/pkg/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
kerror "k8s.io/apimachinery/pkg/api/errors"
|
||||
|
@ -197,7 +196,7 @@ func Test_cleaner_Run(t *testing.T) {
|
|||
timeout: 1 * time.Second,
|
||||
entries: tt.entries,
|
||||
}
|
||||
got := c.Run(context.TODO(), &model.StepReport{})
|
||||
got := c.Run(context.TODO(), nil)
|
||||
assert.Equal(t, tt.want, got)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
"github.com/kyverno/chainsaw/pkg/client/simple"
|
||||
tclient "github.com/kyverno/chainsaw/pkg/client/testing"
|
||||
|
@ -138,13 +137,9 @@ func runE(opts options, cmd *cobra.Command, client client.Client, namespacer nsp
|
|||
}
|
||||
|
||||
func assert(opts options, client client.Client, resource unstructured.Unstructured, namespacer nspacer.Namespacer) error {
|
||||
ctx := context.Background()
|
||||
if opts.timeout.Duration != 0 {
|
||||
_ctx, cancel := context.WithTimeout(ctx, opts.timeout.Duration)
|
||||
defer cancel()
|
||||
ctx = _ctx
|
||||
}
|
||||
op := opassert.New(apis.DefaultCompilers, client, resource, namespacer, false)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), opts.timeout.Duration)
|
||||
defer cancel()
|
||||
op := opassert.New(client, resource, namespacer, false)
|
||||
_, err := op.Exec(ctx, nil)
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -3,30 +3,23 @@ package assert
|
|||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
tclient "github.com/kyverno/chainsaw/pkg/client/testing"
|
||||
"github.com/kyverno/chainsaw/pkg/commands/root"
|
||||
fakeNamespacer "github.com/kyverno/chainsaw/pkg/engine/namespacer/testing"
|
||||
"github.com/kyverno/chainsaw/pkg/testing"
|
||||
"github.com/spf13/cobra"
|
||||
testify "github.com/stretchr/testify/assert"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
)
|
||||
|
||||
type errReader struct{}
|
||||
|
||||
func (e *errReader) Read(p []byte) (n int, err error) {
|
||||
return 0, errors.New("error reading from stdin")
|
||||
}
|
||||
|
||||
func Test_Execute(t *testing.T) {
|
||||
basePath := path.Join("..", "..", "..", "testdata", "commands", "assert")
|
||||
tests := []struct {
|
||||
|
@ -327,7 +320,7 @@ data:
|
|||
cmd.Args = cobra.RangeArgs(0, 1)
|
||||
cmd.SilenceUsage = true
|
||||
cmd.SetOut(bytes.NewBufferString(""))
|
||||
cmd.SetIn(&errReader{})
|
||||
cmd.SetIn(&testing.ErrReader{})
|
||||
return cmd
|
||||
},
|
||||
opts: options{
|
||||
|
|
|
@ -108,7 +108,7 @@ wait
|
|||
{{- with .Test.Spec.Steps }}
|
||||
|
||||
| # | Name | Bindings | Try | Catch | Finally | Cleanup |
|
||||
|:-:|---|:-:|:-:|:-:|:-:|:-:|
|
||||
|:-:|---|:-:|:-:|:-:|:-:|
|
||||
{{- range $i, $step := . }}
|
||||
{{- $name := default (print "step-" (add $i 1)) $step.Name }}
|
||||
| {{ add $i 1 }} | [{{ $name }}](#step-{{ $name }}) | {{ len $step.Bindings }} | {{ len $step.Try }} | {{ add (len $step.Catch) (len $test.Test.Spec.Catch) }} | {{ len $step.Finally }} | {{ len $step.Cleanup }} |
|
||||
|
|
|
@ -19,7 +19,7 @@ func websitePrepender(filename string) string {
|
|||
now := time.Now().Format(time.RFC3339)
|
||||
name := filepath.Base(filename)
|
||||
base := strings.TrimSuffix(name, path.Ext(name))
|
||||
return fmt.Sprintf(fmTemplate, now, strings.ReplaceAll(base, "_", " "))
|
||||
return fmt.Sprintf(fmTemplate, now, strings.Replace(base, "_", " ", -1))
|
||||
}
|
||||
|
||||
func websiteLinkHandler(filename string) string {
|
||||
|
|
|
@ -151,7 +151,7 @@ func processStep(stderr io.Writer, step *v1alpha1.TestStep, s discovery.Step, fo
|
|||
}
|
||||
}
|
||||
if !containsKuttlResources {
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
Apply: &v1alpha1.Apply{
|
||||
ActionResourceRef: v1alpha1.ActionResourceRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
|
@ -193,7 +193,7 @@ func processStep(stderr io.Writer, step *v1alpha1.TestStep, s discovery.Step, fo
|
|||
return err
|
||||
}
|
||||
}
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
Apply: &v1alpha1.Apply{
|
||||
ActionResourceRef: v1alpha1.ActionResourceRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
|
@ -218,7 +218,7 @@ func processStep(stderr io.Writer, step *v1alpha1.TestStep, s discovery.Step, fo
|
|||
}
|
||||
}
|
||||
if !containsKuttlResources {
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
Assert: &v1alpha1.Assert{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
|
@ -254,7 +254,7 @@ func processStep(stderr io.Writer, step *v1alpha1.TestStep, s discovery.Step, fo
|
|||
return err
|
||||
}
|
||||
}
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
Assert: &v1alpha1.Assert{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
|
@ -279,7 +279,7 @@ func processStep(stderr io.Writer, step *v1alpha1.TestStep, s discovery.Step, fo
|
|||
}
|
||||
}
|
||||
if !containsKuttlResources {
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
Error: &v1alpha1.Error{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
|
@ -315,7 +315,7 @@ func processStep(stderr io.Writer, step *v1alpha1.TestStep, s discovery.Step, fo
|
|||
return err
|
||||
}
|
||||
}
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
Error: &v1alpha1.Error{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
|
|
|
@ -12,10 +12,8 @@ import (
|
|||
"github.com/kyverno/chainsaw/pkg/discovery"
|
||||
"github.com/kyverno/chainsaw/pkg/loaders/config"
|
||||
"github.com/kyverno/chainsaw/pkg/loaders/values"
|
||||
"github.com/kyverno/chainsaw/pkg/report"
|
||||
"github.com/kyverno/chainsaw/pkg/runner"
|
||||
enginecontext "github.com/kyverno/chainsaw/pkg/runner/context"
|
||||
runnerflags "github.com/kyverno/chainsaw/pkg/runner/flags"
|
||||
"github.com/kyverno/chainsaw/pkg/runner/failer"
|
||||
flagutils "github.com/kyverno/chainsaw/pkg/utils/flag"
|
||||
fsutils "github.com/kyverno/chainsaw/pkg/utils/fs"
|
||||
restutils "github.com/kyverno/chainsaw/pkg/utils/rest"
|
||||
|
@ -42,7 +40,6 @@ type options struct {
|
|||
testDirs []string
|
||||
skipDelete bool
|
||||
template bool
|
||||
defaultCompiler string
|
||||
failFast bool
|
||||
parallel int
|
||||
repeatCount int
|
||||
|
@ -64,8 +61,6 @@ type options struct {
|
|||
values []string
|
||||
clusters []string
|
||||
remarshal bool
|
||||
shardIndex int
|
||||
shardCount int
|
||||
}
|
||||
|
||||
func Command() *cobra.Command {
|
||||
|
@ -77,28 +72,26 @@ func Command() *cobra.Command {
|
|||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
color.Init(options.noColor, true)
|
||||
clock := clock.RealClock{}
|
||||
stdOut := cmd.OutOrStdout()
|
||||
stdErr := cmd.ErrOrStderr()
|
||||
stdIn := cmd.InOrStdin()
|
||||
fmt.Fprintf(stdOut, "Version: %s\n", version.Version())
|
||||
out := cmd.OutOrStdout()
|
||||
fmt.Fprintf(out, "Version: %s\n", version.Version())
|
||||
var configuration v1alpha2.Configuration
|
||||
// if no config file was provided, give a chance to the default config name
|
||||
if options.config == "" {
|
||||
if _, err := os.Stat(config.DefaultFileName); err == nil {
|
||||
options.config = config.DefaultFileName
|
||||
fmt.Fprintf(stdOut, "No configuration provided but found default file: %s\n", options.config)
|
||||
fmt.Fprintf(out, "No configuration provided but found default file: %s\n", options.config)
|
||||
}
|
||||
}
|
||||
// try to load configuration file
|
||||
if options.config != "" {
|
||||
fmt.Fprintf(stdOut, "Loading config (%s)...\n", options.config)
|
||||
fmt.Fprintf(out, "Loading config (%s)...\n", options.config)
|
||||
config, err := config.Load(options.config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
configuration = *config
|
||||
} else {
|
||||
fmt.Fprintln(stdOut, "Loading default configuration...")
|
||||
fmt.Fprintln(out, "Loading default configuration...")
|
||||
config, err := config.DefaultConfiguration()
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -134,9 +127,6 @@ func Command() *cobra.Command {
|
|||
if flagutils.IsSet(flags, "template") {
|
||||
configuration.Spec.Templating.Enabled = options.template
|
||||
}
|
||||
if flagutils.IsSet(flags, "default-compiler") {
|
||||
configuration.Spec.Templating.Compiler = ptr.To(v1alpha1.Compiler(options.defaultCompiler))
|
||||
}
|
||||
if flagutils.IsSet(flags, "fail-fast") {
|
||||
configuration.Spec.Execution.FailFast = options.failFast
|
||||
}
|
||||
|
@ -229,63 +219,57 @@ func Command() *cobra.Command {
|
|||
if options.pauseOnFailure {
|
||||
configuration.Spec.Execution.Parallel = ptr.To(1)
|
||||
}
|
||||
fmt.Fprintf(stdOut, "- Using test file: %s\n", configuration.Spec.Discovery.TestFile)
|
||||
fmt.Fprintf(stdOut, "- TestDirs %v\n", options.testDirs)
|
||||
fmt.Fprintf(stdOut, "- SkipDelete %v\n", configuration.Spec.Cleanup.SkipDelete)
|
||||
fmt.Fprintf(stdOut, "- FailFast %v\n", configuration.Spec.Execution.FailFast)
|
||||
fmt.Fprintf(out, "- Using test file: %s\n", configuration.Spec.Discovery.TestFile)
|
||||
fmt.Fprintf(out, "- TestDirs %v\n", options.testDirs)
|
||||
fmt.Fprintf(out, "- SkipDelete %v\n", configuration.Spec.Cleanup.SkipDelete)
|
||||
fmt.Fprintf(out, "- FailFast %v\n", configuration.Spec.Execution.FailFast)
|
||||
if configuration.Spec.Report != nil {
|
||||
fmt.Fprintf(stdOut, "- ReportFormat '%v'\n", configuration.Spec.Report.Format)
|
||||
fmt.Fprintf(stdOut, "- ReportName '%v'\n", configuration.Spec.Report.Name)
|
||||
fmt.Fprintf(out, "- ReportFormat '%v'\n", configuration.Spec.Report.Format)
|
||||
fmt.Fprintf(out, "- ReportName '%v'\n", configuration.Spec.Report.Name)
|
||||
if configuration.Spec.Report.Path != "" {
|
||||
fmt.Fprintf(stdOut, "- ReportPath '%v'\n", configuration.Spec.Report.Path)
|
||||
fmt.Fprintf(out, "- ReportPath '%v'\n", configuration.Spec.Report.Path)
|
||||
}
|
||||
}
|
||||
fmt.Fprintf(stdOut, "- Namespace '%v'\n", configuration.Spec.Namespace.Name)
|
||||
fmt.Fprintf(stdOut, "- FullName %v\n", configuration.Spec.Discovery.FullName)
|
||||
fmt.Fprintf(stdOut, "- IncludeTestRegex '%v'\n", configuration.Spec.Discovery.IncludeTestRegex)
|
||||
fmt.Fprintf(stdOut, "- ExcludeTestRegex '%v'\n", configuration.Spec.Discovery.ExcludeTestRegex)
|
||||
fmt.Fprintf(stdOut, "- ApplyTimeout %v\n", configuration.Spec.Timeouts.Apply.Duration)
|
||||
fmt.Fprintf(stdOut, "- AssertTimeout %v\n", configuration.Spec.Timeouts.Assert.Duration)
|
||||
fmt.Fprintf(stdOut, "- CleanupTimeout %v\n", configuration.Spec.Timeouts.Cleanup.Duration)
|
||||
fmt.Fprintf(stdOut, "- DeleteTimeout %v\n", configuration.Spec.Timeouts.Delete.Duration)
|
||||
fmt.Fprintf(stdOut, "- ErrorTimeout %v\n", configuration.Spec.Timeouts.Error.Duration)
|
||||
fmt.Fprintf(stdOut, "- ExecTimeout %v\n", configuration.Spec.Timeouts.Exec.Duration)
|
||||
fmt.Fprintf(stdOut, "- DeletionPropagationPolicy %v\n", configuration.Spec.Deletion.Propagation)
|
||||
fmt.Fprintf(out, "- Namespace '%v'\n", configuration.Spec.Namespace.Name)
|
||||
fmt.Fprintf(out, "- FullName %v\n", configuration.Spec.Discovery.FullName)
|
||||
fmt.Fprintf(out, "- IncludeTestRegex '%v'\n", configuration.Spec.Discovery.IncludeTestRegex)
|
||||
fmt.Fprintf(out, "- ExcludeTestRegex '%v'\n", configuration.Spec.Discovery.ExcludeTestRegex)
|
||||
fmt.Fprintf(out, "- ApplyTimeout %v\n", configuration.Spec.Timeouts.Apply.Duration)
|
||||
fmt.Fprintf(out, "- AssertTimeout %v\n", configuration.Spec.Timeouts.Assert.Duration)
|
||||
fmt.Fprintf(out, "- CleanupTimeout %v\n", configuration.Spec.Timeouts.Cleanup.Duration)
|
||||
fmt.Fprintf(out, "- DeleteTimeout %v\n", configuration.Spec.Timeouts.Delete.Duration)
|
||||
fmt.Fprintf(out, "- ErrorTimeout %v\n", configuration.Spec.Timeouts.Error.Duration)
|
||||
fmt.Fprintf(out, "- ExecTimeout %v\n", configuration.Spec.Timeouts.Exec.Duration)
|
||||
fmt.Fprintf(out, "- DeletionPropagationPolicy %v\n", configuration.Spec.Deletion.Propagation)
|
||||
if configuration.Spec.Execution.Parallel != nil && *configuration.Spec.Execution.Parallel > 0 {
|
||||
fmt.Fprintf(stdOut, "- Parallel %d\n", *configuration.Spec.Execution.Parallel)
|
||||
fmt.Fprintf(out, "- Parallel %d\n", *configuration.Spec.Execution.Parallel)
|
||||
}
|
||||
if configuration.Spec.Execution.RepeatCount != nil {
|
||||
fmt.Fprintf(stdOut, "- RepeatCount %v\n", *configuration.Spec.Execution.RepeatCount)
|
||||
fmt.Fprintf(out, "- RepeatCount %v\n", *configuration.Spec.Execution.RepeatCount)
|
||||
}
|
||||
if configuration.Spec.Execution.ForceTerminationGracePeriod != nil {
|
||||
fmt.Fprintf(stdOut, "- ForceTerminationGracePeriod %v\n", configuration.Spec.Execution.ForceTerminationGracePeriod.Duration)
|
||||
fmt.Fprintf(out, "- ForceTerminationGracePeriod %v\n", configuration.Spec.Execution.ForceTerminationGracePeriod.Duration)
|
||||
}
|
||||
if configuration.Spec.Cleanup.DelayBeforeCleanup != nil {
|
||||
fmt.Fprintf(stdOut, "- DelayBeforeCleanup %v\n", configuration.Spec.Cleanup.DelayBeforeCleanup.Duration)
|
||||
fmt.Fprintf(out, "- DelayBeforeCleanup %v\n", configuration.Spec.Cleanup.DelayBeforeCleanup.Duration)
|
||||
}
|
||||
if len(options.selector) != 0 {
|
||||
fmt.Fprintf(stdOut, "- Selector %v\n", options.selector)
|
||||
fmt.Fprintf(out, "- Selector %v\n", options.selector)
|
||||
}
|
||||
if len(options.values) != 0 {
|
||||
fmt.Fprintf(stdOut, "- Values %v\n", options.values)
|
||||
}
|
||||
fmt.Fprintf(stdOut, "- Template %v\n", configuration.Spec.Templating.Enabled)
|
||||
if configuration.Spec.Templating.Compiler != nil {
|
||||
fmt.Fprintf(stdOut, "- Default compiler %v\n", *configuration.Spec.Templating.Compiler)
|
||||
fmt.Fprintf(out, "- Values %v\n", options.values)
|
||||
}
|
||||
fmt.Fprintf(out, "- Template %v\n", configuration.Spec.Templating.Enabled)
|
||||
if len(configuration.Spec.Clusters) != 0 {
|
||||
fmt.Fprintf(stdOut, "- Clusters %v\n", configuration.Spec.Clusters)
|
||||
fmt.Fprintf(out, "- Clusters %v\n", configuration.Spec.Clusters)
|
||||
}
|
||||
if options.remarshal {
|
||||
fmt.Fprintf(stdOut, "- Remarshal %v\n", options.remarshal)
|
||||
fmt.Fprintf(out, "- Remarshal %v\n", options.remarshal)
|
||||
}
|
||||
fmt.Fprintf(stdOut, "- NoCluster %v\n", options.noCluster)
|
||||
fmt.Fprintf(stdOut, "- PauseOnFailure %v\n", options.pauseOnFailure)
|
||||
if options.shardCount > 0 {
|
||||
fmt.Fprintf(stdOut, "- Shard %v / %v\n", options.shardIndex, options.shardCount)
|
||||
}
|
||||
// load tests
|
||||
fmt.Fprintln(stdOut, "Loading tests...")
|
||||
fmt.Fprintf(out, "- NoCluster %v\n", options.noCluster)
|
||||
fmt.Fprintf(out, "- PauseOnFailure %v\n", options.pauseOnFailure)
|
||||
// loading tests
|
||||
fmt.Fprintln(out, "Loading tests...")
|
||||
if err := fsutils.CheckFolders(options.testDirs...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -301,33 +285,23 @@ func Command() *cobra.Command {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO: we may want to find a sort key here ?
|
||||
if options.shardCount > 0 && options.shardIndex < options.shardCount {
|
||||
shardLen := float64(len(tests)) / float64(options.shardCount)
|
||||
shardStart := int(shardLen * float64(options.shardIndex))
|
||||
shardEnd := int(shardLen * float64(options.shardIndex+1))
|
||||
if options.shardIndex == options.shardCount-1 {
|
||||
shardEnd = len(tests)
|
||||
}
|
||||
tests = tests[shardStart:shardEnd]
|
||||
}
|
||||
var testToRun []discovery.Test
|
||||
for _, test := range tests {
|
||||
if test.Err != nil {
|
||||
fmt.Fprintf(stdOut, "- %s (%s) - (%s)\n", test.Test.Name, test.BasePath, test.Err)
|
||||
fmt.Fprintf(out, "- %s (%s) - (%s)\n", test.Test.Name, test.BasePath, test.Err)
|
||||
} else {
|
||||
fmt.Fprintf(stdOut, "- %s (%s)\n", test.Test.Name, test.BasePath)
|
||||
fmt.Fprintf(out, "- %s (%s)\n", test.Test.Name, test.BasePath)
|
||||
testToRun = append(testToRun, test)
|
||||
}
|
||||
}
|
||||
// load values
|
||||
fmt.Fprintln(stdOut, "Loading values...")
|
||||
// loading tests
|
||||
fmt.Fprintln(out, "Loading values...")
|
||||
values, err := values.Load(options.values...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// run tests
|
||||
fmt.Fprintln(stdOut, "Running tests...")
|
||||
fmt.Fprintln(out, "Running tests...")
|
||||
var restConfig *rest.Config
|
||||
if !options.noCluster {
|
||||
cfg, err := restutils.DefaultConfig(options.kubeConfigOverrides)
|
||||
|
@ -336,44 +310,21 @@ func Command() *cobra.Command {
|
|||
}
|
||||
restConfig = cfg
|
||||
}
|
||||
var onFailure func()
|
||||
if options.pauseOnFailure {
|
||||
onFailure = func() {
|
||||
fmt.Fprintln(stdErr, "Failure detected, press ENTER to continue...")
|
||||
fmt.Fscanln(stdIn) //nolint:errcheck
|
||||
}
|
||||
}
|
||||
ctx := context.Background()
|
||||
tc, err := enginecontext.InitContext(configuration.Spec, restConfig, values)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
runner := runner.New(clock, onFailure)
|
||||
// setup flags
|
||||
if err := runnerflags.SetupFlags(configuration.Spec); err != nil {
|
||||
return err
|
||||
}
|
||||
err = runner.Run(ctx, configuration.Spec.Namespace, tc, testToRun...)
|
||||
fmt.Fprintln(stdOut, "Tests Summary...")
|
||||
fmt.Fprintln(stdOut, "- Passed tests", tc.Passed())
|
||||
fmt.Fprintln(stdOut, "- Failed tests", tc.Failed())
|
||||
fmt.Fprintln(stdOut, "- Skipped tests", tc.Skipped())
|
||||
// process report
|
||||
if err == nil {
|
||||
if configuration.Spec.Report != nil && configuration.Spec.Report.Format != "" {
|
||||
fmt.Fprintln(stdOut, "Saving report...")
|
||||
if err := report.Save(tc.Report, configuration.Spec.Report.Format, configuration.Spec.Report.Path, configuration.Spec.Report.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
ctx := failer.IntoContext(context.Background(), failer.New(options.pauseOnFailure))
|
||||
summary, err := runner.Run(ctx, restConfig, clock, configuration.Spec, values, testToRun...)
|
||||
if summary != nil {
|
||||
fmt.Fprintln(out, "Tests Summary...")
|
||||
fmt.Fprintln(out, "- Passed tests", summary.Passed())
|
||||
fmt.Fprintln(out, "- Failed tests", summary.Failed())
|
||||
fmt.Fprintln(out, "- Skipped tests", summary.Skipped())
|
||||
}
|
||||
if err != nil {
|
||||
fmt.Fprintln(stdOut, "Done with error.")
|
||||
} else if tc.Failed() > 0 {
|
||||
fmt.Fprintln(stdOut, "Done with failures.")
|
||||
fmt.Fprintln(out, "Done with error.")
|
||||
} else if summary != nil && summary.Failed() > 0 {
|
||||
fmt.Fprintln(out, "Done with failures.")
|
||||
err = errors.New("some tests failed")
|
||||
} else {
|
||||
fmt.Fprintln(stdOut, "Done.")
|
||||
fmt.Fprintln(out, "Done.")
|
||||
}
|
||||
return err
|
||||
},
|
||||
|
@ -407,7 +358,6 @@ func Command() *cobra.Command {
|
|||
cmd.Flags().StringVar(&options.namespace, "namespace", "", "Namespace to use for tests")
|
||||
// templating options
|
||||
cmd.Flags().BoolVar(&options.template, "template", config.Spec.Templating.Enabled, "If set, resources will be considered for templating")
|
||||
cmd.Flags().StringVar(&options.defaultCompiler, "default-compiler", "", "If set, configures the default compiler (jp or cel)")
|
||||
// cleanup options
|
||||
cmd.Flags().BoolVar(&options.skipDelete, "skip-delete", false, "If set, do not delete the resources after running the tests")
|
||||
cmd.Flags().DurationVar(&options.delayBeforeCleanup.Duration, "cleanup-delay", 0, "Adds a delay between the time a test ends and the time cleanup starts")
|
||||
|
@ -415,7 +365,7 @@ func Command() *cobra.Command {
|
|||
cmd.Flags().StringVar(&options.deletionPropagationPolicy, "deletion-propagation-policy", "Background", "The deletion propagation policy (Foreground|Background|Orphan)")
|
||||
// error options
|
||||
// reporting options
|
||||
cmd.Flags().StringVar(&options.reportFormat, "report-format", "", "Test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION)")
|
||||
cmd.Flags().StringVar(&options.reportFormat, "report-format", "", "Test report format (JSON|XML|JUNIT-TEST|JUNIT-STEP|JUNIT-OPERATION)")
|
||||
cmd.Flags().StringVar(&options.reportName, "report-name", "chainsaw-report", "The name of the report to create")
|
||||
cmd.Flags().StringVar(&options.reportPath, "report-path", "", "The path of the report to create")
|
||||
// multi-cluster options
|
||||
|
@ -428,9 +378,6 @@ func Command() *cobra.Command {
|
|||
cmd.Flags().StringSliceVar(&options.selector, "selector", nil, "Selector (label query) to filter on")
|
||||
// external values
|
||||
cmd.Flags().StringSliceVar(&options.values, "values", nil, "Values passed to the tests")
|
||||
// sharding
|
||||
cmd.Flags().IntVar(&options.shardIndex, "shard-index", 0, "Current shard index (if `--shard-count` > 0)")
|
||||
cmd.Flags().IntVar(&options.shardCount, "shard-count", 0, "Number of shards")
|
||||
// others
|
||||
cmd.Flags().BoolVar(&options.noColor, "no-color", false, "Removes output colors")
|
||||
cmd.Flags().BoolVar(&options.remarshal, "remarshal", false, "Remarshals tests yaml to apply anchors before parsing")
|
||||
|
|
|
@ -11,7 +11,6 @@ import (
|
|||
)
|
||||
|
||||
func TestChainsawCommand(t *testing.T) {
|
||||
path := "../../../.temp"
|
||||
basePath := "../../../testdata/commands/test"
|
||||
tests := []struct {
|
||||
name string
|
||||
|
@ -117,8 +116,6 @@ func TestChainsawCommand(t *testing.T) {
|
|||
args: []string{
|
||||
"--config",
|
||||
filepath.Join(basePath, "config/config_all_fields.yaml"),
|
||||
"--report-path",
|
||||
path,
|
||||
},
|
||||
wantErr: false,
|
||||
out: filepath.Join(basePath, "config_all_fields.txt"),
|
||||
|
@ -138,8 +135,6 @@ func TestChainsawCommand(t *testing.T) {
|
|||
"--parallel=24",
|
||||
"--repeat-count=12",
|
||||
"--report-format=XML",
|
||||
"--report-path",
|
||||
path,
|
||||
"--report-name=foo",
|
||||
"--namespace=bar",
|
||||
"--full-name=true",
|
||||
|
|
|
@ -81,13 +81,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -103,6 +96,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -135,13 +129,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -161,15 +148,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -183,10 +164,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -201,13 +178,6 @@ spec:
|
|||
required:
|
||||
- entrypoint
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
delete:
|
||||
description: Delete represents a deletion operation.
|
||||
not:
|
||||
|
@ -221,13 +191,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -282,9 +245,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -582,13 +547,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -604,6 +562,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -637,13 +596,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -663,15 +615,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -685,10 +631,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -831,13 +773,6 @@ spec:
|
|||
description: Clusters holds a registry to clusters to support multi-cluster
|
||||
tests.
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when evaluating
|
||||
expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
delayBeforeCleanup:
|
||||
description: DelayBeforeCleanup adds a delay between the time a test
|
||||
ends and the time cleanup starts.
|
||||
|
@ -881,14 +816,8 @@ spec:
|
|||
namespaceTemplate:
|
||||
description: NamespaceTemplate defines a template to create the test
|
||||
namespace.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
namespaceTemplateCompiler:
|
||||
description: NamespaceTemplateCompiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
parallel:
|
||||
description: The maximum number of tests to run at once.
|
||||
format: int
|
||||
|
@ -902,7 +831,7 @@ spec:
|
|||
type: integer
|
||||
reportFormat:
|
||||
description: |-
|
||||
ReportFormat determines test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION, nil) nil == no report.
|
||||
ReportFormat determines test report format (JSON|XML|JUNIT-TEST|JUNIT-STEP|JUNIT-OPERATION|nil) nil == no report.
|
||||
maps to report.Type, however we don't want generated.deepcopy to have reference to it.
|
||||
enum:
|
||||
- JSON
|
||||
|
@ -1108,13 +1037,6 @@ spec:
|
|||
description: Binding represents a key/value set as
|
||||
a binding in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1130,6 +1052,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate
|
||||
the operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will
|
||||
|
@ -1163,13 +1086,6 @@ spec:
|
|||
description: Binding represents a key/value set as
|
||||
a binding in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1189,15 +1105,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -1211,10 +1121,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the
|
||||
command. Useful for sensitive logs or to reduce noise.
|
||||
|
@ -1229,13 +1135,6 @@ spec:
|
|||
required:
|
||||
- entrypoint
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use
|
||||
when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
delete:
|
||||
description: Delete represents a deletion operation.
|
||||
not:
|
||||
|
@ -1249,13 +1148,6 @@ spec:
|
|||
description: Binding represents a key/value set as
|
||||
a binding in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1310,9 +1202,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -1613,13 +1507,6 @@ spec:
|
|||
description: Binding represents a key/value set as
|
||||
a binding in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1635,6 +1522,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate
|
||||
the operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will
|
||||
|
@ -1668,13 +1556,6 @@ spec:
|
|||
description: Binding represents a key/value set as
|
||||
a binding in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1694,15 +1575,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -1716,10 +1591,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the
|
||||
command. Useful for sensitive logs or to reduce noise.
|
||||
|
@ -1877,13 +1748,6 @@ spec:
|
|||
description: Namespace contains properties for the namespace to use
|
||||
for tests.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: |-
|
||||
Name defines the namespace to use for tests.
|
||||
|
@ -1892,6 +1756,7 @@ spec:
|
|||
type: string
|
||||
template:
|
||||
description: Template defines a template to create the test namespace.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type: object
|
||||
report:
|
||||
|
@ -1899,8 +1764,7 @@ spec:
|
|||
properties:
|
||||
format:
|
||||
default: JSON
|
||||
description: ReportFormat determines test report format (JSON,
|
||||
XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION).
|
||||
description: ReportFormat determines test report format (JSON|XML|JUNIT-TEST|JUNIT-STEP|JUNIT-OPERATION).
|
||||
enum:
|
||||
- JSON
|
||||
- XML
|
||||
|
@ -1921,13 +1785,6 @@ spec:
|
|||
default: {}
|
||||
description: Templating contains the templating config.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
enabled:
|
||||
default: true
|
||||
description: Enabled determines whether resources should be considered
|
||||
|
|
|
@ -45,13 +45,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding in
|
||||
an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -104,13 +97,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -126,6 +112,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -158,13 +145,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -184,15 +164,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -206,10 +180,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -224,13 +194,6 @@ spec:
|
|||
required:
|
||||
- entrypoint
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
delete:
|
||||
description: Delete represents a deletion operation.
|
||||
not:
|
||||
|
@ -244,13 +207,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -305,9 +261,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -605,13 +563,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -627,6 +578,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -660,13 +612,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -686,15 +631,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -708,10 +647,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -878,13 +813,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -900,6 +828,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -932,13 +861,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -958,15 +880,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -980,10 +896,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -998,13 +910,6 @@ spec:
|
|||
required:
|
||||
- entrypoint
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
delete:
|
||||
description: Delete represents a deletion operation.
|
||||
not:
|
||||
|
@ -1018,13 +923,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1079,9 +977,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -1379,13 +1279,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1401,6 +1294,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -1434,13 +1328,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1460,15 +1347,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -1482,10 +1363,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -1652,13 +1529,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1674,6 +1544,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -1706,13 +1577,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1732,15 +1596,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -1754,10 +1612,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -1772,13 +1626,6 @@ spec:
|
|||
required:
|
||||
- entrypoint
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
delete:
|
||||
description: Delete represents a deletion operation.
|
||||
not:
|
||||
|
@ -1792,13 +1639,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -1853,9 +1693,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -2153,13 +1995,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2175,6 +2010,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -2208,13 +2044,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2234,15 +2063,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -2256,10 +2079,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -2438,13 +2257,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2493,9 +2305,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -2514,15 +2328,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -2564,13 +2372,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2613,6 +2414,7 @@ spec:
|
|||
type: string
|
||||
resource:
|
||||
description: Check provides a check used in assertions.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
template:
|
||||
description: Template determines whether resources should
|
||||
|
@ -2637,13 +2439,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2659,6 +2454,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -2691,13 +2487,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2717,15 +2506,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -2739,10 +2522,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -2757,13 +2536,6 @@ spec:
|
|||
required:
|
||||
- entrypoint
|
||||
type: object
|
||||
compiler:
|
||||
description: Compiler defines the default compiler to use when
|
||||
evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
continueOnError:
|
||||
description: |-
|
||||
ContinueOnError determines whether a test should continue or not in case the operation was not successful.
|
||||
|
@ -2782,13 +2554,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2837,9 +2602,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -2858,15 +2625,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -2907,13 +2668,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -2968,9 +2722,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -3102,13 +2858,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -3151,6 +2900,7 @@ spec:
|
|||
type: string
|
||||
resource:
|
||||
description: Check provides a check used in assertions.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
template:
|
||||
description: Template determines whether resources should
|
||||
|
@ -3289,13 +3039,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -3344,9 +3087,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -3365,15 +3110,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -3508,15 +3247,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -3555,13 +3288,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -3577,6 +3303,7 @@ spec:
|
|||
check:
|
||||
description: Check is an assertion tree to validate the
|
||||
operation outcome.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
cluster:
|
||||
description: Cluster defines the target cluster (will be
|
||||
|
@ -3610,13 +3337,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -3636,15 +3356,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
@ -3658,10 +3372,6 @@ spec:
|
|||
- value
|
||||
type: object
|
||||
type: array
|
||||
skipCommandOutput:
|
||||
description: SkipCommandOutput removes the command from
|
||||
the output logs.
|
||||
type: boolean
|
||||
skipLogOutput:
|
||||
description: SkipLogOutput removes the output from the command.
|
||||
Useful for sensitive logs or to reduce noise.
|
||||
|
@ -3696,13 +3406,6 @@ spec:
|
|||
description: Binding represents a key/value set as a binding
|
||||
in an executing test.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
pattern: ^(?:\w+|\(.+\))$
|
||||
|
@ -3751,9 +3454,11 @@ spec:
|
|||
properties:
|
||||
check:
|
||||
description: Check defines the verification statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- check
|
||||
|
@ -3772,15 +3477,9 @@ spec:
|
|||
a match to determine if the binding must be considered
|
||||
or not.
|
||||
properties:
|
||||
compiler:
|
||||
description: Compiler defines the default compiler
|
||||
to use when evaluating expressions.
|
||||
enum:
|
||||
- jp
|
||||
- cel
|
||||
type: string
|
||||
match:
|
||||
description: Match defines the matching statement.
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
name:
|
||||
description: Name the name of the binding.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -96,7 +96,6 @@
|
|||
],
|
||||
"default": ""
|
||||
},
|
||||
"x-kubernetes-list-type": "set",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
"generateName": {
|
||||
|
@ -208,8 +207,7 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"x-kubernetes-list-type": "atomic"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names",
|
||||
|
@ -287,10 +285,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"x-kubernetes-list-map-keys": [
|
||||
"uid"
|
||||
],
|
||||
"x-kubernetes-list-type": "map",
|
||||
"x-kubernetes-patch-merge-key": "uid",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
|
@ -427,17 +421,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -453,6 +436,10 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -514,17 +501,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -555,19 +531,12 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -583,13 +552,6 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"skipCommandOutput": {
|
||||
"description": "SkipCommandOutput removes the command from the output logs.",
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"skipLogOutput": {
|
||||
"description": "SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise.",
|
||||
"type": [
|
||||
|
@ -614,17 +576,6 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"description": "Delete represents a deletion operation.",
|
||||
"type": [
|
||||
|
@ -655,17 +606,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -747,10 +687,15 @@
|
|||
"properties": {
|
||||
"check": {
|
||||
"description": "Check defines the verification statement.",
|
||||
"type": "object",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
}
|
||||
},
|
||||
|
@ -1250,17 +1195,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -1276,6 +1210,10 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -1340,17 +1278,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -1381,19 +1308,12 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -1409,13 +1329,6 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"skipCommandOutput": {
|
||||
"description": "SkipCommandOutput removes the command from the output logs.",
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"skipLogOutput": {
|
||||
"description": "SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise.",
|
||||
"type": [
|
||||
|
@ -1657,17 +1570,6 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"delayBeforeCleanup": {
|
||||
"description": "DelayBeforeCleanup adds a delay between the time a test ends and the time cleanup starts.",
|
||||
"type": [
|
||||
|
@ -1732,18 +1634,11 @@
|
|||
},
|
||||
"namespaceTemplate": {
|
||||
"description": "NamespaceTemplate defines a template to create the test namespace.",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"namespaceTemplateCompiler": {
|
||||
"description": "NamespaceTemplateCompiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"parallel": {
|
||||
"description": "The maximum number of tests to run at once.",
|
||||
|
@ -1764,7 +1659,7 @@
|
|||
"minimum": 1
|
||||
},
|
||||
"reportFormat": {
|
||||
"description": "ReportFormat determines test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION, nil) nil == no report.\nmaps to report.Type, however we don't want generated.deepcopy to have reference to it.",
|
||||
"description": "ReportFormat determines test report format (JSON|XML|JUNIT-TEST|JUNIT-STEP|JUNIT-OPERATION|nil) nil == no report.\nmaps to report.Type, however we don't want generated.deepcopy to have reference to it.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
|
|
|
@ -96,7 +96,6 @@
|
|||
],
|
||||
"default": ""
|
||||
},
|
||||
"x-kubernetes-list-type": "set",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
"generateName": {
|
||||
|
@ -208,8 +207,7 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"x-kubernetes-list-type": "atomic"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names",
|
||||
|
@ -287,10 +285,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"x-kubernetes-list-map-keys": [
|
||||
"uid"
|
||||
],
|
||||
"x-kubernetes-list-type": "map",
|
||||
"x-kubernetes-patch-merge-key": "uid",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
|
@ -555,17 +549,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -581,6 +564,10 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -642,17 +629,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -683,19 +659,12 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -711,13 +680,6 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"skipCommandOutput": {
|
||||
"description": "SkipCommandOutput removes the command from the output logs.",
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"skipLogOutput": {
|
||||
"description": "SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise.",
|
||||
"type": [
|
||||
|
@ -742,17 +704,6 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"description": "Delete represents a deletion operation.",
|
||||
"type": [
|
||||
|
@ -783,17 +734,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -875,10 +815,15 @@
|
|||
"properties": {
|
||||
"check": {
|
||||
"description": "Check defines the verification statement.",
|
||||
"type": "object",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
}
|
||||
},
|
||||
|
@ -1378,17 +1323,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -1404,6 +1338,10 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -1468,17 +1406,6 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name the name of the binding.",
|
||||
"type": "string",
|
||||
|
@ -1509,19 +1436,12 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -1537,13 +1457,6 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"skipCommandOutput": {
|
||||
"description": "SkipCommandOutput removes the command from the output logs.",
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"skipLogOutput": {
|
||||
"description": "SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise.",
|
||||
"type": [
|
||||
|
@ -1808,17 +1721,6 @@
|
|||
],
|
||||
"default": {},
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"description": "Name defines the namespace to use for tests.\nIf not specified, every test will execute in a random ephemeral namespace\nunless the namespace is overridden in a the test spec.",
|
||||
"type": [
|
||||
|
@ -1828,6 +1730,10 @@
|
|||
},
|
||||
"template": {
|
||||
"description": "Template defines a template to create the test namespace.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
}
|
||||
},
|
||||
|
@ -1841,7 +1747,7 @@
|
|||
],
|
||||
"properties": {
|
||||
"format": {
|
||||
"description": "ReportFormat determines test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION).",
|
||||
"description": "ReportFormat determines test report format (JSON|XML|JUNIT-TEST|JUNIT-STEP|JUNIT-OPERATION).",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
|
@ -1881,17 +1787,6 @@
|
|||
],
|
||||
"default": {},
|
||||
"properties": {
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"enabled": {
|
||||
"description": "Enabled determines whether resources should be considered for templating.",
|
||||
"type": [
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -67,8 +67,8 @@ func LoadTest(fileName string, path string, remarshal bool) ([]Test, error) {
|
|||
return nil, errors.New("step template not found or multiple templates exist")
|
||||
}
|
||||
template := steptpl[0]
|
||||
step.Bindings = append(step.Bindings, template.Spec.Bindings...)
|
||||
step.Bindings = append(step.Bindings, step.Use.With.Bindings...)
|
||||
step.Bindings = append(step.Bindings, template.Spec.Bindings...)
|
||||
step.Try = append(step.Try, template.Spec.Try...)
|
||||
step.Catch = append(step.Catch, template.Spec.Catch...)
|
||||
step.Finally = append(step.Finally, template.Spec.Finally...)
|
||||
|
@ -109,7 +109,7 @@ func LoadTest(fileName string, path string, remarshal bool) ([]Test, error) {
|
|||
Name: fmt.Sprintf("step-%s", key),
|
||||
}
|
||||
for _, file := range steps[key].OtherFiles {
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
Apply: &v1alpha1.Apply{
|
||||
ActionResourceRef: v1alpha1.ActionResourceRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
|
@ -120,7 +120,7 @@ func LoadTest(fileName string, path string, remarshal bool) ([]Test, error) {
|
|||
})
|
||||
}
|
||||
for _, file := range steps[key].AssertFiles {
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
Assert: &v1alpha1.Assert{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
|
@ -131,7 +131,7 @@ func LoadTest(fileName string, path string, remarshal bool) ([]Test, error) {
|
|||
})
|
||||
}
|
||||
for _, file := range steps[key].ErrorFiles {
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
Error: &v1alpha1.Error{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
|
|
|
@ -5,10 +5,9 @@ import (
|
|||
"fmt"
|
||||
"regexp"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/engine/templating"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers"
|
||||
)
|
||||
|
||||
var identifier = regexp.MustCompile(`^\w+$`)
|
||||
|
@ -20,22 +19,19 @@ func checkBindingName(name string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func RegisterBinding(bindings apis.Bindings, name string, value any) apis.Bindings {
|
||||
return bindings.Register("$"+name, apis.NewBinding(value))
|
||||
func RegisterBinding(ctx context.Context, bindings binding.Bindings, name string, value any) binding.Bindings {
|
||||
return bindings.Register("$"+name, binding.NewBinding(value))
|
||||
}
|
||||
|
||||
func ResolveBinding(ctx context.Context, compilers compilers.Compilers, bindings apis.Bindings, input any, variable v1alpha1.Binding) (string, any, error) {
|
||||
name, err := variable.Name.Value(ctx, compilers, bindings)
|
||||
func ResolveBinding(ctx context.Context, bindings binding.Bindings, input any, variable v1alpha1.Binding) (string, any, error) {
|
||||
name, err := variable.Name.Value(ctx, bindings)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
if err := checkBindingName(name); err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
if variable.Compiler != nil {
|
||||
compilers = compilers.WithDefaultCompiler(string(*variable.Compiler))
|
||||
}
|
||||
value, err := templating.Template(ctx, compilers, variable.Value, input, bindings)
|
||||
value, err := templating.Template(ctx, variable.Value, input, bindings)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
@ -46,17 +46,17 @@ func Test_checkBindingName(t *testing.T) {
|
|||
func TestRegisterBinding(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
bindings apis.Bindings
|
||||
bindings binding.Bindings
|
||||
bindingName string
|
||||
value any
|
||||
}{{
|
||||
bindings: apis.NewBindings(),
|
||||
bindings: binding.NewBindings(),
|
||||
bindingName: "foo",
|
||||
value: "bar",
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
bindings := RegisterBinding(tt.bindings, tt.bindingName, tt.value)
|
||||
bindings := RegisterBinding(context.TODO(), tt.bindings, tt.bindingName, tt.value)
|
||||
assert.NotNil(t, bindings)
|
||||
got, err := bindings.Get("$" + tt.bindingName)
|
||||
assert.NoError(t, err)
|
||||
|
@ -71,7 +71,7 @@ func TestRegisterBinding(t *testing.T) {
|
|||
func TestResolveBinding(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
bindings apis.Bindings
|
||||
bindings binding.Bindings
|
||||
input any
|
||||
variable v1alpha1.Binding
|
||||
wantName string
|
||||
|
@ -79,49 +79,49 @@ func TestResolveBinding(t *testing.T) {
|
|||
wantErr bool
|
||||
}{{
|
||||
name: "ok",
|
||||
bindings: apis.NewBindings(),
|
||||
bindings: binding.NewBindings(),
|
||||
input: nil,
|
||||
variable: v1alpha1.Binding{
|
||||
Name: "foo",
|
||||
Value: v1alpha1.NewProjection("bar"),
|
||||
Value: v1alpha1.Any{Value: "bar"},
|
||||
},
|
||||
wantName: "foo",
|
||||
wantValue: "bar",
|
||||
wantErr: false,
|
||||
}, {
|
||||
name: "error",
|
||||
bindings: apis.NewBindings(),
|
||||
bindings: binding.NewBindings(),
|
||||
input: nil,
|
||||
variable: v1alpha1.Binding{
|
||||
Name: "$foo",
|
||||
Value: v1alpha1.NewProjection("bar"),
|
||||
Value: v1alpha1.Any{Value: "bar"},
|
||||
},
|
||||
wantErr: true,
|
||||
}, {
|
||||
name: "error",
|
||||
bindings: apis.NewBindings(),
|
||||
bindings: binding.NewBindings(),
|
||||
input: nil,
|
||||
variable: v1alpha1.Binding{
|
||||
Name: "foo",
|
||||
Value: v1alpha1.NewProjection("($bar)"),
|
||||
Value: v1alpha1.Any{Value: "($bar)"},
|
||||
},
|
||||
wantErr: true,
|
||||
}, {
|
||||
name: "error",
|
||||
bindings: apis.NewBindings(),
|
||||
bindings: binding.NewBindings(),
|
||||
input: nil,
|
||||
variable: v1alpha1.Binding{
|
||||
Name: "($foo)",
|
||||
Value: v1alpha1.NewProjection("bar"),
|
||||
Value: v1alpha1.Any{Value: "bar"},
|
||||
},
|
||||
wantErr: true,
|
||||
}, {
|
||||
name: "error",
|
||||
bindings: apis.NewBindings().Register("$foo", apis.NewBinding("abc")).Register("$bar", apis.NewBinding("def")),
|
||||
bindings: binding.NewBindings().Register("$foo", binding.NewBinding("abc")).Register("$bar", binding.NewBinding("def")),
|
||||
input: nil,
|
||||
variable: v1alpha1.Binding{
|
||||
Name: "($foo)",
|
||||
Value: v1alpha1.NewProjection("($bar)"),
|
||||
Value: v1alpha1.Any{Value: "($bar)"},
|
||||
},
|
||||
wantName: "abc",
|
||||
wantValue: "def",
|
||||
|
@ -129,7 +129,7 @@ func TestResolveBinding(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
name, value, err := ResolveBinding(context.TODO(), apis.DefaultCompilers, tt.bindings, tt.input, tt.variable)
|
||||
name, value, err := ResolveBinding(context.TODO(), tt.bindings, tt.input, tt.variable)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
} else {
|
||||
|
|
|
@ -4,25 +4,23 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers"
|
||||
"github.com/kyverno/chainsaw/pkg/engine/functions"
|
||||
"github.com/kyverno/kyverno-json/pkg/engine/assert"
|
||||
"github.com/kyverno/kyverno-json/pkg/engine/template"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
)
|
||||
|
||||
func Check(ctx context.Context, compilers compilers.Compilers, obj any, bindings apis.Bindings, check *v1alpha1.Check) (field.ErrorList, error) {
|
||||
func Check(ctx context.Context, obj any, bindings binding.Bindings, check *v1alpha1.Check) (field.ErrorList, error) {
|
||||
if check == nil {
|
||||
return nil, errors.New("check is null")
|
||||
}
|
||||
if check.IsNil() {
|
||||
if check.Value == nil {
|
||||
return nil, errors.New("check value is null")
|
||||
}
|
||||
if assertion, err := check.Compile(nil, compilers); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
if bindings == nil {
|
||||
bindings = apis.NewBindings()
|
||||
}
|
||||
return assertion.Assert(nil, obj, bindings)
|
||||
if bindings == nil {
|
||||
bindings = binding.NewBindings()
|
||||
}
|
||||
return assert.Assert(ctx, nil, assert.Parse(ctx, check.Value), obj, bindings, template.WithFunctionCaller(functions.Caller()))
|
||||
}
|
||||
|
|
|
@ -4,18 +4,17 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
"k8s.io/utils/ptr"
|
||||
)
|
||||
|
||||
func TestCheck(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
obj any
|
||||
bindings apis.Bindings
|
||||
bindings binding.Bindings
|
||||
check *v1alpha1.Check
|
||||
want field.ErrorList
|
||||
wantErr bool
|
||||
|
@ -39,11 +38,11 @@ func TestCheck(t *testing.T) {
|
|||
"foo": "bar",
|
||||
},
|
||||
bindings: nil,
|
||||
check: ptr.To(v1alpha1.NewCheck(
|
||||
map[string]any{
|
||||
check: &v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
"foo": "bar",
|
||||
},
|
||||
)),
|
||||
},
|
||||
want: nil,
|
||||
wantErr: false,
|
||||
}, {
|
||||
|
@ -52,11 +51,11 @@ func TestCheck(t *testing.T) {
|
|||
"foo": "bar",
|
||||
},
|
||||
bindings: nil,
|
||||
check: ptr.To(v1alpha1.NewCheck(
|
||||
map[string]any{
|
||||
check: &v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
"foo": "baz",
|
||||
},
|
||||
)),
|
||||
},
|
||||
want: []*field.Error{{
|
||||
Type: field.ErrorTypeInvalid,
|
||||
Field: "foo",
|
||||
|
@ -67,7 +66,7 @@ func TestCheck(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := Check(context.TODO(), apis.DefaultCompilers, tt.obj, tt.bindings, tt.check)
|
||||
got, err := Check(context.TODO(), tt.obj, tt.bindings, tt.check)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
} else {
|
||||
|
|
|
@ -3,28 +3,27 @@ package checks
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
"k8s.io/utils/ptr"
|
||||
)
|
||||
|
||||
func Expect(ctx context.Context, compilers compilers.Compilers, obj unstructured.Unstructured, bindings apis.Bindings, expect ...v1alpha1.Expectation) (bool, error) {
|
||||
func Expect(ctx context.Context, obj unstructured.Unstructured, bindings binding.Bindings, expect ...v1alpha1.Expectation) (bool, error) {
|
||||
matched := false
|
||||
var results field.ErrorList
|
||||
for _, expectation := range expect {
|
||||
// if a match is specified, skip the check if the resource doesn't match
|
||||
if expectation.Match != nil && !expectation.Match.IsNil() {
|
||||
if errs, err := Check(ctx, compilers, obj.UnstructuredContent(), nil, expectation.Match); err != nil {
|
||||
if expectation.Match != nil && expectation.Match.Value != nil {
|
||||
if errs, err := Check(ctx, obj.UnstructuredContent(), nil, expectation.Match); err != nil {
|
||||
return true, err
|
||||
} else if len(errs) != 0 {
|
||||
continue
|
||||
}
|
||||
}
|
||||
matched = true
|
||||
if errs, err := Check(ctx, compilers, obj.UnstructuredContent(), bindings, ptr.To(expectation.Check)); err != nil {
|
||||
if errs, err := Check(ctx, obj.UnstructuredContent(), bindings, ptr.To(expectation.Check)); err != nil {
|
||||
return true, err
|
||||
} else {
|
||||
results = append(results, errs...)
|
||||
|
|
|
@ -4,18 +4,17 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/utils/ptr"
|
||||
)
|
||||
|
||||
func TestExpectations(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
obj unstructured.Unstructured
|
||||
bindings apis.Bindings
|
||||
bindings binding.Bindings
|
||||
expect []v1alpha1.Expectation
|
||||
want bool
|
||||
wantErr bool
|
||||
|
@ -42,16 +41,16 @@ func TestExpectations(t *testing.T) {
|
|||
},
|
||||
bindings: nil,
|
||||
expect: []v1alpha1.Expectation{{
|
||||
Match: ptr.To(v1alpha1.NewMatch(
|
||||
map[string]any{
|
||||
Match: &v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
"foo": "baz",
|
||||
},
|
||||
)),
|
||||
Check: v1alpha1.NewCheck(
|
||||
map[string]any{
|
||||
},
|
||||
Check: v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
"foo": "bar",
|
||||
},
|
||||
),
|
||||
},
|
||||
}},
|
||||
want: false,
|
||||
wantErr: false,
|
||||
|
@ -64,16 +63,16 @@ func TestExpectations(t *testing.T) {
|
|||
},
|
||||
bindings: nil,
|
||||
expect: []v1alpha1.Expectation{{
|
||||
Match: ptr.To(v1alpha1.NewMatch(
|
||||
map[string]any{
|
||||
Match: &v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
"foo": "bar",
|
||||
},
|
||||
)),
|
||||
Check: v1alpha1.NewCheck(
|
||||
map[string]any{
|
||||
},
|
||||
Check: v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
"foo": "bar",
|
||||
},
|
||||
),
|
||||
},
|
||||
}},
|
||||
want: true,
|
||||
wantErr: false,
|
||||
|
@ -86,16 +85,16 @@ func TestExpectations(t *testing.T) {
|
|||
},
|
||||
bindings: nil,
|
||||
expect: []v1alpha1.Expectation{{
|
||||
Match: ptr.To(v1alpha1.NewMatch(
|
||||
map[string]any{
|
||||
Match: &v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
"foo": "bar",
|
||||
},
|
||||
)),
|
||||
Check: v1alpha1.NewCheck(
|
||||
map[string]any{
|
||||
},
|
||||
Check: v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
"(foo())": "bar",
|
||||
},
|
||||
),
|
||||
},
|
||||
}},
|
||||
want: true,
|
||||
wantErr: true,
|
||||
|
@ -108,23 +107,23 @@ func TestExpectations(t *testing.T) {
|
|||
},
|
||||
bindings: nil,
|
||||
expect: []v1alpha1.Expectation{{
|
||||
Match: ptr.To(v1alpha1.NewMatch(
|
||||
map[string]any{
|
||||
Match: &v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
"(foo())": "bar",
|
||||
},
|
||||
)),
|
||||
Check: v1alpha1.NewCheck(
|
||||
map[string]any{
|
||||
},
|
||||
Check: v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
"foo": "bar",
|
||||
},
|
||||
),
|
||||
},
|
||||
}},
|
||||
want: true,
|
||||
wantErr: true,
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := Expect(context.TODO(), apis.DefaultCompilers, tt.obj, tt.bindings, tt.expect...)
|
||||
got, err := Expect(context.TODO(), tt.obj, tt.bindings, tt.expect...)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
} else {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
"github.com/kyverno/chainsaw/pkg/logging"
|
||||
"github.com/kyverno/chainsaw/pkg/engine/logging"
|
||||
"github.com/kyverno/pkg/ext/output/color"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
@ -94,9 +94,15 @@ func (c *runnerClient) RESTMapper() meta.RESTMapper {
|
|||
}
|
||||
|
||||
func (c *runnerClient) ok(ctx context.Context, op logging.Operation, obj client.Object) {
|
||||
logging.Log(ctx, op, logging.OkStatus, obj, color.BoldGreen)
|
||||
logger := logging.FromContext(ctx)
|
||||
if logger != nil {
|
||||
logger.WithResource(obj).Log(op, logging.OkStatus, color.BoldGreen)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *runnerClient) error(ctx context.Context, op logging.Operation, obj client.Object, err error) {
|
||||
logging.Log(ctx, op, logging.OkStatus, obj, color.BoldYellow, logging.ErrSection(err))
|
||||
logger := logging.FromContext(ctx)
|
||||
if logger != nil {
|
||||
logger.WithResource(obj).Log(op, logging.WarnStatus, color.BoldYellow, logging.ErrSection(err))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
tclient "github.com/kyverno/chainsaw/pkg/client/testing"
|
||||
"github.com/kyverno/chainsaw/pkg/logging"
|
||||
"github.com/kyverno/chainsaw/pkg/mocks"
|
||||
"github.com/kyverno/chainsaw/pkg/engine/logging"
|
||||
tlogging "github.com/kyverno/chainsaw/pkg/engine/logging/testing"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
@ -48,6 +48,7 @@ func Test_runnerClient_Get(t *testing.T) {
|
|||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
logger func(t *testing.T) *tlogging.FakeLogger
|
||||
inner func(t *testing.T) *tclient.FakeClient
|
||||
args args
|
||||
wantErr bool
|
||||
|
@ -55,6 +56,10 @@ func Test_runnerClient_Get(t *testing.T) {
|
|||
loggerCalls int
|
||||
}{{
|
||||
name: "with error",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -72,6 +77,10 @@ func Test_runnerClient_Get(t *testing.T) {
|
|||
innerCalls: 1,
|
||||
}, {
|
||||
name: "no error",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -89,6 +98,10 @@ func Test_runnerClient_Get(t *testing.T) {
|
|||
innerCalls: 1,
|
||||
}, {
|
||||
name: "inner was called",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -109,6 +122,10 @@ func Test_runnerClient_Get(t *testing.T) {
|
|||
innerCalls: 1,
|
||||
}, {
|
||||
name: "logger was not called",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -130,12 +147,12 @@ func Test_runnerClient_Get(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
logger := &mocks.Logger{}
|
||||
mockLogger := tt.logger(t)
|
||||
mockClient := tt.inner(t)
|
||||
c := &runnerClient{
|
||||
inner: mockClient,
|
||||
}
|
||||
ctx := logging.WithLogger(context.TODO(), logger)
|
||||
ctx := logging.IntoContext(context.TODO(), mockLogger)
|
||||
err := c.Get(ctx, tt.args.key, tt.args.obj, tt.args.opts...)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
|
@ -143,7 +160,7 @@ func Test_runnerClient_Get(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.innerCalls, mockClient.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, logger.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, mockLogger.NumCalls())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -155,6 +172,7 @@ func Test_runnerClient_Create(t *testing.T) {
|
|||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
logger func(t *testing.T) *tlogging.FakeLogger
|
||||
inner func(t *testing.T) *tclient.FakeClient
|
||||
args args
|
||||
wantErr bool
|
||||
|
@ -162,6 +180,10 @@ func Test_runnerClient_Create(t *testing.T) {
|
|||
loggerCalls int
|
||||
}{{
|
||||
name: "with error",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -175,10 +197,14 @@ func Test_runnerClient_Create(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: true,
|
||||
loggerCalls: 1,
|
||||
loggerCalls: 2,
|
||||
innerCalls: 1,
|
||||
}, {
|
||||
name: "no error",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -192,17 +218,17 @@ func Test_runnerClient_Create(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: false,
|
||||
loggerCalls: 1,
|
||||
loggerCalls: 2,
|
||||
innerCalls: 1,
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
logger := &mocks.Logger{}
|
||||
mockLogger := tt.logger(t)
|
||||
mockClient := tt.inner(t)
|
||||
c := &runnerClient{
|
||||
inner: mockClient,
|
||||
}
|
||||
ctx := logging.WithLogger(context.TODO(), logger)
|
||||
ctx := logging.IntoContext(context.TODO(), mockLogger)
|
||||
err := c.Create(ctx, tt.args.obj, tt.args.opts...)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
|
@ -210,7 +236,7 @@ func Test_runnerClient_Create(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.innerCalls, mockClient.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, logger.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, mockLogger.NumCalls())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -222,6 +248,7 @@ func Test_runnerClient_Update(t *testing.T) {
|
|||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
logger func(t *testing.T) *tlogging.FakeLogger
|
||||
inner func(t *testing.T) *tclient.FakeClient
|
||||
args args
|
||||
wantErr bool
|
||||
|
@ -229,6 +256,10 @@ func Test_runnerClient_Update(t *testing.T) {
|
|||
loggerCalls int
|
||||
}{{
|
||||
name: "with error",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -242,10 +273,14 @@ func Test_runnerClient_Update(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: true,
|
||||
loggerCalls: 1,
|
||||
loggerCalls: 2,
|
||||
innerCalls: 1,
|
||||
}, {
|
||||
name: "no error",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -259,17 +294,17 @@ func Test_runnerClient_Update(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: false,
|
||||
loggerCalls: 1,
|
||||
loggerCalls: 2,
|
||||
innerCalls: 1,
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
logger := &mocks.Logger{}
|
||||
mockLogger := tt.logger(t)
|
||||
mockClient := tt.inner(t)
|
||||
c := &runnerClient{
|
||||
inner: mockClient,
|
||||
}
|
||||
ctx := logging.WithLogger(context.TODO(), logger)
|
||||
ctx := logging.IntoContext(context.TODO(), mockLogger)
|
||||
err := c.Update(ctx, tt.args.obj, tt.args.opts...)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
|
@ -277,7 +312,7 @@ func Test_runnerClient_Update(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.innerCalls, mockClient.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, logger.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, mockLogger.NumCalls())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -289,6 +324,7 @@ func Test_runnerClient_Delete(t *testing.T) {
|
|||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
logger func(t *testing.T) *tlogging.FakeLogger
|
||||
inner func(t *testing.T) *tclient.FakeClient
|
||||
args args
|
||||
wantErr bool
|
||||
|
@ -296,6 +332,10 @@ func Test_runnerClient_Delete(t *testing.T) {
|
|||
loggerCalls int
|
||||
}{{
|
||||
name: "with error",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -309,10 +349,14 @@ func Test_runnerClient_Delete(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: true,
|
||||
loggerCalls: 1,
|
||||
loggerCalls: 2,
|
||||
innerCalls: 1,
|
||||
}, {
|
||||
name: "no error",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -326,17 +370,17 @@ func Test_runnerClient_Delete(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: false,
|
||||
loggerCalls: 1,
|
||||
loggerCalls: 2,
|
||||
innerCalls: 1,
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
logger := &mocks.Logger{}
|
||||
mockLogger := tt.logger(t)
|
||||
mockClient := tt.inner(t)
|
||||
c := &runnerClient{
|
||||
inner: mockClient,
|
||||
}
|
||||
ctx := logging.WithLogger(context.TODO(), logger)
|
||||
ctx := logging.IntoContext(context.TODO(), mockLogger)
|
||||
err := c.Delete(ctx, tt.args.obj, tt.args.opts...)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
|
@ -344,7 +388,7 @@ func Test_runnerClient_Delete(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.innerCalls, mockClient.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, logger.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, mockLogger.NumCalls())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -356,6 +400,7 @@ func Test_runnerClient_List(t *testing.T) {
|
|||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
logger func(t *testing.T) *tlogging.FakeLogger
|
||||
inner func(t *testing.T) *tclient.FakeClient
|
||||
args args
|
||||
wantErr bool
|
||||
|
@ -363,6 +408,10 @@ func Test_runnerClient_List(t *testing.T) {
|
|||
loggerCalls int
|
||||
}{{
|
||||
name: "with error",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -380,6 +429,10 @@ func Test_runnerClient_List(t *testing.T) {
|
|||
innerCalls: 1,
|
||||
}, {
|
||||
name: "no error",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -398,12 +451,12 @@ func Test_runnerClient_List(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
logger := &mocks.Logger{}
|
||||
mockLogger := tt.logger(t)
|
||||
mockClient := tt.inner(t)
|
||||
c := &runnerClient{
|
||||
inner: mockClient,
|
||||
}
|
||||
ctx := logging.WithLogger(context.TODO(), logger)
|
||||
ctx := logging.IntoContext(context.TODO(), mockLogger)
|
||||
err := c.List(ctx, tt.args.obj, tt.args.opts...)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
|
@ -411,7 +464,7 @@ func Test_runnerClient_List(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.innerCalls, mockClient.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, logger.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, mockLogger.NumCalls())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -424,6 +477,7 @@ func Test_runnerClient_Patch(t *testing.T) {
|
|||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
logger func(t *testing.T) *tlogging.FakeLogger
|
||||
inner func(t *testing.T) *tclient.FakeClient
|
||||
args args
|
||||
wantErr bool
|
||||
|
@ -431,6 +485,10 @@ func Test_runnerClient_Patch(t *testing.T) {
|
|||
loggerCalls int
|
||||
}{{
|
||||
name: "with error",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -444,10 +502,14 @@ func Test_runnerClient_Patch(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: true,
|
||||
loggerCalls: 1,
|
||||
loggerCalls: 2,
|
||||
innerCalls: 1,
|
||||
}, {
|
||||
name: "no error",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -461,17 +523,17 @@ func Test_runnerClient_Patch(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: false,
|
||||
loggerCalls: 1,
|
||||
loggerCalls: 2,
|
||||
innerCalls: 1,
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
logger := &mocks.Logger{}
|
||||
mockLogger := tt.logger(t)
|
||||
mockClient := tt.inner(t)
|
||||
c := &runnerClient{
|
||||
inner: mockClient,
|
||||
}
|
||||
ctx := logging.WithLogger(context.TODO(), logger)
|
||||
ctx := logging.IntoContext(context.TODO(), mockLogger)
|
||||
err := c.Patch(ctx, tt.args.obj, tt.args.patch, tt.args.opts...)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
|
@ -479,7 +541,7 @@ func Test_runnerClient_Patch(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.innerCalls, mockClient.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, logger.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, mockLogger.NumCalls())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -490,6 +552,7 @@ func Test_runnerClient_IsObjectNamespaced(t *testing.T) {
|
|||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
logger func(t *testing.T) *tlogging.FakeLogger
|
||||
inner func(t *testing.T) *tclient.FakeClient
|
||||
args args
|
||||
want bool
|
||||
|
@ -497,6 +560,10 @@ func Test_runnerClient_IsObjectNamespaced(t *testing.T) {
|
|||
innerCalls int
|
||||
}{{
|
||||
name: "with error",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -512,6 +579,10 @@ func Test_runnerClient_IsObjectNamespaced(t *testing.T) {
|
|||
innerCalls: 1,
|
||||
}, {
|
||||
name: "no error - false",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
@ -528,6 +599,10 @@ func Test_runnerClient_IsObjectNamespaced(t *testing.T) {
|
|||
innerCalls: 1,
|
||||
}, {
|
||||
name: "no error - true",
|
||||
logger: func(t *testing.T) *tlogging.FakeLogger {
|
||||
t.Helper()
|
||||
return &tlogging.FakeLogger{}
|
||||
},
|
||||
inner: func(t *testing.T) *tclient.FakeClient {
|
||||
t.Helper()
|
||||
return &tclient.FakeClient{
|
||||
|
|
|
@ -16,10 +16,10 @@ type fromConfig struct {
|
|||
config *rest.Config
|
||||
}
|
||||
|
||||
func NewClusterFromConfig(config *rest.Config) Cluster {
|
||||
func NewClusterFromConfig(config *rest.Config) (Cluster, error) {
|
||||
return &fromConfig{
|
||||
config: config,
|
||||
}
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *fromConfig) Config() (*rest.Config, error) {
|
||||
|
|
|
@ -9,9 +9,10 @@ import (
|
|||
|
||||
func TestNewClusterFromConfig(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
config *rest.Config
|
||||
want Cluster
|
||||
name string
|
||||
config *rest.Config
|
||||
want Cluster
|
||||
wantErr bool
|
||||
}{{
|
||||
name: "nil",
|
||||
want: &fromConfig{
|
||||
|
@ -26,11 +27,17 @@ func TestNewClusterFromConfig(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got := NewClusterFromConfig(tt.config)
|
||||
assert.Equal(t, tt.want, got)
|
||||
config, err := got.Config()
|
||||
assert.NoError(t, err)
|
||||
assert.Same(t, tt.config, config)
|
||||
got, err := NewClusterFromConfig(tt.config)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
assert.Nil(t, got)
|
||||
} else {
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, tt.want, got)
|
||||
got, err := got.Config()
|
||||
assert.NoError(t, err)
|
||||
assert.Same(t, tt.config, got)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
package engine
|
||||
|
||||
import (
|
||||
"context"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/engine/bindings"
|
||||
"github.com/kyverno/chainsaw/pkg/engine/clusters"
|
||||
)
|
||||
|
||||
func WithBindings(ctx context.Context, tc Context, variables ...v1alpha1.Binding) (Context, error) {
|
||||
for _, variable := range variables {
|
||||
name, value, err := bindings.ResolveBinding(ctx, tc.Bindings(), nil, variable)
|
||||
if err != nil {
|
||||
return tc, err
|
||||
}
|
||||
tc = tc.WithBinding(ctx, name, value)
|
||||
}
|
||||
return tc, nil
|
||||
}
|
||||
|
||||
func WithClusters(ctx context.Context, tc Context, basePath string, c map[string]v1alpha1.Cluster) Context {
|
||||
for name, cluster := range c {
|
||||
kubeconfig := filepath.Join(basePath, cluster.Kubeconfig)
|
||||
cluster := clusters.NewClusterFromKubeconfig(kubeconfig, cluster.Context)
|
||||
tc = tc.WithCluster(ctx, name, cluster)
|
||||
}
|
||||
return tc
|
||||
}
|
||||
|
||||
func WithCurrentCluster(ctx context.Context, tc Context, name string) (Context, error) {
|
||||
tc = tc.WithCurrentCluster(ctx, name)
|
||||
config, client, err := tc.CurrentClusterClient()
|
||||
if err != nil {
|
||||
return tc, err
|
||||
}
|
||||
tc = tc.WithBinding(ctx, "client", client)
|
||||
tc = tc.WithBinding(ctx, "config", config)
|
||||
return tc, nil
|
||||
}
|
||||
|
||||
func WithNamespace(ctx context.Context, tc Context, namespace string) Context {
|
||||
return tc.WithBinding(ctx, "namespace", namespace)
|
||||
}
|
||||
|
||||
func WithValues(ctx context.Context, tc Context, values any) Context {
|
||||
return tc.WithBinding(ctx, "values", values)
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
package context
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
"github.com/kyverno/chainsaw/pkg/client/dryrun"
|
||||
apibindings "github.com/kyverno/chainsaw/pkg/engine/bindings"
|
||||
"github.com/kyverno/chainsaw/pkg/engine/clusters"
|
||||
"github.com/kyverno/chainsaw/pkg/model"
|
||||
"k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type TestContext struct {
|
||||
*model.Summary
|
||||
*model.Report
|
||||
bindings binding.Bindings
|
||||
cluster clusters.Cluster
|
||||
clusters clusters.Registry
|
||||
dryRun bool
|
||||
}
|
||||
|
||||
func MakeContext(bindings binding.Bindings, registry clusters.Registry) TestContext {
|
||||
return TestContext{
|
||||
Summary: &model.Summary{},
|
||||
Report: &model.Report{
|
||||
Name: "chainsaw-report",
|
||||
StartTime: time.Now(),
|
||||
},
|
||||
bindings: bindings,
|
||||
clusters: registry,
|
||||
cluster: nil,
|
||||
}
|
||||
}
|
||||
|
||||
func EmptyContext() TestContext {
|
||||
return MakeContext(binding.NewBindings(), clusters.NewRegistry(nil))
|
||||
}
|
||||
|
||||
func (tc *TestContext) Bindings() binding.Bindings {
|
||||
return tc.bindings
|
||||
}
|
||||
|
||||
func (tc *TestContext) Cluster(name string) clusters.Cluster {
|
||||
return tc.clusters.Lookup(name)
|
||||
}
|
||||
|
||||
func (tc *TestContext) Clusters() clusters.Registry {
|
||||
return tc.clusters
|
||||
}
|
||||
|
||||
func (tc *TestContext) CurrentCluster() clusters.Cluster {
|
||||
return tc.cluster
|
||||
}
|
||||
|
||||
func (tc *TestContext) CurrentClusterClient() (*rest.Config, client.Client, error) {
|
||||
config, client, err := tc.clusters.Build(tc.cluster)
|
||||
if err == nil && client != nil && tc.DryRun() {
|
||||
client = dryrun.New(client)
|
||||
}
|
||||
return config, client, err
|
||||
}
|
||||
|
||||
func (tc *TestContext) DryRun() bool {
|
||||
return tc.dryRun
|
||||
}
|
||||
|
||||
func (tc TestContext) WithBinding(ctx context.Context, name string, value any) TestContext {
|
||||
tc.bindings = apibindings.RegisterBinding(ctx, tc.bindings, name, value)
|
||||
return tc
|
||||
}
|
||||
|
||||
func (tc TestContext) WithCluster(ctx context.Context, name string, cluster clusters.Cluster) TestContext {
|
||||
tc.clusters = tc.clusters.Register(name, cluster)
|
||||
return tc
|
||||
}
|
||||
|
||||
func (tc TestContext) WithCurrentCluster(ctx context.Context, name string) TestContext {
|
||||
tc.cluster = tc.Cluster(name)
|
||||
return tc
|
||||
}
|
||||
|
||||
func (tc TestContext) WithDryRun(ctx context.Context, dryRun bool) TestContext {
|
||||
tc.dryRun = dryRun
|
||||
return tc
|
||||
}
|
|
@ -6,12 +6,12 @@ import (
|
|||
|
||||
jpfunctions "github.com/jmespath-community/go-jmespath/pkg/functions"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/interpreter"
|
||||
"github.com/kyverno/kyverno-json/pkg/jp"
|
||||
"github.com/kyverno/kyverno-json/pkg/engine/template"
|
||||
)
|
||||
|
||||
var Caller = sync.OnceValue(func() interpreter.FunctionCaller {
|
||||
var funcs []jpfunctions.FunctionEntry
|
||||
funcs = append(funcs, jp.GetFunctions(context.Background())...)
|
||||
funcs = append(funcs, template.GetFunctions(context.Background())...)
|
||||
funcs = append(funcs, GetFunctions()...)
|
||||
return interpreter.NewFunctionCaller(funcs...)
|
||||
})
|
||||
|
|
|
@ -27,8 +27,7 @@ func GetFunctions() []functions.FunctionEntry {
|
|||
Arguments: []functions.ArgSpec{
|
||||
{Types: []functions.JpType{functions.JpString}},
|
||||
},
|
||||
Handler: jpEnv,
|
||||
Description: "Returns the value of the environment variable passed in argument.",
|
||||
Handler: jpEnv,
|
||||
}, {
|
||||
Name: k8sGet,
|
||||
Arguments: []functions.ArgSpec{
|
||||
|
@ -38,8 +37,7 @@ func GetFunctions() []functions.FunctionEntry {
|
|||
{Types: []functions.JpType{functions.JpString}},
|
||||
{Types: []functions.JpType{functions.JpString}},
|
||||
},
|
||||
Handler: jpKubernetesGet,
|
||||
Description: "Gets a resource from a Kubernetes cluster.",
|
||||
Handler: jpKubernetesGet,
|
||||
}, {
|
||||
Name: k8sList,
|
||||
Arguments: []functions.ArgSpec{
|
||||
|
@ -48,8 +46,7 @@ func GetFunctions() []functions.FunctionEntry {
|
|||
{Types: []functions.JpType{functions.JpString}},
|
||||
{Types: []functions.JpType{functions.JpString}, Optional: true},
|
||||
},
|
||||
Handler: jpKubernetesList,
|
||||
Description: "Lists resources from a Kubernetes cluster.",
|
||||
Handler: jpKubernetesList,
|
||||
}, {
|
||||
Name: k8sExists,
|
||||
Arguments: []functions.ArgSpec{
|
||||
|
@ -59,8 +56,7 @@ func GetFunctions() []functions.FunctionEntry {
|
|||
{Types: []functions.JpType{functions.JpString}},
|
||||
{Types: []functions.JpType{functions.JpString}},
|
||||
},
|
||||
Handler: jpKubernetesExists,
|
||||
Description: "Checks if a given resource exists in a Kubernetes cluster.",
|
||||
Handler: jpKubernetesExists,
|
||||
}, {
|
||||
Name: k8sResourceExists,
|
||||
Arguments: []functions.ArgSpec{
|
||||
|
@ -68,29 +64,25 @@ func GetFunctions() []functions.FunctionEntry {
|
|||
{Types: []functions.JpType{functions.JpString}},
|
||||
{Types: []functions.JpType{functions.JpString}},
|
||||
},
|
||||
Handler: jpKubernetesResourceExists,
|
||||
Description: "Checks if a given resource type is available in a Kubernetes cluster.",
|
||||
Handler: jpKubernetesResourceExists,
|
||||
}, {
|
||||
Name: k8sServerVersion,
|
||||
Arguments: []functions.ArgSpec{
|
||||
{Types: []functions.JpType{functions.JpAny}},
|
||||
},
|
||||
Handler: jpKubernetesServerVersion,
|
||||
Description: "Returns the version of a Kubernetes cluster.",
|
||||
Handler: jpKubernetesServerVersion,
|
||||
}, {
|
||||
Name: metricsDecode,
|
||||
Arguments: []functions.ArgSpec{
|
||||
{Types: []functions.JpType{functions.JpString}},
|
||||
},
|
||||
Handler: jpMetricsDecode,
|
||||
Description: "Decodes metrics in the Prometheus text format.",
|
||||
Handler: jpMetricsDecode,
|
||||
}, {
|
||||
Name: trimSpace,
|
||||
Arguments: []functions.ArgSpec{
|
||||
{Types: []functions.JpType{functions.JpString}},
|
||||
},
|
||||
Handler: jpTrimSpace,
|
||||
Description: "Trims leading and trailing spaces from the string passed in argument.",
|
||||
Handler: jpTrimSpace,
|
||||
}, {
|
||||
Name: asString,
|
||||
Arguments: []functions.ArgSpec{
|
||||
|
@ -111,6 +103,5 @@ func GetFunctions() []functions.FunctionEntry {
|
|||
}
|
||||
return nil, nil
|
||||
},
|
||||
Description: "Returns the passed in argument converted into a string.",
|
||||
}}
|
||||
}
|
||||
|
|
|
@ -13,12 +13,6 @@ import (
|
|||
"k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// jpKubernetesResourceExists is a JMESPath function that checks if a Kubernetes resource type exists in the cluster.
|
||||
// Arguments:
|
||||
// - client: The Kubernetes client
|
||||
// - apiVersion: API version of the resource (e.g., "v1", "apps/v1")
|
||||
// - kind: Kind of the resource (e.g., "Pod", "Deployment")
|
||||
// Returns true if the resource type exists, false otherwise.
|
||||
func jpKubernetesResourceExists(arguments []any) (any, error) {
|
||||
var client client.Client
|
||||
var apiVersion, kind string
|
||||
|
@ -46,14 +40,6 @@ func jpKubernetesResourceExists(arguments []any) (any, error) {
|
|||
}
|
||||
}
|
||||
|
||||
// jpKubernetesExists is a JMESPath function that checks if a specific Kubernetes resource exists in the cluster.
|
||||
// Arguments:
|
||||
// - client: The Kubernetes client
|
||||
// - apiVersion: API version of the resource (e.g., "v1", "apps/v1")
|
||||
// - kind: Kind of the resource (e.g., "Pod", "Deployment")
|
||||
// - namespace: Namespace of the resource
|
||||
// - name: Name of the resource
|
||||
// Returns true if the specific resource exists, false otherwise.
|
||||
func jpKubernetesExists(arguments []any) (any, error) {
|
||||
var apiVersion, kind string
|
||||
var key client.ObjectKey
|
||||
|
@ -86,14 +72,6 @@ func jpKubernetesExists(arguments []any) (any, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// jpKubernetesGet is a JMESPath function that retrieves a specific Kubernetes resource from the cluster.
|
||||
// Arguments:
|
||||
// - client: The Kubernetes client
|
||||
// - apiVersion: API version of the resource (e.g., "v1", "apps/v1")
|
||||
// - kind: Kind of the resource (e.g., "Pod", "Deployment")
|
||||
// - namespace: Namespace of the resource
|
||||
// - name: Name of the resource
|
||||
// Returns the resource as an unstructured object if found, error otherwise.
|
||||
func jpKubernetesGet(arguments []any) (any, error) {
|
||||
var apiVersion, kind string
|
||||
var key client.ObjectKey
|
||||
|
@ -122,13 +100,6 @@ func jpKubernetesGet(arguments []any) (any, error) {
|
|||
return obj.UnstructuredContent(), nil
|
||||
}
|
||||
|
||||
// jpKubernetesList is a JMESPath function that lists Kubernetes resources of a specific type from the cluster.
|
||||
// Arguments:
|
||||
// - client: The Kubernetes client
|
||||
// - apiVersion: API version of the resource (e.g., "v1", "apps/v1")
|
||||
// - kind: Kind of the resource (e.g., "Pod", "Deployment")
|
||||
// - namespace: (Optional) Namespace to filter resources by
|
||||
// Returns a list of resources as an unstructured object.
|
||||
func jpKubernetesList(arguments []any) (any, error) {
|
||||
var c client.Client
|
||||
var apiVersion, kind, namespace string
|
||||
|
@ -159,10 +130,6 @@ func jpKubernetesList(arguments []any) (any, error) {
|
|||
return list.UnstructuredContent(), nil
|
||||
}
|
||||
|
||||
// jpKubernetesServerVersion is a JMESPath function that retrieves the Kubernetes server version.
|
||||
// Arguments:
|
||||
// - config: The Kubernetes REST config
|
||||
// Returns the server version information.
|
||||
func jpKubernetesServerVersion(arguments []any) (any, error) {
|
||||
var config *rest.Config
|
||||
if err := getArg(arguments, 0, &config); err != nil {
|
||||
|
|
|
@ -5,20 +5,14 @@ import (
|
|||
"fmt"
|
||||
)
|
||||
|
||||
// stable is a utility function that returns the function name as-is.
|
||||
// Used for stable, non-experimental JMESPath functions.
|
||||
func stable(in string) string {
|
||||
return in
|
||||
}
|
||||
|
||||
// experimental is a utility function that prefixes the function name with "x_".
|
||||
// Used for experimental JMESPath functions that may change in future versions.
|
||||
func experimental(in string) string {
|
||||
return "x_" + in
|
||||
}
|
||||
|
||||
// getArgAt retrieves an argument at the specified index from the arguments slice.
|
||||
// Returns an error if the index is out of range.
|
||||
func getArgAt(arguments []any, index int) (any, error) {
|
||||
if index >= len(arguments) {
|
||||
return nil, fmt.Errorf("index out of range (%d / %d)", index, len(arguments))
|
||||
|
@ -26,12 +20,6 @@ func getArgAt(arguments []any, index int) (any, error) {
|
|||
return arguments[index], nil
|
||||
}
|
||||
|
||||
// getArg is a generic function that retrieves and type-asserts an argument at the specified index.
|
||||
// Arguments:
|
||||
// - arguments: The slice of arguments to retrieve from
|
||||
// - index: The index of the argument to retrieve
|
||||
// - out: A pointer to store the retrieved value
|
||||
// Returns an error if the index is out of range or if the type assertion fails.
|
||||
func getArg[T any](arguments []any, index int, out *T) error {
|
||||
arg, err := getArgAt(arguments, index)
|
||||
if err != nil {
|
||||
|
|
|
@ -5,32 +5,31 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers"
|
||||
)
|
||||
|
||||
func Describe(ctx context.Context, compilers compilers.Compilers, client client.Client, tc apis.Bindings, collector *v1alpha1.Describe) (string, []string, error) {
|
||||
func Describe(ctx context.Context, client client.Client, tc binding.Bindings, collector *v1alpha1.Describe) (string, []string, error) {
|
||||
if collector == nil {
|
||||
return "", nil, errors.New("collector is null")
|
||||
}
|
||||
name, err := collector.Name.Value(ctx, compilers, tc)
|
||||
name, err := collector.Name.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
namespace, err := collector.Namespace.Value(ctx, compilers, tc)
|
||||
namespace, err := collector.Namespace.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
selector, err := collector.Selector.Value(ctx, compilers, tc)
|
||||
selector, err := collector.Selector.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
if name != "" && selector != "" {
|
||||
return "", nil, errors.New("name cannot be provided when a selector is specified")
|
||||
}
|
||||
resource, clustered, err := mapResource(ctx, compilers, client, tc, collector.ObjectType)
|
||||
resource, clustered, err := mapResource(ctx, client, tc, collector.ObjectType)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/client/simple"
|
||||
restutils "github.com/kyverno/chainsaw/pkg/utils/rest"
|
||||
|
@ -273,7 +272,7 @@ func TestDescribe(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
entrypoint, args, err := Describe(context.TODO(), apis.DefaultCompilers, client, nil, tt.collector)
|
||||
entrypoint, args, err := Describe(context.TODO(), client, nil, tt.collector)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
} else {
|
||||
|
|
|
@ -4,36 +4,35 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers"
|
||||
)
|
||||
|
||||
func Get(ctx context.Context, compilers compilers.Compilers, client client.Client, tc apis.Bindings, collector *v1alpha1.Get) (string, []string, error) {
|
||||
func Get(ctx context.Context, client client.Client, tc binding.Bindings, collector *v1alpha1.Get) (string, []string, error) {
|
||||
if collector == nil {
|
||||
return "", nil, errors.New("collector is null")
|
||||
}
|
||||
name, err := collector.Name.Value(ctx, compilers, tc)
|
||||
name, err := collector.Name.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
namespace, err := collector.Namespace.Value(ctx, compilers, tc)
|
||||
namespace, err := collector.Namespace.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
selector, err := collector.Selector.Value(ctx, compilers, tc)
|
||||
selector, err := collector.Selector.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
format, err := v1alpha1.Expression(collector.Format).Value(ctx, compilers, tc)
|
||||
format, err := v1alpha1.Expression(collector.Format).Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
if name != "" && selector != "" {
|
||||
return "", nil, errors.New("name cannot be provided when a selector is specified")
|
||||
}
|
||||
resource, clustered, err := mapResource(ctx, compilers, client, tc, collector.ObjectType)
|
||||
resource, clustered, err := mapResource(ctx, client, tc, collector.ObjectType)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/client/simple"
|
||||
restutils "github.com/kyverno/chainsaw/pkg/utils/rest"
|
||||
|
@ -257,7 +256,7 @@ func TestGet(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
entrypoint, args, err := Get(context.TODO(), apis.DefaultCompilers, client, nil, tt.collector)
|
||||
entrypoint, args, err := Get(context.TODO(), client, nil, tt.collector)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
} else {
|
||||
|
|
|
@ -5,28 +5,27 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers"
|
||||
)
|
||||
|
||||
func Logs(ctx context.Context, compilers compilers.Compilers, tc apis.Bindings, collector *v1alpha1.PodLogs) (string, []string, error) {
|
||||
func Logs(ctx context.Context, tc binding.Bindings, collector *v1alpha1.PodLogs) (string, []string, error) {
|
||||
if collector == nil {
|
||||
return "", nil, errors.New("collector is null")
|
||||
}
|
||||
name, err := collector.Name.Value(ctx, compilers, tc)
|
||||
name, err := collector.Name.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
namespace, err := collector.Namespace.Value(ctx, compilers, tc)
|
||||
namespace, err := collector.Namespace.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
selector, err := collector.Selector.Value(ctx, compilers, tc)
|
||||
selector, err := collector.Selector.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
container, err := collector.Container.Value(ctx, compilers, tc)
|
||||
container, err := collector.Container.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"k8s.io/utils/ptr"
|
||||
|
@ -181,7 +180,7 @@ func TestLogs(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
entrypoint, args, err := Logs(context.TODO(), apis.DefaultCompilers, nil, tt.collector)
|
||||
entrypoint, args, err := Logs(context.TODO(), nil, tt.collector)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
} else {
|
||||
|
|
|
@ -5,19 +5,18 @@ import (
|
|||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
func mapResource(ctx context.Context, compilers compilers.Compilers, client client.Client, tc apis.Bindings, resource v1alpha1.ObjectType) (string, bool, error) {
|
||||
func mapResource(ctx context.Context, client client.Client, tc binding.Bindings, resource v1alpha1.ObjectType) (string, bool, error) {
|
||||
if resource.APIVersion != "" && resource.Kind != "" {
|
||||
if apiVersion, err := resource.APIVersion.Value(ctx, compilers, tc); err != nil {
|
||||
if apiVersion, err := resource.APIVersion.Value(ctx, tc); err != nil {
|
||||
return "", false, err
|
||||
} else if kind, err := resource.Kind.Value(ctx, compilers, tc); err != nil {
|
||||
} else if kind, err := resource.Kind.Value(ctx, tc); err != nil {
|
||||
return "", false, err
|
||||
} else {
|
||||
return mapResourceFromApiVersionAndKind(client, apiVersion, kind)
|
||||
|
|
|
@ -5,33 +5,32 @@ import (
|
|||
"errors"
|
||||
"path"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers"
|
||||
)
|
||||
|
||||
func Proxy(ctx context.Context, compilers compilers.Compilers, client client.Client, tc apis.Bindings, collector *v1alpha1.Proxy) (string, []string, error) {
|
||||
func Proxy(ctx context.Context, client client.Client, tc binding.Bindings, collector *v1alpha1.Proxy) (string, []string, error) {
|
||||
if collector == nil {
|
||||
return "", nil, errors.New("collector is null")
|
||||
}
|
||||
name, err := collector.Name.Value(ctx, compilers, tc)
|
||||
name, err := collector.Name.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
namespace, err := collector.Namespace.Value(ctx, compilers, tc)
|
||||
namespace, err := collector.Namespace.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
targetPath, err := collector.TargetPath.Value(ctx, compilers, tc)
|
||||
targetPath, err := collector.TargetPath.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
targetPort, err := collector.TargetPort.Value(ctx, compilers, tc)
|
||||
targetPort, err := collector.TargetPort.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
resource, _, err := mapResource(ctx, compilers, client, tc, collector.ObjectType)
|
||||
resource, _, err := mapResource(ctx, client, tc, collector.ObjectType)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/client/simple"
|
||||
restutils "github.com/kyverno/chainsaw/pkg/utils/rest"
|
||||
|
@ -334,7 +333,7 @@ func TestProxy(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
entrypoint, args, err := Proxy(context.TODO(), apis.DefaultCompilers, client, nil, tt.collector)
|
||||
entrypoint, args, err := Proxy(context.TODO(), client, nil, tt.collector)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
} else {
|
||||
|
|
|
@ -5,52 +5,51 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers"
|
||||
)
|
||||
|
||||
func Wait(ctx context.Context, compilers compilers.Compilers, client client.Client, tc apis.Bindings, collector *v1alpha1.Wait) (string, []string, error) {
|
||||
func Wait(ctx context.Context, client client.Client, tc binding.Bindings, collector *v1alpha1.Wait) (string, []string, error) {
|
||||
if collector == nil {
|
||||
return "", nil, errors.New("collector is null")
|
||||
}
|
||||
name, err := collector.Name.Value(ctx, compilers, tc)
|
||||
name, err := collector.Name.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
namespace, err := collector.Namespace.Value(ctx, compilers, tc)
|
||||
namespace, err := collector.Namespace.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
selector, err := collector.Selector.Value(ctx, compilers, tc)
|
||||
selector, err := collector.Selector.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
format, err := v1alpha1.Expression(collector.Format).Value(ctx, compilers, tc)
|
||||
format, err := v1alpha1.Expression(collector.Format).Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
if name != "" && selector != "" {
|
||||
return "", nil, errors.New("name cannot be provided when a selector is specified")
|
||||
}
|
||||
resource, clustered, err := mapResource(ctx, compilers, client, tc, collector.ObjectType)
|
||||
resource, clustered, err := mapResource(ctx, client, tc, collector.ObjectType)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
args := []string{"wait", resource}
|
||||
if collector.Deletion != nil {
|
||||
if collector.WaitFor.Deletion != nil {
|
||||
args = append(args, "--for=delete")
|
||||
} else if collector.Condition != nil {
|
||||
name, err := collector.Condition.Name.Value(ctx, compilers, tc)
|
||||
} else if collector.WaitFor.Condition != nil {
|
||||
name, err := collector.WaitFor.Condition.Name.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
if name == "" {
|
||||
return "", nil, errors.New("a condition name must be specified for condition wait type")
|
||||
}
|
||||
if collector.Condition.Value != nil {
|
||||
value, err := collector.Condition.Value.Value(ctx, compilers, tc)
|
||||
if collector.WaitFor.Condition.Value != nil {
|
||||
value, err := collector.WaitFor.Condition.Value.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
@ -58,16 +57,16 @@ func Wait(ctx context.Context, compilers compilers.Compilers, client client.Clie
|
|||
} else {
|
||||
args = append(args, fmt.Sprintf("--for=condition=%s", name))
|
||||
}
|
||||
} else if collector.JsonPath != nil {
|
||||
path, err := collector.JsonPath.Path.Value(ctx, compilers, tc)
|
||||
} else if collector.WaitFor.JsonPath != nil {
|
||||
path, err := collector.WaitFor.JsonPath.Path.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
if path == "" {
|
||||
return "", nil, errors.New("a path must be specified for jsonpath wait type")
|
||||
}
|
||||
if collector.JsonPath.Value != nil {
|
||||
value, err := collector.JsonPath.Value.Value(ctx, compilers, tc)
|
||||
if collector.WaitFor.JsonPath.Value != nil {
|
||||
value, err := collector.WaitFor.JsonPath.Value.Value(ctx, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/client/simple"
|
||||
restutils "github.com/kyverno/chainsaw/pkg/utils/rest"
|
||||
|
@ -349,7 +348,7 @@ func TestWait(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
entrypoint, args, err := Wait(context.TODO(), apis.DefaultCompilers, client, nil, tt.collector)
|
||||
entrypoint, args, err := Wait(context.TODO(), client, nil, tt.collector)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
} else {
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package logging
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type contextKey struct{}
|
||||
|
||||
func FromContext(ctx context.Context) Logger {
|
||||
if ctx != nil {
|
||||
if v, ok := ctx.Value(contextKey{}).(Logger); ok {
|
||||
return v
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func IntoContext(ctx context.Context, logger Logger) context.Context {
|
||||
return context.WithValue(ctx, contextKey{}, logger)
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package logging
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
"github.com/kyverno/pkg/ext/output/color"
|
||||
"k8s.io/utils/clock"
|
||||
)
|
||||
|
||||
const eraser = "\b\b\b\b\b\b\b\b\b"
|
||||
|
||||
type logger struct {
|
||||
t TLogger
|
||||
clock clock.PassiveClock
|
||||
test string
|
||||
step string
|
||||
resource client.Object
|
||||
}
|
||||
|
||||
func NewLogger(t TLogger, clock clock.PassiveClock, test string, step string) Logger {
|
||||
t.Helper()
|
||||
return &logger{
|
||||
t: t,
|
||||
clock: clock,
|
||||
test: test,
|
||||
step: step,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *logger) Log(operation Operation, status Status, color *color.Color, args ...fmt.Stringer) {
|
||||
sprint := fmt.Sprint
|
||||
opLen := 9
|
||||
stLen := 5
|
||||
if color != nil {
|
||||
sprint = color.Sprint
|
||||
opLen += 14
|
||||
stLen += 14
|
||||
}
|
||||
a := make([]any, 0, len(args)+2)
|
||||
prefix := fmt.Sprintf("%s| %s | %s | %s | %-*s | %-*s |", eraser, l.clock.Now().Format("15:04:05"), sprint(l.test), sprint(l.step), opLen, sprint(operation), stLen, sprint(status))
|
||||
if l.resource != nil {
|
||||
gvk := l.resource.GetObjectKind().GroupVersionKind()
|
||||
key := client.Key(l.resource)
|
||||
prefix = fmt.Sprintf("%s %s/%s @ %s", prefix, gvk.GroupVersion(), gvk.Kind, client.Name(key))
|
||||
}
|
||||
a = append(a, prefix)
|
||||
for _, arg := range args {
|
||||
a = append(a, "\n")
|
||||
a = append(a, arg)
|
||||
}
|
||||
l.t.Log(fmt.Sprint(a...))
|
||||
}
|
||||
|
||||
func (l *logger) WithResource(resource client.Object) Logger {
|
||||
return &logger{
|
||||
t: l.t,
|
||||
clock: l.clock,
|
||||
test: l.test,
|
||||
step: l.step,
|
||||
resource: resource,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,157 @@
|
|||
package logging
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/fatih/color"
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
tlogging "github.com/kyverno/chainsaw/pkg/engine/logging/testing"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
tclock "k8s.io/utils/clock/testing"
|
||||
)
|
||||
|
||||
func TestNewLogger(t *testing.T) {
|
||||
fakeClock := tclock.NewFakePassiveClock(time.Now())
|
||||
testName := "testName"
|
||||
stepName := "stepName"
|
||||
logger, ok := NewLogger(t, fakeClock, testName, stepName).(*logger)
|
||||
|
||||
assert.True(t, ok, "Type assertion for *logger failed")
|
||||
|
||||
assert.Equal(t, t, logger.t)
|
||||
assert.Equal(t, fakeClock, logger.clock)
|
||||
assert.Equal(t, testName, logger.test)
|
||||
assert.Equal(t, stepName, logger.step)
|
||||
assert.Nil(t, logger.resource)
|
||||
}
|
||||
|
||||
type s string
|
||||
|
||||
func (v s) String() string { return string(v) }
|
||||
|
||||
func Test_logger_Log(t *testing.T) {
|
||||
fakeClock := tclock.NewFakePassiveClock(time.Now())
|
||||
mockT := &tlogging.FakeTLogger{}
|
||||
fakeLogger := NewLogger(mockT, fakeClock, "testName", "stepName").(*logger)
|
||||
disabled := color.New(color.FgBlue)
|
||||
disabled.DisableColor()
|
||||
enabled := color.New(color.FgBlue)
|
||||
enabled.EnableColor()
|
||||
testCases := []struct {
|
||||
name string
|
||||
resource client.Object
|
||||
operation string
|
||||
status string
|
||||
color *color.Color
|
||||
args []fmt.Stringer
|
||||
expectContains []string
|
||||
}{
|
||||
{
|
||||
name: "without resource",
|
||||
resource: nil,
|
||||
operation: "OPERATION",
|
||||
status: "STATUS",
|
||||
args: []fmt.Stringer{s("arg1"), s("arg2")},
|
||||
expectContains: []string{
|
||||
"testName", "stepName", "OPERATION", "arg1", "arg2",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "with color",
|
||||
resource: nil,
|
||||
operation: "OPERATION",
|
||||
status: "STATUS",
|
||||
color: enabled,
|
||||
args: []fmt.Stringer{s("arg1"), s("arg2")},
|
||||
expectContains: []string{
|
||||
"testName", "stepName", "OPERATION", "arg1", "arg2",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "with resource",
|
||||
resource: func() client.Object {
|
||||
var r unstructured.Unstructured
|
||||
r.SetName("testResource")
|
||||
r.SetNamespace("default")
|
||||
r.SetAPIVersion("testGroup/v1")
|
||||
r.SetKind("testKind")
|
||||
return &r
|
||||
}(),
|
||||
operation: "OPERATION",
|
||||
status: "STATUS",
|
||||
args: []fmt.Stringer{s("arg1"), s("arg2")},
|
||||
expectContains: []string{
|
||||
"testName", "stepName", "OPERATION", "default/testResource", "testGroup/v1/testKind", "arg1", "arg2",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range testCases {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if tt.resource != nil {
|
||||
fakeLogger = fakeLogger.WithResource(tt.resource).(*logger)
|
||||
}
|
||||
fakeLogger.Log(Operation(tt.operation), Status(tt.status), tt.color, tt.args...)
|
||||
for _, exp := range tt.expectContains {
|
||||
found := false
|
||||
for _, msg := range mockT.Messages {
|
||||
if strings.Contains(msg, exp) {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
assert.True(t, found, "Expected to find '%s' in logs, but didn't. Logs: %v", exp, mockT.Messages)
|
||||
}
|
||||
mockT.Messages = []string{}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_logger_WithResource(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
resource client.Object
|
||||
expectNil bool
|
||||
}{{
|
||||
name: "Valid Resource",
|
||||
resource: func() client.Object {
|
||||
var r unstructured.Unstructured
|
||||
r.SetName("testResource")
|
||||
return &r
|
||||
}(),
|
||||
expectNil: false,
|
||||
}, {
|
||||
name: "Nil Resource",
|
||||
resource: nil,
|
||||
expectNil: true,
|
||||
}}
|
||||
for _, tt := range testCases {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
fakeClock := tclock.NewFakePassiveClock(time.Now())
|
||||
fakeLogger := logger{
|
||||
t: t,
|
||||
clock: fakeClock,
|
||||
test: "testName",
|
||||
step: "stepName",
|
||||
}
|
||||
|
||||
newLogger := fakeLogger.WithResource(tt.resource).(*logger)
|
||||
|
||||
if tt.expectNil {
|
||||
assert.Nil(t, newLogger.resource, "Expected resource to be nil in the logger")
|
||||
} else {
|
||||
assert.NotNil(t, newLogger.resource, "Expected resource to not be nil in the logger")
|
||||
assert.Equal(t, tt.resource, newLogger.resource, "Expected correct resource to be set in the logger")
|
||||
}
|
||||
|
||||
assert.Equal(t, fakeLogger.t, newLogger.t, "Expected testing.T to remain the same")
|
||||
assert.Equal(t, fakeLogger.clock, newLogger.clock, "Expected clock to remain the same")
|
||||
assert.Equal(t, fakeLogger.test, newLogger.test, "Expected test name to remain the same")
|
||||
assert.Equal(t, fakeLogger.step, newLogger.step, "Expected step name to remain the same")
|
||||
})
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package logging
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/kyverno/pkg/ext/output/color"
|
||||
)
|
||||
|
||||
func Log(ctx context.Context, operation Operation, status Status, color *color.Color, args ...fmt.Stringer) {
|
||||
logger := FromContext(ctx)
|
||||
if logger != nil {
|
||||
logger.Log(operation, status, color, args...)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package logging
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
tlogging "github.com/kyverno/chainsaw/pkg/engine/logging/testing"
|
||||
"github.com/kyverno/pkg/ext/output/color"
|
||||
tclock "k8s.io/utils/clock/testing"
|
||||
)
|
||||
|
||||
func TestLog(t *testing.T) {
|
||||
fakeClock := tclock.NewFakePassiveClock(time.Now())
|
||||
mockT := &tlogging.FakeTLogger{}
|
||||
fakeLogger := NewLogger(mockT, fakeClock, "testName", "stepName").(*logger)
|
||||
tests := []struct {
|
||||
name string
|
||||
ctx context.Context //nolint:containedctx
|
||||
operation string
|
||||
status string
|
||||
color *color.Color
|
||||
args []fmt.Stringer
|
||||
}{{
|
||||
name: "background",
|
||||
ctx: context.Background(),
|
||||
operation: "foo",
|
||||
status: "bar",
|
||||
color: nil,
|
||||
args: nil,
|
||||
}, {
|
||||
name: "nil",
|
||||
ctx: nil,
|
||||
operation: "foo",
|
||||
status: "bar",
|
||||
color: nil,
|
||||
args: nil,
|
||||
}, {
|
||||
name: "with logger",
|
||||
ctx: IntoContext(context.Background(), fakeLogger),
|
||||
operation: "foo",
|
||||
status: "bar",
|
||||
color: nil,
|
||||
args: nil,
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
Log(tt.ctx, Operation(tt.operation), Status(tt.status), tt.color, tt.args...)
|
||||
})
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue