mirror of https://github.com/kyverno/chainsaw.git
Compare commits
578 Commits
v0.2.8-bet
...
main
Author | SHA1 | Date |
---|---|---|
|
c923201c9f | |
|
79b6709e2d | |
|
787e5aa4b9 | |
|
c3e918eae1 | |
|
fcdd8da755 | |
|
c03f744625 | |
|
b602c7e3a4 | |
|
354baeb734 | |
|
210f67e40f | |
|
7b90b0c1b6 | |
|
6ff9d759f4 | |
|
bf1a17fd0e | |
|
d2caa8cdf5 | |
|
efa0fffa88 | |
|
80f988ee45 | |
|
d8598992a0 | |
|
b5b747053d | |
|
c975dcc68b | |
|
3c18804a4a | |
|
2ebca820bb | |
|
3c23435ab3 | |
|
fa007ee411 | |
|
bab727ee05 | |
|
77c12f7cd6 | |
|
5bccfa414c | |
|
809cbbcf9c | |
|
b71b2cd0ee | |
|
983cfa61de | |
|
53ea7ae4ee | |
|
dfe952c4b7 | |
|
72c0a05595 | |
|
ad8cfdcc88 | |
|
63dfbdc6d3 | |
|
7e78f4118b | |
|
02960c38cf | |
|
b8ad80b1d2 | |
|
4432b2d300 | |
|
d7f079f4d7 | |
|
76f2cd3338 | |
|
c505780e00 | |
|
3f46fff124 | |
|
23d9658a05 | |
|
c38526b194 | |
|
478efb086b | |
|
7994fce982 | |
|
1f4ec806e6 | |
|
eae65169ae | |
|
38eb74776b | |
|
8458e289d1 | |
|
d6e3e2cf70 | |
|
71cac61ed2 | |
|
de947f21dc | |
|
639647664a | |
|
baafd69f0b | |
|
0670f8dec3 | |
|
9250ed5326 | |
|
8b6858fa14 | |
|
fd3b4afccf | |
|
1fb3b0d055 | |
|
0d9649bfb3 | |
|
9223850b89 | |
|
496d4173fb | |
|
5ac242ceb7 | |
|
57a4201085 | |
|
019b877176 | |
|
d8d638129b | |
|
5b45636bc4 | |
|
b36344859b | |
|
60be808cda | |
|
bc982f8320 | |
|
93f14ebe5c | |
|
dda88e999b | |
|
939fe1833c | |
|
bd3e7cd395 | |
|
fd11837f57 | |
|
3abe1fced8 | |
|
38c69531ff | |
|
9b108553da | |
|
bc40b1f0f7 | |
|
9035ce6417 | |
|
b2b2ab6713 | |
|
9df3003deb | |
|
d8845f136e | |
|
f121618067 | |
|
9cef44342a | |
|
dac0712e93 | |
|
3f3276b668 | |
|
e3a0234d23 | |
|
19434ceb34 | |
|
90d2e2c8c6 | |
|
595060e332 | |
|
41b1966a91 | |
|
e44813dc4a | |
|
e0fe5946cf | |
|
8891bf31e1 | |
|
3078680efe | |
|
f9a9f9dd60 | |
|
461bddf61c | |
|
d7a79146d0 | |
|
e2c56a0ecb | |
|
8bb564ee84 | |
|
d281b6e618 | |
|
c818f77884 | |
|
ed5c7aacdc | |
|
3977046b0b | |
|
05ef5b10e7 | |
|
fe23bd0472 | |
|
aa0a7bb181 | |
|
2d80344c34 | |
|
58dbdbc308 | |
|
c68f42bb02 | |
|
0acd1bdb3e | |
|
366c1acf31 | |
|
fe419e9a63 | |
|
4a27d4f659 | |
|
b285ae4cbf | |
|
ef85df2772 | |
|
aa474dc4a7 | |
|
57be38138d | |
|
3efa453777 | |
|
e29a5e78dd | |
|
006ea0967c | |
|
b488897eb6 | |
|
86321cd75d | |
|
24c568610a | |
|
2314b2fca0 | |
|
aaadec5414 | |
|
88bfaf4d46 | |
|
6421092a10 | |
|
61b9b0a846 | |
|
6459cd84a7 | |
|
d7c5d6cbd3 | |
|
a6dbce538b | |
|
994bcf8864 | |
|
c0f4f08760 | |
|
3a91d2de0c | |
|
3a833705be | |
|
71141dc847 | |
|
3563f314f4 | |
|
ab5f0a3bc3 | |
|
2dc1aad8c3 | |
|
961b0c7766 | |
|
303a9d23b6 | |
|
c3eff17d44 | |
|
0ce4047440 | |
|
ecfde299b3 | |
|
8447d7911f | |
|
60d583d3f7 | |
|
90a7f9bf00 | |
|
ec5bbae20c | |
|
9831f99d43 | |
|
4b6cf19149 | |
|
08ac0d8f58 | |
|
51955db339 | |
|
103b6ac7da | |
|
7212894600 | |
|
360b92a3fb | |
|
1e60f26fcc | |
|
dd7648a5dc | |
|
8e88768403 | |
|
7911bf8496 | |
|
61a8df3c77 | |
|
da8a094b04 | |
|
54d8d44491 | |
|
693f455928 | |
|
c8da404aac | |
|
04788e7879 | |
|
ef236f6c70 | |
|
12698261f0 | |
|
0b9476e14f | |
|
b3ef058b74 | |
|
fec1d54534 | |
|
3e60a55118 | |
|
1585687cc7 | |
|
e1ffa7eafb | |
|
e11804b29f | |
|
e26262cfa7 | |
|
7545f461f7 | |
|
2c3d27852f | |
|
b5fcc779d6 | |
|
8d773783c4 | |
|
beb0f63197 | |
|
f9588b77b8 | |
|
8d94591f03 | |
|
639aec0bee | |
|
d248745e9e | |
|
b9ef52207f | |
|
6b7c694ec9 | |
|
0ad76501e7 | |
|
252a45f9a0 | |
|
2224d46478 | |
|
fb9f55f9df | |
|
7c5e0c687a | |
|
0f01d17313 | |
|
06375030e4 | |
|
e70c040abe | |
|
f11987801c | |
|
dbbe5e83e0 | |
|
e876efe102 | |
|
2a11382f7b | |
|
e8e95e2b77 | |
|
072a531bab | |
|
d56d81b19a | |
|
4f2bc3cd17 | |
|
75ed8df8d6 | |
|
1d2d64bc85 | |
|
ba6a01a907 | |
|
e7877e98d5 | |
|
21e113d7c3 | |
|
0bf4992677 | |
|
ae17c4fe4d | |
|
804435f82a | |
|
8b1ade57b5 | |
|
ca9426508b | |
|
b310d8c250 | |
|
f46e488d55 | |
|
81916ce8e6 | |
|
0cf92f710b | |
|
a9d1db95df | |
|
ac253919dc | |
|
0621e0a2c7 | |
|
ce3f6923a2 | |
|
ae96478fe6 | |
|
01c20fb152 | |
|
ddb186fb5a | |
|
404084144e | |
|
351e47a97a | |
|
0cd5fa6113 | |
|
8a946b8ae8 | |
|
4f78603f81 | |
|
6cebaf49ff | |
|
fca3457948 | |
|
5914bccdb6 | |
|
652e62cf1d | |
|
30883c276e | |
|
3d33acbcae | |
|
de0a5f0b65 | |
|
686432be5b | |
|
f342f73fb6 | |
|
864c63880f | |
|
45a1a42c40 | |
|
c6c7e3cbdd | |
|
24b27445d1 | |
|
dbced8a8c7 | |
|
37595bf9aa | |
|
c10b2431e6 | |
|
7f2229e75e | |
|
e178df0335 | |
|
3159301d8c | |
|
cbddf600af | |
|
17a636ee5c | |
|
58ba6bd7a2 | |
|
11530fff85 | |
|
4be9942ee9 | |
|
ab00abbc06 | |
|
4de43dd227 | |
|
2d2fcf47a6 | |
|
54866f9138 | |
|
dd89a42096 | |
|
b652b82fd7 | |
|
684ebc1e00 | |
|
0e4b3e1b11 | |
|
fa480f5274 | |
|
a5e637397d | |
|
5abe84c8f1 | |
|
aa9468fee7 | |
|
6dbc53abe4 | |
|
c638f6469f | |
|
7093e0cc28 | |
|
adab74f53c | |
|
bbee980f37 | |
|
a5b1fddb6a | |
|
5e047e8152 | |
|
694827fd9e | |
|
7a97e6a37b | |
|
0c6223e6d9 | |
|
51bf6ba3bc | |
|
4d132f91be | |
|
4124072173 | |
|
7fb94ad995 | |
|
92ec50d170 | |
|
6c8e9470e6 | |
|
8e36f27b7e | |
|
556385b200 | |
|
e7d0047c2d | |
|
d6b957aebc | |
|
722b68647b | |
|
4b8269d714 | |
|
f2cc745f60 | |
|
f53dafcea0 | |
|
cbf26e0171 | |
|
24088b55a7 | |
|
b9d6bcae5b | |
|
2951ca20db | |
|
db55f26619 | |
|
fa067b0f25 | |
|
6cfcb423d3 | |
|
b462e511a5 | |
|
7dab320cfc | |
|
147a062d13 | |
|
badb0f8735 | |
|
9b63b864d8 | |
|
eab2035ba0 | |
|
6ea7051839 | |
|
bc87c470a5 | |
|
c578df870b | |
|
080cb14cee | |
|
76a7c20ce2 | |
|
2129593e70 | |
|
4fbfa30af3 | |
|
9f6eb3270b | |
|
de6ba2088b | |
|
77adfadd41 | |
|
2659d1acf5 | |
|
1f6bf6ff30 | |
|
a331548664 | |
|
8be8931110 | |
|
5a192aa95c | |
|
9f5ea20454 | |
|
1618d0aee9 | |
|
56bb8611f2 | |
|
49f95eddd4 | |
|
e74dd6af1d | |
|
b0d0c4f072 | |
|
dbfe50e124 | |
|
4a667d2735 | |
|
a398c1f9f7 | |
|
b73ab00483 | |
|
f2fbf2f115 | |
|
919468c1f5 | |
|
4be728e237 | |
|
702f07ca1d | |
|
e114afa485 | |
|
f9063af1c9 | |
|
89a409aefe | |
|
8b2c16716f | |
|
f00417c840 | |
|
6a9ee23e31 | |
|
751f45713d | |
|
111abb48ba | |
|
ee7018cb8b | |
|
ee20a89b76 | |
|
3b77d6bec5 | |
|
05ff4b24cf | |
|
90906dc95a | |
|
2bd0d2ecc3 | |
|
c51641b4ef | |
|
d31402ec4f | |
|
d953f4b61b | |
|
2409bc15de | |
|
36e6deb2c5 | |
|
eaf5860837 | |
|
c3399063c4 | |
|
7258052b6d | |
|
e046f2d3f4 | |
|
f0bc7d173b | |
|
da3e3f3096 | |
|
4011b4dc21 | |
|
0fc8023702 | |
|
a7d84c852a | |
|
047eaf2a2a | |
|
c2ff8bbfa9 | |
|
83562ff008 | |
|
d39b624a8b | |
|
94b83d1f96 | |
|
78e0b0dbe5 | |
|
bd8b53d796 | |
|
079d442739 | |
|
006dbcaee6 | |
|
a60de55f7d | |
|
8d14831159 | |
|
6bb32f2260 | |
|
bcaa04cfaf | |
|
9a9d0ec59e | |
|
d8927c83a5 | |
|
4b02cd755f | |
|
098ad3ac1c | |
|
79b2eecc52 | |
|
73528bed44 | |
|
b7ac6b7fc7 | |
|
d1e7cb5db5 | |
|
03ea226339 | |
|
f65a235e5a | |
|
a130317395 | |
|
60adeea499 | |
|
62242167f7 | |
|
26e6caa4b4 | |
|
779ec37d43 | |
|
dc6d69e2bc | |
|
cb8ef56369 | |
|
a032196d1a | |
|
9552c5a296 | |
|
c1f2981eb8 | |
|
8b3c39ad90 | |
|
6b21a1c9a7 | |
|
82a85c29c7 | |
|
028c7f4a8d | |
|
20bfb5a58a | |
|
f5804be7c6 | |
|
ec6d0f1883 | |
|
c078452226 | |
|
fb4aa3f1be | |
|
2b4fa76aab | |
|
ac9f03f41a | |
|
2f3c548eb2 | |
|
54eb299c52 | |
|
8b2c70b632 | |
|
647f8f5907 | |
|
00ca330dc4 | |
|
5b387658d2 | |
|
3e5463522a | |
|
15c2cce1d8 | |
|
211f28906f | |
|
25c7e19005 | |
|
72fb202859 | |
|
e1dd5cae1a | |
|
b84ea6ef65 | |
|
5a99c5a900 | |
|
ef2bdafc30 | |
|
70d1569970 | |
|
50499c319b | |
|
529031711f | |
|
629cde72c2 | |
|
bf73fa76de | |
|
7c8279f85c | |
|
f6a47d7824 | |
|
a99127701b | |
|
266e15b040 | |
|
87ed804319 | |
|
162c3513fe | |
|
a627b06c75 | |
|
78ff106bf4 | |
|
cd2c5c890b | |
|
3888c720df | |
|
8e32373817 | |
|
f57de883c0 | |
|
592008bc5e | |
|
22675c0dd0 | |
|
d8c933037d | |
|
dc29601812 | |
|
cb2e64bba4 | |
|
2d1c4f6168 | |
|
029ff4e7ec | |
|
621bba2657 | |
|
7994403a51 | |
|
be718fb882 | |
|
0720eb6730 | |
|
ee675ef908 | |
|
2d9b66f5ae | |
|
2c2f20ab54 | |
|
916828f5e6 | |
|
50586e5ec9 | |
|
34713d7ac7 | |
|
cae181e3f7 | |
|
4f7bb55046 | |
|
a44db07e46 | |
|
9ac1bd2f72 | |
|
78706e032a | |
|
71a0ddb2b6 | |
|
b25b333267 | |
|
0a8540b550 | |
|
4a8c9c3a81 | |
|
dff8ab896a | |
|
8dac77c513 | |
|
be17317fb4 | |
|
3ddf8eccaf | |
|
33bf20976e | |
|
fc2f9011ae | |
|
0576980c12 | |
|
68637213c6 | |
|
4e311fd0ef | |
|
ddb3b46e85 | |
|
9b0682a3bb | |
|
bae937e857 | |
|
45b8269b2a | |
|
277e0b1659 | |
|
614085a816 | |
|
54dedd2748 | |
|
6f47d3accb | |
|
359493c4c9 | |
|
8e5f391b78 | |
|
e2aab972bc | |
|
2150a6f579 | |
|
32f5530843 | |
|
4b7c7e8310 | |
|
93b2db4a4e | |
|
38295f578d | |
|
ebbb8b7a3c | |
|
68b565ef5d | |
|
550a148b07 | |
|
220e6a7195 | |
|
cff2c52a8b | |
|
04d167649f | |
|
899f51bcd4 | |
|
5faf877b9a | |
|
2842af3f94 | |
|
ae17ff8da4 | |
|
35c5725aa6 | |
|
06639e226c | |
|
e29455312c | |
|
5b6bad4d0f | |
|
bce0a60a50 | |
|
397a8db1ec | |
|
278f3bce14 | |
|
074b3222c1 | |
|
0ed7083839 | |
|
c8ae0541cc | |
|
76a5be7b3f | |
|
a8976f10fd | |
|
11a3b128ca | |
|
437b8a49bb | |
|
c693ceac12 | |
|
81ea4738b6 | |
|
26dd875444 | |
|
c92d6f8e90 | |
|
e7cf99589e | |
|
5b0349c776 | |
|
cd7f0c99bc | |
|
de2d0bad3f | |
|
090440bd0a | |
|
38851c5d89 | |
|
650a726b25 | |
|
d058ce7c8b | |
|
042745efd5 | |
|
f443264e18 | |
|
427e0d58c2 | |
|
d4b0dda8cc | |
|
8ef255bf45 | |
|
4dc59f83e8 | |
|
fb25a2a30b | |
|
fc8c31c694 | |
|
e3397c3cc4 | |
|
05c5a8972d | |
|
aa769c9153 | |
|
df7827a663 | |
|
3a0034d23e | |
|
76d93770da | |
|
b397cb10f5 | |
|
a5ead230e6 | |
|
9370918ae8 | |
|
c332839223 | |
|
a651a49ff4 | |
|
cd2c0af3b7 | |
|
17caf145b4 | |
|
9f0b9edcfa | |
|
069b1fbdde | |
|
d7d33f9d2e | |
|
86adf25a13 | |
|
f6bc655d66 | |
|
5be8d9adbf | |
|
f9e37b11a0 | |
|
594c4e370b | |
|
6033a0fe3c | |
|
c3e17e04d0 | |
|
c16b23c999 | |
|
b2cdd9e1ae | |
|
87941d05bd | |
|
fa1211a96b | |
|
109842209a | |
|
f25babcd87 | |
|
9c9419ebb4 | |
|
d19ce19346 | |
|
a9a6bfa44c | |
|
82ce93849f | |
|
58bf8ed6d5 | |
|
86897ca770 | |
|
d0c5c72f8a | |
|
47e28b5857 | |
|
d022adff11 | |
|
188f32adab | |
|
c131549f26 | |
|
4043ba44ec | |
|
f0fa29ef44 | |
|
36eab419f6 | |
|
5c0056e1ee | |
|
c6e8f36c9d | |
|
c810adaafc | |
|
31d1fdc350 |
|
@ -81,6 +81,13 @@ 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+|\(.+\))$
|
||||
|
@ -96,7 +103,6 @@ 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
|
||||
|
@ -129,6 +135,13 @@ 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+|\(.+\))$
|
||||
|
@ -148,9 +161,15 @@ 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.
|
||||
|
@ -164,6 +183,10 @@ 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.
|
||||
|
@ -172,9 +195,19 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for command.
|
||||
type: string
|
||||
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:
|
||||
|
@ -188,6 +221,13 @@ 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+|\(.+\))$
|
||||
|
@ -242,11 +282,9 @@ 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
|
||||
|
@ -544,6 +582,13 @@ 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+|\(.+\))$
|
||||
|
@ -559,7 +604,6 @@ 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
|
||||
|
@ -593,6 +637,13 @@ 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+|\(.+\))$
|
||||
|
@ -612,9 +663,15 @@ 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.
|
||||
|
@ -628,6 +685,10 @@ 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.
|
||||
|
@ -636,6 +697,9 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for script.
|
||||
type: string
|
||||
type: object
|
||||
sleep:
|
||||
description: Sleep defines zzzz.
|
||||
|
@ -715,7 +779,6 @@ spec:
|
|||
type: string
|
||||
required:
|
||||
- path
|
||||
- value
|
||||
type: object
|
||||
type: object
|
||||
format:
|
||||
|
@ -768,6 +831,13 @@ 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.
|
||||
|
@ -811,8 +881,14 @@ 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
|
||||
|
@ -826,11 +902,14 @@ spec:
|
|||
type: integer
|
||||
reportFormat:
|
||||
description: |-
|
||||
ReportFormat determines test report format (JSON|XML|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
|
||||
- XML
|
||||
- JUNIT-TEST
|
||||
- JUNIT-STEP
|
||||
- JUNIT-OPERATION
|
||||
type: string
|
||||
reportName:
|
||||
default: chainsaw-report
|
||||
|
@ -1029,6 +1108,13 @@ 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+|\(.+\))$
|
||||
|
@ -1044,7 +1130,6 @@ 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
|
||||
|
@ -1078,6 +1163,13 @@ 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+|\(.+\))$
|
||||
|
@ -1097,9 +1189,15 @@ 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.
|
||||
|
@ -1113,6 +1211,10 @@ 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.
|
||||
|
@ -1121,9 +1223,19 @@ spec:
|
|||
description: Timeout for the operation. Overrides the
|
||||
global timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for command.
|
||||
type: string
|
||||
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:
|
||||
|
@ -1137,6 +1249,13 @@ 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+|\(.+\))$
|
||||
|
@ -1191,11 +1310,9 @@ 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
|
||||
|
@ -1496,6 +1613,13 @@ 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+|\(.+\))$
|
||||
|
@ -1511,7 +1635,6 @@ 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
|
||||
|
@ -1545,6 +1668,13 @@ 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+|\(.+\))$
|
||||
|
@ -1564,9 +1694,15 @@ 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.
|
||||
|
@ -1580,6 +1716,10 @@ 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.
|
||||
|
@ -1588,6 +1728,9 @@ spec:
|
|||
description: Timeout for the operation. Overrides the
|
||||
global timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for script.
|
||||
type: string
|
||||
type: object
|
||||
sleep:
|
||||
description: Sleep defines zzzz.
|
||||
|
@ -1668,7 +1811,6 @@ spec:
|
|||
type: string
|
||||
required:
|
||||
- path
|
||||
- value
|
||||
type: object
|
||||
type: object
|
||||
format:
|
||||
|
@ -1735,6 +1877,13 @@ 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.
|
||||
|
@ -1743,7 +1892,6 @@ 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:
|
||||
|
@ -1751,10 +1899,14 @@ spec:
|
|||
properties:
|
||||
format:
|
||||
default: JSON
|
||||
description: ReportFormat determines test report format (JSON|XML).
|
||||
description: ReportFormat determines test report format (JSON,
|
||||
XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION).
|
||||
enum:
|
||||
- JSON
|
||||
- XML
|
||||
- JUNIT-TEST
|
||||
- JUNIT-STEP
|
||||
- JUNIT-OPERATION
|
||||
type: string
|
||||
name:
|
||||
default: chainsaw-report
|
||||
|
@ -1769,6 +1921,13 @@ 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,6 +45,13 @@ 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+|\(.+\))$
|
||||
|
@ -97,6 +104,13 @@ 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+|\(.+\))$
|
||||
|
@ -112,7 +126,6 @@ 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
|
||||
|
@ -145,6 +158,13 @@ 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+|\(.+\))$
|
||||
|
@ -164,9 +184,15 @@ 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.
|
||||
|
@ -180,6 +206,10 @@ 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.
|
||||
|
@ -188,9 +218,19 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for command.
|
||||
type: string
|
||||
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:
|
||||
|
@ -204,6 +244,13 @@ 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+|\(.+\))$
|
||||
|
@ -258,11 +305,9 @@ 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
|
||||
|
@ -560,6 +605,13 @@ 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+|\(.+\))$
|
||||
|
@ -575,7 +627,6 @@ 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
|
||||
|
@ -609,6 +660,13 @@ 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+|\(.+\))$
|
||||
|
@ -628,9 +686,15 @@ 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.
|
||||
|
@ -644,6 +708,10 @@ 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.
|
||||
|
@ -652,6 +720,9 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for script.
|
||||
type: string
|
||||
type: object
|
||||
sleep:
|
||||
description: Sleep defines zzzz.
|
||||
|
@ -731,7 +802,6 @@ spec:
|
|||
type: string
|
||||
required:
|
||||
- path
|
||||
- value
|
||||
type: object
|
||||
type: object
|
||||
format:
|
||||
|
@ -808,6 +878,13 @@ 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+|\(.+\))$
|
||||
|
@ -823,7 +900,6 @@ 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
|
||||
|
@ -856,6 +932,13 @@ 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+|\(.+\))$
|
||||
|
@ -875,9 +958,15 @@ 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.
|
||||
|
@ -891,6 +980,10 @@ 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.
|
||||
|
@ -899,9 +992,19 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for command.
|
||||
type: string
|
||||
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:
|
||||
|
@ -915,6 +1018,13 @@ 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+|\(.+\))$
|
||||
|
@ -969,11 +1079,9 @@ 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
|
||||
|
@ -1271,6 +1379,13 @@ 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+|\(.+\))$
|
||||
|
@ -1286,7 +1401,6 @@ 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
|
||||
|
@ -1320,6 +1434,13 @@ 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+|\(.+\))$
|
||||
|
@ -1339,9 +1460,15 @@ 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.
|
||||
|
@ -1355,6 +1482,10 @@ 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.
|
||||
|
@ -1363,6 +1494,9 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for script.
|
||||
type: string
|
||||
type: object
|
||||
sleep:
|
||||
description: Sleep defines zzzz.
|
||||
|
@ -1442,7 +1576,6 @@ spec:
|
|||
type: string
|
||||
required:
|
||||
- path
|
||||
- value
|
||||
type: object
|
||||
type: object
|
||||
format:
|
||||
|
@ -1519,6 +1652,13 @@ 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+|\(.+\))$
|
||||
|
@ -1534,7 +1674,6 @@ 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
|
||||
|
@ -1567,6 +1706,13 @@ 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+|\(.+\))$
|
||||
|
@ -1586,9 +1732,15 @@ 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.
|
||||
|
@ -1602,6 +1754,10 @@ 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.
|
||||
|
@ -1610,9 +1766,19 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for command.
|
||||
type: string
|
||||
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:
|
||||
|
@ -1626,6 +1792,13 @@ 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+|\(.+\))$
|
||||
|
@ -1680,11 +1853,9 @@ 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
|
||||
|
@ -1982,6 +2153,13 @@ 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+|\(.+\))$
|
||||
|
@ -1997,7 +2175,6 @@ 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
|
||||
|
@ -2031,6 +2208,13 @@ 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+|\(.+\))$
|
||||
|
@ -2050,9 +2234,15 @@ 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.
|
||||
|
@ -2066,6 +2256,10 @@ 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.
|
||||
|
@ -2074,6 +2268,9 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for script.
|
||||
type: string
|
||||
type: object
|
||||
sleep:
|
||||
description: Sleep defines zzzz.
|
||||
|
@ -2153,7 +2350,6 @@ spec:
|
|||
type: string
|
||||
required:
|
||||
- path
|
||||
- value
|
||||
type: object
|
||||
type: object
|
||||
format:
|
||||
|
@ -2242,6 +2438,13 @@ 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+|\(.+\))$
|
||||
|
@ -2290,11 +2493,9 @@ 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
|
||||
|
@ -2313,9 +2514,15 @@ 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.
|
||||
|
@ -2357,6 +2564,13 @@ 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+|\(.+\))$
|
||||
|
@ -2399,7 +2613,6 @@ 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
|
||||
|
@ -2424,6 +2637,13 @@ 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+|\(.+\))$
|
||||
|
@ -2439,7 +2659,6 @@ 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
|
||||
|
@ -2472,6 +2691,13 @@ 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+|\(.+\))$
|
||||
|
@ -2491,9 +2717,15 @@ 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.
|
||||
|
@ -2507,6 +2739,10 @@ 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.
|
||||
|
@ -2515,9 +2751,19 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for command.
|
||||
type: string
|
||||
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.
|
||||
|
@ -2536,6 +2782,13 @@ 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+|\(.+\))$
|
||||
|
@ -2584,11 +2837,9 @@ 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
|
||||
|
@ -2607,9 +2858,15 @@ 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.
|
||||
|
@ -2650,6 +2907,13 @@ 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+|\(.+\))$
|
||||
|
@ -2704,11 +2968,9 @@ 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
|
||||
|
@ -2840,6 +3102,13 @@ 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+|\(.+\))$
|
||||
|
@ -2882,7 +3151,6 @@ 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
|
||||
|
@ -3021,6 +3289,13 @@ 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+|\(.+\))$
|
||||
|
@ -3069,11 +3344,9 @@ 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
|
||||
|
@ -3092,9 +3365,15 @@ 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.
|
||||
|
@ -3229,9 +3508,15 @@ 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.
|
||||
|
@ -3270,6 +3555,13 @@ 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+|\(.+\))$
|
||||
|
@ -3285,7 +3577,6 @@ 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
|
||||
|
@ -3319,6 +3610,13 @@ 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+|\(.+\))$
|
||||
|
@ -3338,9 +3636,15 @@ 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.
|
||||
|
@ -3354,6 +3658,10 @@ 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.
|
||||
|
@ -3362,6 +3670,9 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for script.
|
||||
type: string
|
||||
type: object
|
||||
sleep:
|
||||
description: Sleep defines zzzz.
|
||||
|
@ -3385,6 +3696,13 @@ 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+|\(.+\))$
|
||||
|
@ -3433,11 +3751,9 @@ 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
|
||||
|
@ -3456,9 +3772,15 @@ 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,7 +3877,6 @@ spec:
|
|||
type: string
|
||||
required:
|
||||
- path
|
||||
- value
|
||||
type: object
|
||||
type: object
|
||||
format:
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -14,6 +14,11 @@ 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
|
||||
- v0.2.6
|
||||
- v0.2.5
|
||||
|
|
|
@ -23,6 +23,11 @@ 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
|
||||
- v0.2.6
|
||||
- v0.2.5
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: gomod
|
||||
directory: /
|
||||
directories:
|
||||
- /
|
||||
- /hack/controller-gen/
|
||||
schedule:
|
||||
interval: daily
|
||||
- package-ecosystem: github-actions
|
||||
|
|
|
@ -23,9 +23,9 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: Ensure SHA pinned actions
|
||||
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@b88cd0aad2c36a63e42c71f81cb1958fed95ac87 # v3.0.10
|
||||
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@fc87bb5b5a97953d987372e74478de634726b3e5 # v3.0.25
|
||||
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Run Trivy vulnerability scanner in repo mode
|
||||
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # v0.24.0
|
||||
uses: aquasecurity/trivy-action@dc5a429b52fcf669ce959baa2c2dd26090d2a6c4 # v0.32.0
|
||||
with:
|
||||
scan-type: fs
|
||||
ignore-unfixed: false
|
||||
|
@ -39,8 +39,10 @@ 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@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
|
||||
uses: github/codeql-action/upload-sarif@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.5
|
||||
with:
|
||||
sarif_file: trivy-results.sarif
|
||||
category: code
|
||||
category: code
|
||||
|
|
|
@ -20,9 +20,9 @@ jobs:
|
|||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v3.7.1
|
||||
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
|
||||
with:
|
||||
skip-cache: true
|
||||
|
|
|
@ -44,7 +44,6 @@ 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
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@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
- name: Install Cosign
|
||||
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0
|
||||
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
|
||||
- name: Install Syft
|
||||
uses: anchore/sbom-action/download-syft@d94f46e13c6c62f59525ac9a1e147a99dc0b9bf5 # v0.17.0
|
||||
uses: anchore/sbom-action/download-syft@7b36ad622f042cab6f59a75c2ac24ccb256e9b45 # v0.20.4
|
||||
- name: Install Ko
|
||||
uses: ko-build/setup-ko@3aebd0597dc1e9d1a26bcfdb7cbeb19c131d3037 # v0.7
|
||||
uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
|
||||
- name: Run GoReleaser
|
||||
id: goreleaser
|
||||
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
|
||||
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.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@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # 2.9.0
|
||||
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # 2.11.2
|
||||
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@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # 2.9.0
|
||||
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # 2.11.2
|
||||
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.0.0
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.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.0.0
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
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@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: coverage.out
|
||||
path: coverage.out
|
||||
|
@ -50,14 +50,12 @@ jobs:
|
|||
- unit-tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Download coverage
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
||||
with:
|
||||
name: coverage.out
|
||||
- name: Upload Report to Codecov
|
||||
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
|
||||
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
|
||||
with:
|
||||
files: ./coverage.out
|
||||
fail_ci_if_error: true
|
||||
|
@ -69,9 +67,9 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
|
@ -84,18 +82,33 @@ 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
- name: Install ko
|
||||
uses: ko-build/setup-ko@3aebd0597dc1e9d1a26bcfdb7cbeb19c131d3037 #v0.7
|
||||
uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d #v0.9
|
||||
- name: Create test cluster
|
||||
run: |
|
||||
set -e
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
version: "2"
|
||||
linters:
|
||||
enable:
|
||||
- asasalint
|
||||
|
@ -5,46 +6,49 @@ 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
|
||||
- unused
|
||||
- usetesting
|
||||
- wastedassign
|
||||
- whitespace
|
||||
|
||||
run:
|
||||
timeout: 15m
|
||||
|
||||
output:
|
||||
sort-results: true
|
||||
|
||||
issues:
|
||||
exclude-files:
|
||||
- ".+\\.generated.go"
|
||||
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$
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
version: 2
|
||||
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
|
@ -15,6 +17,30 @@ builds:
|
|||
- -trimpath
|
||||
ldflags:
|
||||
- -s -w -X github.com/kyverno/chainsaw/pkg/version.BuildVersion={{ .Version }}
|
||||
- id: s390x
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- s390x
|
||||
binary: chainsaw
|
||||
flags:
|
||||
- -trimpath
|
||||
ldflags:
|
||||
- -s -w -X github.com/kyverno/chainsaw/pkg/version.BuildVersion={{ .Version }}
|
||||
- id: ppc64le
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- ppc64le
|
||||
binary: chainsaw
|
||||
flags:
|
||||
- -trimpath
|
||||
ldflags:
|
||||
- -s -w -X github.com/kyverno/chainsaw/pkg/version.BuildVersion={{ .Version }}
|
||||
|
||||
kos:
|
||||
- build: chainsaw
|
||||
|
@ -82,7 +108,7 @@ sboms:
|
|||
artifacts: source
|
||||
|
||||
snapshot:
|
||||
name_template: '{{ incpatch .Version }}-next'
|
||||
version_template: '{{ incpatch .Version }}-next'
|
||||
|
||||
release:
|
||||
prerelease: auto
|
||||
|
|
|
@ -5,12 +5,16 @@ Release notes for `TODO`.
|
|||
<!--
|
||||
## ‼️ Breaking changes ‼️
|
||||
|
||||
## 💫 New features 💫
|
||||
|
||||
## ✨ UI changes ✨
|
||||
|
||||
## ⭐ Examples ⭐
|
||||
|
||||
## ⛵ Tutorials ⛵
|
||||
|
||||
## 🔧 Fixes 🔧
|
||||
|
||||
## 📚 Docs 📚
|
||||
|
||||
## 🎸 Misc 🎸
|
||||
|
@ -18,18 +22,4 @@ Release notes for `TODO`.
|
|||
|
||||
## 💫 New features 💫
|
||||
|
||||
- Added `chainsaw renovate config` to upgrade configuration manifests to `v1alpha2`
|
||||
- Changed `cluster` in test step and actions to a pointer
|
||||
- `null` means inherit the current cluster
|
||||
- an empty string means the default cluster
|
||||
- Made default timeouts part of the schemas
|
||||
- Added support to fail fast at the test level (test will be skipped if a previous error was already reported)
|
||||
- Delay operation loading until operation execution
|
||||
- Generate strict JSON schemas
|
||||
|
||||
## 🔧 Fixes 🔧
|
||||
|
||||
- Fixed incorrect bindings when operations are run against different clusters
|
||||
- Fixed operation info built-in bindings not registered before other bindings
|
||||
- Fixed incorrect cluster client used when applying the test namespace to resources
|
||||
- Detect accessing nodes not present in the payload when traversing an assertion tree
|
||||
- Continue tests when an error happens when computing the test name
|
|
@ -0,0 +1,24 @@
|
|||
# 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
|
|
@ -0,0 +1,17 @@
|
|||
# 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
|
|
@ -0,0 +1,15 @@
|
|||
# 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
|
|
@ -0,0 +1,21 @@
|
|||
# Release notes
|
||||
|
||||
Release notes for `v0.2.8`.
|
||||
|
||||
## 💫 New features 💫
|
||||
|
||||
- Added `chainsaw renovate config` to upgrade configuration manifests to `v1alpha2`
|
||||
- Changed `cluster` in test step and actions to a pointer
|
||||
- `null` means inherit the current cluster
|
||||
- an empty string means the default cluster
|
||||
- Made default timeouts part of the schemas
|
||||
- Added support to fail fast at the test level (test will be skipped if a previous error was already reported)
|
||||
- Delay operation loading until operation execution
|
||||
- Generate strict JSON schemas
|
||||
|
||||
## 🔧 Fixes 🔧
|
||||
|
||||
- Fixed incorrect bindings when operations are run against different clusters
|
||||
- Fixed operation info built-in bindings not registered before other bindings
|
||||
- Fixed incorrect cluster client used when applying the test namespace to resources
|
||||
- Detect accessing nodes not present in the payload when traversing an assertion tree
|
|
@ -0,0 +1,19 @@
|
|||
# Release notes
|
||||
|
||||
Release notes for `v0.2.9`.
|
||||
|
||||
## 💫 New features 💫
|
||||
|
||||
- Added support for templating filenames used in operations
|
||||
- Added `ppc64le` and `s390x` binaries in release artifacts
|
||||
- Added support for Kubernetes 1.31
|
||||
- Added server side validation to validate the submitted resource
|
||||
- Added support for overriding the working directory in `command` and `script` operations
|
||||
- Compile string expressions at loading time
|
||||
- Made json path value optional in `wait` operation
|
||||
- Improved logging with `begin`, `end` and `warning` statuses
|
||||
- Added golang 1.23 support
|
||||
|
||||
## 🔧 Fixes 🔧
|
||||
|
||||
- Fixed configuration `v1alpha2` lint command
|
|
@ -96,6 +96,7 @@
|
|||
],
|
||||
"default": ""
|
||||
},
|
||||
"x-kubernetes-list-type": "set",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
"generateName": {
|
||||
|
@ -207,7 +208,8 @@
|
|||
"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",
|
||||
|
@ -285,6 +287,10 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"x-kubernetes-list-map-keys": [
|
||||
"uid"
|
||||
],
|
||||
"x-kubernetes-list-type": "map",
|
||||
"x-kubernetes-patch-merge-key": "uid",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
|
@ -421,6 +427,17 @@
|
|||
"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",
|
||||
|
@ -436,10 +453,6 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -501,6 +514,17 @@
|
|||
"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",
|
||||
|
@ -531,12 +555,19 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"object",
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -552,6 +583,13 @@
|
|||
"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": [
|
||||
|
@ -565,10 +603,28 @@
|
|||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"workDir": {
|
||||
"description": "WorkDir is the working directory for command.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"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": [
|
||||
|
@ -599,6 +655,17 @@
|
|||
"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",
|
||||
|
@ -680,15 +747,10 @@
|
|||
"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
|
||||
}
|
||||
},
|
||||
|
@ -1188,6 +1250,17 @@
|
|||
"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",
|
||||
|
@ -1203,10 +1276,6 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -1271,6 +1340,17 @@
|
|||
"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",
|
||||
|
@ -1301,12 +1381,19 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"object",
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -1322,6 +1409,13 @@
|
|||
"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": [
|
||||
|
@ -1335,6 +1429,13 @@
|
|||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"workDir": {
|
||||
"description": "WorkDir is the working directory for script.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
@ -1458,8 +1559,7 @@
|
|||
"null"
|
||||
],
|
||||
"required": [
|
||||
"path",
|
||||
"value"
|
||||
"path"
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
|
@ -1468,7 +1568,10 @@
|
|||
},
|
||||
"value": {
|
||||
"description": "Value defines the expected value to wait for, e.g., \"Running\".",
|
||||
"type": "string"
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
@ -1554,6 +1657,17 @@
|
|||
"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": [
|
||||
|
@ -1618,11 +1732,18 @@
|
|||
},
|
||||
"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": [
|
||||
"object",
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"parallel": {
|
||||
"description": "The maximum number of tests to run at once.",
|
||||
|
@ -1643,14 +1764,17 @@
|
|||
"minimum": 1
|
||||
},
|
||||
"reportFormat": {
|
||||
"description": "ReportFormat determines test report format (JSON|XML|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"
|
||||
],
|
||||
"enum": [
|
||||
"JSON",
|
||||
"XML"
|
||||
"XML",
|
||||
"JUNIT-TEST",
|
||||
"JUNIT-STEP",
|
||||
"JUNIT-OPERATION"
|
||||
]
|
||||
},
|
||||
"reportName": {
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
],
|
||||
"default": ""
|
||||
},
|
||||
"x-kubernetes-list-type": "set",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
"generateName": {
|
||||
|
@ -207,7 +208,8 @@
|
|||
"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",
|
||||
|
@ -285,6 +287,10 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"x-kubernetes-list-map-keys": [
|
||||
"uid"
|
||||
],
|
||||
"x-kubernetes-list-type": "map",
|
||||
"x-kubernetes-patch-merge-key": "uid",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
|
@ -549,6 +555,17 @@
|
|||
"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",
|
||||
|
@ -564,10 +581,6 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -629,6 +642,17 @@
|
|||
"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",
|
||||
|
@ -659,12 +683,19 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"object",
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -680,6 +711,13 @@
|
|||
"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": [
|
||||
|
@ -693,10 +731,28 @@
|
|||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"workDir": {
|
||||
"description": "WorkDir is the working directory for command.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"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": [
|
||||
|
@ -727,6 +783,17 @@
|
|||
"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",
|
||||
|
@ -808,15 +875,10 @@
|
|||
"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
|
||||
}
|
||||
},
|
||||
|
@ -1316,6 +1378,17 @@
|
|||
"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",
|
||||
|
@ -1331,10 +1404,6 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -1399,6 +1468,17 @@
|
|||
"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",
|
||||
|
@ -1429,12 +1509,19 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"object",
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -1450,6 +1537,13 @@
|
|||
"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": [
|
||||
|
@ -1463,6 +1557,13 @@
|
|||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"workDir": {
|
||||
"description": "WorkDir is the working directory for script.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
@ -1586,8 +1687,7 @@
|
|||
"null"
|
||||
],
|
||||
"required": [
|
||||
"path",
|
||||
"value"
|
||||
"path"
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
|
@ -1596,7 +1696,10 @@
|
|||
},
|
||||
"value": {
|
||||
"description": "Value defines the expected value to wait for, e.g., \"Running\".",
|
||||
"type": "string"
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
@ -1705,6 +1808,17 @@
|
|||
],
|
||||
"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": [
|
||||
|
@ -1714,10 +1828,6 @@
|
|||
},
|
||||
"template": {
|
||||
"description": "Template defines a template to create the test namespace.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
}
|
||||
},
|
||||
|
@ -1731,7 +1841,7 @@
|
|||
],
|
||||
"properties": {
|
||||
"format": {
|
||||
"description": "ReportFormat determines test report format (JSON|XML).",
|
||||
"description": "ReportFormat determines test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION).",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
|
@ -1739,7 +1849,10 @@
|
|||
"default": "JSON",
|
||||
"enum": [
|
||||
"JSON",
|
||||
"XML"
|
||||
"XML",
|
||||
"JUNIT-TEST",
|
||||
"JUNIT-STEP",
|
||||
"JUNIT-OPERATION"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
|
@ -1768,6 +1881,17 @@
|
|||
],
|
||||
"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
File diff suppressed because it is too large
Load Diff
|
@ -16,6 +16,7 @@
|
|||
"./testdata/e2e/examples",
|
||||
"--config",
|
||||
"./testdata/e2e/config.yaml",
|
||||
"--remarshal",
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@ 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 |
|
||||
|
@ -20,6 +21,7 @@ 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
|
||||
|
|
63
Makefile
63
Makefile
|
@ -7,9 +7,6 @@
|
|||
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
|
||||
|
@ -21,7 +18,7 @@ LD_FLAGS := "-s -w"
|
|||
endif
|
||||
KO_REGISTRY := ko.local
|
||||
KO_TAGS := $(GIT_SHA)
|
||||
KIND_IMAGE ?= kindest/node:v1.29.2
|
||||
KIND_IMAGE ?= kindest/node:v1.33.2
|
||||
|
||||
#########
|
||||
# TOOLS #
|
||||
|
@ -29,17 +26,16 @@ KIND_IMAGE ?= kindest/node:v1.29.2
|
|||
|
||||
TOOLS_DIR := $(PWD)/.tools
|
||||
CONTROLLER_GEN := $(TOOLS_DIR)/controller-gen
|
||||
CONTROLLER_GEN_VERSION := v0.15.0
|
||||
REGISTER_GEN := $(TOOLS_DIR)/register-gen
|
||||
DEEPCOPY_GEN := $(TOOLS_DIR)/deepcopy-gen
|
||||
CONVERSION_GEN := $(TOOLS_DIR)/conversion-gen
|
||||
CODE_GEN_VERSION := v0.28.0
|
||||
CODE_GEN_VERSION := v0.33.3
|
||||
REFERENCE_DOCS := $(TOOLS_DIR)/genref
|
||||
REFERENCE_DOCS_VERSION := latest
|
||||
KIND := $(TOOLS_DIR)/kind
|
||||
KIND_VERSION := v0.22.0
|
||||
KIND_VERSION := v0.29.0
|
||||
KO ?= $(TOOLS_DIR)/ko
|
||||
KO_VERSION ?= v0.15.1
|
||||
KO_VERSION ?= v0.18.0
|
||||
TOOLS := $(CONTROLLER_GEN) $(REGISTER_GEN) $(DEEPCOPY_GEN) $(CONVERSION_GEN) $(REFERENCE_DOCS) $(KIND) $(KO)
|
||||
PIP ?= "pip"
|
||||
ifeq ($(GOOS), darwin)
|
||||
|
@ -51,7 +47,7 @@ COMMA := ,
|
|||
|
||||
$(CONTROLLER_GEN):
|
||||
@echo Install controller-gen... >&2
|
||||
@GOBIN=$(TOOLS_DIR) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION)
|
||||
@cd ./hack/controller-gen && GOBIN=$(TOOLS_DIR) go install -buildvcs=false
|
||||
|
||||
$(REGISTER_GEN):
|
||||
@echo Install register-gen... >&2
|
||||
|
@ -90,43 +86,32 @@ 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
|
||||
@GOPATH=$(GOPATH_SHIM) $(REGISTER_GEN) \
|
||||
@$(REGISTER_GEN) \
|
||||
--go-header-file=./hack/boilerplate.go.txt \
|
||||
--input-dirs=$(INPUT_DIRS)
|
||||
--output-file zz_generated.register.go \
|
||||
./pkg/apis/...
|
||||
|
||||
.PHONY: codegen-deepcopy
|
||||
codegen-deepcopy: ## Generate deep copy functions
|
||||
codegen-deepcopy: $(PACKAGE_SHIM)
|
||||
codegen-deepcopy: $(DEEPCOPY_GEN)
|
||||
@echo Generate deep copy functions... >&2
|
||||
@GOPATH=$(GOPATH_SHIM) $(DEEPCOPY_GEN) \
|
||||
@$(DEEPCOPY_GEN) \
|
||||
--go-header-file=./hack/boilerplate.go.txt \
|
||||
--input-dirs=$(INPUT_DIRS) \
|
||||
--output-file-base=zz_generated.deepcopy
|
||||
--output-file=zz_generated.deepcopy.go \
|
||||
./pkg/apis/...
|
||||
|
||||
.PHONY: codegen-conversion
|
||||
codegen-conversion: ## Generate conversion functions
|
||||
codegen-conversion: $(PACKAGE_SHIM)
|
||||
codegen-conversion: $(CONVERSION_GEN)
|
||||
@echo Generate conversion functions... >&2
|
||||
@GOPATH=$(GOPATH_SHIM) $(CONVERSION_GEN) \
|
||||
@$(CONVERSION_GEN) \
|
||||
--go-header-file=./hack/boilerplate.go.txt \
|
||||
--input-dirs=$(INPUT_DIRS) \
|
||||
--output-file-base=zz_generated.conversion
|
||||
--output-file=zz_generated.conversion.go \
|
||||
./pkg/apis/...
|
||||
|
||||
.PHONY: codegen-crds
|
||||
codegen-crds: ## Generate CRDs
|
||||
|
@ -135,8 +120,8 @@ codegen-crds: codegen-deepcopy
|
|||
codegen-crds: codegen-register
|
||||
codegen-crds: codegen-conversion
|
||||
@echo Generate crds... >&2
|
||||
@rm -rf $(CRDS_PATH)
|
||||
@go run ./hack/controller-gen -- paths=./pkg/apis/... crd:crdVersions=v1,ignoreUnexportedFields=true,generateEmbeddedObjectMeta=false output:dir=$(CRDS_PATH)
|
||||
@rm -rf $(CRDS_PATH)
|
||||
@$(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
|
||||
|
@ -145,8 +130,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/reference/docs/commands
|
||||
@rm -rf docs/user/commands && mkdir -p docs/user/commands
|
||||
@rm -rf website/docs/reference/commands && mkdir -p website/docs/reference/commands
|
||||
@./$(CLI_BIN) docs -o website/docs/reference/commands --autogenTag=false
|
||||
|
||||
.PHONY: codegen-api-docs
|
||||
|
@ -162,7 +146,7 @@ codegen-api-docs: codegen-conversion
|
|||
.PHONY: codegen-jp-docs
|
||||
codegen-jp-docs: ## Generate JP docs
|
||||
@echo Generate jp docs... >&2
|
||||
@rm -rf ./website/docs/reference/jp && mkdir -p ./website/docs/reference/jp
|
||||
@mkdir -p ./website/docs/reference/jp
|
||||
@go run ./website/jp/main.go > ./website/docs/reference/jp/functions.md
|
||||
|
||||
.PHONY: codegen-mkdocs
|
||||
|
@ -242,7 +226,7 @@ verify-codegen: codegen
|
|||
|
||||
.PHONY: mkdocs-serve
|
||||
mkdocs-serve: ## Generate and serve mkdocs website
|
||||
@echo Generate and servemkdocs website... >&2
|
||||
@echo Generate and serve mkdocs website... >&2
|
||||
@$(PIP) install -r requirements.txt
|
||||
@mkdocs serve -f ./website/mkdocs.yaml
|
||||
|
||||
|
@ -299,7 +283,14 @@ tests: $(CLI_BIN)
|
|||
e2e-tests: ## Run e2e tests
|
||||
e2e-tests: $(CLI_BIN)
|
||||
@echo Running e2e tests... >&2
|
||||
@./$(CLI_BIN) test --test-dir ./testdata/e2e --remarshal --config ./testdata/e2e/config.yaml --values ./testdata/e2e/values.yaml
|
||||
@./$(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
|
||||
|
||||
.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 for Kyverno-Chainsaw maintainers to make announcements and provide project updates, and request input and feedback.
|
||||
This is a public, weekly meeting 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.1.9"
|
||||
version "0.2.12"
|
||||
|
||||
on_macos do
|
||||
if Hardware::CPU.arm?
|
||||
url "https://github.com/kyverno/chainsaw/releases/download/v0.1.9/chainsaw_darwin_arm64.tar.gz"
|
||||
sha256 "4187956ba26fd5dadf6552bfa77e769afdac48c08e5741c46a8e38b07ca708bc"
|
||||
on_intel do
|
||||
url "https://github.com/kyverno/chainsaw/releases/download/v0.2.12/chainsaw_darwin_amd64.tar.gz"
|
||||
sha256 "b49dba1214b32024567b1edc7653498a644fbef18111bcc3e1c46dc52e1d194e"
|
||||
|
||||
def install
|
||||
bin.install "chainsaw"
|
||||
end
|
||||
end
|
||||
if Hardware::CPU.intel?
|
||||
url "https://github.com/kyverno/chainsaw/releases/download/v0.1.9/chainsaw_darwin_amd64.tar.gz"
|
||||
sha256 "8c65f3ee952aa04754d644f2ef3d5f489153638de4e71de6348d4628e5af0378"
|
||||
on_arm do
|
||||
url "https://github.com/kyverno/chainsaw/releases/download/v0.2.12/chainsaw_darwin_arm64.tar.gz"
|
||||
sha256 "717a07fcc4d781fff967b287880fed1d8b1e6af9fbecc7650a714c467f296d33"
|
||||
|
||||
def install
|
||||
bin.install "chainsaw"
|
||||
|
@ -27,20 +27,24 @@ class Chainsaw < Formula
|
|||
end
|
||||
|
||||
on_linux do
|
||||
if Hardware::CPU.intel?
|
||||
url "https://github.com/kyverno/chainsaw/releases/download/v0.1.9/chainsaw_linux_amd64.tar.gz"
|
||||
sha256 "4080d3bb5ea6de6f85198e413e24a5c7aee941f027ba8b545f7a1ddbaa2e2856"
|
||||
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"
|
||||
|
||||
def install
|
||||
bin.install "chainsaw"
|
||||
def install
|
||||
bin.install "chainsaw"
|
||||
end
|
||||
end
|
||||
end
|
||||
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"
|
||||
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"
|
||||
|
||||
def install
|
||||
bin.install "chainsaw"
|
||||
def install
|
||||
bin.install "chainsaw"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
180
go.mod
180
go.mod
|
@ -1,98 +1,105 @@
|
|||
module github.com/kyverno/chainsaw
|
||||
|
||||
go 1.22.2
|
||||
go 1.24.2
|
||||
|
||||
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.0+incompatible
|
||||
github.com/fatih/color v1.17.0
|
||||
github.com/go-logr/logr v1.4.2
|
||||
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/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
||||
github.com/hashicorp/go-getter v1.7.5
|
||||
github.com/jmespath-community/go-jmespath v1.1.2-0.20240627155901-bdbb290f571e
|
||||
github.com/kudobuilder/kuttl v0.18.0
|
||||
github.com/kyverno/kyverno-json v0.0.4-0.20240730143747-aade3d42fc0e
|
||||
github.com/hashicorp/go-getter v1.7.8
|
||||
github.com/jmespath-community/go-jmespath v1.1.2-0.20240930152130-6eb5a346873f
|
||||
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/kyverno/pkg/ext v0.0.0-20240418121121-df8add26c55c
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
|
||||
github.com/prometheus/common v0.47.0
|
||||
github.com/spf13/cobra v1.8.1
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/stretchr/testify v1.9.0
|
||||
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/xeipuuv/gojsonschema v1.2.0
|
||||
go.uber.org/multierr v1.11.0
|
||||
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
k8s.io/api v0.30.3
|
||||
k8s.io/apiextensions-apiserver v0.30.3
|
||||
k8s.io/apimachinery v0.30.3
|
||||
k8s.io/client-go v0.30.3
|
||||
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
|
||||
sigs.k8s.io/controller-runtime v0.18.4
|
||||
sigs.k8s.io/controller-tools v0.15.0
|
||||
sigs.k8s.io/kubectl-validate v0.0.4
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
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
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.115.0 // indirect
|
||||
cloud.google.com/go/auth v0.7.2 // indirect
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.5.0 // indirect
|
||||
cloud.google.com/go/iam v1.1.12 // indirect
|
||||
cloud.google.com/go/storage v1.43.0 // indirect
|
||||
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/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
|
||||
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/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // 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.3 // 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/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.4 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.6 // 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/evanphx/json-patch/v5 v5.9.0 // 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/felixge/httpsnoop v1.0.4 // indirect
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.8.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/gobuffalo/flect v1.0.2 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/google/cel-go v0.17.8 // 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/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/s2a-go v0.1.8 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // 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.21.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.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.17.9 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // 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
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
|
@ -104,52 +111,59 @@ require (
|
|||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/prometheus/client_golang v1.18.0 // indirect
|
||||
github.com/prometheus/client_model v0.6.0 // indirect
|
||||
github.com/prometheus/procfs v0.12.0 // 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/procfs v0.15.1 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/stoewer/go-strcase v1.3.0 // indirect
|
||||
github.com/ulikunitz/xz v0.5.12 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
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.15 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.15 // indirect
|
||||
go.etcd.io/etcd/client/v3 v3.5.15 // 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.opencensus.io v0.24.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
|
||||
go.opentelemetry.io/otel v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.28.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.3.1 // 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.uber.org/zap v1.27.0 // indirect
|
||||
golang.org/x/crypto v0.25.0 // indirect
|
||||
golang.org/x/mod v0.19.0 // indirect
|
||||
golang.org/x/net v0.27.0 // indirect
|
||||
golang.org/x/oauth2 v0.21.0 // indirect
|
||||
golang.org/x/sync v0.7.0 // indirect
|
||||
golang.org/x/sys v0.22.0 // indirect
|
||||
golang.org/x/term v0.22.0 // indirect
|
||||
golang.org/x/text v0.16.0 // indirect
|
||||
golang.org/x/time v0.5.0 // indirect
|
||||
golang.org/x/tools v0.23.0 // indirect
|
||||
google.golang.org/api v0.189.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20240725223205-93522f1f2a9f // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240725223205-93522f1f2a9f // indirect
|
||||
google.golang.org/grpc v1.65.0 // indirect
|
||||
google.golang.org/protobuf v1.34.2 // 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
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
k8s.io/apiserver v0.30.3 // indirect
|
||||
k8s.io/component-base v0.30.3 // indirect
|
||||
k8s.io/apiextensions-apiserver v0.33.0 // indirect
|
||||
k8s.io/component-base v0.33.3 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20240726031636-6f6746feab9c // 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
|
||||
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
|
||||
)
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
module github.com/kyverno/chainsaw/hack/controller-gen
|
||||
|
||||
go 1.24.0
|
||||
|
||||
require (
|
||||
github.com/spf13/cobra v1.9.1
|
||||
k8s.io/apiextensions-apiserver v0.33.3
|
||||
sigs.k8s.io/controller-tools v0.17.2
|
||||
)
|
||||
|
||||
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/gogo/protobuf v1.3.2 // 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/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/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
|
||||
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/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
|
||||
)
|
|
@ -0,0 +1,135 @@
|
|||
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
||||
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/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/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/gofuzz v1.0.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=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
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/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/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/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=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
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/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=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
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/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/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/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/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/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/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=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
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.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/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=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
|
@ -0,0 +1,45 @@
|
|||
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,12 +22,14 @@ 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
|
||||
}
|
||||
|
@ -58,6 +60,7 @@ 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{
|
||||
|
@ -66,7 +69,8 @@ func Convert_v1alpha1_ConfigurationSpec_To_v1alpha2_ConfigurationSpec(in *v1alph
|
|||
Name: in.ReportName,
|
||||
}
|
||||
out.Templating = v1alpha2.TemplatingOptions{
|
||||
Enabled: in.Template,
|
||||
Enabled: in.Template,
|
||||
Compiler: in.Compiler,
|
||||
}
|
||||
out.Timeouts = in.Timeouts
|
||||
return nil
|
||||
|
|
|
@ -26,7 +26,7 @@ type ActionCheckRef struct {
|
|||
|
||||
// Check provides a check used in assertions.
|
||||
// +optional
|
||||
Check *Check `json:"resource,omitempty"`
|
||||
Check *Projection `json:"resource,omitempty"`
|
||||
|
||||
// Template determines whether resources should be considered for templating.
|
||||
// +optional
|
||||
|
@ -60,6 +60,10 @@ 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.
|
||||
|
@ -97,7 +101,7 @@ type ActionObjectSelector struct {
|
|||
|
||||
// Selector defines labels selector.
|
||||
// +optional
|
||||
Selector string `json:"selector,omitempty"`
|
||||
Selector Expression `json:"selector,omitempty"`
|
||||
}
|
||||
|
||||
// ActionOutputs contains outputs options for an action.
|
||||
|
@ -112,7 +116,7 @@ type FileRef struct {
|
|||
// File is the path to the referenced file. This can be a direct path to a file
|
||||
// or an expression that matches multiple files, such as "manifest/*.yaml" for all YAML
|
||||
// files within the "manifest" directory.
|
||||
File string `json:"file,omitempty"`
|
||||
File Expression `json:"file,omitempty"`
|
||||
}
|
||||
|
||||
// ActionResourceRef contains resource reference options for an action.
|
||||
|
@ -174,6 +178,10 @@ type Command struct {
|
|||
// Args is the command arguments.
|
||||
// +optional
|
||||
Args []string `json:"args,omitempty"`
|
||||
|
||||
// WorkDir is the working directory for command.
|
||||
// +optional
|
||||
WorkDir *string `json:"workDir,omitempty"`
|
||||
}
|
||||
|
||||
// Create represents a set of resources that should be created.
|
||||
|
@ -204,7 +212,7 @@ type Delete struct {
|
|||
// or an expression that matches multiple files, such as "manifest/*.yaml" for all YAML
|
||||
// files within the "manifest" directory.
|
||||
// +optional
|
||||
File string `json:"file,omitempty"`
|
||||
File Expression `json:"file,omitempty"`
|
||||
|
||||
// Ref determines objects to be deleted.
|
||||
// +optional
|
||||
|
@ -274,7 +282,7 @@ type PodLogs struct {
|
|||
|
||||
// Container in pod to get logs from else --all-containers is used.
|
||||
// +optional
|
||||
Container string `json:"container,omitempty"`
|
||||
Container Expression `json:"container,omitempty"`
|
||||
|
||||
// Tail is the number of last lines to collect from pods. If omitted or zero,
|
||||
// then the default is 10 if you use a selector, or -1 (all) if you use a pod name.
|
||||
|
@ -293,11 +301,11 @@ type Proxy struct {
|
|||
|
||||
// TargetPort defines the target port to proxy the request.
|
||||
// +optional
|
||||
TargetPort string `json:"port,omitempty"`
|
||||
TargetPort Expression `json:"port,omitempty"`
|
||||
|
||||
// TargetPath defines the target path to proxy the request.
|
||||
// +optional
|
||||
TargetPath string `json:"path,omitempty"`
|
||||
TargetPath Expression `json:"path,omitempty"`
|
||||
}
|
||||
|
||||
// Script describes a script to run as a part of a test step.
|
||||
|
@ -312,6 +320,10 @@ type Script struct {
|
|||
// Content defines a shell script (run with "sh -c ...").
|
||||
// +optional
|
||||
Content string `json:"content,omitempty"`
|
||||
|
||||
// WorkDir is the working directory for script.
|
||||
// +optional
|
||||
WorkDir *string `json:"workDir,omitempty"`
|
||||
}
|
||||
|
||||
// Sleep represents a duration while nothing happens.
|
||||
|
@ -361,11 +373,11 @@ type WaitFor struct {
|
|||
// WaitForCondition represents parameters for waiting on a specific condition of a resource.
|
||||
type WaitForCondition struct {
|
||||
// Name defines the specific condition to wait for, e.g., "Available", "Ready".
|
||||
Name string `json:"name"`
|
||||
Name Expression `json:"name"`
|
||||
|
||||
// Value defines the specific condition status to wait for, e.g., "True", "False".
|
||||
// +optional
|
||||
Value *string `json:"value,omitempty"`
|
||||
Value *Expression `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// WaitForDeletion represents parameters for waiting on a resource's deletion.
|
||||
|
@ -374,8 +386,9 @@ type WaitForDeletion struct{}
|
|||
// WaitForJsonPath represents parameters for waiting on a json path of a resource.
|
||||
type WaitForJsonPath struct {
|
||||
// Path defines the json path to wait for, e.g. '{.status.phase}'.
|
||||
Path string `json:"path"`
|
||||
Path Expression `json:"path"`
|
||||
|
||||
// Value defines the expected value to wait for, e.g., "Running".
|
||||
Value string `json:"value"`
|
||||
// +optional
|
||||
Value *Expression `json:"value,omitempty"`
|
||||
}
|
||||
|
|
|
@ -15,6 +15,10 @@ 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{{"foo", Any{Value: "bar"}}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
}, {
|
||||
fields: fields{
|
||||
Delete: &Delete{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -55,7 +55,7 @@ func TestFinally_Bindings(t *testing.T) {
|
|||
}, {
|
||||
fields: fields{
|
||||
Script: &Script{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -107,7 +107,7 @@ func TestFinally_Outputs(t *testing.T) {
|
|||
}{{
|
||||
fields: fields{
|
||||
Command: &Command{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -134,7 +134,7 @@ func TestFinally_Outputs(t *testing.T) {
|
|||
}, {
|
||||
fields: fields{
|
||||
Script: &Script{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
|
|
@ -37,6 +37,10 @@ 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"`
|
||||
|
@ -54,10 +58,10 @@ type ConfigurationSpec struct {
|
|||
// +kubebuilder:default:=Background
|
||||
DeletionPropagationPolicy metav1.DeletionPropagation `json:"deletionPropagationPolicy,omitempty"`
|
||||
|
||||
// ReportFormat determines test report format (JSON|XML|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;
|
||||
// +kubebuilder:validation:Enum:=JSON;XML;JUNIT-TEST;JUNIT-STEP;JUNIT-OPERATION;
|
||||
ReportFormat ReportFormatType `json:"reportFormat,omitempty"`
|
||||
|
||||
// ReportPath defines the path.
|
||||
|
@ -75,9 +79,13 @@ 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 *Any `json:"namespaceTemplate,omitempty"`
|
||||
NamespaceTemplate *Projection `json:"namespaceTemplate,omitempty"`
|
||||
|
||||
// FullName makes use of the full test case folder path instead of the folder name.
|
||||
// +optional
|
||||
|
@ -124,7 +132,10 @@ type ConfigurationSpec struct {
|
|||
type ReportFormatType string
|
||||
|
||||
const (
|
||||
JSONFormat ReportFormatType = "JSON"
|
||||
XMLFormat ReportFormatType = "XML"
|
||||
NoReport ReportFormatType = ""
|
||||
JSONFormat ReportFormatType = "JSON"
|
||||
XMLFormat ReportFormatType = "XML"
|
||||
JUnitTestFormat ReportFormatType = "JUNIT-TEST"
|
||||
JUnitStepFormat ReportFormatType = "JUNIT-STEP"
|
||||
JUnitOperationFormat ReportFormatType = "JUNIT-OPERATION"
|
||||
NoReport ReportFormatType = ""
|
||||
)
|
||||
|
|
|
@ -10,6 +10,10 @@ 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{{"foo", Any{Value: "bar"}}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
}, {
|
||||
operation: Operation{
|
||||
Assert: &Assert{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
}, {
|
||||
operation: Operation{
|
||||
Command: &Command{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
}, {
|
||||
operation: Operation{
|
||||
Create: &Create{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
}, {
|
||||
operation: Operation{
|
||||
Delete: &Delete{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -54,7 +54,7 @@ func TestOperation_Bindings(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Error: &Error{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -71,7 +71,7 @@ func TestOperation_Bindings(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Patch: &Patch{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -88,7 +88,7 @@ func TestOperation_Bindings(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Script: &Script{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -99,7 +99,7 @@ func TestOperation_Bindings(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Update: &Update{
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
|
||||
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -125,7 +125,7 @@ func TestOperation_Outputs(t *testing.T) {
|
|||
}{{
|
||||
operation: Operation{
|
||||
Apply: &Apply{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -136,14 +136,14 @@ func TestOperation_Outputs(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Command: &Command{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
}, {
|
||||
operation: Operation{
|
||||
Create: &Create{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -170,7 +170,7 @@ func TestOperation_Outputs(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Patch: &Patch{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -185,7 +185,7 @@ func TestOperation_Outputs(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Script: &Script{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
@ -196,7 +196,7 @@ func TestOperation_Outputs(t *testing.T) {
|
|||
}, {
|
||||
operation: Operation{
|
||||
Update: &Update{
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
|
||||
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}},
|
||||
},
|
||||
},
|
||||
want: 1,
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
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
|
||||
}
|
|
@ -62,7 +62,19 @@ type TestStep struct {
|
|||
// Use defines a reference to a step template.
|
||||
type Use struct {
|
||||
// Template references a step template.
|
||||
Template string `json:"template,omitempty"`
|
||||
Template string `json:"template"`
|
||||
|
||||
// With defines arguments passed to the step template.
|
||||
// +optional
|
||||
// +kubebuilder:default:={}
|
||||
With With `json:"with"`
|
||||
}
|
||||
|
||||
// With defines arguments passed to step templates.
|
||||
type With struct {
|
||||
// Bindings defines additional binding key/values.
|
||||
// +optional
|
||||
Bindings []Binding `json:"bindings,omitempty"`
|
||||
}
|
||||
|
||||
// TestStepSpec defines the desired state and behavior for each test step.
|
||||
|
@ -98,6 +110,10 @@ 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,13 +60,21 @@ 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 *Any `json:"namespaceTemplate,omitempty"`
|
||||
NamespaceTemplate *Projection `json:"namespaceTemplate,omitempty"`
|
||||
|
||||
// NamespaceTemplateCompiler defines the default compiler to use when evaluating expressions.
|
||||
// +optional
|
||||
NamespaceTemplateCompiler *Compiler `json:"namespaceTemplateCompiler,omitempty"`
|
||||
|
||||
// Scenarios defines test scenarios.
|
||||
// +optional
|
||||
|
|
|
@ -1,39 +1,57 @@
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"regexp"
|
||||
|
||||
"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"
|
||||
)
|
||||
|
||||
var identifier = regexp.MustCompile(`^(?:\w+|\(.+\))$`)
|
||||
const (
|
||||
EngineJP = v1alpha1.EngineJP
|
||||
EngineCEL = v1alpha1.EngineCEL
|
||||
)
|
||||
|
||||
// Any represents any type.
|
||||
type Any = v1alpha1.Any
|
||||
var (
|
||||
identifier = regexp.MustCompile(`^(?:\w+|\(.+\))$`)
|
||||
NewAny = v1alpha1.NewAny
|
||||
NewCheck = v1alpha1.NewAssertionTree
|
||||
NewMatch = v1alpha1.NewAssertionTree
|
||||
)
|
||||
|
||||
type Compiler = v1alpha1.Compiler
|
||||
|
||||
// Binding represents a key/value set as a binding in an executing test.
|
||||
type Binding struct {
|
||||
// Name the name of the binding.
|
||||
// +kubebuilder:validation:Pattern=`^(?:\w+|\(.+\))$`
|
||||
Name string `json:"name"`
|
||||
// +kubebuilder:validation:Type:=string
|
||||
// +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.
|
||||
// +kubebuilder:validation:Schemaless
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Value Any `json:"value"`
|
||||
Value Projection `json:"value"`
|
||||
}
|
||||
|
||||
func (b Binding) CheckName() error {
|
||||
if !identifier.MatchString(b.Name) {
|
||||
if !identifier.MatchString(string(b.Name)) {
|
||||
return fmt.Errorf("invalid name %s", b.Name)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Check represents a check to be applied on the result of an operation.
|
||||
type Check = Any
|
||||
type Check = v1alpha1.AssertionTree
|
||||
|
||||
// Cluster defines cluster config and context.
|
||||
type Cluster struct {
|
||||
|
@ -59,24 +77,60 @@ type Expectation struct {
|
|||
Check Check `json:"check"`
|
||||
}
|
||||
|
||||
// Expression defines an expression to be used in string fields.
|
||||
type Expression string
|
||||
|
||||
func (e *Expression) MarshalJSON() ([]byte, error) {
|
||||
if e == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return json.Marshal(string(*e))
|
||||
}
|
||||
|
||||
func (e *Expression) UnmarshalJSON(data []byte) error {
|
||||
var statement string
|
||||
err := json.Unmarshal(data, &statement)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*e = Expression(statement)
|
||||
expression := expressions.Parse(context.TODO(), statement)
|
||||
if expression == nil {
|
||||
return nil
|
||||
}
|
||||
if expression.Engine == "" {
|
||||
return nil
|
||||
}
|
||||
parser := parsing.NewParser()
|
||||
if _, err := parser.Parse(statement); err != nil {
|
||||
return err
|
||||
}
|
||||
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)
|
||||
}
|
||||
|
||||
// Format determines the output format (json or yaml).
|
||||
// +kubebuilder:validation:Pattern=`^(?:json|yaml|\(.+\))$`
|
||||
type Format string
|
||||
// +kubebuilder:validation:Type:=string
|
||||
// +kubebuilder:validation:Pattern:=`^(?:json|yaml|\(.+\))$`
|
||||
type Format Expression
|
||||
|
||||
// Match represents a match condition against an evaluated object.
|
||||
type Match = Any
|
||||
type Match = v1alpha1.AssertionTree
|
||||
|
||||
// ObjectName represents an object namespace and name.
|
||||
type ObjectName struct {
|
||||
// Namespace of the referent.
|
||||
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
Namespace Expression `json:"namespace,omitempty"`
|
||||
|
||||
// Name of the referent.
|
||||
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
// +optional
|
||||
Name string `json:"name,omitempty"`
|
||||
Name Expression `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// ObjectReference represents one or more objects with a specific apiVersion and kind.
|
||||
|
@ -94,11 +148,11 @@ type ObjectReference struct {
|
|||
// ObjectType represents a specific apiVersion and kind.
|
||||
type ObjectType struct {
|
||||
// API version of the referent.
|
||||
APIVersion string `json:"apiVersion"`
|
||||
APIVersion Expression `json:"apiVersion"`
|
||||
|
||||
// Kind of the referent.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
Kind string `json:"kind"`
|
||||
Kind Expression `json:"kind"`
|
||||
}
|
||||
|
||||
// Output represents an output binding with a match to determine if the binding must be considered or not.
|
||||
|
@ -144,31 +198,6 @@ 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,17 +2,15 @@ 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 string
|
||||
bindingValue Any
|
||||
bindingName Expression
|
||||
bindingValue Projection
|
||||
wantErr bool
|
||||
}{{
|
||||
name: "empty",
|
||||
|
@ -57,51 +55,3 @@ 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,6 +22,7 @@ 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"
|
||||
)
|
||||
|
@ -377,6 +378,11 @@ 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
|
||||
}
|
||||
|
@ -394,6 +400,11 @@ 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)
|
||||
|
@ -504,6 +515,11 @@ func (in *Command) DeepCopyInto(out *Command) {
|
|||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.WorkDir != nil {
|
||||
in, out := &in.WorkDir, &out.WorkDir
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -548,11 +564,21 @@ 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()
|
||||
|
@ -962,6 +988,11 @@ 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
|
||||
}
|
||||
|
||||
|
@ -1096,6 +1127,11 @@ func (in *Script) DeepCopyInto(out *Script) {
|
|||
in.ActionEnv.DeepCopyInto(&out.ActionEnv)
|
||||
in.ActionOutputs.DeepCopyInto(&out.ActionOutputs)
|
||||
in.ActionTimeout.DeepCopyInto(&out.ActionTimeout)
|
||||
if in.WorkDir != nil {
|
||||
in, out := &in.WorkDir, &out.WorkDir
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1276,10 +1312,20 @@ 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))
|
||||
|
@ -1342,7 +1388,7 @@ func (in *TestStep) DeepCopyInto(out *TestStep) {
|
|||
if in.Use != nil {
|
||||
in, out := &in.Use, &out.Use
|
||||
*out = new(Use)
|
||||
**out = **in
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
in.TestStepSpec.DeepCopyInto(&out.TestStepSpec)
|
||||
return
|
||||
|
@ -1393,6 +1439,11 @@ 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))
|
||||
|
@ -1513,6 +1564,7 @@ func (in *Update) DeepCopy() *Update {
|
|||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Use) DeepCopyInto(out *Use) {
|
||||
*out = *in
|
||||
in.With.DeepCopyInto(&out.With)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1563,7 +1615,7 @@ func (in *WaitFor) DeepCopyInto(out *WaitFor) {
|
|||
if in.JsonPath != nil {
|
||||
in, out := &in.JsonPath, &out.JsonPath
|
||||
*out = new(WaitForJsonPath)
|
||||
**out = **in
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -1583,7 +1635,7 @@ func (in *WaitForCondition) DeepCopyInto(out *WaitForCondition) {
|
|||
*out = *in
|
||||
if in.Value != nil {
|
||||
in, out := &in.Value, &out.Value
|
||||
*out = new(string)
|
||||
*out = new(Expression)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
|
@ -1618,6 +1670,11 @@ func (in *WaitForDeletion) DeepCopy() *WaitForDeletion {
|
|||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WaitForJsonPath) DeepCopyInto(out *WaitForJsonPath) {
|
||||
*out = *in
|
||||
if in.Value != nil {
|
||||
in, out := &in.Value, &out.Value
|
||||
*out = new(Expression)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1630,3 +1687,26 @@ func (in *WaitForJsonPath) DeepCopy() *WaitForJsonPath {
|
|||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *With) DeepCopyInto(out *With) {
|
||||
*out = *in
|
||||
if in.Bindings != nil {
|
||||
in, out := &in.Bindings, &out.Bindings
|
||||
*out = make([]Binding, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new With.
|
||||
func (in *With) DeepCopy() *With {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(With)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
|
@ -20,8 +23,8 @@ package v1alpha1
|
|||
|
||||
import (
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// GroupName specifies the group name used to register the objects.
|
||||
|
@ -43,7 +46,7 @@ var (
|
|||
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// Depreciated: use Install instead
|
||||
// Deprecated: use Install instead
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
Install = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
|
|
@ -1,325 +0,0 @@
|
|||
package v1alpha2
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
)
|
||||
|
||||
// ActionCheck contains check for an action.
|
||||
type ActionCheck struct {
|
||||
// Check is an assertion tree to validate the operation outcome.
|
||||
// +optional
|
||||
Check *Check `json:"check,omitempty"`
|
||||
}
|
||||
|
||||
// ActionCheckRef contains check reference options for an action.
|
||||
type ActionCheckRef struct {
|
||||
FileRef `json:",inline"`
|
||||
|
||||
// Check provides a check used in assertions.
|
||||
// +optional
|
||||
Check *Check `json:"resource,omitempty"`
|
||||
|
||||
// Template determines whether resources should be considered for templating.
|
||||
// +optional
|
||||
Template *bool `json:"template,omitempty"`
|
||||
}
|
||||
|
||||
// ActionDryRun contains dry run options for an action.
|
||||
type ActionDryRun struct {
|
||||
// DryRun determines whether the file should be applied in dry run mode.
|
||||
// +optional
|
||||
DryRun *bool `json:"dryRun,omitempty"`
|
||||
}
|
||||
|
||||
// ActionEnv contains environment options for an action.
|
||||
type ActionEnv struct {
|
||||
// Env defines additional environment variables.
|
||||
// +optional
|
||||
Env []Binding `json:"env,omitempty"`
|
||||
|
||||
// SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise.
|
||||
// +optional
|
||||
SkipLogOutput bool `json:"skipLogOutput,omitempty"`
|
||||
}
|
||||
|
||||
// ActionExpectations contains expectations for an action.
|
||||
type ActionExpectations struct {
|
||||
// Expect defines a list of matched checks to validate the operation outcome.
|
||||
// +optional
|
||||
Expect []Expectation `json:"expect,omitempty"`
|
||||
}
|
||||
|
||||
// ActionFormat contains format for an action.
|
||||
type ActionFormat struct {
|
||||
// Format determines the output format (json or yaml).
|
||||
// +optional
|
||||
Format Format `json:"format,omitempty"`
|
||||
}
|
||||
|
||||
type ActionInlineResource struct {
|
||||
// Resource provides a resource to be applied.
|
||||
// +kubebuilder:validation:XEmbeddedResource
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
// +optional
|
||||
Resource *unstructured.Unstructured `json:"resource,omitempty"`
|
||||
}
|
||||
|
||||
// ActionObject contains object selector options for an action.
|
||||
type ActionObject struct {
|
||||
ObjectType `json:",inline"`
|
||||
ActionObjectSelector `json:",inline"`
|
||||
}
|
||||
|
||||
// ActionObjectSelector contains object selector options for an action.
|
||||
type ActionObjectSelector struct {
|
||||
ObjectName `json:",inline"`
|
||||
|
||||
// Selector defines labels selector.
|
||||
// +optional
|
||||
Selector string `json:"selector,omitempty"`
|
||||
}
|
||||
|
||||
// FileRef represents a file reference.
|
||||
type FileRef struct {
|
||||
// File is the path to the referenced file. This can be a direct path to a file
|
||||
// or an expression that matches multiple files, such as "manifest/*.yaml" for all YAML
|
||||
// files within the "manifest" directory.
|
||||
File string `json:"file,omitempty"`
|
||||
}
|
||||
|
||||
// ActionResourceRef contains resource reference options for an action.
|
||||
type ActionResourceRef struct {
|
||||
FileRef `json:",inline"`
|
||||
// Resource provides a resource to be applied.
|
||||
// +kubebuilder:validation:XEmbeddedResource
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
// +optional
|
||||
Resource *unstructured.Unstructured `json:"resource,omitempty"`
|
||||
// ActionInlineResource `json:",inline"`
|
||||
|
||||
// Template determines whether resources should be considered for templating.
|
||||
// +optional
|
||||
Template *bool `json:"template,omitempty"`
|
||||
}
|
||||
|
||||
// ActionTimeout contains timeout options for an action.
|
||||
type ActionTimeout struct {
|
||||
// Timeout for the operation. Overrides the global timeout set in the Configuration.
|
||||
// +optional
|
||||
Timeout *metav1.Duration `json:"timeout,omitempty"`
|
||||
}
|
||||
|
||||
// Apply represents a set of configurations or resources that
|
||||
// should be applied during testing.
|
||||
// +k8s:conversion-gen=false
|
||||
type Apply struct {
|
||||
ActionDryRun `json:",inline"`
|
||||
ActionExpectations `json:",inline"`
|
||||
ActionResourceRef `json:",inline"`
|
||||
ActionTimeout `json:",inline"`
|
||||
}
|
||||
|
||||
// Assert represents a test condition that is expected to hold true
|
||||
// during the testing process.
|
||||
// +k8s:conversion-gen=false
|
||||
type Assert struct {
|
||||
ActionCheckRef `json:",inline"`
|
||||
ActionTimeout `json:",inline"`
|
||||
}
|
||||
|
||||
// Command describes a command to run as a part of a test step.
|
||||
// +k8s:conversion-gen=false
|
||||
type Command struct {
|
||||
ActionCheck `json:",inline"`
|
||||
ActionEnv `json:",inline"`
|
||||
ActionTimeout `json:",inline"`
|
||||
|
||||
// Entrypoint is the command entry point to run.
|
||||
Entrypoint string `json:"entrypoint"`
|
||||
|
||||
// Args is the command arguments.
|
||||
// +optional
|
||||
Args []string `json:"args,omitempty"`
|
||||
}
|
||||
|
||||
// Create represents a set of resources that should be created.
|
||||
// If a resource already exists in the cluster it will fail.
|
||||
// +k8s:conversion-gen=false
|
||||
type Create struct {
|
||||
ActionDryRun `json:",inline"`
|
||||
ActionExpectations `json:",inline"`
|
||||
ActionResourceRef `json:",inline"`
|
||||
ActionTimeout `json:",inline"`
|
||||
}
|
||||
|
||||
// Delete is a reference to an object that should be deleted
|
||||
// +k8s:conversion-gen=false
|
||||
type Delete struct {
|
||||
ActionExpectations `json:",inline"`
|
||||
ActionTimeout `json:",inline"`
|
||||
|
||||
// Template determines whether resources should be considered for templating.
|
||||
// +optional
|
||||
Template *bool `json:"template,omitempty"`
|
||||
|
||||
// File is the path to the referenced file. This can be a direct path to a file
|
||||
// or an expression that matches multiple files, such as "manifest/*.yaml" for all YAML
|
||||
// files within the "manifest" directory.
|
||||
// +optional
|
||||
File string `json:"file,omitempty"`
|
||||
|
||||
// Ref determines objects to be deleted.
|
||||
// +optional
|
||||
Ref *ObjectReference `json:"ref,omitempty"`
|
||||
|
||||
// DeletionPropagationPolicy decides if a deletion will propagate to the dependents of
|
||||
// the object, and how the garbage collector will handle the propagation.
|
||||
// Overrides the deletion propagation policy set in the Configuration, the Test and the TestStep.
|
||||
// +optional
|
||||
// +kubebuilder:validation:Enum:=Orphan;Background;Foreground
|
||||
DeletionPropagationPolicy *metav1.DeletionPropagation `json:"deletionPropagationPolicy,omitempty"`
|
||||
}
|
||||
|
||||
// Describe defines how to describe resources.
|
||||
// +k8s:conversion-gen=false
|
||||
type Describe struct {
|
||||
ActionObject `json:",inline"`
|
||||
ActionTimeout `json:",inline"`
|
||||
|
||||
// Show Events indicates whether to include related events.
|
||||
// +optional
|
||||
ShowEvents *bool `json:"showEvents,omitempty"`
|
||||
}
|
||||
|
||||
// Error represents an anticipated error condition that may arise during testing.
|
||||
// Instead of treating such an error as a test failure, it acknowledges it as expected.
|
||||
// +k8s:conversion-gen=false
|
||||
type Error struct {
|
||||
ActionCheckRef `json:",inline"`
|
||||
ActionTimeout `json:",inline"`
|
||||
}
|
||||
|
||||
// Events defines how to collect events.
|
||||
// +k8s:conversion-gen=false
|
||||
type Events struct {
|
||||
ActionFormat `json:",inline"`
|
||||
ActionObjectSelector `json:",inline"`
|
||||
ActionTimeout `json:",inline"`
|
||||
}
|
||||
|
||||
// Get defines how to get resources.
|
||||
// +k8s:conversion-gen=false
|
||||
type Get struct {
|
||||
ActionFormat `json:",inline"`
|
||||
ActionObject `json:",inline"`
|
||||
ActionTimeout `json:",inline"`
|
||||
}
|
||||
|
||||
// Patch represents a set of resources that should be patched.
|
||||
// If a resource doesn't exist yet in the cluster it will fail.
|
||||
// +k8s:conversion-gen=false
|
||||
type Patch struct {
|
||||
ActionDryRun `json:",inline"`
|
||||
ActionExpectations `json:",inline"`
|
||||
ActionResourceRef `json:",inline"`
|
||||
ActionTimeout `json:",inline"`
|
||||
}
|
||||
|
||||
// PodLogs defines how to collect pod logs.
|
||||
// +k8s:conversion-gen=false
|
||||
type PodLogs struct {
|
||||
ActionObjectSelector `json:",inline"`
|
||||
ActionTimeout `json:",inline"`
|
||||
|
||||
// Container in pod to get logs from else --all-containers is used.
|
||||
// +optional
|
||||
Container string `json:"container,omitempty"`
|
||||
|
||||
// Tail is the number of last lines to collect from pods. If omitted or zero,
|
||||
// then the default is 10 if you use a selector, or -1 (all) if you use a pod name.
|
||||
// This matches default behavior of `kubectl logs`.
|
||||
// +optional
|
||||
Tail *int `json:"tail,omitempty"`
|
||||
}
|
||||
|
||||
// Script describes a script to run as a part of a test step.
|
||||
// +k8s:conversion-gen=false
|
||||
type Script struct {
|
||||
ActionCheck `json:",inline"`
|
||||
ActionEnv `json:",inline"`
|
||||
ActionTimeout `json:",inline"`
|
||||
|
||||
// Content defines a shell script (run with "sh -c ...").
|
||||
// +optional
|
||||
Content string `json:"content,omitempty"`
|
||||
}
|
||||
|
||||
// Sleep represents a duration while nothing happens.
|
||||
// +k8s:conversion-gen=false
|
||||
type Sleep struct {
|
||||
// Duration is the delay used for sleeping.
|
||||
Duration metav1.Duration `json:"duration"`
|
||||
}
|
||||
|
||||
// Update represents a set of resources that should be updated.
|
||||
// If a resource does not exist in the cluster it will fail.
|
||||
// +k8s:conversion-gen=false
|
||||
type Update struct {
|
||||
ActionDryRun `json:",inline"`
|
||||
ActionExpectations `json:",inline"`
|
||||
ActionResourceRef `json:",inline"`
|
||||
ActionTimeout `json:",inline"`
|
||||
}
|
||||
|
||||
// Wait specifies how to perform wait operations on resources.
|
||||
// +k8s:conversion-gen=false
|
||||
type Wait struct {
|
||||
ActionTimeout `json:",inline"`
|
||||
ActionFormat `json:",inline"`
|
||||
ActionObject `json:",inline"`
|
||||
|
||||
// WaitFor specifies the condition to wait for.
|
||||
WaitFor `json:"for"`
|
||||
}
|
||||
|
||||
// WaitFor specifies the condition to wait for.
|
||||
// +k8s:conversion-gen=false
|
||||
type WaitFor struct {
|
||||
// Deletion specifies parameters for waiting on a resource's deletion.
|
||||
// +optional
|
||||
Deletion *WaitForDeletion `json:"deletion,omitempty"`
|
||||
|
||||
// Condition specifies the condition to wait for.
|
||||
// +optional
|
||||
Condition *WaitForCondition `json:"condition,omitempty"`
|
||||
|
||||
// JsonPath specifies the json path condition to wait for.
|
||||
// +optional
|
||||
JsonPath *WaitForJsonPath `json:"jsonPath,omitempty"`
|
||||
}
|
||||
|
||||
// WaitForCondition represents parameters for waiting on a specific condition of a resource.
|
||||
// +k8s:conversion-gen=false
|
||||
type WaitForCondition struct {
|
||||
// Name defines the specific condition to wait for, e.g., "Available", "Ready".
|
||||
Name string `json:"name"`
|
||||
|
||||
// Value defines the specific condition status to wait for, e.g., "True", "False".
|
||||
// +optional
|
||||
Value *string `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// WaitForDeletion represents parameters for waiting on a resource's deletion.
|
||||
// +k8s:conversion-gen=false
|
||||
type WaitForDeletion struct{}
|
||||
|
||||
// WaitForJsonPath represents parameters for waiting on a json path of a resource.
|
||||
// +k8s:conversion-gen=false
|
||||
type WaitForJsonPath struct {
|
||||
// Path defines the json path to wait for, e.g. '{.status.phase}'.
|
||||
Path string `json:"path"`
|
||||
|
||||
// Value defines the expected value to wait for, e.g., "Running".
|
||||
Value string `json:"value"`
|
||||
}
|
|
@ -1,115 +0,0 @@
|
|||
package v1alpha2
|
||||
|
||||
// Operation defines operation elements.
|
||||
// +k8s:conversion-gen=false
|
||||
type Operation struct {
|
||||
OperationAction `json:",inline"`
|
||||
OperationBindings `json:",inline"`
|
||||
OperationClusters `json:",inline"`
|
||||
OperationOutputs `json:",inline"`
|
||||
|
||||
// Description contains a description of the operation.
|
||||
// +optional
|
||||
Description string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// OperationAction defines an operation action, only one action should be specified per operation.
|
||||
type OperationAction struct {
|
||||
// Apply represents resources that should be applied for this test step. This can include things
|
||||
// like configuration settings or any other resources that need to be available during the test.
|
||||
// +optional
|
||||
Apply *Apply `json:"apply,omitempty"`
|
||||
|
||||
// Assert represents an assertion to be made. It checks whether the conditions specified in the assertion hold true.
|
||||
// +optional
|
||||
Assert *Assert `json:"assert,omitempty"`
|
||||
|
||||
// Command defines a command to run.
|
||||
// +optional
|
||||
Command *Command `json:"command,omitempty"`
|
||||
|
||||
// Create represents a creation operation.
|
||||
// +optional
|
||||
Create *Create `json:"create,omitempty"`
|
||||
|
||||
// Delete represents a deletion operation.
|
||||
// +optional
|
||||
Delete *Delete `json:"delete,omitempty"`
|
||||
|
||||
// Describe determines the resource describe collector to execute.
|
||||
// +optional
|
||||
Describe *Describe `json:"describe,omitempty"`
|
||||
|
||||
// Error represents the expected errors for this test step. If any of these errors occur, the test
|
||||
// will consider them as expected; otherwise, they will be treated as test failures.
|
||||
// +optional
|
||||
Error *Error `json:"error,omitempty"`
|
||||
|
||||
// Events determines the events collector to execute.
|
||||
// +optional
|
||||
Events *Events `json:"events,omitempty"`
|
||||
|
||||
// Get determines the resource get collector to execute.
|
||||
// +optional
|
||||
Get *Get `json:"get,omitempty"`
|
||||
|
||||
// Patch represents a patch operation.
|
||||
// +optional
|
||||
Patch *Patch `json:"patch,omitempty"`
|
||||
|
||||
// PodLogs determines the pod logs collector to execute.
|
||||
// +optional
|
||||
PodLogs *PodLogs `json:"podLogs,omitempty"`
|
||||
|
||||
// Script defines a script to run.
|
||||
// +optional
|
||||
Script *Script `json:"script,omitempty"`
|
||||
|
||||
// Sleep defines zzzz.
|
||||
// +optional
|
||||
Sleep *Sleep `json:"sleep,omitempty"`
|
||||
|
||||
// Update represents an update operation.
|
||||
// +optional
|
||||
Update *Update `json:"update,omitempty"`
|
||||
|
||||
// Wait determines the resource wait collector to execute.
|
||||
// +optional
|
||||
Wait *Wait `json:"wait,omitempty"`
|
||||
}
|
||||
|
||||
// OperationBindings contains bindings options for an operation.
|
||||
type OperationBindings struct {
|
||||
// Bindings defines additional binding key/values.
|
||||
// +optional
|
||||
Bindings []Binding `json:"bindings,omitempty"`
|
||||
}
|
||||
|
||||
// OperationClusters contains clusters options for an operation.
|
||||
type OperationClusters struct {
|
||||
// Cluster defines the target cluster (default cluster will be used if not specified and/or overridden).
|
||||
// +optional
|
||||
Cluster string `json:"cluster,omitempty"`
|
||||
|
||||
// Clusters holds a registry to clusters to support multi-cluster tests.
|
||||
// +optional
|
||||
Clusters Clusters `json:"clusters,omitempty"`
|
||||
}
|
||||
|
||||
// OperationOutputs contains outputs options for an operation.
|
||||
type OperationOutputs struct {
|
||||
// Outputs defines output bindings.
|
||||
// +optional
|
||||
Outputs []Output `json:"outputs,omitempty"`
|
||||
}
|
||||
|
||||
// TryOperation defines operation elements.
|
||||
// +k8s:conversion-gen=false
|
||||
type TryOperation struct {
|
||||
Operation `json:",inline"`
|
||||
|
||||
// ContinueOnError determines whether a test should continue or not in case the operation was not successful.
|
||||
// Even if the test continues executing, it will still be reported as failed.
|
||||
// +optional
|
||||
ContinueOnError *bool `json:"continueOnError,omitempty"`
|
||||
}
|
|
@ -2,7 +2,6 @@ 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"
|
||||
)
|
||||
|
||||
|
@ -87,23 +86,30 @@ 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 *Any `json:"template,omitempty"`
|
||||
Template *Projection `json:"template,omitempty"`
|
||||
}
|
||||
|
||||
type ReportFormatType string
|
||||
|
||||
const (
|
||||
JSONFormat ReportFormatType = "JSON"
|
||||
XMLFormat ReportFormatType = "XML"
|
||||
JSONFormat ReportFormatType = "JSON"
|
||||
XMLFormat ReportFormatType = "XML"
|
||||
JUnitTestFormat ReportFormatType = "JUNIT-TEST"
|
||||
JUnitStepFormat ReportFormatType = "JUNIT-STEP"
|
||||
JUnitOperationFormat ReportFormatType = "JUNIT-OPERATION"
|
||||
)
|
||||
|
||||
// ReportOptions contains the configuration used for reporting.
|
||||
type ReportOptions struct {
|
||||
// ReportFormat determines test report format (JSON|XML).
|
||||
// ReportFormat determines test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION).
|
||||
// +optional
|
||||
// +kubebuilder:validation:Enum:=JSON;XML
|
||||
// +kubebuilder:validation:Enum:=JSON;XML;JUNIT-TEST;JUNIT-STEP;JUNIT-OPERATION
|
||||
// +kubebuilder:default:="JSON"
|
||||
Format ReportFormatType `json:"format,omitempty"`
|
||||
|
||||
|
@ -123,4 +129,8 @@ 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"`
|
||||
}
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
package v1alpha2
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// TestStep contains the test step definition used in a test spec.
|
||||
// +k8s:conversion-gen=false
|
||||
type TestStep struct {
|
||||
// Name of the step.
|
||||
// +optional
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// TestStepSpec of the step.
|
||||
TestStepSpec `json:",inline"`
|
||||
}
|
||||
|
||||
// TestStepSpec defines the desired state and behavior for each test step.
|
||||
// +k8s:conversion-gen=false
|
||||
type TestStepSpec struct {
|
||||
// Description contains a description of the test step.
|
||||
// +optional
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// Timeouts for the test step. Overrides the global timeouts set in the Configuration and the timeouts eventually set in the Test.
|
||||
// +optional
|
||||
Timeouts *Timeouts `json:"timeouts,omitempty"`
|
||||
|
||||
// DeletionPropagationPolicy decides if a deletion will propagate to the dependents of
|
||||
// the object, and how the garbage collector will handle the propagation.
|
||||
// Overrides the deletion propagation policy set in both the Configuration and the Test.
|
||||
// +optional
|
||||
// +kubebuilder:validation:Enum:=Orphan;Background;Foreground
|
||||
DeletionPropagationPolicy *metav1.DeletionPropagation `json:"deletionPropagationPolicy,omitempty"`
|
||||
|
||||
// Cluster defines the target cluster (default cluster will be used if not specified and/or overridden).
|
||||
// +optional
|
||||
Cluster string `json:"cluster,omitempty"`
|
||||
|
||||
// Clusters holds a registry to clusters to support multi-cluster tests.
|
||||
// +optional
|
||||
Clusters Clusters `json:"clusters,omitempty"`
|
||||
|
||||
// SkipDelete determines whether the resources created by the step should be deleted after the test step is executed.
|
||||
// +optional
|
||||
SkipDelete *bool `json:"skipDelete,omitempty"`
|
||||
|
||||
// Template determines whether resources should be considered for templating.
|
||||
// +optional
|
||||
Template *bool `json:"template,omitempty"`
|
||||
|
||||
// Bindings defines additional binding key/values.
|
||||
// +optional
|
||||
Bindings []Binding `json:"bindings,omitempty"`
|
||||
|
||||
// Try defines what the step will try to execute.
|
||||
// +kubebuilder:validation:MinItems:=1
|
||||
Try []TryOperation `json:"try"`
|
||||
|
||||
// Catch defines what the step will execute when an error happens.
|
||||
// +optional
|
||||
Catch []Operation `json:"catch,omitempty"`
|
||||
|
||||
// Finally defines what the step will execute after the step is terminated.
|
||||
// +optional
|
||||
Finally []Operation `json:"finally,omitempty"`
|
||||
|
||||
// Cleanup defines what will be executed after the test is terminated.
|
||||
// +optional
|
||||
Cleanup []Operation `json:"cleanup,omitempty"`
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
package v1alpha2
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:scope=Cluster
|
||||
|
||||
// Test is the resource that contains a test definition.
|
||||
type Test struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
|
||||
// Standard object's metadata.
|
||||
// +optional
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
// Test spec.
|
||||
Spec TestSpec `json:"spec"`
|
||||
}
|
||||
|
||||
// TestSpec contains the test spec.
|
||||
// +k8s:conversion-gen=false
|
||||
type TestSpec struct {
|
||||
// Cleanup contains cleanup configuration.
|
||||
// +optional
|
||||
// +kubebuilder:default:={}
|
||||
Cleanup CleanupOptions `json:"cleanup"`
|
||||
|
||||
// Cluster defines the target cluster (default cluster will be used if not specified and/or overridden).
|
||||
// +optional
|
||||
Cluster string `json:"cluster,omitempty"`
|
||||
|
||||
// Clusters holds a registry to clusters to support multi-cluster tests.
|
||||
// +optional
|
||||
Clusters Clusters `json:"clusters,omitempty"`
|
||||
|
||||
// Execution contains tests execution configuration.
|
||||
// +optional
|
||||
// +kubebuilder:default:={}
|
||||
Execution TestExecutionOptions `json:"execution"`
|
||||
|
||||
// Bindings defines additional binding key/values.
|
||||
// +optional
|
||||
Bindings []Binding `json:"bindings,omitempty"`
|
||||
|
||||
// Deletion contains the global deletion configuration.
|
||||
// +optional
|
||||
// +kubebuilder:default:={}
|
||||
Deletion DeletionOptions `json:"deletion"`
|
||||
|
||||
// Description contains a description of the test.
|
||||
// +optional
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// Error contains the global error configuration.
|
||||
// +optional
|
||||
// +kubebuilder:default:={}
|
||||
Error ErrorOptions `json:"error"`
|
||||
|
||||
// Namespace contains properties for the namespace to use for tests.
|
||||
// +optional
|
||||
// +kubebuilder:default:={}
|
||||
Namespace NamespaceOptions `json:"namespace"`
|
||||
|
||||
// Steps defining the test.
|
||||
Steps []TestStep `json:"steps"`
|
||||
|
||||
// Templating contains the templating config.
|
||||
// +optional
|
||||
// +kubebuilder:default:={}
|
||||
Templating TemplatingOptions `json:"templating"`
|
||||
|
||||
// Timeouts for the test. Overrides the global timeouts set in the Configuration on a per operation basis.
|
||||
// +optional
|
||||
// +kubebuilder:default:={}
|
||||
Timeouts Timeouts `json:"timeouts"`
|
||||
}
|
||||
|
||||
// TestExecutionOptions determines how tests are run.
|
||||
type TestExecutionOptions struct {
|
||||
// Concurrent determines whether the test should run concurrently with other tests.
|
||||
// +optional
|
||||
// +kubebuilder:default:=true
|
||||
Concurrent bool `json:"concurrent"`
|
||||
|
||||
// Skip determines whether the test should skipped.
|
||||
// +optional
|
||||
Skip bool `json:"skip,omitempty"`
|
||||
|
||||
// TerminationGracePeriod forces the termination grace period on pods, statefulsets, daemonsets and deployments.
|
||||
// +optional
|
||||
TerminationGracePeriod *metav1.Duration `json:"terminationGracePeriod,omitempty"`
|
||||
}
|
|
@ -3,33 +3,16 @@ 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"
|
||||
)
|
||||
|
||||
const (
|
||||
EngineJP = v1alpha1.EngineJP
|
||||
EngineCEL = v1alpha1.EngineCEL
|
||||
)
|
||||
|
||||
type (
|
||||
Any = v1alpha1.Any
|
||||
Binding = v1alpha1.Binding
|
||||
Check = v1alpha1.Check
|
||||
Cluster = v1alpha1.Cluster
|
||||
Clusters = v1alpha1.Clusters
|
||||
Expectation = v1alpha1.Expectation
|
||||
Format = v1alpha1.Format
|
||||
ObjectName = v1alpha1.ObjectName
|
||||
ObjectType = v1alpha1.ObjectType
|
||||
Output = v1alpha1.Output
|
||||
Timeouts = v1alpha1.Timeouts
|
||||
Compiler = v1alpha1.Compiler
|
||||
DefaultTimeouts = v1alpha1.DefaultTimeouts
|
||||
Projection = v1alpha1.Projection
|
||||
)
|
||||
|
||||
// ObjectReference represents one or more objects with a specific apiVersion and kind.
|
||||
// For a single object name and namespace are used to identify the object.
|
||||
// For multiple objects use labels.
|
||||
// +k8s:conversion-gen=false
|
||||
type ObjectReference struct {
|
||||
ObjectType `json:",inline"`
|
||||
ObjectName `json:",inline"`
|
||||
|
||||
// Label selector to match objects to delete
|
||||
// +optional
|
||||
Labels *metav1.LabelSelector `json:"labelSelector,omitempty"`
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,3 +1,6 @@
|
|||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
|
@ -20,8 +23,8 @@ package v1alpha2
|
|||
|
||||
import (
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// GroupName specifies the group name used to register the objects.
|
||||
|
@ -43,7 +46,7 @@ var (
|
|||
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// Depreciated: use Install instead
|
||||
// Deprecated: use Install instead
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
Install = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
@ -59,7 +62,6 @@ func init() {
|
|||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&Configuration{},
|
||||
&Test{},
|
||||
)
|
||||
// AddToGroupVersion allows the serialization of client types like ListOptions.
|
||||
v1.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||
|
|
|
@ -5,6 +5,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
"github.com/kyverno/chainsaw/pkg/model"
|
||||
kerrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
@ -21,20 +22,22 @@ type CleanerCollector interface {
|
|||
|
||||
type Cleaner interface {
|
||||
CleanerCollector
|
||||
Run(ctx context.Context) []error
|
||||
Run(ctx context.Context, stepReport *model.StepReport) []error
|
||||
}
|
||||
|
||||
func New(timeout time.Duration, delay *time.Duration) Cleaner {
|
||||
func New(timeout time.Duration, delay *time.Duration, propagation metav1.DeletionPropagation) Cleaner {
|
||||
return &cleaner{
|
||||
delay: delay,
|
||||
timeout: timeout,
|
||||
delay: delay,
|
||||
timeout: timeout,
|
||||
propagation: propagation,
|
||||
}
|
||||
}
|
||||
|
||||
type cleaner struct {
|
||||
delay *time.Duration
|
||||
timeout time.Duration
|
||||
entries []cleanupEntry
|
||||
delay *time.Duration
|
||||
timeout time.Duration
|
||||
propagation metav1.DeletionPropagation
|
||||
entries []cleanupEntry
|
||||
}
|
||||
|
||||
func (c *cleaner) Add(client client.Client, object client.Object) {
|
||||
|
@ -48,23 +51,34 @@ func (c *cleaner) Empty() bool {
|
|||
return len(c.entries) == 0
|
||||
}
|
||||
|
||||
func (c *cleaner) Run(ctx context.Context) []error {
|
||||
func (c *cleaner) Run(ctx context.Context, stepReport *model.StepReport) []error {
|
||||
if c.delay != nil {
|
||||
time.Sleep(*c.delay)
|
||||
}
|
||||
var errs []error
|
||||
for i := len(c.entries) - 1; i >= 0; i-- {
|
||||
if err := c.delete(ctx, c.entries[i]); err != nil {
|
||||
errs = append(errs, err)
|
||||
report := model.OperationReport{
|
||||
Type: model.OperationTypeDelete,
|
||||
StartTime: time.Now(),
|
||||
}
|
||||
if report.Err = c.delete(ctx, c.entries[i]); report.Err != nil {
|
||||
errs = append(errs, report.Err)
|
||||
}
|
||||
report.EndTime = time.Now()
|
||||
if stepReport != nil {
|
||||
stepReport.Add(&report)
|
||||
}
|
||||
}
|
||||
return errs
|
||||
}
|
||||
|
||||
func (c *cleaner) delete(ctx context.Context, entry cleanupEntry) error {
|
||||
ctx, cancel := context.WithTimeout(ctx, c.timeout)
|
||||
defer cancel()
|
||||
if err := entry.client.Delete(ctx, entry.object, client.PropagationPolicy(metav1.DeletePropagationForeground)); err != nil {
|
||||
if c.timeout != 0 {
|
||||
_ctx, cancel := context.WithTimeout(ctx, c.timeout)
|
||||
defer cancel()
|
||||
ctx = _ctx
|
||||
}
|
||||
if err := entry.client.Delete(ctx, entry.object, client.PropagationPolicy(c.propagation)); err != nil {
|
||||
if !kerrors.IsNotFound(err) {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ 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"
|
||||
|
@ -27,21 +28,23 @@ func TestNew(t *testing.T) {
|
|||
timeout: time.Minute,
|
||||
delay: nil,
|
||||
want: &cleaner{
|
||||
timeout: time.Minute,
|
||||
delay: nil,
|
||||
timeout: time.Minute,
|
||||
delay: nil,
|
||||
propagation: metav1.DeletePropagationBackground,
|
||||
},
|
||||
}, {
|
||||
name: "with delay",
|
||||
timeout: time.Minute,
|
||||
delay: ptr.To(10 * time.Second),
|
||||
want: &cleaner{
|
||||
timeout: time.Minute,
|
||||
delay: ptr.To(10 * time.Second),
|
||||
timeout: time.Minute,
|
||||
delay: ptr.To(10 * time.Second),
|
||||
propagation: metav1.DeletePropagationBackground,
|
||||
},
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got := New(tt.timeout, tt.delay)
|
||||
got := New(tt.timeout, tt.delay, metav1.DeletePropagationBackground)
|
||||
assert.Equal(t, tt.want, got)
|
||||
})
|
||||
}
|
||||
|
@ -194,7 +197,7 @@ func Test_cleaner_Run(t *testing.T) {
|
|||
timeout: 1 * time.Second,
|
||||
entries: tt.entries,
|
||||
}
|
||||
got := c.Run(context.TODO())
|
||||
got := c.Run(context.TODO(), &model.StepReport{})
|
||||
assert.Equal(t, tt.want, got)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -2,11 +2,16 @@ package simple
|
|||
|
||||
import (
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/client-go/rest"
|
||||
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
|
||||
)
|
||||
|
||||
func New(cfg *rest.Config) (client.Client, error) {
|
||||
var opts ctrlclient.Options
|
||||
return ctrlclient.New(cfg, opts)
|
||||
client, err := ctrlclient.New(cfg, opts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ctrlclient.WithFieldValidation(client, metav1.FieldValidationStrict), nil
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@ import (
|
|||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
)
|
||||
|
||||
const PollInterval = 50 * time.Millisecond
|
||||
|
||||
func Key(obj metav1.Object) ObjectKey {
|
||||
return ObjectKey{
|
||||
Name: obj.GetName(),
|
||||
|
@ -60,7 +62,7 @@ func PatchObject(actual, expected runtime.Object) (runtime.Object, error) {
|
|||
|
||||
func WaitForDeletion(ctx context.Context, client Client, object Object) error {
|
||||
key := Key(object)
|
||||
return wait.PollUntilContextCancel(ctx, 50*time.Millisecond, true, func(ctx context.Context) (bool, error) {
|
||||
return wait.PollUntilContextCancel(ctx, PollInterval, true, func(ctx context.Context) (bool, error) {
|
||||
if err := client.Get(ctx, key, object); err != nil {
|
||||
if kerrors.IsNotFound(err) {
|
||||
return true, nil
|
||||
|
|
|
@ -6,14 +6,15 @@ 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"
|
||||
engineclient "github.com/kyverno/chainsaw/pkg/engine/client"
|
||||
nspacer "github.com/kyverno/chainsaw/pkg/engine/namespacer"
|
||||
opassert "github.com/kyverno/chainsaw/pkg/engine/operations/assert"
|
||||
"github.com/kyverno/chainsaw/pkg/loaders/config"
|
||||
"github.com/kyverno/chainsaw/pkg/loaders/resource"
|
||||
opassert "github.com/kyverno/chainsaw/pkg/runner/operations/assert"
|
||||
restutils "github.com/kyverno/chainsaw/pkg/utils/rest"
|
||||
"github.com/kyverno/pkg/ext/output/color"
|
||||
"github.com/spf13/cobra"
|
||||
|
@ -137,9 +138,13 @@ 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, cancel := context.WithTimeout(context.Background(), opts.timeout.Duration)
|
||||
defer cancel()
|
||||
op := opassert.New(client, resource, namespacer, false)
|
||||
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)
|
||||
_, err := op.Exec(ctx, nil)
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -3,23 +3,30 @@ 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 {
|
||||
|
@ -320,7 +327,7 @@ data:
|
|||
cmd.Args = cobra.RangeArgs(0, 1)
|
||||
cmd.SilenceUsage = true
|
||||
cmd.SetOut(bytes.NewBufferString(""))
|
||||
cmd.SetIn(&testing.ErrReader{})
|
||||
cmd.SetIn(&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.Replace(base, "_", " ", -1))
|
||||
return fmt.Sprintf(fmTemplate, now, strings.ReplaceAll(base, "_", " "))
|
||||
}
|
||||
|
||||
func websiteLinkHandler(filename string) string {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package lint
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
@ -8,6 +9,7 @@ import (
|
|||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/xeipuuv/gojsonschema"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
func Command() *cobra.Command {
|
||||
|
@ -40,16 +42,16 @@ func Command() *cobra.Command {
|
|||
return cmd
|
||||
}
|
||||
|
||||
func lintInput(input []byte, schema string, format string, writer io.Writer) error {
|
||||
func lintInput(input []byte, kind string, format string, writer io.Writer) error {
|
||||
fmt.Fprintln(writer, "Processing input...")
|
||||
if err := lintSchema(input, schema, format, writer); err != nil {
|
||||
if err := lintSchema(input, kind, format, writer); err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Fprintln(writer, "The document is valid")
|
||||
return nil
|
||||
}
|
||||
|
||||
func lintSchema(input []byte, schema string, format string, writer io.Writer) error {
|
||||
func lintSchema(input []byte, kind string, format string, writer io.Writer) error {
|
||||
processor, err := getProcessor(format, input)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -58,7 +60,15 @@ func lintSchema(input []byte, schema string, format string, writer io.Writer) er
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
goschema, err := getScheme(schema)
|
||||
var unstructured map[string]any
|
||||
if err := json.Unmarshal(jsonInput, &unstructured); err != nil {
|
||||
return err
|
||||
}
|
||||
gv, err := schema.ParseGroupVersion(unstructured["apiVersion"].(string))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
goschema, err := getScheme(kind, gv.Version)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -7,29 +7,10 @@ import (
|
|||
"github.com/kyverno/chainsaw/pkg/data"
|
||||
)
|
||||
|
||||
func getScheme(schema string) ([]byte, error) {
|
||||
switch schema {
|
||||
case "test":
|
||||
return getTestSchema()
|
||||
case "configuration":
|
||||
return getConfigurationSchema()
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown schema: %s", schema)
|
||||
}
|
||||
}
|
||||
|
||||
func getTestSchema() ([]byte, error) {
|
||||
func getScheme(kind string, version string) ([]byte, error) {
|
||||
schemasFs, err := data.Schemas()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return fs.ReadFile(schemasFs, "test-chainsaw-v1alpha1.json")
|
||||
}
|
||||
|
||||
func getConfigurationSchema() ([]byte, error) {
|
||||
schemasFs, err := data.Schemas()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return fs.ReadFile(schemasFs, "configuration-chainsaw-v1alpha1.json")
|
||||
return fs.ReadFile(schemasFs, fmt.Sprintf("%s-chainsaw-%s.json", kind, version))
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"maps"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
|
@ -18,7 +19,6 @@ import (
|
|||
fsutils "github.com/kyverno/chainsaw/pkg/utils/fs"
|
||||
"github.com/kyverno/pkg/ext/resource/convert"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/exp/maps"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/utils/ptr"
|
||||
|
@ -75,8 +75,6 @@ func processFolder(stdout io.Writer, stderr io.Writer, folder string, save, clea
|
|||
}
|
||||
if len(steps) != 0 {
|
||||
fmt.Fprintf(stderr, "Converting test %s ...\n", folder)
|
||||
keys := maps.Keys(steps)
|
||||
slices.Sort(keys)
|
||||
test := v1alpha1.Test{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
APIVersion: v1alpha1.SchemeGroupVersion.String(),
|
||||
|
@ -84,7 +82,7 @@ func processFolder(stdout io.Writer, stderr io.Writer, folder string, save, clea
|
|||
},
|
||||
}
|
||||
test.SetName(strings.ToLower(strings.ReplaceAll(filepath.Base(folder), "_", "-")))
|
||||
for _, key := range keys {
|
||||
for _, key := range slices.Sorted(maps.Keys(steps)) {
|
||||
step := v1alpha1.TestStep{
|
||||
Name: fmt.Sprintf("step-%s", key),
|
||||
}
|
||||
|
@ -153,11 +151,11 @@ func processStep(stderr io.Writer, step *v1alpha1.TestStep, s discovery.Step, fo
|
|||
}
|
||||
}
|
||||
if !containsKuttlResources {
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
Apply: &v1alpha1.Apply{
|
||||
ActionResourceRef: v1alpha1.ActionResourceRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
File: file,
|
||||
File: v1alpha1.Expression(file),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -195,11 +193,11 @@ func processStep(stderr io.Writer, step *v1alpha1.TestStep, s discovery.Step, fo
|
|||
return err
|
||||
}
|
||||
}
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
Apply: &v1alpha1.Apply{
|
||||
ActionResourceRef: v1alpha1.ActionResourceRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
File: file,
|
||||
File: v1alpha1.Expression(file),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -220,11 +218,11 @@ func processStep(stderr io.Writer, step *v1alpha1.TestStep, s discovery.Step, fo
|
|||
}
|
||||
}
|
||||
if !containsKuttlResources {
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
Assert: &v1alpha1.Assert{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
File: file,
|
||||
File: v1alpha1.Expression(file),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -256,11 +254,11 @@ func processStep(stderr io.Writer, step *v1alpha1.TestStep, s discovery.Step, fo
|
|||
return err
|
||||
}
|
||||
}
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
Assert: &v1alpha1.Assert{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
File: file,
|
||||
File: v1alpha1.Expression(file),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -281,11 +279,11 @@ func processStep(stderr io.Writer, step *v1alpha1.TestStep, s discovery.Step, fo
|
|||
}
|
||||
}
|
||||
if !containsKuttlResources {
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
Error: &v1alpha1.Error{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
File: file,
|
||||
File: v1alpha1.Expression(file),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -317,11 +315,11 @@ func processStep(stderr io.Writer, step *v1alpha1.TestStep, s discovery.Step, fo
|
|||
return err
|
||||
}
|
||||
}
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
Error: &v1alpha1.Error{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
File: file,
|
||||
File: v1alpha1.Expression(file),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -422,7 +420,7 @@ func testStep(to *v1alpha1.TestStepSpec, in unstructured.Unstructured) error {
|
|||
Apply: &v1alpha1.Apply{
|
||||
ActionResourceRef: v1alpha1.ActionResourceRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
File: operation,
|
||||
File: v1alpha1.Expression(operation),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -433,7 +431,7 @@ func testStep(to *v1alpha1.TestStepSpec, in unstructured.Unstructured) error {
|
|||
Assert: &v1alpha1.Assert{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
File: operation,
|
||||
File: v1alpha1.Expression(operation),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -444,7 +442,7 @@ func testStep(to *v1alpha1.TestStepSpec, in unstructured.Unstructured) error {
|
|||
Error: &v1alpha1.Error{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
File: operation,
|
||||
File: v1alpha1.Expression(operation),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -455,12 +453,12 @@ func testStep(to *v1alpha1.TestStepSpec, in unstructured.Unstructured) error {
|
|||
Delete: &v1alpha1.Delete{
|
||||
Ref: &v1alpha1.ObjectReference{
|
||||
ObjectType: v1alpha1.ObjectType{
|
||||
APIVersion: operation.APIVersion,
|
||||
Kind: operation.Kind,
|
||||
APIVersion: v1alpha1.Expression(operation.APIVersion),
|
||||
Kind: v1alpha1.Expression(operation.Kind),
|
||||
},
|
||||
ObjectName: v1alpha1.ObjectName{
|
||||
Namespace: operation.Namespace,
|
||||
Name: operation.Name,
|
||||
Namespace: v1alpha1.Expression(operation.Namespace),
|
||||
Name: v1alpha1.Expression(operation.Name),
|
||||
},
|
||||
Labels: operation.Labels,
|
||||
},
|
||||
|
@ -506,12 +504,12 @@ func testAssert(to *v1alpha1.TestStepSpec, in unstructured.Unstructured) error {
|
|||
op := &v1alpha1.PodLogs{
|
||||
ActionObjectSelector: v1alpha1.ActionObjectSelector{
|
||||
ObjectName: v1alpha1.ObjectName{
|
||||
Name: collector.Pod,
|
||||
Namespace: collector.Namespace,
|
||||
Name: v1alpha1.Expression(collector.Pod),
|
||||
Namespace: v1alpha1.Expression(collector.Namespace),
|
||||
},
|
||||
Selector: collector.Selector,
|
||||
Selector: v1alpha1.Expression(collector.Selector),
|
||||
},
|
||||
Container: collector.Container,
|
||||
Container: v1alpha1.Expression(collector.Container),
|
||||
}
|
||||
if collector.Tail != 0 {
|
||||
op.Tail = ptr.To(collector.Tail)
|
||||
|
@ -531,10 +529,10 @@ func testAssert(to *v1alpha1.TestStepSpec, in unstructured.Unstructured) error {
|
|||
Events: &v1alpha1.Events{
|
||||
ActionObjectSelector: v1alpha1.ActionObjectSelector{
|
||||
ObjectName: v1alpha1.ObjectName{
|
||||
Name: collector.Pod,
|
||||
Namespace: collector.Namespace,
|
||||
Name: v1alpha1.Expression(collector.Pod),
|
||||
Namespace: v1alpha1.Expression(collector.Namespace),
|
||||
},
|
||||
Selector: collector.Selector,
|
||||
Selector: v1alpha1.Expression(collector.Selector),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
@ -12,8 +12,10 @@ 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"
|
||||
"github.com/kyverno/chainsaw/pkg/runner/failer"
|
||||
enginecontext "github.com/kyverno/chainsaw/pkg/runner/context"
|
||||
runnerflags "github.com/kyverno/chainsaw/pkg/runner/flags"
|
||||
flagutils "github.com/kyverno/chainsaw/pkg/utils/flag"
|
||||
fsutils "github.com/kyverno/chainsaw/pkg/utils/fs"
|
||||
restutils "github.com/kyverno/chainsaw/pkg/utils/rest"
|
||||
|
@ -40,6 +42,7 @@ type options struct {
|
|||
testDirs []string
|
||||
skipDelete bool
|
||||
template bool
|
||||
defaultCompiler string
|
||||
failFast bool
|
||||
parallel int
|
||||
repeatCount int
|
||||
|
@ -61,6 +64,8 @@ type options struct {
|
|||
values []string
|
||||
clusters []string
|
||||
remarshal bool
|
||||
shardIndex int
|
||||
shardCount int
|
||||
}
|
||||
|
||||
func Command() *cobra.Command {
|
||||
|
@ -72,26 +77,28 @@ func Command() *cobra.Command {
|
|||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
color.Init(options.noColor, true)
|
||||
clock := clock.RealClock{}
|
||||
out := cmd.OutOrStdout()
|
||||
fmt.Fprintf(out, "Version: %s\n", version.Version())
|
||||
stdOut := cmd.OutOrStdout()
|
||||
stdErr := cmd.ErrOrStderr()
|
||||
stdIn := cmd.InOrStdin()
|
||||
fmt.Fprintf(stdOut, "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(out, "No configuration provided but found default file: %s\n", options.config)
|
||||
fmt.Fprintf(stdOut, "No configuration provided but found default file: %s\n", options.config)
|
||||
}
|
||||
}
|
||||
// try to load configuration file
|
||||
if options.config != "" {
|
||||
fmt.Fprintf(out, "Loading config (%s)...\n", options.config)
|
||||
fmt.Fprintf(stdOut, "Loading config (%s)...\n", options.config)
|
||||
config, err := config.Load(options.config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
configuration = *config
|
||||
} else {
|
||||
fmt.Fprintln(out, "Loading default configuration...")
|
||||
fmt.Fprintln(stdOut, "Loading default configuration...")
|
||||
config, err := config.DefaultConfiguration()
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -127,6 +134,9 @@ 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
|
||||
}
|
||||
|
@ -138,19 +148,28 @@ func Command() *cobra.Command {
|
|||
}
|
||||
if flagutils.IsSet(flags, "report-format") {
|
||||
if configuration.Spec.Report == nil {
|
||||
configuration.Spec.Report = &v1alpha2.ReportOptions{}
|
||||
configuration.Spec.Report = &v1alpha2.ReportOptions{
|
||||
Format: v1alpha2.JSONFormat,
|
||||
Name: "chainsaw-report",
|
||||
}
|
||||
}
|
||||
configuration.Spec.Report.Format = v1alpha2.ReportFormatType(options.reportFormat)
|
||||
}
|
||||
if flagutils.IsSet(flags, "report-path") {
|
||||
if configuration.Spec.Report == nil {
|
||||
configuration.Spec.Report = &v1alpha2.ReportOptions{}
|
||||
configuration.Spec.Report = &v1alpha2.ReportOptions{
|
||||
Format: v1alpha2.JSONFormat,
|
||||
Name: "chainsaw-report",
|
||||
}
|
||||
}
|
||||
configuration.Spec.Report.Path = options.reportPath
|
||||
}
|
||||
if flagutils.IsSet(flags, "report-name") {
|
||||
if configuration.Spec.Report == nil {
|
||||
configuration.Spec.Report = &v1alpha2.ReportOptions{}
|
||||
configuration.Spec.Report = &v1alpha2.ReportOptions{
|
||||
Format: v1alpha2.JSONFormat,
|
||||
Name: "chainsaw-report",
|
||||
}
|
||||
}
|
||||
configuration.Spec.Report.Name = options.reportName
|
||||
}
|
||||
|
@ -210,57 +229,63 @@ func Command() *cobra.Command {
|
|||
if options.pauseOnFailure {
|
||||
configuration.Spec.Execution.Parallel = ptr.To(1)
|
||||
}
|
||||
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)
|
||||
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)
|
||||
if configuration.Spec.Report != nil {
|
||||
fmt.Fprintf(out, "- ReportFormat '%v'\n", configuration.Spec.Report.Format)
|
||||
fmt.Fprintf(out, "- ReportName '%v'\n", configuration.Spec.Report.Name)
|
||||
fmt.Fprintf(stdOut, "- ReportFormat '%v'\n", configuration.Spec.Report.Format)
|
||||
fmt.Fprintf(stdOut, "- ReportName '%v'\n", configuration.Spec.Report.Name)
|
||||
if configuration.Spec.Report.Path != "" {
|
||||
fmt.Fprintf(out, "- ReportPath '%v'\n", configuration.Spec.Report.Path)
|
||||
fmt.Fprintf(stdOut, "- ReportPath '%v'\n", configuration.Spec.Report.Path)
|
||||
}
|
||||
}
|
||||
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)
|
||||
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)
|
||||
if configuration.Spec.Execution.Parallel != nil && *configuration.Spec.Execution.Parallel > 0 {
|
||||
fmt.Fprintf(out, "- Parallel %d\n", *configuration.Spec.Execution.Parallel)
|
||||
fmt.Fprintf(stdOut, "- Parallel %d\n", *configuration.Spec.Execution.Parallel)
|
||||
}
|
||||
if configuration.Spec.Execution.RepeatCount != nil {
|
||||
fmt.Fprintf(out, "- RepeatCount %v\n", *configuration.Spec.Execution.RepeatCount)
|
||||
fmt.Fprintf(stdOut, "- RepeatCount %v\n", *configuration.Spec.Execution.RepeatCount)
|
||||
}
|
||||
if configuration.Spec.Execution.ForceTerminationGracePeriod != nil {
|
||||
fmt.Fprintf(out, "- ForceTerminationGracePeriod %v\n", configuration.Spec.Execution.ForceTerminationGracePeriod.Duration)
|
||||
fmt.Fprintf(stdOut, "- ForceTerminationGracePeriod %v\n", configuration.Spec.Execution.ForceTerminationGracePeriod.Duration)
|
||||
}
|
||||
if configuration.Spec.Cleanup.DelayBeforeCleanup != nil {
|
||||
fmt.Fprintf(out, "- DelayBeforeCleanup %v\n", configuration.Spec.Cleanup.DelayBeforeCleanup.Duration)
|
||||
fmt.Fprintf(stdOut, "- DelayBeforeCleanup %v\n", configuration.Spec.Cleanup.DelayBeforeCleanup.Duration)
|
||||
}
|
||||
if len(options.selector) != 0 {
|
||||
fmt.Fprintf(out, "- Selector %v\n", options.selector)
|
||||
fmt.Fprintf(stdOut, "- Selector %v\n", options.selector)
|
||||
}
|
||||
if len(options.values) != 0 {
|
||||
fmt.Fprintf(out, "- Values %v\n", options.values)
|
||||
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, "- Template %v\n", configuration.Spec.Templating.Enabled)
|
||||
if len(configuration.Spec.Clusters) != 0 {
|
||||
fmt.Fprintf(out, "- Clusters %v\n", configuration.Spec.Clusters)
|
||||
fmt.Fprintf(stdOut, "- Clusters %v\n", configuration.Spec.Clusters)
|
||||
}
|
||||
if options.remarshal {
|
||||
fmt.Fprintf(out, "- Remarshal %v\n", options.remarshal)
|
||||
fmt.Fprintf(stdOut, "- Remarshal %v\n", options.remarshal)
|
||||
}
|
||||
fmt.Fprintf(out, "- NoCluster %v\n", options.noCluster)
|
||||
fmt.Fprintf(out, "- PauseOnFailure %v\n", options.pauseOnFailure)
|
||||
// loading tests
|
||||
fmt.Fprintln(out, "Loading tests...")
|
||||
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...")
|
||||
if err := fsutils.CheckFolders(options.testDirs...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -276,23 +301,33 @@ 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(out, "- %s (%s) - (%s)\n", test.Test.Name, test.BasePath, test.Err)
|
||||
fmt.Fprintf(stdOut, "- %s (%s) - (%s)\n", test.Test.Name, test.BasePath, test.Err)
|
||||
} else {
|
||||
fmt.Fprintf(out, "- %s (%s)\n", test.Test.Name, test.BasePath)
|
||||
fmt.Fprintf(stdOut, "- %s (%s)\n", test.Test.Name, test.BasePath)
|
||||
testToRun = append(testToRun, test)
|
||||
}
|
||||
}
|
||||
// loading tests
|
||||
fmt.Fprintln(out, "Loading values...")
|
||||
// load values
|
||||
fmt.Fprintln(stdOut, "Loading values...")
|
||||
values, err := values.Load(options.values...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// run tests
|
||||
fmt.Fprintln(out, "Running tests...")
|
||||
fmt.Fprintln(stdOut, "Running tests...")
|
||||
var restConfig *rest.Config
|
||||
if !options.noCluster {
|
||||
cfg, err := restutils.DefaultConfig(options.kubeConfigOverrides)
|
||||
|
@ -301,21 +336,44 @@ func Command() *cobra.Command {
|
|||
}
|
||||
restConfig = cfg
|
||||
}
|
||||
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())
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
fmt.Fprintln(out, "Done with error.")
|
||||
} else if summary != nil && summary.Failed() > 0 {
|
||||
fmt.Fprintln(out, "Done with failures.")
|
||||
fmt.Fprintln(stdOut, "Done with error.")
|
||||
} else if tc.Failed() > 0 {
|
||||
fmt.Fprintln(stdOut, "Done with failures.")
|
||||
err = errors.New("some tests failed")
|
||||
} else {
|
||||
fmt.Fprintln(out, "Done.")
|
||||
fmt.Fprintln(stdOut, "Done.")
|
||||
}
|
||||
return err
|
||||
},
|
||||
|
@ -349,6 +407,7 @@ 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")
|
||||
|
@ -356,7 +415,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|nil)")
|
||||
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
|
||||
|
@ -369,6 +428,9 @@ 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,6 +11,7 @@ import (
|
|||
)
|
||||
|
||||
func TestChainsawCommand(t *testing.T) {
|
||||
path := "../../../.temp"
|
||||
basePath := "../../../testdata/commands/test"
|
||||
tests := []struct {
|
||||
name string
|
||||
|
@ -116,6 +117,8 @@ 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"),
|
||||
|
@ -135,6 +138,8 @@ 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,6 +81,13 @@ 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+|\(.+\))$
|
||||
|
@ -96,7 +103,6 @@ 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
|
||||
|
@ -129,6 +135,13 @@ 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+|\(.+\))$
|
||||
|
@ -148,9 +161,15 @@ 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.
|
||||
|
@ -164,6 +183,10 @@ 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.
|
||||
|
@ -172,9 +195,19 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for command.
|
||||
type: string
|
||||
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:
|
||||
|
@ -188,6 +221,13 @@ 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+|\(.+\))$
|
||||
|
@ -242,11 +282,9 @@ 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
|
||||
|
@ -544,6 +582,13 @@ 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+|\(.+\))$
|
||||
|
@ -559,7 +604,6 @@ 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
|
||||
|
@ -593,6 +637,13 @@ 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+|\(.+\))$
|
||||
|
@ -612,9 +663,15 @@ 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.
|
||||
|
@ -628,6 +685,10 @@ 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.
|
||||
|
@ -636,6 +697,9 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for script.
|
||||
type: string
|
||||
type: object
|
||||
sleep:
|
||||
description: Sleep defines zzzz.
|
||||
|
@ -715,7 +779,6 @@ spec:
|
|||
type: string
|
||||
required:
|
||||
- path
|
||||
- value
|
||||
type: object
|
||||
type: object
|
||||
format:
|
||||
|
@ -768,6 +831,13 @@ 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.
|
||||
|
@ -811,8 +881,14 @@ 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
|
||||
|
@ -826,11 +902,14 @@ spec:
|
|||
type: integer
|
||||
reportFormat:
|
||||
description: |-
|
||||
ReportFormat determines test report format (JSON|XML|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
|
||||
- XML
|
||||
- JUNIT-TEST
|
||||
- JUNIT-STEP
|
||||
- JUNIT-OPERATION
|
||||
type: string
|
||||
reportName:
|
||||
default: chainsaw-report
|
||||
|
@ -1029,6 +1108,13 @@ 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+|\(.+\))$
|
||||
|
@ -1044,7 +1130,6 @@ 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
|
||||
|
@ -1078,6 +1163,13 @@ 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+|\(.+\))$
|
||||
|
@ -1097,9 +1189,15 @@ 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.
|
||||
|
@ -1113,6 +1211,10 @@ 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.
|
||||
|
@ -1121,9 +1223,19 @@ spec:
|
|||
description: Timeout for the operation. Overrides the
|
||||
global timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for command.
|
||||
type: string
|
||||
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:
|
||||
|
@ -1137,6 +1249,13 @@ 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+|\(.+\))$
|
||||
|
@ -1191,11 +1310,9 @@ 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
|
||||
|
@ -1496,6 +1613,13 @@ 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+|\(.+\))$
|
||||
|
@ -1511,7 +1635,6 @@ 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
|
||||
|
@ -1545,6 +1668,13 @@ 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+|\(.+\))$
|
||||
|
@ -1564,9 +1694,15 @@ 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.
|
||||
|
@ -1580,6 +1716,10 @@ 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.
|
||||
|
@ -1588,6 +1728,9 @@ spec:
|
|||
description: Timeout for the operation. Overrides the
|
||||
global timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for script.
|
||||
type: string
|
||||
type: object
|
||||
sleep:
|
||||
description: Sleep defines zzzz.
|
||||
|
@ -1668,7 +1811,6 @@ spec:
|
|||
type: string
|
||||
required:
|
||||
- path
|
||||
- value
|
||||
type: object
|
||||
type: object
|
||||
format:
|
||||
|
@ -1735,6 +1877,13 @@ 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.
|
||||
|
@ -1743,7 +1892,6 @@ 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:
|
||||
|
@ -1751,10 +1899,14 @@ spec:
|
|||
properties:
|
||||
format:
|
||||
default: JSON
|
||||
description: ReportFormat determines test report format (JSON|XML).
|
||||
description: ReportFormat determines test report format (JSON,
|
||||
XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION).
|
||||
enum:
|
||||
- JSON
|
||||
- XML
|
||||
- JUNIT-TEST
|
||||
- JUNIT-STEP
|
||||
- JUNIT-OPERATION
|
||||
type: string
|
||||
name:
|
||||
default: chainsaw-report
|
||||
|
@ -1769,6 +1921,13 @@ 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,6 +45,13 @@ 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+|\(.+\))$
|
||||
|
@ -97,6 +104,13 @@ 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+|\(.+\))$
|
||||
|
@ -112,7 +126,6 @@ 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
|
||||
|
@ -145,6 +158,13 @@ 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+|\(.+\))$
|
||||
|
@ -164,9 +184,15 @@ 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.
|
||||
|
@ -180,6 +206,10 @@ 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.
|
||||
|
@ -188,9 +218,19 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for command.
|
||||
type: string
|
||||
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:
|
||||
|
@ -204,6 +244,13 @@ 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+|\(.+\))$
|
||||
|
@ -258,11 +305,9 @@ 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
|
||||
|
@ -560,6 +605,13 @@ 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+|\(.+\))$
|
||||
|
@ -575,7 +627,6 @@ 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
|
||||
|
@ -609,6 +660,13 @@ 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+|\(.+\))$
|
||||
|
@ -628,9 +686,15 @@ 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.
|
||||
|
@ -644,6 +708,10 @@ 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.
|
||||
|
@ -652,6 +720,9 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for script.
|
||||
type: string
|
||||
type: object
|
||||
sleep:
|
||||
description: Sleep defines zzzz.
|
||||
|
@ -731,7 +802,6 @@ spec:
|
|||
type: string
|
||||
required:
|
||||
- path
|
||||
- value
|
||||
type: object
|
||||
type: object
|
||||
format:
|
||||
|
@ -808,6 +878,13 @@ 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+|\(.+\))$
|
||||
|
@ -823,7 +900,6 @@ 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
|
||||
|
@ -856,6 +932,13 @@ 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+|\(.+\))$
|
||||
|
@ -875,9 +958,15 @@ 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.
|
||||
|
@ -891,6 +980,10 @@ 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.
|
||||
|
@ -899,9 +992,19 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for command.
|
||||
type: string
|
||||
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:
|
||||
|
@ -915,6 +1018,13 @@ 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+|\(.+\))$
|
||||
|
@ -969,11 +1079,9 @@ 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
|
||||
|
@ -1271,6 +1379,13 @@ 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+|\(.+\))$
|
||||
|
@ -1286,7 +1401,6 @@ 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
|
||||
|
@ -1320,6 +1434,13 @@ 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+|\(.+\))$
|
||||
|
@ -1339,9 +1460,15 @@ 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.
|
||||
|
@ -1355,6 +1482,10 @@ 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.
|
||||
|
@ -1363,6 +1494,9 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for script.
|
||||
type: string
|
||||
type: object
|
||||
sleep:
|
||||
description: Sleep defines zzzz.
|
||||
|
@ -1442,7 +1576,6 @@ spec:
|
|||
type: string
|
||||
required:
|
||||
- path
|
||||
- value
|
||||
type: object
|
||||
type: object
|
||||
format:
|
||||
|
@ -1519,6 +1652,13 @@ 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+|\(.+\))$
|
||||
|
@ -1534,7 +1674,6 @@ 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
|
||||
|
@ -1567,6 +1706,13 @@ 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+|\(.+\))$
|
||||
|
@ -1586,9 +1732,15 @@ 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.
|
||||
|
@ -1602,6 +1754,10 @@ 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.
|
||||
|
@ -1610,9 +1766,19 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for command.
|
||||
type: string
|
||||
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:
|
||||
|
@ -1626,6 +1792,13 @@ 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+|\(.+\))$
|
||||
|
@ -1680,11 +1853,9 @@ 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
|
||||
|
@ -1982,6 +2153,13 @@ 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+|\(.+\))$
|
||||
|
@ -1997,7 +2175,6 @@ 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
|
||||
|
@ -2031,6 +2208,13 @@ 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+|\(.+\))$
|
||||
|
@ -2050,9 +2234,15 @@ 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.
|
||||
|
@ -2066,6 +2256,10 @@ 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.
|
||||
|
@ -2074,6 +2268,9 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for script.
|
||||
type: string
|
||||
type: object
|
||||
sleep:
|
||||
description: Sleep defines zzzz.
|
||||
|
@ -2153,7 +2350,6 @@ spec:
|
|||
type: string
|
||||
required:
|
||||
- path
|
||||
- value
|
||||
type: object
|
||||
type: object
|
||||
format:
|
||||
|
@ -2242,6 +2438,13 @@ 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+|\(.+\))$
|
||||
|
@ -2290,11 +2493,9 @@ 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
|
||||
|
@ -2313,9 +2514,15 @@ 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.
|
||||
|
@ -2357,6 +2564,13 @@ 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+|\(.+\))$
|
||||
|
@ -2399,7 +2613,6 @@ 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
|
||||
|
@ -2424,6 +2637,13 @@ 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+|\(.+\))$
|
||||
|
@ -2439,7 +2659,6 @@ 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
|
||||
|
@ -2472,6 +2691,13 @@ 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+|\(.+\))$
|
||||
|
@ -2491,9 +2717,15 @@ 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.
|
||||
|
@ -2507,6 +2739,10 @@ 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.
|
||||
|
@ -2515,9 +2751,19 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for command.
|
||||
type: string
|
||||
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.
|
||||
|
@ -2536,6 +2782,13 @@ 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+|\(.+\))$
|
||||
|
@ -2584,11 +2837,9 @@ 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
|
||||
|
@ -2607,9 +2858,15 @@ 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.
|
||||
|
@ -2650,6 +2907,13 @@ 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+|\(.+\))$
|
||||
|
@ -2704,11 +2968,9 @@ 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
|
||||
|
@ -2840,6 +3102,13 @@ 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+|\(.+\))$
|
||||
|
@ -2882,7 +3151,6 @@ 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
|
||||
|
@ -3021,6 +3289,13 @@ 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+|\(.+\))$
|
||||
|
@ -3069,11 +3344,9 @@ 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
|
||||
|
@ -3092,9 +3365,15 @@ 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.
|
||||
|
@ -3229,9 +3508,15 @@ 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.
|
||||
|
@ -3270,6 +3555,13 @@ 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+|\(.+\))$
|
||||
|
@ -3285,7 +3577,6 @@ 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
|
||||
|
@ -3319,6 +3610,13 @@ 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+|\(.+\))$
|
||||
|
@ -3338,9 +3636,15 @@ 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.
|
||||
|
@ -3354,6 +3658,10 @@ 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.
|
||||
|
@ -3362,6 +3670,9 @@ spec:
|
|||
description: Timeout for the operation. Overrides the global
|
||||
timeout set in the Configuration.
|
||||
type: string
|
||||
workDir:
|
||||
description: WorkDir is the working directory for script.
|
||||
type: string
|
||||
type: object
|
||||
sleep:
|
||||
description: Sleep defines zzzz.
|
||||
|
@ -3385,6 +3696,13 @@ 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+|\(.+\))$
|
||||
|
@ -3433,11 +3751,9 @@ 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
|
||||
|
@ -3456,9 +3772,15 @@ 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,7 +3877,6 @@ spec:
|
|||
type: string
|
||||
required:
|
||||
- path
|
||||
- value
|
||||
type: object
|
||||
type: object
|
||||
format:
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -46,7 +46,6 @@ func TestSchemas(t *testing.T) {
|
|||
"configuration-chainsaw-v1alpha2.json",
|
||||
"steptemplate-chainsaw-v1alpha1.json",
|
||||
"test-chainsaw-v1alpha1.json",
|
||||
"test-chainsaw-v1alpha2.json",
|
||||
}
|
||||
for _, file := range files {
|
||||
file, err := fs.Stat(data, file)
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
],
|
||||
"default": ""
|
||||
},
|
||||
"x-kubernetes-list-type": "set",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
"generateName": {
|
||||
|
@ -207,7 +208,8 @@
|
|||
"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",
|
||||
|
@ -285,6 +287,10 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"x-kubernetes-list-map-keys": [
|
||||
"uid"
|
||||
],
|
||||
"x-kubernetes-list-type": "map",
|
||||
"x-kubernetes-patch-merge-key": "uid",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
|
@ -421,6 +427,17 @@
|
|||
"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",
|
||||
|
@ -436,10 +453,6 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -501,6 +514,17 @@
|
|||
"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",
|
||||
|
@ -531,12 +555,19 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"object",
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -552,6 +583,13 @@
|
|||
"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": [
|
||||
|
@ -565,10 +603,28 @@
|
|||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"workDir": {
|
||||
"description": "WorkDir is the working directory for command.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"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": [
|
||||
|
@ -599,6 +655,17 @@
|
|||
"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",
|
||||
|
@ -680,15 +747,10 @@
|
|||
"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
|
||||
}
|
||||
},
|
||||
|
@ -1188,6 +1250,17 @@
|
|||
"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",
|
||||
|
@ -1203,10 +1276,6 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -1271,6 +1340,17 @@
|
|||
"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",
|
||||
|
@ -1301,12 +1381,19 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"object",
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -1322,6 +1409,13 @@
|
|||
"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": [
|
||||
|
@ -1335,6 +1429,13 @@
|
|||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"workDir": {
|
||||
"description": "WorkDir is the working directory for script.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
@ -1458,8 +1559,7 @@
|
|||
"null"
|
||||
],
|
||||
"required": [
|
||||
"path",
|
||||
"value"
|
||||
"path"
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
|
@ -1468,7 +1568,10 @@
|
|||
},
|
||||
"value": {
|
||||
"description": "Value defines the expected value to wait for, e.g., \"Running\".",
|
||||
"type": "string"
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
@ -1554,6 +1657,17 @@
|
|||
"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": [
|
||||
|
@ -1618,11 +1732,18 @@
|
|||
},
|
||||
"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": [
|
||||
"object",
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"parallel": {
|
||||
"description": "The maximum number of tests to run at once.",
|
||||
|
@ -1643,14 +1764,17 @@
|
|||
"minimum": 1
|
||||
},
|
||||
"reportFormat": {
|
||||
"description": "ReportFormat determines test report format (JSON|XML|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"
|
||||
],
|
||||
"enum": [
|
||||
"JSON",
|
||||
"XML"
|
||||
"XML",
|
||||
"JUNIT-TEST",
|
||||
"JUNIT-STEP",
|
||||
"JUNIT-OPERATION"
|
||||
]
|
||||
},
|
||||
"reportName": {
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
],
|
||||
"default": ""
|
||||
},
|
||||
"x-kubernetes-list-type": "set",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
"generateName": {
|
||||
|
@ -207,7 +208,8 @@
|
|||
"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",
|
||||
|
@ -285,6 +287,10 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"x-kubernetes-list-map-keys": [
|
||||
"uid"
|
||||
],
|
||||
"x-kubernetes-list-type": "map",
|
||||
"x-kubernetes-patch-merge-key": "uid",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
},
|
||||
|
@ -549,6 +555,17 @@
|
|||
"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",
|
||||
|
@ -564,10 +581,6 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -629,6 +642,17 @@
|
|||
"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",
|
||||
|
@ -659,12 +683,19 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"object",
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -680,6 +711,13 @@
|
|||
"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": [
|
||||
|
@ -693,10 +731,28 @@
|
|||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"workDir": {
|
||||
"description": "WorkDir is the working directory for command.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"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": [
|
||||
|
@ -727,6 +783,17 @@
|
|||
"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",
|
||||
|
@ -808,15 +875,10 @@
|
|||
"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
|
||||
}
|
||||
},
|
||||
|
@ -1316,6 +1378,17 @@
|
|||
"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",
|
||||
|
@ -1331,10 +1404,6 @@
|
|||
},
|
||||
"check": {
|
||||
"description": "Check is an assertion tree to validate the operation outcome.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"cluster": {
|
||||
|
@ -1399,6 +1468,17 @@
|
|||
"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",
|
||||
|
@ -1429,12 +1509,19 @@
|
|||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"compiler": {
|
||||
"description": "Compiler defines the default compiler to use when evaluating expressions.",
|
||||
"type": [
|
||||
"object",
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"jp",
|
||||
"cel"
|
||||
]
|
||||
},
|
||||
"match": {
|
||||
"description": "Match defines the matching statement.",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"name": {
|
||||
|
@ -1450,6 +1537,13 @@
|
|||
"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": [
|
||||
|
@ -1463,6 +1557,13 @@
|
|||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"workDir": {
|
||||
"description": "WorkDir is the working directory for script.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
@ -1586,8 +1687,7 @@
|
|||
"null"
|
||||
],
|
||||
"required": [
|
||||
"path",
|
||||
"value"
|
||||
"path"
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
|
@ -1596,7 +1696,10 @@
|
|||
},
|
||||
"value": {
|
||||
"description": "Value defines the expected value to wait for, e.g., \"Running\".",
|
||||
"type": "string"
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
@ -1705,6 +1808,17 @@
|
|||
],
|
||||
"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": [
|
||||
|
@ -1714,10 +1828,6 @@
|
|||
},
|
||||
"template": {
|
||||
"description": "Template defines a template to create the test namespace.",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
}
|
||||
},
|
||||
|
@ -1731,7 +1841,7 @@
|
|||
],
|
||||
"properties": {
|
||||
"format": {
|
||||
"description": "ReportFormat determines test report format (JSON|XML).",
|
||||
"description": "ReportFormat determines test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION).",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
|
@ -1739,7 +1849,10 @@
|
|||
"default": "JSON",
|
||||
"enum": [
|
||||
"JSON",
|
||||
"XML"
|
||||
"XML",
|
||||
"JUNIT-TEST",
|
||||
"JUNIT-STEP",
|
||||
"JUNIT-OPERATION"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
|
@ -1768,6 +1881,17 @@
|
|||
],
|
||||
"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
File diff suppressed because it is too large
Load Diff
|
@ -3,6 +3,7 @@ package discovery
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"maps"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
|
@ -11,7 +12,6 @@ import (
|
|||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/loaders/steptemplate"
|
||||
"github.com/kyverno/chainsaw/pkg/loaders/test"
|
||||
"golang.org/x/exp/maps"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
|
@ -58,7 +58,7 @@ func LoadTest(fileName string, path string, remarshal bool) ([]Test, error) {
|
|||
for _, apiTest := range apiTests {
|
||||
for step := range apiTest.Spec.Steps {
|
||||
step := &apiTest.Spec.Steps[step]
|
||||
if step.Use != nil && step.Use.Template != "" {
|
||||
if step.Use != nil {
|
||||
steptpl, err := steptemplate.Load(filepath.Join(path, step.Use.Template), remarshal)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -66,12 +66,14 @@ func LoadTest(fileName string, path string, remarshal bool) ([]Test, error) {
|
|||
if len(steptpl) != 1 {
|
||||
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.Try = append(step.Try, template.Spec.Try...)
|
||||
step.Catch = append(step.Catch, template.Spec.Catch...)
|
||||
step.Finally = append(step.Finally, template.Spec.Finally...)
|
||||
step.Cleanup = append(step.Cleanup, template.Spec.Cleanup...)
|
||||
step.Use = nil
|
||||
step.Bindings = append(step.Bindings, steptpl[0].Spec.Bindings...)
|
||||
step.Try = append(step.Try, steptpl[0].Spec.Try...)
|
||||
step.Catch = append(step.Catch, steptpl[0].Spec.Catch...)
|
||||
step.Finally = append(step.Finally, steptpl[0].Spec.Finally...)
|
||||
step.Cleanup = append(step.Cleanup, steptpl[0].Spec.Cleanup...)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -93,8 +95,6 @@ func LoadTest(fileName string, path string, remarshal bool) ([]Test, error) {
|
|||
if len(steps) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
keys := maps.Keys(steps)
|
||||
slices.Sort(keys)
|
||||
test := &v1alpha1.Test{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
APIVersion: v1alpha1.SchemeGroupVersion.String(),
|
||||
|
@ -104,38 +104,38 @@ func LoadTest(fileName string, path string, remarshal bool) ([]Test, error) {
|
|||
Name: strings.ToLower(strings.ReplaceAll(filepath.Base(path), "_", "-")),
|
||||
},
|
||||
}
|
||||
for _, key := range keys {
|
||||
for _, key := range slices.Sorted(maps.Keys(steps)) {
|
||||
step := v1alpha1.TestStep{
|
||||
Name: fmt.Sprintf("step-%s", key),
|
||||
}
|
||||
for _, file := range steps[key].OtherFiles {
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
Apply: &v1alpha1.Apply{
|
||||
ActionResourceRef: v1alpha1.ActionResourceRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
File: file,
|
||||
File: v1alpha1.Expression(file),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
for _, file := range steps[key].AssertFiles {
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
Assert: &v1alpha1.Assert{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
File: file,
|
||||
File: v1alpha1.Expression(file),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
for _, file := range steps[key].ErrorFiles {
|
||||
step.TestStepSpec.Try = append(step.TestStepSpec.Try, v1alpha1.Operation{
|
||||
step.Try = append(step.Try, v1alpha1.Operation{
|
||||
Error: &v1alpha1.Error{
|
||||
ActionCheckRef: v1alpha1.ActionCheckRef{
|
||||
FileRef: v1alpha1.FileRef{
|
||||
File: file,
|
||||
File: v1alpha1.Expression(file),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -5,9 +5,10 @@ import (
|
|||
"fmt"
|
||||
"regexp"
|
||||
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"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+$`)
|
||||
|
@ -19,19 +20,22 @@ func checkBindingName(name string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func RegisterBinding(ctx context.Context, bindings binding.Bindings, name string, value any) binding.Bindings {
|
||||
return bindings.Register("$"+name, binding.NewBinding(value))
|
||||
func RegisterBinding(bindings apis.Bindings, name string, value any) apis.Bindings {
|
||||
return bindings.Register("$"+name, apis.NewBinding(value))
|
||||
}
|
||||
|
||||
func ResolveBinding(ctx context.Context, bindings binding.Bindings, input any, variable v1alpha1.Binding) (string, any, error) {
|
||||
name, err := templating.String(ctx, variable.Name, bindings)
|
||||
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)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
if err := checkBindingName(name); err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
value, err := templating.Template(ctx, variable.Value, input, bindings)
|
||||
if variable.Compiler != nil {
|
||||
compilers = compilers.WithDefaultCompiler(string(*variable.Compiler))
|
||||
}
|
||||
value, err := templating.Template(ctx, compilers, variable.Value, input, bindings)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"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 binding.Bindings
|
||||
bindings apis.Bindings
|
||||
bindingName string
|
||||
value any
|
||||
}{{
|
||||
bindings: binding.NewBindings(),
|
||||
bindings: apis.NewBindings(),
|
||||
bindingName: "foo",
|
||||
value: "bar",
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
bindings := RegisterBinding(context.TODO(), tt.bindings, tt.bindingName, tt.value)
|
||||
bindings := RegisterBinding(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 binding.Bindings
|
||||
bindings apis.Bindings
|
||||
input any
|
||||
variable v1alpha1.Binding
|
||||
wantName string
|
||||
|
@ -79,49 +79,49 @@ func TestResolveBinding(t *testing.T) {
|
|||
wantErr bool
|
||||
}{{
|
||||
name: "ok",
|
||||
bindings: binding.NewBindings(),
|
||||
bindings: apis.NewBindings(),
|
||||
input: nil,
|
||||
variable: v1alpha1.Binding{
|
||||
Name: "foo",
|
||||
Value: v1alpha1.Any{Value: "bar"},
|
||||
Value: v1alpha1.NewProjection("bar"),
|
||||
},
|
||||
wantName: "foo",
|
||||
wantValue: "bar",
|
||||
wantErr: false,
|
||||
}, {
|
||||
name: "error",
|
||||
bindings: binding.NewBindings(),
|
||||
bindings: apis.NewBindings(),
|
||||
input: nil,
|
||||
variable: v1alpha1.Binding{
|
||||
Name: "$foo",
|
||||
Value: v1alpha1.Any{Value: "bar"},
|
||||
Value: v1alpha1.NewProjection("bar"),
|
||||
},
|
||||
wantErr: true,
|
||||
}, {
|
||||
name: "error",
|
||||
bindings: binding.NewBindings(),
|
||||
bindings: apis.NewBindings(),
|
||||
input: nil,
|
||||
variable: v1alpha1.Binding{
|
||||
Name: "foo",
|
||||
Value: v1alpha1.Any{Value: "($bar)"},
|
||||
Value: v1alpha1.NewProjection("($bar)"),
|
||||
},
|
||||
wantErr: true,
|
||||
}, {
|
||||
name: "error",
|
||||
bindings: binding.NewBindings(),
|
||||
bindings: apis.NewBindings(),
|
||||
input: nil,
|
||||
variable: v1alpha1.Binding{
|
||||
Name: "($foo)",
|
||||
Value: v1alpha1.Any{Value: "bar"},
|
||||
Value: v1alpha1.NewProjection("bar"),
|
||||
},
|
||||
wantErr: true,
|
||||
}, {
|
||||
name: "error",
|
||||
bindings: binding.NewBindings().Register("$foo", binding.NewBinding("abc")).Register("$bar", binding.NewBinding("def")),
|
||||
bindings: apis.NewBindings().Register("$foo", apis.NewBinding("abc")).Register("$bar", apis.NewBinding("def")),
|
||||
input: nil,
|
||||
variable: v1alpha1.Binding{
|
||||
Name: "($foo)",
|
||||
Value: v1alpha1.Any{Value: "($bar)"},
|
||||
Value: v1alpha1.NewProjection("($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(), tt.bindings, tt.input, tt.variable)
|
||||
name, value, err := ResolveBinding(context.TODO(), apis.DefaultCompilers, tt.bindings, tt.input, tt.variable)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
} else {
|
||||
|
|
|
@ -4,23 +4,25 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/engine/functions"
|
||||
"github.com/kyverno/kyverno-json/pkg/engine/assert"
|
||||
"github.com/kyverno/kyverno-json/pkg/engine/template"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
)
|
||||
|
||||
func Check(ctx context.Context, obj any, bindings binding.Bindings, check *v1alpha1.Check) (field.ErrorList, error) {
|
||||
func Check(ctx context.Context, compilers compilers.Compilers, obj any, bindings apis.Bindings, check *v1alpha1.Check) (field.ErrorList, error) {
|
||||
if check == nil {
|
||||
return nil, errors.New("check is null")
|
||||
}
|
||||
if check.Value == nil {
|
||||
if check.IsNil() {
|
||||
return nil, errors.New("check value is null")
|
||||
}
|
||||
if bindings == nil {
|
||||
bindings = binding.NewBindings()
|
||||
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)
|
||||
}
|
||||
return assert.Assert(ctx, nil, assert.Parse(ctx, check.Value), obj, bindings, template.WithFunctionCaller(functions.Caller()))
|
||||
}
|
||||
|
|
|
@ -4,17 +4,18 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"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 binding.Bindings
|
||||
bindings apis.Bindings
|
||||
check *v1alpha1.Check
|
||||
want field.ErrorList
|
||||
wantErr bool
|
||||
|
@ -38,11 +39,11 @@ func TestCheck(t *testing.T) {
|
|||
"foo": "bar",
|
||||
},
|
||||
bindings: nil,
|
||||
check: &v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
check: ptr.To(v1alpha1.NewCheck(
|
||||
map[string]any{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
)),
|
||||
want: nil,
|
||||
wantErr: false,
|
||||
}, {
|
||||
|
@ -51,11 +52,11 @@ func TestCheck(t *testing.T) {
|
|||
"foo": "bar",
|
||||
},
|
||||
bindings: nil,
|
||||
check: &v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
check: ptr.To(v1alpha1.NewCheck(
|
||||
map[string]any{
|
||||
"foo": "baz",
|
||||
},
|
||||
},
|
||||
)),
|
||||
want: []*field.Error{{
|
||||
Type: field.ErrorTypeInvalid,
|
||||
Field: "foo",
|
||||
|
@ -66,7 +67,7 @@ func TestCheck(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := Check(context.TODO(), tt.obj, tt.bindings, tt.check)
|
||||
got, err := Check(context.TODO(), apis.DefaultCompilers, tt.obj, tt.bindings, tt.check)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
} else {
|
||||
|
|
|
@ -3,27 +3,28 @@ package checks
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"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, obj unstructured.Unstructured, bindings binding.Bindings, expect ...v1alpha1.Expectation) (bool, error) {
|
||||
func Expect(ctx context.Context, compilers compilers.Compilers, obj unstructured.Unstructured, bindings apis.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.Value != nil {
|
||||
if errs, err := Check(ctx, obj.UnstructuredContent(), nil, expectation.Match); err != nil {
|
||||
if expectation.Match != nil && !expectation.Match.IsNil() {
|
||||
if errs, err := Check(ctx, compilers, obj.UnstructuredContent(), nil, expectation.Match); err != nil {
|
||||
return true, err
|
||||
} else if len(errs) != 0 {
|
||||
continue
|
||||
}
|
||||
}
|
||||
matched = true
|
||||
if errs, err := Check(ctx, obj.UnstructuredContent(), bindings, ptr.To(expectation.Check)); err != nil {
|
||||
if errs, err := Check(ctx, compilers, obj.UnstructuredContent(), bindings, ptr.To(expectation.Check)); err != nil {
|
||||
return true, err
|
||||
} else {
|
||||
results = append(results, errs...)
|
||||
|
|
|
@ -4,17 +4,18 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"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 binding.Bindings
|
||||
bindings apis.Bindings
|
||||
expect []v1alpha1.Expectation
|
||||
want bool
|
||||
wantErr bool
|
||||
|
@ -41,16 +42,16 @@ func TestExpectations(t *testing.T) {
|
|||
},
|
||||
bindings: nil,
|
||||
expect: []v1alpha1.Expectation{{
|
||||
Match: &v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
Match: ptr.To(v1alpha1.NewMatch(
|
||||
map[string]any{
|
||||
"foo": "baz",
|
||||
},
|
||||
},
|
||||
Check: v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
)),
|
||||
Check: v1alpha1.NewCheck(
|
||||
map[string]any{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
),
|
||||
}},
|
||||
want: false,
|
||||
wantErr: false,
|
||||
|
@ -63,16 +64,16 @@ func TestExpectations(t *testing.T) {
|
|||
},
|
||||
bindings: nil,
|
||||
expect: []v1alpha1.Expectation{{
|
||||
Match: &v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
Match: ptr.To(v1alpha1.NewMatch(
|
||||
map[string]any{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
Check: v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
)),
|
||||
Check: v1alpha1.NewCheck(
|
||||
map[string]any{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
),
|
||||
}},
|
||||
want: true,
|
||||
wantErr: false,
|
||||
|
@ -85,16 +86,16 @@ func TestExpectations(t *testing.T) {
|
|||
},
|
||||
bindings: nil,
|
||||
expect: []v1alpha1.Expectation{{
|
||||
Match: &v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
Match: ptr.To(v1alpha1.NewMatch(
|
||||
map[string]any{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
Check: v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
)),
|
||||
Check: v1alpha1.NewCheck(
|
||||
map[string]any{
|
||||
"(foo())": "bar",
|
||||
},
|
||||
},
|
||||
),
|
||||
}},
|
||||
want: true,
|
||||
wantErr: true,
|
||||
|
@ -107,23 +108,23 @@ func TestExpectations(t *testing.T) {
|
|||
},
|
||||
bindings: nil,
|
||||
expect: []v1alpha1.Expectation{{
|
||||
Match: &v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
Match: ptr.To(v1alpha1.NewMatch(
|
||||
map[string]any{
|
||||
"(foo())": "bar",
|
||||
},
|
||||
},
|
||||
Check: v1alpha1.Check{
|
||||
Value: map[string]any{
|
||||
)),
|
||||
Check: v1alpha1.NewCheck(
|
||||
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(), tt.obj, tt.bindings, tt.expect...)
|
||||
got, err := Expect(context.TODO(), apis.DefaultCompilers, 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/engine/logging"
|
||||
"github.com/kyverno/chainsaw/pkg/logging"
|
||||
"github.com/kyverno/pkg/ext/output/color"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
@ -94,15 +94,9 @@ func (c *runnerClient) RESTMapper() meta.RESTMapper {
|
|||
}
|
||||
|
||||
func (c *runnerClient) ok(ctx context.Context, op logging.Operation, obj client.Object) {
|
||||
logger := logging.FromContext(ctx)
|
||||
if logger != nil {
|
||||
logger.WithResource(obj).Log(op, logging.OkStatus, color.BoldGreen)
|
||||
}
|
||||
logging.Log(ctx, op, logging.OkStatus, obj, color.BoldGreen)
|
||||
}
|
||||
|
||||
func (c *runnerClient) error(ctx context.Context, op logging.Operation, obj client.Object, err error) {
|
||||
logger := logging.FromContext(ctx)
|
||||
if logger != nil {
|
||||
logger.WithResource(obj).Log(op, logging.ErrorStatus, color.BoldYellow, logging.ErrSection(err))
|
||||
}
|
||||
logging.Log(ctx, op, logging.OkStatus, obj, 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/engine/logging"
|
||||
tlogging "github.com/kyverno/chainsaw/pkg/engine/logging/testing"
|
||||
"github.com/kyverno/chainsaw/pkg/logging"
|
||||
"github.com/kyverno/chainsaw/pkg/mocks"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
@ -48,7 +48,6 @@ 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
|
||||
|
@ -56,10 +55,6 @@ 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{
|
||||
|
@ -77,10 +72,6 @@ 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{
|
||||
|
@ -98,10 +89,6 @@ 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{
|
||||
|
@ -122,10 +109,6 @@ 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{
|
||||
|
@ -147,12 +130,12 @@ func Test_runnerClient_Get(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
mockLogger := tt.logger(t)
|
||||
logger := &mocks.Logger{}
|
||||
mockClient := tt.inner(t)
|
||||
c := &runnerClient{
|
||||
inner: mockClient,
|
||||
}
|
||||
ctx := logging.IntoContext(context.TODO(), mockLogger)
|
||||
ctx := logging.WithLogger(context.TODO(), logger)
|
||||
err := c.Get(ctx, tt.args.key, tt.args.obj, tt.args.opts...)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
|
@ -160,7 +143,7 @@ func Test_runnerClient_Get(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.innerCalls, mockClient.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, mockLogger.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, logger.NumCalls())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -172,7 +155,6 @@ 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
|
||||
|
@ -180,10 +162,6 @@ 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{
|
||||
|
@ -197,14 +175,10 @@ func Test_runnerClient_Create(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: true,
|
||||
loggerCalls: 2,
|
||||
loggerCalls: 1,
|
||||
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{
|
||||
|
@ -218,17 +192,17 @@ func Test_runnerClient_Create(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: false,
|
||||
loggerCalls: 2,
|
||||
loggerCalls: 1,
|
||||
innerCalls: 1,
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
mockLogger := tt.logger(t)
|
||||
logger := &mocks.Logger{}
|
||||
mockClient := tt.inner(t)
|
||||
c := &runnerClient{
|
||||
inner: mockClient,
|
||||
}
|
||||
ctx := logging.IntoContext(context.TODO(), mockLogger)
|
||||
ctx := logging.WithLogger(context.TODO(), logger)
|
||||
err := c.Create(ctx, tt.args.obj, tt.args.opts...)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
|
@ -236,7 +210,7 @@ func Test_runnerClient_Create(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.innerCalls, mockClient.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, mockLogger.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, logger.NumCalls())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -248,7 +222,6 @@ 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
|
||||
|
@ -256,10 +229,6 @@ 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{
|
||||
|
@ -273,14 +242,10 @@ func Test_runnerClient_Update(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: true,
|
||||
loggerCalls: 2,
|
||||
loggerCalls: 1,
|
||||
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{
|
||||
|
@ -294,17 +259,17 @@ func Test_runnerClient_Update(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: false,
|
||||
loggerCalls: 2,
|
||||
loggerCalls: 1,
|
||||
innerCalls: 1,
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
mockLogger := tt.logger(t)
|
||||
logger := &mocks.Logger{}
|
||||
mockClient := tt.inner(t)
|
||||
c := &runnerClient{
|
||||
inner: mockClient,
|
||||
}
|
||||
ctx := logging.IntoContext(context.TODO(), mockLogger)
|
||||
ctx := logging.WithLogger(context.TODO(), logger)
|
||||
err := c.Update(ctx, tt.args.obj, tt.args.opts...)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
|
@ -312,7 +277,7 @@ func Test_runnerClient_Update(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.innerCalls, mockClient.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, mockLogger.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, logger.NumCalls())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -324,7 +289,6 @@ 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
|
||||
|
@ -332,10 +296,6 @@ 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{
|
||||
|
@ -349,14 +309,10 @@ func Test_runnerClient_Delete(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: true,
|
||||
loggerCalls: 2,
|
||||
loggerCalls: 1,
|
||||
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{
|
||||
|
@ -370,17 +326,17 @@ func Test_runnerClient_Delete(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: false,
|
||||
loggerCalls: 2,
|
||||
loggerCalls: 1,
|
||||
innerCalls: 1,
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
mockLogger := tt.logger(t)
|
||||
logger := &mocks.Logger{}
|
||||
mockClient := tt.inner(t)
|
||||
c := &runnerClient{
|
||||
inner: mockClient,
|
||||
}
|
||||
ctx := logging.IntoContext(context.TODO(), mockLogger)
|
||||
ctx := logging.WithLogger(context.TODO(), logger)
|
||||
err := c.Delete(ctx, tt.args.obj, tt.args.opts...)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
|
@ -388,7 +344,7 @@ func Test_runnerClient_Delete(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.innerCalls, mockClient.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, mockLogger.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, logger.NumCalls())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -400,7 +356,6 @@ 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
|
||||
|
@ -408,10 +363,6 @@ 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{
|
||||
|
@ -429,10 +380,6 @@ 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{
|
||||
|
@ -451,12 +398,12 @@ func Test_runnerClient_List(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
mockLogger := tt.logger(t)
|
||||
logger := &mocks.Logger{}
|
||||
mockClient := tt.inner(t)
|
||||
c := &runnerClient{
|
||||
inner: mockClient,
|
||||
}
|
||||
ctx := logging.IntoContext(context.TODO(), mockLogger)
|
||||
ctx := logging.WithLogger(context.TODO(), logger)
|
||||
err := c.List(ctx, tt.args.obj, tt.args.opts...)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
|
@ -464,7 +411,7 @@ func Test_runnerClient_List(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.innerCalls, mockClient.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, mockLogger.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, logger.NumCalls())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -477,7 +424,6 @@ 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
|
||||
|
@ -485,10 +431,6 @@ 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{
|
||||
|
@ -502,14 +444,10 @@ func Test_runnerClient_Patch(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: true,
|
||||
loggerCalls: 2,
|
||||
loggerCalls: 1,
|
||||
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{
|
||||
|
@ -523,17 +461,17 @@ func Test_runnerClient_Patch(t *testing.T) {
|
|||
opts: nil,
|
||||
},
|
||||
wantErr: false,
|
||||
loggerCalls: 2,
|
||||
loggerCalls: 1,
|
||||
innerCalls: 1,
|
||||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
mockLogger := tt.logger(t)
|
||||
logger := &mocks.Logger{}
|
||||
mockClient := tt.inner(t)
|
||||
c := &runnerClient{
|
||||
inner: mockClient,
|
||||
}
|
||||
ctx := logging.IntoContext(context.TODO(), mockLogger)
|
||||
ctx := logging.WithLogger(context.TODO(), logger)
|
||||
err := c.Patch(ctx, tt.args.obj, tt.args.patch, tt.args.opts...)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
|
@ -541,7 +479,7 @@ func Test_runnerClient_Patch(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.innerCalls, mockClient.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, mockLogger.NumCalls())
|
||||
assert.Equal(t, tt.loggerCalls, logger.NumCalls())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -552,7 +490,6 @@ 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
|
||||
|
@ -560,10 +497,6 @@ 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{
|
||||
|
@ -579,10 +512,6 @@ 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{
|
||||
|
@ -599,10 +528,6 @@ 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, error) {
|
||||
func NewClusterFromConfig(config *rest.Config) Cluster {
|
||||
return &fromConfig{
|
||||
config: config,
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c *fromConfig) Config() (*rest.Config, error) {
|
||||
|
|
|
@ -9,10 +9,9 @@ import (
|
|||
|
||||
func TestNewClusterFromConfig(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
config *rest.Config
|
||||
want Cluster
|
||||
wantErr bool
|
||||
name string
|
||||
config *rest.Config
|
||||
want Cluster
|
||||
}{{
|
||||
name: "nil",
|
||||
want: &fromConfig{
|
||||
|
@ -27,17 +26,11 @@ func TestNewClusterFromConfig(t *testing.T) {
|
|||
}}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
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)
|
||||
}
|
||||
got := NewClusterFromConfig(tt.config)
|
||||
assert.Equal(t, tt.want, got)
|
||||
config, err := got.Config()
|
||||
assert.NoError(t, err)
|
||||
assert.Same(t, tt.config, config)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
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)
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
package context
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"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
|
||||
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{},
|
||||
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/engine/template"
|
||||
"github.com/kyverno/kyverno-json/pkg/jp"
|
||||
)
|
||||
|
||||
var Caller = sync.OnceValue(func() interpreter.FunctionCaller {
|
||||
var funcs []jpfunctions.FunctionEntry
|
||||
funcs = append(funcs, template.GetFunctions(context.Background())...)
|
||||
funcs = append(funcs, jp.GetFunctions(context.Background())...)
|
||||
funcs = append(funcs, GetFunctions()...)
|
||||
return interpreter.NewFunctionCaller(funcs...)
|
||||
})
|
||||
|
|
|
@ -27,7 +27,8 @@ func GetFunctions() []functions.FunctionEntry {
|
|||
Arguments: []functions.ArgSpec{
|
||||
{Types: []functions.JpType{functions.JpString}},
|
||||
},
|
||||
Handler: jpEnv,
|
||||
Handler: jpEnv,
|
||||
Description: "Returns the value of the environment variable passed in argument.",
|
||||
}, {
|
||||
Name: k8sGet,
|
||||
Arguments: []functions.ArgSpec{
|
||||
|
@ -37,7 +38,8 @@ func GetFunctions() []functions.FunctionEntry {
|
|||
{Types: []functions.JpType{functions.JpString}},
|
||||
{Types: []functions.JpType{functions.JpString}},
|
||||
},
|
||||
Handler: jpKubernetesGet,
|
||||
Handler: jpKubernetesGet,
|
||||
Description: "Gets a resource from a Kubernetes cluster.",
|
||||
}, {
|
||||
Name: k8sList,
|
||||
Arguments: []functions.ArgSpec{
|
||||
|
@ -46,7 +48,8 @@ func GetFunctions() []functions.FunctionEntry {
|
|||
{Types: []functions.JpType{functions.JpString}},
|
||||
{Types: []functions.JpType{functions.JpString}, Optional: true},
|
||||
},
|
||||
Handler: jpKubernetesList,
|
||||
Handler: jpKubernetesList,
|
||||
Description: "Lists resources from a Kubernetes cluster.",
|
||||
}, {
|
||||
Name: k8sExists,
|
||||
Arguments: []functions.ArgSpec{
|
||||
|
@ -56,7 +59,8 @@ func GetFunctions() []functions.FunctionEntry {
|
|||
{Types: []functions.JpType{functions.JpString}},
|
||||
{Types: []functions.JpType{functions.JpString}},
|
||||
},
|
||||
Handler: jpKubernetesExists,
|
||||
Handler: jpKubernetesExists,
|
||||
Description: "Checks if a given resource exists in a Kubernetes cluster.",
|
||||
}, {
|
||||
Name: k8sResourceExists,
|
||||
Arguments: []functions.ArgSpec{
|
||||
|
@ -64,25 +68,29 @@ func GetFunctions() []functions.FunctionEntry {
|
|||
{Types: []functions.JpType{functions.JpString}},
|
||||
{Types: []functions.JpType{functions.JpString}},
|
||||
},
|
||||
Handler: jpKubernetesResourceExists,
|
||||
Handler: jpKubernetesResourceExists,
|
||||
Description: "Checks if a given resource type is available in a Kubernetes cluster.",
|
||||
}, {
|
||||
Name: k8sServerVersion,
|
||||
Arguments: []functions.ArgSpec{
|
||||
{Types: []functions.JpType{functions.JpAny}},
|
||||
},
|
||||
Handler: jpKubernetesServerVersion,
|
||||
Handler: jpKubernetesServerVersion,
|
||||
Description: "Returns the version of a Kubernetes cluster.",
|
||||
}, {
|
||||
Name: metricsDecode,
|
||||
Arguments: []functions.ArgSpec{
|
||||
{Types: []functions.JpType{functions.JpString}},
|
||||
},
|
||||
Handler: jpMetricsDecode,
|
||||
Handler: jpMetricsDecode,
|
||||
Description: "Decodes metrics in the Prometheus text format.",
|
||||
}, {
|
||||
Name: trimSpace,
|
||||
Arguments: []functions.ArgSpec{
|
||||
{Types: []functions.JpType{functions.JpString}},
|
||||
},
|
||||
Handler: jpTrimSpace,
|
||||
Handler: jpTrimSpace,
|
||||
Description: "Trims leading and trailing spaces from the string passed in argument.",
|
||||
}, {
|
||||
Name: asString,
|
||||
Arguments: []functions.ArgSpec{
|
||||
|
@ -103,5 +111,6 @@ func GetFunctions() []functions.FunctionEntry {
|
|||
}
|
||||
return nil, nil
|
||||
},
|
||||
Description: "Returns the passed in argument converted into a string.",
|
||||
}}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,12 @@ 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
|
||||
|
@ -40,6 +46,14 @@ 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
|
||||
|
@ -72,6 +86,14 @@ 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
|
||||
|
@ -100,6 +122,13 @@ 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
|
||||
|
@ -130,6 +159,10 @@ 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,14 +5,20 @@ 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))
|
||||
|
@ -20,6 +26,12 @@ 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,32 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/jmespath-community/go-jmespath/pkg/binding"
|
||||
"github.com/kyverno/chainsaw/pkg/apis"
|
||||
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
|
||||
"github.com/kyverno/chainsaw/pkg/client"
|
||||
"github.com/kyverno/chainsaw/pkg/engine/templating"
|
||||
"github.com/kyverno/kyverno-json/pkg/core/compilers"
|
||||
)
|
||||
|
||||
func Describe(ctx context.Context, client client.Client, tc binding.Bindings, collector *v1alpha1.Describe) (string, []string, error) {
|
||||
func Describe(ctx context.Context, compilers compilers.Compilers, client client.Client, tc apis.Bindings, collector *v1alpha1.Describe) (string, []string, error) {
|
||||
if collector == nil {
|
||||
return "", nil, errors.New("collector is null")
|
||||
}
|
||||
name, err := templating.String(ctx, collector.Name, tc)
|
||||
name, err := collector.Name.Value(ctx, compilers, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
namespace, err := templating.String(ctx, collector.Namespace, tc)
|
||||
namespace, err := collector.Namespace.Value(ctx, compilers, tc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
selector, err := templating.String(ctx, collector.Selector, tc)
|
||||
selector, err := collector.Selector.Value(ctx, compilers, 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, client, tc, collector.ObjectType)
|
||||
resource, clustered, err := mapResource(ctx, compilers, client, tc, collector.ObjectType)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue