mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 18:10:21 +00:00
Compare commits
1769 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f95ff4f06e | ||
|
|
e30876e4d2 | ||
|
|
141c6bb2ef | ||
|
|
bdfd8e1f8d | ||
|
|
cfbaf38715 | ||
|
|
d3006f2d9e | ||
|
|
8f7aa9b746 | ||
|
|
8431cdb10d | ||
|
|
66013a9607 | ||
|
|
1d133df1dd | ||
|
|
c66f5f103f | ||
|
|
e6779f6906 | ||
|
|
a48b74d4be | ||
|
|
2da80af3c4 | ||
|
|
7bf5e17262 | ||
|
|
53a6d54b73 | ||
|
|
bcd072507b | ||
|
|
ae075e6cb6 | ||
|
|
b2127ee4fa | ||
|
|
a865c85d05 | ||
|
|
ab2d2750f2 | ||
|
|
99411a7f01 | ||
|
|
f9b218919a | ||
|
|
83b26349c7 | ||
|
|
2c64d04417 | ||
|
|
ef653ebeb4 | ||
|
|
305403ff8b | ||
|
|
eebcc6c6ae | ||
|
|
298ce69593 | ||
|
|
1e21a01320 | ||
|
|
042485124a | ||
|
|
49a91ca4c5 | ||
|
|
a2ad91f2f5 | ||
|
|
5364e53e50 | ||
|
|
811c783a00 | ||
|
|
22bf2e4c3a | ||
|
|
ee0a73b5b7 | ||
|
|
ddb6285b19 | ||
|
|
3a310f0402 | ||
|
|
6771c688dd | ||
|
|
61a12b0916 | ||
|
|
360c19cf2d | ||
|
|
11103b31bb | ||
|
|
a8adaefc78 | ||
|
|
b4c7ed1773 | ||
|
|
2e12ea9bd8 | ||
|
|
0a9518f583 | ||
|
|
e6668ac390 | ||
|
|
2be5b20c6d | ||
|
|
4f2ed4f59e | ||
|
|
2d8c8efe08 | ||
|
|
89c697ca87 | ||
|
|
4379a46a79 | ||
|
|
d933af022c | ||
|
|
60435e42a5 | ||
|
|
55e746cc7a | ||
|
|
48002641b9 | ||
|
|
c1e6ded23d | ||
|
|
cafb55256f | ||
|
|
b60c16a4be | ||
|
|
8407c0bf4d | ||
|
|
76527421d7 | ||
|
|
a151d17fde | ||
|
|
4ff4afde51 | ||
|
|
fbac93665d | ||
|
|
36c7b9ec5b | ||
|
|
d0e8418c4a | ||
|
|
291f9d139e | ||
|
|
9a766467a3 | ||
|
|
c9b2c99dbf | ||
|
|
0a3244f590 | ||
|
|
12361c133e | ||
|
|
c590853f37 | ||
|
|
17c17fcfc6 | ||
|
|
0e8ffd717f | ||
|
|
8d8447ad94 | ||
|
|
e8d051a532 | ||
|
|
c1ebe9db24 | ||
|
|
3d29df3a52 | ||
|
|
324bbe5e57 | ||
|
|
8e172091f6 | ||
|
|
e73655a8b2 | ||
|
|
ce70f9f57f | ||
|
|
215c4e0752 | ||
|
|
d93d8626c0 | ||
|
|
b66f2995a5 | ||
|
|
cad21c5138 | ||
|
|
af01349f28 | ||
|
|
445db3b276 | ||
|
|
7ed34b675d | ||
|
|
537f19f06b | ||
|
|
6cbdbe84b2 | ||
|
|
2ba7480a41 | ||
|
|
7d827182e6 | ||
|
|
da5b32f1a8 | ||
|
|
8b1ce6937f | ||
|
|
a79c96fa46 | ||
|
|
faa445255d | ||
|
|
f270c5901b | ||
|
|
19bcfdd8df | ||
|
|
e0eded58e5 | ||
|
|
873a19e9e0 | ||
|
|
579f7427fa | ||
|
|
65402bd926 | ||
|
|
ae724b2a9a | ||
|
|
5730d08396 | ||
|
|
c451d74cfd | ||
|
|
4ed40bebe3 | ||
|
|
e29f22a7b3 | ||
|
|
426aa7af34 | ||
|
|
f8ac24db27 | ||
|
|
493e255d78 | ||
|
|
32b6502e74 | ||
|
|
02f79a5cd9 | ||
|
|
ecef32a7f3 | ||
|
|
e59374bb7d | ||
|
|
cec16cc1a4 | ||
|
|
1776859631 | ||
|
|
f5c2c85381 | ||
|
|
7a42c743d7 | ||
|
|
d4277f644e | ||
|
|
f130d1d922 | ||
|
|
1a6d2be6d0 | ||
|
|
2d1edbb16d | ||
|
|
7a139b554f | ||
|
|
6bf4a2c1f7 | ||
|
|
9f6812414d | ||
|
|
7310cc1363 | ||
|
|
161bab7d62 | ||
|
|
332fd4753e | ||
|
|
4e010d7bae | ||
|
|
1ce8722e25 | ||
|
|
cd153e8ce5 | ||
|
|
2cea51e5e9 | ||
|
|
75a972516d | ||
|
|
25bc43ae39 | ||
|
|
068e9d97c4 | ||
|
|
e9981b6e20 | ||
|
|
0781937100 | ||
|
|
75eab7bdde | ||
|
|
d24e282e67 | ||
|
|
0c7048b2a0 | ||
|
|
9780ce3bef | ||
|
|
cb790bfc13 | ||
|
|
73be37b73b | ||
|
|
950411dbe8 | ||
|
|
5fcc2ad9f7 | ||
|
|
cc8a1d3bde | ||
|
|
1f6d4d2345 | ||
|
|
6719e8af3a | ||
|
|
5d17fb3a7f | ||
|
|
08f1ff99cf | ||
|
|
44262f03de | ||
|
|
2145afe4e1 | ||
|
|
60cd8ef7de | ||
|
|
8fb64fcb19 | ||
|
|
8fc192bfac | ||
|
|
c4380dbe06 | ||
|
|
01f7357525 | ||
|
|
9311c22c16 | ||
|
|
7254bb67a3 | ||
|
|
8a334d7e82 | ||
|
|
af04ca37a5 | ||
|
|
37bd10d762 | ||
|
|
324fc1ac7c | ||
|
|
850fc704a1 | ||
|
|
4941a3e9c2 | ||
|
|
bd91cf762d | ||
|
|
0906d1b602 | ||
|
|
fa283ee695 | ||
|
|
bec6c89389 | ||
|
|
96a8b24a64 | ||
|
|
0c0b9d0774 | ||
|
|
f033768dd2 | ||
|
|
65217c0a44 | ||
|
|
8ac5d2276e | ||
|
|
9b7c4562ca | ||
|
|
a6753737b3 | ||
|
|
8e4a0c8306 | ||
|
|
601510e43c | ||
|
|
2854c4204c | ||
|
|
09c85191ba | ||
|
|
b11d0c69d6 | ||
|
|
cc4b55983f | ||
|
|
a9ab04dfe3 | ||
|
|
3ccaf04354 | ||
|
|
050afca7a6 | ||
|
|
a599a6a88b | ||
|
|
b6a2ab804e | ||
|
|
309e71a60f | ||
|
|
d3f264273f | ||
|
|
1e294b3164 | ||
|
|
51669f0e41 | ||
|
|
11524bf591 | ||
|
|
682385dea9 | ||
|
|
63341e8f6e | ||
|
|
d7a31c4cb3 | ||
|
|
223bcd3770 | ||
|
|
f2868305ff | ||
|
|
9e2f406ee0 | ||
|
|
3c5fae12b3 | ||
|
|
201c3c466d | ||
|
|
638957a333 | ||
|
|
9620fbbfca | ||
|
|
bf93bf5004 | ||
|
|
fa57fcf66e | ||
|
|
8d298ecfdd | ||
|
|
d7c179b91d | ||
|
|
63cfc2b68a | ||
|
|
873c8299d8 | ||
|
|
356db2dc97 | ||
|
|
abbec2c36b | ||
|
|
120e6fcc5c | ||
|
|
072e6b0aa7 | ||
|
|
ea64b1db3b | ||
|
|
a874aa3f71 | ||
|
|
e12a9303eb | ||
|
|
a715564147 | ||
|
|
94dab9f2a5 | ||
|
|
97d2715b87 | ||
|
|
6168537f56 | ||
|
|
d5abd6fd77 | ||
|
|
ee0282af18 | ||
|
|
116e78e66a | ||
|
|
2ee3256b20 | ||
|
|
0eed21987a | ||
|
|
3f326f06e4 | ||
|
|
db0b7b6ea3 | ||
|
|
c6c03d823b | ||
|
|
566cd8cbc8 | ||
|
|
1a7db89fbd | ||
|
|
0752244d0b | ||
|
|
5f1d07bfc6 | ||
|
|
6405603970 | ||
|
|
13fc4e2b25 | ||
|
|
478eb69b31 | ||
|
|
2aa31a9f2b | ||
|
|
e3edde44af | ||
|
|
af1e9dc195 | ||
|
|
5ddeabb6af | ||
|
|
aa87d3da24 | ||
|
|
7a1f95773d | ||
|
|
d9cd048d79 | ||
|
|
2c2fe4dc66 | ||
|
|
66644de597 | ||
|
|
b4ebdac5bb | ||
|
|
9d6aaa6044 | ||
|
|
b88ac35779 | ||
|
|
0a16175523 | ||
|
|
53855019d0 | ||
|
|
4eb8f1a0ee | ||
|
|
7161959aca | ||
|
|
4481e7637d | ||
|
|
2b1946ee7b | ||
|
|
a8c4d5f01e | ||
|
|
de1b84724c | ||
|
|
e71d71c6b7 | ||
|
|
e7041f913f | ||
|
|
3199fd7577 | ||
|
|
a736b1f7b0 | ||
|
|
804024599b | ||
|
|
c0144865d2 | ||
|
|
5d6ce83174 | ||
|
|
6b804acbf5 | ||
|
|
e62d5d23e7 | ||
|
|
9d7d2eb262 | ||
|
|
c508cd45c6 | ||
|
|
ed0039e1ee | ||
|
|
0b46895211 | ||
|
|
5e064219e7 | ||
|
|
ff6fcd9f10 | ||
|
|
10073df98a | ||
|
|
d77969b52e | ||
|
|
21cde39c50 | ||
|
|
40a09e5468 | ||
|
|
644cafe0a1 | ||
|
|
ead859b717 | ||
|
|
fcecd0cc8d | ||
|
|
e91deaa4cc | ||
|
|
40171f08bb | ||
|
|
07ebca4376 | ||
|
|
38cf4c8195 | ||
|
|
7d711c2f39 | ||
|
|
1d76964ca0 | ||
|
|
af50f32826 | ||
|
|
e972535e49 | ||
|
|
87576cc67e | ||
|
|
d7950063c3 | ||
|
|
5b6f248152 | ||
|
|
3016fd1e91 | ||
|
|
9a3c63a843 | ||
|
|
9e1189c4df | ||
|
|
e72f5b8d2a | ||
|
|
0611c0a79a | ||
|
|
3c05232de8 | ||
|
|
572f7b47bd | ||
|
|
3d464b6461 | ||
|
|
14a2f8a7bd | ||
|
|
d489cc4b37 | ||
|
|
cd1fdc8ade | ||
|
|
016becf2be | ||
|
|
fba53cfbf3 | ||
|
|
4930c2c71f | ||
|
|
700b1aa951 | ||
|
|
fb1eb51e92 | ||
|
|
071476a04f | ||
|
|
01ed9a647c | ||
|
|
9adf269869 | ||
|
|
227052f51e | ||
|
|
facd56fd4f | ||
|
|
c53cebef0a | ||
|
|
6d446e13f6 | ||
|
|
fc5043c543 | ||
|
|
bd41d49311 | ||
|
|
4eb33e9239 | ||
|
|
75bbd63f9e | ||
|
|
be0563a8ea | ||
|
|
9c70edeb77 | ||
|
|
aec9913557 | ||
|
|
22d014d91a | ||
|
|
2b4d12fbdd | ||
|
|
b2adf5b472 | ||
|
|
88933d07d6 | ||
|
|
e176fcfc56 | ||
|
|
93234e8290 | ||
|
|
b582ccc060 | ||
|
|
5a778b4732 | ||
|
|
8bc63a431f | ||
|
|
4b120546f0 | ||
|
|
94bc87d03e | ||
|
|
20ceca4c99 | ||
|
|
e07c95fa26 | ||
|
|
c1b5203009 | ||
|
|
4040c8e67c | ||
|
|
d2a2a9ac07 | ||
|
|
5cb5491bc8 | ||
|
|
f94cf51543 | ||
|
|
61d7aff01c | ||
|
|
e217e9e0df | ||
|
|
5b332c24d8 | ||
|
|
b752511e74 | ||
|
|
70eeec4c89 | ||
|
|
d7e1d90585 | ||
|
|
003ab91f51 | ||
|
|
046376aa1a | ||
|
|
649e0376cc | ||
|
|
ed4844d518 | ||
|
|
8970c95875 | ||
|
|
72bdb04f94 | ||
|
|
e5c8f259f3 | ||
|
|
e494516593 | ||
|
|
9972911510 | ||
|
|
fbb0cddb30 | ||
|
|
889e38e984 | ||
|
|
9de6aea5ab | ||
|
|
f4cbe1b98b | ||
|
|
2c9cf94817 | ||
|
|
54a828863b | ||
|
|
f4f72708a5 | ||
|
|
b224230b9c | ||
|
|
b6a6982a57 | ||
|
|
570eaf6077 | ||
|
|
5a6feb3a19 | ||
|
|
d42e0e3162 | ||
|
|
72ba2162e9 | ||
|
|
c7e46e49ca | ||
|
|
aafd4fdd2f | ||
|
|
c463b147a1 | ||
|
|
447ab4a35a | ||
|
|
8dcbb61cb8 | ||
|
|
75d35ecdf8 | ||
|
|
fd13fb4441 | ||
|
|
dd682919a8 | ||
|
|
b93460cbb4 | ||
|
|
f4feb1af9c | ||
|
|
6dab3fb985 | ||
|
|
fb23e0ebd2 | ||
|
|
4f47bec238 | ||
|
|
8c864f33b9 | ||
|
|
21fe5fab9e | ||
|
|
931ca3ea3e | ||
|
|
fa8b3ef763 | ||
|
|
4c7c954357 | ||
|
|
a52367eced | ||
|
|
fd9e99f19f | ||
|
|
9a10e967ee | ||
|
|
181bcda66a | ||
|
|
0753734372 | ||
|
|
8380e66b1e | ||
|
|
de9b06e716 | ||
|
|
abfb2ae6ef | ||
|
|
0c7706d442 | ||
|
|
30662d632b | ||
|
|
cd93196aef | ||
|
|
fed40a1060 | ||
|
|
76744ad26e | ||
|
|
c93db6494a | ||
|
|
27c1eda2a6 | ||
|
|
59a8765aa1 | ||
|
|
845ce1bbf4 | ||
|
|
ef1cd50a1a | ||
|
|
b124873fd7 | ||
|
|
0556f03f28 | ||
|
|
7929f9fe09 | ||
|
|
f73236a617 | ||
|
|
98a31f68ae | ||
|
|
aa720f3c67 | ||
|
|
512a87466e | ||
|
|
cc8bf15962 | ||
|
|
d3fcbf4d45 | ||
|
|
8f67454396 | ||
|
|
2fa02bc1c0 | ||
|
|
e63ec032b2 | ||
|
|
ef021c5d2d | ||
|
|
a11ae2f95d | ||
|
|
87ff9c9f84 | ||
|
|
d2f471df3f | ||
|
|
80b2c3713b | ||
|
|
37d9adbc6c | ||
|
|
b4ae473dae | ||
|
|
4ef8cb3f12 | ||
|
|
138676315f | ||
|
|
9772907d66 | ||
|
|
884648a010 | ||
|
|
eefc8c13ce | ||
|
|
0a4c20c999 | ||
|
|
58b3fffa36 | ||
|
|
c4cb69120e | ||
|
|
ba8c6c020a | ||
|
|
83c9c17cc7 | ||
|
|
2a5573015e | ||
|
|
4b897baae8 | ||
|
|
f137a9adf3 | ||
|
|
d90e78af97 | ||
|
|
1866753769 | ||
|
|
1660930ed3 | ||
|
|
5cc92e5420 | ||
|
|
18bf1189a3 | ||
|
|
c9d21e6707 | ||
|
|
1f73020c4d | ||
|
|
1e08b3a037 | ||
|
|
5d22e868eb | ||
|
|
ee69d761f9 | ||
|
|
2ca7ce5c8b | ||
|
|
675b0e24db | ||
|
|
7ed1c66578 | ||
|
|
5079659404 | ||
|
|
b3302b318c | ||
|
|
e1dfe40794 | ||
|
|
0571ae3a54 | ||
|
|
29744a6f18 | ||
|
|
fbd4565115 | ||
|
|
3543cb9b23 | ||
|
|
1d731b808a | ||
|
|
bba6e056a5 | ||
|
|
7787fe8e6a | ||
|
|
6a956f9343 | ||
|
|
b76a3f3f42 | ||
|
|
fd44069a21 | ||
|
|
cd8f31c4d8 | ||
|
|
f625877eb1 | ||
|
|
396f244af1 | ||
|
|
ed3e8d384a | ||
|
|
5f34a0c658 | ||
|
|
c40108f413 | ||
|
|
63855abed9 | ||
|
|
4dd00ac536 | ||
|
|
55b6ef1846 | ||
|
|
737b4dc2e4 | ||
|
|
60b8ec3ff2 | ||
|
|
fed2d13d98 | ||
|
|
85d6c77fad | ||
|
|
a488a24af4 | ||
|
|
00a4e4ca01 | ||
|
|
ef0888f256 | ||
|
|
0519c1ea8c | ||
|
|
467506c498 | ||
|
|
0ac7f02fc9 | ||
|
|
662a791e71 | ||
|
|
b726c5291f | ||
|
|
7377e17f8f | ||
|
|
1867436174 | ||
|
|
a3c97ecf31 | ||
|
|
ee7dac354d | ||
|
|
21c631ac26 | ||
|
|
90f7d11787 | ||
|
|
b1ad5574b8 | ||
|
|
b9a56aeb17 | ||
|
|
3800a700b0 | ||
|
|
75f081f248 | ||
|
|
ba68e33e23 | ||
|
|
fb6d505e6e | ||
|
|
1a267bc6d1 | ||
|
|
8643558f6b | ||
|
|
d063cd3b78 | ||
|
|
c4fa81b703 | ||
|
|
ebc8476a31 | ||
|
|
0333b9e891 | ||
|
|
3be63bba91 | ||
|
|
f9f2c3b119 | ||
|
|
34684650c3 | ||
|
|
e76992df87 | ||
|
|
3a68ec77fd | ||
|
|
199e747865 | ||
|
|
c6b65cbd5b | ||
|
|
9fa237721e | ||
|
|
b90fffad43 | ||
|
|
1ad6dcc1a7 | ||
|
|
1659528015 | ||
|
|
ce20f55382 | ||
|
|
384c5ab6a9 | ||
|
|
a7bfb2fb6f | ||
|
|
8703950da6 | ||
|
|
f7cfe6fbae | ||
|
|
e8ed4d78cf | ||
|
|
0c8e22ef4d | ||
|
|
e9004d7478 | ||
|
|
282efa2893 | ||
|
|
580157df6a | ||
|
|
6ecb0567f5 | ||
|
|
dcf79a9b57 | ||
|
|
b411d79ed0 | ||
|
|
d8eb7d687c | ||
|
|
63b348f4d8 | ||
|
|
2e43a6dc78 | ||
|
|
26163aacdc | ||
|
|
5164efeb4a | ||
|
|
2254777523 | ||
|
|
389722a94e | ||
|
|
4b86689d63 | ||
|
|
2b07ec49d4 | ||
|
|
7edfbde2f5 | ||
|
|
bc6a60dde2 | ||
|
|
1407fc5125 | ||
|
|
2d6f2083db | ||
|
|
c619b7b290 | ||
|
|
bc6000f794 | ||
|
|
2e92a66fa5 | ||
|
|
e5a9be8de9 | ||
|
|
5d40f121ea | ||
|
|
58c3283411 | ||
|
|
6d65169449 | ||
|
|
9bf6cc2659 | ||
|
|
ecbb5f56ca | ||
|
|
7ede0746c1 | ||
|
|
e8e45dd7d3 | ||
|
|
08a1dc5a22 | ||
|
|
d2a46322c0 | ||
|
|
7d31d84ec3 | ||
|
|
f59341f667 | ||
|
|
a446aab46b | ||
|
|
f2de6de6f8 | ||
|
|
0f23f6eb09 | ||
|
|
473164efbd | ||
|
|
7dec0afc16 | ||
|
|
a44257e153 | ||
|
|
1261e2678f | ||
|
|
325a4cdb0e | ||
|
|
b33b6fbead | ||
|
|
15b1bd2660 | ||
|
|
8c73ea5d8a | ||
|
|
4b25ed4ba1 | ||
|
|
f47ca0f4da | ||
|
|
5b1b054cca | ||
|
|
35376bd396 | ||
|
|
06069d3580 | ||
|
|
43057161bf | ||
|
|
50ded65805 | ||
|
|
1444376b0c | ||
|
|
04486f89bb | ||
|
|
d6d19a7c5a | ||
|
|
6b8875012d | ||
|
|
7ae6a148a0 | ||
|
|
bbea29c8e5 | ||
|
|
6e6c4c76a6 | ||
|
|
1bf673c3c1 | ||
|
|
352fe1ba5b | ||
|
|
3bdf7a044f | ||
|
|
3cb9fa79bf | ||
|
|
20f6e0ab02 | ||
|
|
438ab96f95 | ||
|
|
b5bf7a4f62 | ||
|
|
d473e41f20 | ||
|
|
96c1d0786a | ||
|
|
f7196e10ca | ||
|
|
a2997a070d | ||
|
|
0629049e1f | ||
|
|
553b5d19eb | ||
|
|
07c8c23884 | ||
|
|
d5d0cd1878 | ||
|
|
1d315aa045 | ||
|
|
74a95133b2 | ||
|
|
78ed5cade0 | ||
|
|
72f533e5eb | ||
|
|
4918b5cee7 | ||
|
|
0d8f656cdb | ||
|
|
ffe08904f0 | ||
|
|
eb4efc960f | ||
|
|
4729c8af80 | ||
|
|
2d95800618 | ||
|
|
567fc46642 | ||
|
|
de798f3c8a | ||
|
|
b5cbc75734 | ||
|
|
8ef3a37c50 | ||
|
|
05c0fb8f9a | ||
|
|
14caa9cb70 | ||
|
|
f58b68205b | ||
|
|
bba5de9a8c | ||
|
|
f762a1279e | ||
|
|
26b9db6322 | ||
|
|
9e40b77b60 | ||
|
|
14635b6f2d | ||
|
|
ba78ea7f0e | ||
|
|
02976bea67 | ||
|
|
ce5f345fc4 | ||
|
|
284cd8aa72 | ||
|
|
49f16274c9 | ||
|
|
c4cf704eea | ||
|
|
66bcb612ef | ||
|
|
ea60117ba5 | ||
|
|
2dfc653ef0 | ||
|
|
cfabcee181 | ||
|
|
aa548ab3d4 | ||
|
|
52c88ec6c5 | ||
|
|
c71b5a20b6 | ||
|
|
c4512decf1 | ||
|
|
4540270813 | ||
|
|
95622cafa4 | ||
|
|
cbc866ccae | ||
|
|
68a0e40db4 | ||
|
|
6469d538be | ||
|
|
aa21bfcb60 | ||
|
|
baa8d87e71 | ||
|
|
1c89435515 | ||
|
|
8e8ec58b97 | ||
|
|
30baeabadc | ||
|
|
2c68c0e6d4 | ||
|
|
0e9a3ceb3b | ||
|
|
74a82e0397 | ||
|
|
20a31d4554 | ||
|
|
31af7b780f | ||
|
|
0926469541 | ||
|
|
94b7cbff21 | ||
|
|
ec7eed3e37 | ||
|
|
db8aee17f0 | ||
|
|
26f0db3d30 | ||
|
|
d042c0c7ec | ||
|
|
06a099f540 | ||
|
|
efa5078d81 | ||
|
|
b726481e7a | ||
|
|
c5d81c975a | ||
|
|
33dae5e36e | ||
|
|
53ae9aaa40 | ||
|
|
a4fda31829 | ||
|
|
e8a8981ef5 | ||
|
|
fc55b65aad | ||
|
|
9366c6e0b4 | ||
|
|
b6218bf67d | ||
|
|
4b9e933ca5 | ||
|
|
ab7ccb7499 | ||
|
|
4c392d263a | ||
|
|
7fab96d363 | ||
|
|
320651c80d | ||
|
|
c59c760ed5 | ||
|
|
6e73038f92 | ||
|
|
baff3d77c4 | ||
|
|
94068571c5 | ||
|
|
a96225a12b | ||
|
|
086effa141 | ||
|
|
acf497b1c7 | ||
|
|
30f30d9c93 | ||
|
|
f554523196 | ||
|
|
dbc4593b23 | ||
|
|
11bc937f62 | ||
|
|
75c123df2f | ||
|
|
0b72c7ce34 | ||
|
|
a856499c3f | ||
|
|
395f7d6849 | ||
|
|
98bf8e6b86 | ||
|
|
628f2e1fdb | ||
|
|
eea2fd4c35 | ||
|
|
48e8c24ad1 | ||
|
|
379e143222 | ||
|
|
d4705380a8 | ||
|
|
15ffac9a46 | ||
|
|
ddcbb9aefd | ||
|
|
8666b6b6e9 | ||
|
|
fe1c319f06 | ||
|
|
868530316c | ||
|
|
135282834d | ||
|
|
d6dc946998 | ||
|
|
f43db50af2 | ||
|
|
7931e2a0a5 | ||
|
|
3f28a6d917 | ||
|
|
1c126c5a26 | ||
|
|
0bc7454b79 | ||
|
|
f4c20d4459 | ||
|
|
63d965d381 | ||
|
|
d750cf2657 | ||
|
|
d253b84161 | ||
|
|
c6b477e1ca | ||
|
|
243fba3b23 | ||
|
|
485cdff57a | ||
|
|
bd00d2fc51 | ||
|
|
d09531b343 | ||
|
|
a3ecf7c510 | ||
|
|
657baf9f15 | ||
|
|
e978e26c25 | ||
|
|
3a2208f0d2 | ||
|
|
99e8ff648e | ||
|
|
8e7d8a46e7 | ||
|
|
4903eb7cb2 | ||
|
|
3742b98636 | ||
|
|
72cdc3ec74 | ||
|
|
e4a5b17e90 | ||
|
|
276d544766 | ||
|
|
2084ac6e3d | ||
|
|
fdefd614cf | ||
|
|
540d826295 | ||
|
|
ae5b8ff4af | ||
|
|
25a2a8a60c | ||
|
|
f51a07c802 | ||
|
|
f4223ebc1a | ||
|
|
7b1037ccad | ||
|
|
cafc8c5e5e | ||
|
|
0161b082b6 | ||
|
|
837d6708e8 | ||
|
|
ec27850e65 | ||
|
|
aaf0a37c4a | ||
|
|
5acc5a9015 | ||
|
|
857f382c7e | ||
|
|
b0bf9b1d96 | ||
|
|
fdeedb31be | ||
|
|
bdd2916972 | ||
|
|
d6cb52d73a | ||
|
|
ee649d9592 | ||
|
|
54339f7c05 | ||
|
|
d0026839f4 | ||
|
|
7bddeff93d | ||
|
|
23a0da27d2 | ||
|
|
6a96062464 | ||
|
|
b788401920 | ||
|
|
c678247211 | ||
|
|
3345846f78 | ||
|
|
c349c94181 | ||
|
|
7328e572e5 | ||
|
|
019d8719a3 | ||
|
|
e335707ab0 | ||
|
|
dc89cfafa4 | ||
|
|
7e22c19383 | ||
|
|
5b2b27e6a4 | ||
|
|
86b363c56c | ||
|
|
b216c0a636 | ||
|
|
d4c2b7cb5a | ||
|
|
be03c788be | ||
|
|
4c762ebf83 | ||
|
|
cbc7a3855e | ||
|
|
abde9e789d | ||
|
|
6145e6edc2 | ||
|
|
711a4a9d7a | ||
|
|
d7dbcfc1cc | ||
|
|
1cdcf2ab48 | ||
|
|
f589471640 | ||
|
|
a76f847668 | ||
|
|
33df4d9dea | ||
|
|
14b3a4d6cb | ||
|
|
e61cba4add | ||
|
|
7bd96bb324 | ||
|
|
c34c5a9a6c | ||
|
|
96d9287525 | ||
|
|
6c0141a62d | ||
|
|
1652b4cf0c | ||
|
|
dd0979b912 | ||
|
|
60df873b93 | ||
|
|
52657ac7ba | ||
|
|
99b8e4aba3 | ||
|
|
ccc5826616 | ||
|
|
2d7cbf9467 | ||
|
|
cc044b0de5 | ||
|
|
9d5b31be2b | ||
|
|
b64009c02d | ||
|
|
2cebad6ff4 | ||
|
|
d84ebd3ae9 | ||
|
|
1048b399fd | ||
|
|
c47dd8c16b | ||
|
|
bdf239f1ae | ||
|
|
66c111be6c | ||
|
|
76f7f7e7a5 | ||
|
|
7f8e53b29d | ||
|
|
9afe577087 | ||
|
|
339889813b | ||
|
|
c2b6e6efdd | ||
|
|
f60d6820d9 | ||
|
|
dbc9523728 | ||
|
|
6bf85f6f6e | ||
|
|
31b1490359 | ||
|
|
8bbf62b8fe | ||
|
|
0c1b9eba35 | ||
|
|
f17d3feb06 | ||
|
|
28fce2d7de | ||
|
|
994ef23c0c | ||
|
|
784fc0b402 | ||
|
|
68d5e6cdcc | ||
|
|
6c794bda08 | ||
|
|
1976a0fa64 | ||
|
|
c121d33b2c | ||
|
|
198c836849 | ||
|
|
6b73436362 | ||
|
|
d938b9ee9e | ||
|
|
c520a24423 | ||
|
|
eac2d37551 | ||
|
|
570cf01949 | ||
|
|
a39c429020 | ||
|
|
003db753aa | ||
|
|
2fb2306117 | ||
|
|
e5240932a7 | ||
|
|
8c8ca60756 | ||
|
|
7207819080 | ||
|
|
48ee5a1d1c | ||
|
|
84f34e3f01 | ||
|
|
66177ddd13 | ||
|
|
b4b3a8ab69 | ||
|
|
488341398a | ||
|
|
a8337921bc | ||
|
|
abf9270473 | ||
|
|
d6f28bfd9e | ||
|
|
abaac1de2b | ||
|
|
e25f7598ca | ||
|
|
d4a47f733f | ||
|
|
171e20a7d6 | ||
|
|
9bf008aa3f | ||
|
|
2b24bad2b8 | ||
|
|
97eac314de | ||
|
|
3270bfc0da | ||
|
|
6eeb98870f | ||
|
|
4eb290a1d2 | ||
|
|
580110ed44 | ||
|
|
309786338a | ||
|
|
816ea76bd5 | ||
|
|
d7a12ac5fd | ||
|
|
b399f34c71 | ||
|
|
98b059c0ae | ||
|
|
9bb996e9d5 | ||
|
|
95cd9bb198 | ||
|
|
dee442eb3d | ||
|
|
dd222ac876 | ||
|
|
13a70e6819 | ||
|
|
6e0b6092a5 | ||
|
|
efb24d5b4c | ||
|
|
dc5694bdc4 | ||
|
|
ee93efc154 | ||
|
|
073f3bc0c7 | ||
|
|
1c91d46ce3 | ||
|
|
5ad5c2fd69 | ||
|
|
8f83e3dd98 | ||
|
|
9444124c3b | ||
|
|
d7f64725d6 | ||
|
|
d54a9bda05 | ||
|
|
f285490da9 | ||
|
|
6419b8ff57 | ||
|
|
d3511415c2 | ||
|
|
05bd7a3ab2 | ||
|
|
9f38b02b1c | ||
|
|
645312a129 | ||
|
|
e48515850d | ||
|
|
df89d247cf | ||
|
|
f81e265877 | ||
|
|
2aebcf014a | ||
|
|
6dc70be801 | ||
|
|
936dc4100d | ||
|
|
5c9e396e5c | ||
|
|
bb7033b1e6 | ||
|
|
9c41d3f212 | ||
|
|
7db9b93e1a | ||
|
|
8554fb1a2d | ||
|
|
aac0df2de6 | ||
|
|
1f0af863ef | ||
|
|
062df46e47 | ||
|
|
9d47a85f80 | ||
|
|
1d38d6ea18 | ||
|
|
52c243d338 | ||
|
|
ce6e92e660 | ||
|
|
101ac18836 | ||
|
|
8c7a0ab19f | ||
|
|
bcb761d5d5 | ||
|
|
1fdc137f8b | ||
|
|
67adafce1b | ||
|
|
8a3b8a29a7 | ||
|
|
7ee298ba77 | ||
|
|
be59d70018 | ||
|
|
a4da93877d | ||
|
|
87fca7b22a | ||
|
|
d404ae9459 | ||
|
|
fa053a53d0 | ||
|
|
b8ee8e879f | ||
|
|
cd6d0a5787 | ||
|
|
52e3bacfae | ||
|
|
a605198863 | ||
|
|
e7396ae9ab | ||
|
|
da52367897 | ||
|
|
6532bc4573 | ||
|
|
c908d8e1e7 | ||
|
|
5e9d49e139 | ||
|
|
3ee746ae17 | ||
|
|
f6d2e76102 | ||
|
|
58bd00f137 | ||
|
|
994c194d0f | ||
|
|
abe01d2add | ||
|
|
aabd1e399a | ||
|
|
12cc22b5c4 | ||
|
|
47ab481eee | ||
|
|
b564e0ef26 | ||
|
|
1119d1b529 | ||
|
|
8af08075df | ||
|
|
4b06961e6f | ||
|
|
96a589b098 | ||
|
|
258bdd7b76 | ||
|
|
1f5223267b | ||
|
|
c24169e42d | ||
|
|
9230e5c181 | ||
|
|
10bf5739ca | ||
|
|
15020660c9 | ||
|
|
cd971063f8 | ||
|
|
b6f10bb1fa | ||
|
|
868e0925d4 | ||
|
|
f2bd881d27 | ||
|
|
ea306dac5e | ||
|
|
a761e75c01 | ||
|
|
87e52bb349 | ||
|
|
dc8358f910 | ||
|
|
26a7e57d6e | ||
|
|
026d5f6446 | ||
|
|
26aa3eceae | ||
|
|
966a773195 | ||
|
|
5aea4c4baa | ||
|
|
51860cf11a | ||
|
|
90d82c38e9 | ||
|
|
2375e019bd | ||
|
|
fb15b43914 | ||
|
|
829d230427 | ||
|
|
f310665fe0 | ||
|
|
dafbbbb606 | ||
|
|
2524a3e5fb | ||
|
|
dd04402a28 | ||
|
|
62611896e1 | ||
|
|
8186b174ba | ||
|
|
b99a4b619c | ||
|
|
5ae47074d1 | ||
|
|
5a2305b83e | ||
|
|
78a145fa74 | ||
|
|
02f214b766 | ||
|
|
dd6810314e | ||
|
|
2efeec8a8e | ||
|
|
671c73a070 | ||
|
|
942115a1c3 | ||
|
|
f737379738 | ||
|
|
e5a9721fa5 | ||
|
|
86db8de125 | ||
|
|
7f64974701 | ||
|
|
18f184d57c | ||
|
|
b80bacf65d | ||
|
|
c96a92475d | ||
|
|
316b438674 | ||
|
|
104f0827dc | ||
|
|
0a81696315 | ||
|
|
93ae8a9099 | ||
|
|
ed436d4e6d | ||
|
|
e5e71dbc25 | ||
|
|
af61a81828 | ||
|
|
b88309a333 | ||
|
|
c41bd241ce | ||
|
|
5c188dd9cc | ||
|
|
66fb99954e | ||
|
|
f39660c286 | ||
|
|
07e16d9f8a | ||
|
|
2abcb44ee2 | ||
|
|
d2ce5856a6 | ||
|
|
bed609e192 | ||
|
|
6922f7cfab | ||
|
|
aed2494875 | ||
|
|
10076f8516 | ||
|
|
a8b4004e3b | ||
|
|
d1c93ed90c | ||
|
|
a042b6b43d | ||
|
|
130827629b | ||
|
|
82cdb615c0 | ||
|
|
7629399683 | ||
|
|
ad496b132a | ||
|
|
ef5d3c35c6 | ||
|
|
2a943c9429 | ||
|
|
52aed26b96 | ||
|
|
61c256a97c | ||
|
|
8dbad9e8c1 | ||
|
|
3e8f0b3299 | ||
|
|
c1a14a70f5 | ||
|
|
0a6065d7d0 | ||
|
|
fa58501a97 | ||
|
|
aa03e9c9d4 | ||
|
|
4d00ad78ae | ||
|
|
5b26575c16 | ||
|
|
cf60e72fe9 | ||
|
|
a2707395e9 | ||
|
|
a420785dc2 | ||
|
|
ccf47a2189 | ||
|
|
3d98b94fd8 | ||
|
|
6adb91fb50 | ||
|
|
d27aa77753 | ||
|
|
462be588af | ||
|
|
c85bbe1ae2 | ||
|
|
a257f6e60c | ||
|
|
0e987a08b6 | ||
|
|
206d343785 | ||
|
|
1cf1e6c064 | ||
|
|
c1f50d622b | ||
|
|
e664831ff6 | ||
|
|
3a73221661 | ||
|
|
97f45ae859 | ||
|
|
4cd9a70cfe | ||
|
|
75ecf2f301 | ||
|
|
77642f069a | ||
|
|
2720028e2a | ||
|
|
72ee26dbb4 | ||
|
|
9173ff828f | ||
|
|
62ec540fcf | ||
|
|
f6a3ade584 | ||
|
|
be49ea092b | ||
|
|
b173224212 | ||
|
|
c71eea7f90 | ||
|
|
5b1a55b58b | ||
|
|
eba7049f39 | ||
|
|
65706f401b | ||
|
|
59a6ef5140 | ||
|
|
1fcd4ca55e | ||
|
|
d74dbb4fda | ||
|
|
b6edd4bc7e | ||
|
|
879c6c8878 | ||
|
|
c722f561b0 | ||
|
|
0b5052ad91 | ||
|
|
4661297ca5 | ||
|
|
87cc86dde2 | ||
|
|
adbe1f9368 | ||
|
|
f0d8bd078b | ||
|
|
78b86d84b6 | ||
|
|
ba4374dc27 | ||
|
|
806c396264 | ||
|
|
721ca9ff92 | ||
|
|
023d24d392 | ||
|
|
a674174cda | ||
|
|
48f3ed94b7 | ||
|
|
47f35e6d62 | ||
|
|
f55dd467b9 | ||
|
|
7524aeee31 | ||
|
|
cb368c2f8c | ||
|
|
64c560583e | ||
|
|
580056b209 | ||
|
|
2706e63743 | ||
|
|
3546001bf6 | ||
|
|
40aa97363e | ||
|
|
f6345534e6 | ||
|
|
df32d4b1ba | ||
|
|
a10dccf5bd | ||
|
|
f40a41dbc1 | ||
|
|
732d8f76d3 | ||
|
|
4732bd943d | ||
|
|
89863b30e8 | ||
|
|
00ba0697dc | ||
|
|
30585f80e6 | ||
|
|
83ce5ec724 | ||
|
|
4467084c0e | ||
|
|
1f1f3af7b7 | ||
|
|
d38c08af56 | ||
|
|
2761e7afb9 | ||
|
|
8410f03eb0 | ||
|
|
e51c283c1d | ||
|
|
f694d1ad5d | ||
|
|
674408784b | ||
|
|
19e8aa2af6 | ||
|
|
3dd954541e | ||
|
|
ba614da809 | ||
|
|
b92e2a92fc | ||
|
|
718a4b1999 | ||
|
|
de83320306 | ||
|
|
4cfee561b9 | ||
|
|
6b78945c18 | ||
|
|
72d6981628 | ||
|
|
2243632d0c | ||
|
|
775991cfaa | ||
|
|
da097989f8 | ||
|
|
53164a4d2f | ||
|
|
3d3b3239d8 | ||
|
|
b1a97b08ec | ||
|
|
72663f68cb | ||
|
|
8c7db9b0e0 | ||
|
|
c72941f916 | ||
|
|
cc590d7c42 | ||
|
|
5e06e41477 | ||
|
|
6e658d1ea8 | ||
|
|
4832d95506 | ||
|
|
61b9816296 | ||
|
|
9a613da8c5 | ||
|
|
72ee5db872 | ||
|
|
cb68136f93 | ||
|
|
a181ff46b6 | ||
|
|
2e1433c366 | ||
|
|
bac35a425f | ||
|
|
08d0b4830a | ||
|
|
a1d9b3d032 | ||
|
|
8d0595ed4e | ||
|
|
01bd05d0a5 | ||
|
|
76d585795b | ||
|
|
4088a20252 | ||
|
|
810cbcaae4 | ||
|
|
dfdb833abe | ||
|
|
f10e53c1eb | ||
|
|
a88d0a5660 | ||
|
|
02bb9a1dc1 | ||
|
|
950238aa11 | ||
|
|
b52fc09fd6 | ||
|
|
062c906e95 | ||
|
|
69e860a1e8 | ||
|
|
0bd85d359a | ||
|
|
1abbe1f7cf | ||
|
|
88143ae64a | ||
|
|
b25e911a74 | ||
|
|
d8d891f6c9 | ||
|
|
a7f823940c | ||
|
|
3a47d5de73 | ||
|
|
eb2501f644 | ||
|
|
abce944aad | ||
|
|
386d5dd0ee | ||
|
|
509895511b | ||
|
|
c0ebe8dc62 | ||
|
|
ebf1b51d58 | ||
|
|
4b27f9b4e2 | ||
|
|
8f6d0fded8 | ||
|
|
e8cabdc13c | ||
|
|
a03d9f2626 | ||
|
|
37cb5ccb51 | ||
|
|
4c34048186 | ||
|
|
76e0bbcabd | ||
|
|
32bc74456a | ||
|
|
82df7c3a71 | ||
|
|
c06aca6f60 | ||
|
|
69dcf2fc5a | ||
|
|
04c9af5c81 | ||
|
|
1e6248d189 | ||
|
|
e3b4bcd2ca | ||
|
|
9730cb438d | ||
|
|
a8f48eb140 | ||
|
|
ab6a170c1d | ||
|
|
dc9b1eb6fc | ||
|
|
629bf00b63 | ||
|
|
1f2c38d3c7 | ||
|
|
b129637cf2 | ||
|
|
630f1e48bc | ||
|
|
4bed55b400 | ||
|
|
54ca5c115f | ||
|
|
ddba62fba0 | ||
|
|
15a24c65b9 | ||
|
|
56285ca540 | ||
|
|
b1c3f593db | ||
|
|
e23f6b3866 | ||
|
|
2943bc7ce1 | ||
|
|
da0f8916aa | ||
|
|
7609da212f | ||
|
|
7f87a47832 | ||
|
|
04868d217b | ||
|
|
56aa3c24d7 | ||
|
|
a54ba9bb54 | ||
|
|
fbe93dc847 | ||
|
|
dbd855cc25 | ||
|
|
7f136159c0 | ||
|
|
af61b59c5e | ||
|
|
c09e4df452 | ||
|
|
1694980eba | ||
|
|
feee1306fd | ||
|
|
0d56da4ab8 | ||
|
|
582c3788c4 | ||
|
|
b8fd6f9823 | ||
|
|
0fab691ba3 | ||
|
|
3cb172f7ff | ||
|
|
e882a650ae | ||
|
|
ef9c26ffec | ||
|
|
cf2a57c96a | ||
|
|
7acc52ebdb | ||
|
|
3c35d9dadc | ||
|
|
07742b6349 | ||
|
|
d45d086efb | ||
|
|
a31a316171 | ||
|
|
ec287a181f | ||
|
|
50f4d10b00 | ||
|
|
9f27f70da8 | ||
|
|
3df55a92f3 | ||
|
|
fd65c27ecb | ||
|
|
576d928a83 | ||
|
|
d14558a227 | ||
|
|
f48aba6f66 | ||
|
|
f51dccf956 | ||
|
|
a961b002c2 | ||
|
|
bffd43fa2c | ||
|
|
2a88f9221f | ||
|
|
efdef27d0a | ||
|
|
58bef9791f | ||
|
|
c1de71d122 | ||
|
|
f8e320b97c | ||
|
|
f69476df37 | ||
|
|
922892a909 | ||
|
|
f36f7296fd | ||
|
|
eff9d5f6e9 | ||
|
|
a75f32857a | ||
|
|
f011fe14bc | ||
|
|
7889a8c467 | ||
|
|
f37cb3a1a7 | ||
|
|
bb6b050d15 | ||
|
|
ec8427c419 | ||
|
|
3211c89610 | ||
|
|
92f31a100e | ||
|
|
960322c21f | ||
|
|
f0596c4914 | ||
|
|
4ff9639daa | ||
|
|
8513c40b62 | ||
|
|
9224e8eb47 | ||
|
|
ee547ec441 | ||
|
|
dc4071d0bc | ||
|
|
1ec07b0198 | ||
|
|
a848dd1bf3 | ||
|
|
901b1ef83e | ||
|
|
79c2209d19 | ||
|
|
c018b4e722 | ||
|
|
28ede4adca | ||
|
|
c61efb1352 | ||
|
|
b36bfa02a6 | ||
|
|
6f9d49be52 | ||
|
|
f702b845be | ||
|
|
2a2bc40282 | ||
|
|
305360b755 | ||
|
|
799bcf9cef | ||
|
|
21cae61f93 | ||
|
|
89507ec8ef | ||
|
|
2bd0e0af81 | ||
|
|
169b02f965 | ||
|
|
9f44bb128f | ||
|
|
b7d16f7188 | ||
|
|
06585fea92 | ||
|
|
7d3397ac31 | ||
|
|
8f9104387e | ||
|
|
2c3c97560d | ||
|
|
ee906dbd5a | ||
|
|
a4e68dd604 | ||
|
|
b45b9dd6c7 | ||
|
|
c52847eaaa | ||
|
|
306b21459e | ||
|
|
af5bdd713f | ||
|
|
2bd770d88d | ||
|
|
39db378bcd | ||
|
|
0c22a4c72e | ||
|
|
1a37228e03 | ||
|
|
c02e1eae9e | ||
|
|
014513d55e | ||
|
|
5e4f270b1e | ||
|
|
ec388b11bb | ||
|
|
fb40432309 | ||
|
|
e7ab480e40 | ||
|
|
9aae23e163 | ||
|
|
f7718b4c08 | ||
|
|
6ef0605542 | ||
|
|
12a2eb8491 | ||
|
|
8b27ade1cb | ||
|
|
b8f18153b3 | ||
|
|
7658a05b84 | ||
|
|
ba2d945079 | ||
|
|
6b931d9b32 | ||
|
|
43754e89b6 | ||
|
|
26b4e3c2d5 | ||
|
|
cfadfd8763 | ||
|
|
6480873e81 | ||
|
|
2e975e678c | ||
|
|
fa7b6fa85f | ||
|
|
d31a983c7e | ||
|
|
6303d311c8 | ||
|
|
bfb0f94b82 | ||
|
|
855f194228 | ||
|
|
db03c6e291 | ||
|
|
be8403dc0d | ||
|
|
edaac86304 | ||
|
|
fc805214c7 | ||
|
|
ee9b44fa80 | ||
|
|
aa5a11bcdd | ||
|
|
80d4a8bfd1 | ||
|
|
31e5eb05c5 | ||
|
|
615f81c251 | ||
|
|
899e7e1647 | ||
|
|
c7bb52a4d4 | ||
|
|
31012bc7e5 | ||
|
|
03259630c2 | ||
|
|
2876d2f921 | ||
|
|
ba7a4a33fc | ||
|
|
e6397723db | ||
|
|
2165624ba8 | ||
|
|
3c233d3a9b | ||
|
|
ecae9e4785 | ||
|
|
32921796e8 | ||
|
|
83ed11e254 | ||
|
|
461968ab5c | ||
|
|
d42aff9fb2 | ||
|
|
5a6cfa401c | ||
|
|
9027a78c4f | ||
|
|
816b7d2d6f | ||
|
|
050b66b5d0 | ||
|
|
6862435594 | ||
|
|
c195580126 | ||
|
|
0747b03c50 | ||
|
|
25558b2c86 | ||
|
|
f1ff1564fb | ||
|
|
ebfd1dfe15 | ||
|
|
51873e0b4d | ||
|
|
bcd6fb08cc | ||
|
|
7457c39f48 | ||
|
|
7a81bba7ca | ||
|
|
5a4b70479c | ||
|
|
2becbebceb | ||
|
|
cf57610e20 | ||
|
|
244b3f7f48 | ||
|
|
42c9e68512 | ||
|
|
17b4a2c966 | ||
|
|
5266274c60 | ||
|
|
00ee2bfad4 | ||
|
|
e6445f7458 | ||
|
|
debc0da3b6 | ||
|
|
ea823db8ea | ||
|
|
fb8c33af8d | ||
|
|
974027e233 | ||
|
|
cb946bff95 | ||
|
|
f22c8995f4 | ||
|
|
550d708637 | ||
|
|
1a592496a1 | ||
|
|
a5eb3161eb | ||
|
|
ffa965d637 | ||
|
|
ef16da72f5 | ||
|
|
19657d488f | ||
|
|
b9fc2180c5 | ||
|
|
daef0523fa | ||
|
|
3269c4f48f | ||
|
|
2526760080 | ||
|
|
5ec22917a1 | ||
|
|
efb76ee5ee | ||
|
|
47222606dd | ||
|
|
fe81ed1653 | ||
|
|
51fe5e7c7b | ||
|
|
3e6002cc95 | ||
|
|
6792d7ded1 | ||
|
|
2b2eb9701c | ||
|
|
93559a2f01 | ||
|
|
ecf3f5d664 | ||
|
|
54e30b1f8b | ||
|
|
de7bb9ba46 | ||
|
|
c1d6dedb5d | ||
|
|
9a89699691 | ||
|
|
34819f8d80 | ||
|
|
6486b7878f | ||
|
|
9fcfb7e1df | ||
|
|
8d4fe38cc3 | ||
|
|
48052e59ee | ||
|
|
b0c9e4b78a | ||
|
|
4e7af35e61 | ||
|
|
4264a63613 | ||
|
|
f90140ee5b | ||
|
|
57dc83976d | ||
|
|
2a88bf271a | ||
|
|
84a17764ed | ||
|
|
98a6d7a8cf | ||
|
|
dd5a74235d | ||
|
|
c10cbead76 | ||
|
|
28e417ef47 | ||
|
|
43a674b6f7 | ||
|
|
cfab53f97b | ||
|
|
df7dca81da | ||
|
|
22b6e87d58 | ||
|
|
4b768c49a6 | ||
|
|
cd4615405f | ||
|
|
ccc3576a4c | ||
|
|
3dd5e493c6 | ||
|
|
e120e141ee | ||
|
|
e794da5492 | ||
|
|
7031e04c75 | ||
|
|
e8de0e29df | ||
|
|
d67ce4d2a1 | ||
|
|
40ab610a8e | ||
|
|
78b1c5b32c | ||
|
|
7b957df709 | ||
|
|
3edc6ed317 | ||
|
|
c43dad4907 | ||
|
|
b4b9fcfaf0 | ||
|
|
3af42feb02 | ||
|
|
16ddba80b3 | ||
|
|
32bb102a86 | ||
|
|
0fcc6498cb | ||
|
|
ab72ddbea4 | ||
|
|
10d360c03c | ||
|
|
4b609e0fff | ||
|
|
49e8aca2bd | ||
|
|
c5ecd0aff3 | ||
|
|
adac554333 | ||
|
|
c6e15fae2d | ||
|
|
7f75d22ab6 | ||
|
|
e148a901a9 | ||
|
|
9c5e156e23 | ||
|
|
626eb5eb68 | ||
|
|
72f3d22942 | ||
|
|
07351d9dd7 | ||
|
|
6ac7e88a63 | ||
|
|
36d2b9e761 | ||
|
|
1681fe7de2 | ||
|
|
214a5ee4aa | ||
|
|
e69548a72a | ||
|
|
877b7b8cb6 | ||
|
|
2476f83b1b | ||
|
|
c9929cf7cf | ||
|
|
8b9c927572 | ||
|
|
b59fe17f4d | ||
|
|
645fd3f917 | ||
|
|
15e1564983 | ||
|
|
c24c039b15 | ||
|
|
8e2205ef07 | ||
|
|
cd3c91b537 | ||
|
|
f6e3fc31d1 | ||
|
|
1f5d3bde7b | ||
|
|
0fc1c3132e | ||
|
|
f18ee6586a | ||
|
|
da8457fbf0 | ||
|
|
29e97a6040 | ||
|
|
5c0f26c6f6 | ||
|
|
fd3f300901 | ||
|
|
025ce5d74d | ||
|
|
bbb2c527d9 | ||
|
|
65db8753de | ||
|
|
890aef14f3 | ||
|
|
7371496f27 | ||
|
|
f792bf2bbf | ||
|
|
9ca4f64030 | ||
|
|
d5909a13f3 | ||
|
|
9b5c72e5ad | ||
|
|
88d3042767 | ||
|
|
9f6e53269d | ||
|
|
66f157cca7 | ||
|
|
94fad7229b | ||
|
|
2b71fd5201 | ||
|
|
a199c1f009 | ||
|
|
936b4dfa32 | ||
|
|
35f3b68d45 | ||
|
|
91f47586cf | ||
|
|
37bbc37fa2 | ||
|
|
a9ea45370d | ||
|
|
a9d7e3844b | ||
|
|
0d2c251b45 | ||
|
|
b02b0db950 | ||
|
|
b2db04e8c2 | ||
|
|
c23ff6810a | ||
|
|
9a6523cade | ||
|
|
e52d173d57 | ||
|
|
9a27c604b1 | ||
|
|
d91c5b9bfe | ||
|
|
b7cdedd0cb | ||
|
|
1c67b6ea16 | ||
|
|
630e27f762 | ||
|
|
35ae4109bc | ||
|
|
81df4e23af | ||
|
|
1e6c3d66c5 | ||
|
|
86f05cf47a | ||
|
|
f02982b6a1 | ||
|
|
5ca9aa4ed2 | ||
|
|
2b47a934d3 | ||
|
|
1736efb33c | ||
|
|
3dcd861d0c | ||
|
|
1809b47bb9 | ||
|
|
d621cc34b6 | ||
|
|
24c7f23e8a | ||
|
|
6efb68f51f | ||
|
|
2121fa6cc1 | ||
|
|
f19d8be2f6 | ||
|
|
ce286701a2 | ||
|
|
6b4325eebc | ||
|
|
6ca3381882 | ||
|
|
6ec5799ce4 | ||
|
|
8b028fff31 | ||
|
|
08c784506e | ||
|
|
e6b5e11311 | ||
|
|
5c7f37f034 | ||
|
|
81d40a2f51 | ||
|
|
27621463fd | ||
|
|
e20b6c9bf4 | ||
|
|
2c7391f2d0 | ||
|
|
5066320a2f | ||
|
|
31bc537b5d | ||
|
|
b2750906fa | ||
|
|
d082502406 | ||
|
|
0afddf945a | ||
|
|
104c33403e | ||
|
|
3097a46a04 | ||
|
|
526712d56c | ||
|
|
2cfa7b7ec7 | ||
|
|
26b6327919 | ||
|
|
0168f5fdda | ||
|
|
c02e3a7b54 | ||
|
|
7cfc80cd41 | ||
|
|
e043e6b764 | ||
|
|
33ed0a9a20 | ||
|
|
7d021d6e89 | ||
|
|
f77999e8dc | ||
|
|
6fb615be73 | ||
|
|
5f34351706 | ||
|
|
b6be560ad0 | ||
|
|
371cfa3a57 | ||
|
|
435ac44cbf | ||
|
|
c212ac93ff | ||
|
|
865c52e883 | ||
|
|
e58d705a8b | ||
|
|
0a3b3ffdb1 | ||
|
|
a4be8bbbe1 | ||
|
|
27bb0f8844 | ||
|
|
7e5e2de263 | ||
|
|
cc93367b22 | ||
|
|
9c5c3f879f | ||
|
|
5bda371861 | ||
|
|
94aa38640a | ||
|
|
d44832aa01 | ||
|
|
8b3c2104bc | ||
|
|
d003a6652d | ||
|
|
6ffee730ec | ||
|
|
838995e816 | ||
|
|
c51f4d5074 | ||
|
|
c8fc39370e | ||
|
|
9c2b75d9af | ||
|
|
9be4316256 | ||
|
|
854e88f385 | ||
|
|
085151cf1f | ||
|
|
0381b0fb95 | ||
|
|
bb3111d68d | ||
|
|
cf19fed17f | ||
|
|
f94d2128d9 | ||
|
|
2632617e70 | ||
|
|
f4f0d92a74 | ||
|
|
85aa774dd4 | ||
|
|
aea6fd4589 | ||
|
|
629ceee307 | ||
|
|
deb73c34fa | ||
|
|
54ac8eb6c2 | ||
|
|
2451236791 | ||
|
|
8fdf48eac1 | ||
|
|
5cc97bc2c0 | ||
|
|
f016ada842 | ||
|
|
24ef896142 | ||
|
|
488cc9d545 | ||
|
|
f0fe340d7d | ||
|
|
c87594ad04 | ||
|
|
391a1e5e89 | ||
|
|
72d0284454 | ||
|
|
0ef3d8650b | ||
|
|
7150d71716 | ||
|
|
091b70deba | ||
|
|
8e0641baca | ||
|
|
4426133c43 | ||
|
|
32daa8f280 | ||
|
|
0f85f9763d | ||
|
|
1c3f7f925e | ||
|
|
aae80847a1 | ||
|
|
4d30423d55 | ||
|
|
e9b4257107 | ||
|
|
b52fc92e93 | ||
|
|
1522280e50 | ||
|
|
5f4a55f594 | ||
|
|
42115e7774 | ||
|
|
137b56cb03 | ||
|
|
c25a22a17d | ||
|
|
cf22e96b37 | ||
|
|
82f5ee0bd3 | ||
|
|
e827da2db2 | ||
|
|
ac4b948a4e | ||
|
|
782664696f | ||
|
|
69944f9dad | ||
|
|
5dd91add89 | ||
|
|
d2452ad8ef | ||
|
|
b8cb0565a8 | ||
|
|
ac9a2a2b81 | ||
|
|
4d4ea8f3c4 | ||
|
|
4c70136ba1 | ||
|
|
f962dc0f11 | ||
|
|
95823cdcdb | ||
|
|
182805c9ca | ||
|
|
1c1508b0c3 | ||
|
|
cba72cb6e6 | ||
|
|
cff6a74430 | ||
|
|
e9186fa8eb | ||
|
|
3d17464c44 | ||
|
|
eed2e2f219 | ||
|
|
16d3cbd5a4 | ||
|
|
80cf81e4d5 | ||
|
|
f92cdcefe4 | ||
|
|
ea836ee2eb | ||
|
|
0990e6fa64 | ||
|
|
2b0759bcff | ||
|
|
d425ded75c | ||
|
|
ec5b45a428 | ||
|
|
2e71e21991 | ||
|
|
24a92c9cbc | ||
|
|
410eb2be2b | ||
|
|
fecf1a710d | ||
|
|
75a7ad4139 | ||
|
|
e874f68f39 | ||
|
|
4bd850853f | ||
|
|
fe5f4b1680 | ||
|
|
297131d23d | ||
|
|
6cf7a30dd4 | ||
|
|
755e134b87 | ||
|
|
192f435cfc | ||
|
|
c5baa3ea19 | ||
|
|
45f4e7d575 | ||
|
|
64da6af3dc | ||
|
|
879427176d | ||
|
|
0962a6f776 | ||
|
|
11d8f63e63 | ||
|
|
f3e17ef90a | ||
|
|
fbca8aab49 | ||
|
|
770ecb3848 | ||
|
|
be6122edc3 | ||
|
|
26ca8b85da | ||
|
|
791578ee0c | ||
|
|
109e807d17 | ||
|
|
d3466a0c4a | ||
|
|
c810e9494c | ||
|
|
037f14806a | ||
|
|
941f5a973a | ||
|
|
b11ccee60d | ||
|
|
1b82e3ae2a | ||
|
|
da05d71014 | ||
|
|
f2825f2181 | ||
|
|
125a0ce081 | ||
|
|
c4a8d31073 | ||
|
|
e286862c59 | ||
|
|
faaaf5fd59 | ||
|
|
cbc8a90152 | ||
|
|
3082b7b9dd | ||
|
|
6675b8a806 | ||
|
|
8b0764e170 | ||
|
|
204a578aaa | ||
|
|
de28c06af5 | ||
|
|
20a5457d5f | ||
|
|
fa575a0103 | ||
|
|
841ce47ecd | ||
|
|
df495d9c04 | ||
|
|
5f755d4ec9 | ||
|
|
a195d25546 | ||
|
|
177e89a399 | ||
|
|
04fcad21d4 | ||
|
|
13dea58e35 | ||
|
|
38dc6fe73e | ||
|
|
33c9a1dade | ||
|
|
b13677363f | ||
|
|
50e5c6a25c | ||
|
|
3812ed2488 | ||
|
|
1cc8a3980c | ||
|
|
b08c6b9441 | ||
|
|
8de3ee27f4 | ||
|
|
82714d163d | ||
|
|
4fa3fb6486 | ||
|
|
62de2e4d50 | ||
|
|
146dcb5e41 | ||
|
|
4889e458d4 | ||
|
|
8f4d9b37d2 | ||
|
|
0e83ff303c | ||
|
|
3d2bd9a898 | ||
|
|
96f6a38869 | ||
|
|
4ef766c05d | ||
|
|
2c721e5177 | ||
|
|
f58617f733 | ||
|
|
1166c5b526 | ||
|
|
a5cacbe383 | ||
|
|
d9302ff982 | ||
|
|
3751b98e7a | ||
|
|
a66938eee8 | ||
|
|
529d150737 | ||
|
|
395e2d55f7 | ||
|
|
4cb677418f | ||
|
|
ad819b354a | ||
|
|
48404bde98 | ||
|
|
a36e6fc14b | ||
|
|
f3eed5f283 | ||
|
|
53fc9e5b71 | ||
|
|
1479109324 | ||
|
|
f106752b48 | ||
|
|
467d3ab59c | ||
|
|
6076516c24 | ||
|
|
af91fdf21e | ||
|
|
4bb8492f43 | ||
|
|
4428a6e738 | ||
|
|
1f3548eee4 | ||
|
|
64d77656cf | ||
|
|
21f191b889 | ||
|
|
60402414f1 | ||
|
|
6fb9d02e8d | ||
|
|
eaac01b58c | ||
|
|
af724ad58a | ||
|
|
590918af32 | ||
|
|
0b59db8fb0 | ||
|
|
04deadd684 | ||
|
|
dd08aa4d45 | ||
|
|
8b3bda82f7 | ||
|
|
6aafb90acd | ||
|
|
a0e12b84c7 | ||
|
|
e56eb2fa67 | ||
|
|
28e75551ed | ||
|
|
045a4aae2d | ||
|
|
53a9e9284d | ||
|
|
189175c4db | ||
|
|
aa9c96d0b5 | ||
|
|
ceaf6db82c | ||
|
|
e4570e22ae | ||
|
|
c9a28309b2 | ||
|
|
6d50eed4f9 | ||
|
|
e922666d5f | ||
|
|
43223f0759 | ||
|
|
2641630b97 | ||
|
|
f4d5a13934 | ||
|
|
61544a0be6 | ||
|
|
e422d0ba86 | ||
|
|
d0d8d77337 | ||
|
|
3f468e4752 | ||
|
|
3b6ced2a58 | ||
|
|
f29bb26880 | ||
|
|
6ede8601b4 | ||
|
|
8a15d19348 | ||
|
|
e0b4e5f76f | ||
|
|
6c04af02cb | ||
|
|
351049b74f | ||
|
|
30127f8a3e | ||
|
|
6863ac02a1 | ||
|
|
24c30e65fb | ||
|
|
c4dd02761a | ||
|
|
72b7a89e9a | ||
|
|
453976e28f | ||
|
|
914fa61819 | ||
|
|
e1a2edb604 | ||
|
|
d245f3f939 | ||
|
|
433296d718 | ||
|
|
28c3c683a0 | ||
|
|
50ba36eb1e | ||
|
|
c69c809264 | ||
|
|
fac05a3bd1 | ||
|
|
60e34d5b03 | ||
|
|
8b480df72d | ||
|
|
5deef1c098 | ||
|
|
11d4fcd56f | ||
|
|
d78648b73c | ||
|
|
525c228bd7 | ||
|
|
ba6a53c6f5 | ||
|
|
0d1dd62b8a | ||
|
|
5ac7265474 | ||
|
|
08701568a1 | ||
|
|
faedce906a | ||
|
|
f5908741d3 | ||
|
|
5414cc1f86 | ||
|
|
371a989f9b | ||
|
|
8b3af3be93 | ||
|
|
d6e519f1c4 | ||
|
|
90fd0a5055 | ||
|
|
3af41f6515 | ||
|
|
ee39054537 | ||
|
|
b5218d371a | ||
|
|
7f5298a802 |
36
.github/CODEOWNERS
vendored
Normal file
36
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# This file is a github code protect rule follow the codeowners https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners#example-of-a-codeowners-file
|
||||
|
||||
* @hongchaodeng @wonderflow @leejanee
|
||||
design/ @hongchaodeng @resouer @wonderflow
|
||||
|
||||
# Owner of CUE
|
||||
pkg/cue @leejanee @FogDong
|
||||
pkg/stdlib @leejanee @FogDong
|
||||
|
||||
# Owner of Workflow
|
||||
pkg/workflow @leejanee @FogDong
|
||||
|
||||
# Owner of rollout
|
||||
pkg/controller/common/rollout/ @wangyikewxgm @wonderflow
|
||||
pkg/controller/core.oam.dev/v1alpha2/applicationrollout @wangyikewxgm @wonderflow
|
||||
pkg/controller/standard.oam.dev/v1alpha1/rollout @wangyikewxgm @wonderflow
|
||||
runtime/rollout @wangyikewxgm @wonderflow
|
||||
|
||||
# Owner of definition controller
|
||||
pkg/controller/core.oam.dev/v1alpha2/core/workflow/workflowstepdefinition @yangsoon @Somefive
|
||||
pkg/controller/core.oam.dev/v1alpha2/core/policies/policydefinition @yangsoon @Somefive
|
||||
pkg/controller/core.oam.dev/v1alpha2/core/components/componentdefinition @yangsoon @zzxwill
|
||||
pkg/controller/core.oam.dev/v1alpha2/core/traits/traitdefinition @yangsoon @zzxwill
|
||||
|
||||
# Owner of health scope controller
|
||||
pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope @captainroy-hy @zzxwill
|
||||
|
||||
# Owner of vela templates
|
||||
vela-templates/ @Somefive @barnettZQG @wonderflow
|
||||
|
||||
# Owner of vela CLI
|
||||
references/cli/ @Somefive @zzxwill
|
||||
|
||||
# Owner of vela APIServer
|
||||
pkg/apiserver/ @barnettZQG @yangsoon
|
||||
|
||||
16
.github/ISSUE_TEMPLATE/bug_report.md
vendored
16
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: Bug report
|
||||
name: "\U0001F41B Bug report"
|
||||
about: Create a report to help us improve
|
||||
title: "[BUG]"
|
||||
title: ""
|
||||
labels: kind/bug
|
||||
assignees: ''
|
||||
|
||||
@@ -15,9 +15,9 @@ A clear and concise description of what the bug is.
|
||||
**To Reproduce**
|
||||
<!--
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
1. The YAML files of Component/Trait I used.
|
||||
2. The YAML file of Application I applied.
|
||||
3. Other operations I have done.
|
||||
4. See error
|
||||
-->
|
||||
|
||||
@@ -31,6 +31,12 @@ A clear and concise description of what you expected to happen.
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
-->
|
||||
|
||||
**KubeVela Version**
|
||||
|
||||
<!--
|
||||
Describe your KubeVela controller or CLI version information.
|
||||
-->
|
||||
|
||||
**Cluster information**
|
||||
<!--
|
||||
Describe your kubernetes cluster information.
|
||||
|
||||
1
.github/ISSUE_TEMPLATE/config.yaml
vendored
1
.github/ISSUE_TEMPLATE/config.yaml
vendored
@@ -1 +0,0 @@
|
||||
blank_issues_enabled: true
|
||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Questions & Help
|
||||
url: https://github.com/oam-dev/kubevela/discussions
|
||||
about: Please ask and answer questions here.
|
||||
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: Feature request
|
||||
name: "\U0001F680 Feature request"
|
||||
about: Suggest an idea for this project
|
||||
title: "[Feature]"
|
||||
labels: kind/feature
|
||||
|
||||
12
.github/ISSUE_TEMPLATE/question.md
vendored
12
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -1,12 +0,0 @@
|
||||
---
|
||||
name: Question
|
||||
about: Help wanted.
|
||||
title: "[Question]"
|
||||
labels: help wanted
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Please write your questions.
|
||||
-->
|
||||
36
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
36
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<!--
|
||||
|
||||
Thank you for sending a pull request! Here are some tips:
|
||||
|
||||
1. If this is your first time, please read our contribution guide at https://github.com/oam-dev/kubevela/blob/master/CONTRIBUTING.md
|
||||
|
||||
2. Ensure you include and run the appropriate tests as part of your Pull Request.
|
||||
|
||||
3. In a new feature or configuration option, an update to the documentation is necessary. Everything related to the documentation is under the docs folder in the root of the repository.
|
||||
|
||||
4. If the Pull Request is a work in progress, make use of GitHub's "Draft PR" feature and mark it as such.
|
||||
|
||||
5. If you can not merge your Pull Request due to a merge conflict, Rebase it. This gets it in sync with the master branch.
|
||||
|
||||
6. Name your PR as "<FeatureArea>: Describe your change", e.g. Application: Add health check for application.
|
||||
If it's a fix or feature relevant for the changelog describe the user impact in the title.
|
||||
The PR title is used to auto-generate the changelog for issues marked with the "add to changelog" label.
|
||||
|
||||
-->
|
||||
|
||||
**What this PR does / why we need it**:
|
||||
|
||||
**Which issue(s) this PR fixes**:
|
||||
|
||||
<!--
|
||||
|
||||
- Automatically closes linked issue when the Pull Request is merged.
|
||||
|
||||
Usage: "Fixes #<issue number>", or "Fixes (paste link of issue)"
|
||||
|
||||
-->
|
||||
|
||||
Fixes #
|
||||
|
||||
**Special notes for your reviewer**:
|
||||
|
||||
31
.github/bot.md
vendored
Normal file
31
.github/bot.md
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
### GitHub & kubevela automation
|
||||
|
||||
The bot is configured via [issue-commands.json](https://github.com/oam-dev/kubevela/blob/master/.github/workflows/issue-commands.json)
|
||||
and some other GitHub [workflows](https://github.com/oam-dev/kubevela/blob/master/.github/workflows).
|
||||
By default, users with write access to the repo is allowed to use the comments,
|
||||
the [userlist](https://github.com/oam-dev/kubevela/blob/master/.github/comment.userlist)
|
||||
file is for adding additional members who do not have access and want to contribute to the issue triage.
|
||||
|
||||
Comment commands:
|
||||
* Write the word `/needsInvestigation` in a comment, and the bot will add the corresponding label.
|
||||
* Write the word `/needsMoreInfo` in a comment, and the bot will add the correct label and standard message.
|
||||
* Write the word `/duplicate #<number>` to have `type/duplicate` label, the issue number is required for remind where is the other issue.
|
||||
* Write the word `/type/*` in a comment, and the bot will add the corresponding label `/type/*`.
|
||||
* Write the word `/area/*` in a comment, and the bot will add the corresponding label `/area/*`.
|
||||
* Write the word `/priority/*` in a comment, and the bot will add the corresponding label `/priority/*`.
|
||||
|
||||
The `*` mention above represent a specific word. Please read the details about label category in [ISSUE_TRIAGE.md](https://github.com/oam-dev/kubevela/blob/master/ISSUE_TRIAGE.md)
|
||||
|
||||
Label commands:
|
||||
|
||||
* Add label `bot/question` the bot will close with standard question message and add label `type/question`
|
||||
* Add label `bot/needs more info` for bot to request more info (or use comment command mentioned above)
|
||||
* Add label `bot/no new info` for bot to close an issue where we asked for more info but has not received any updates in at least 14 days.
|
||||
* Add label `bot/duplicate` to have `type/duplicate` label & the bot will close issue with an appropriate message.
|
||||
* Add label `bot/close feature request` for bot to close a feature request with standard message.
|
||||
|
||||
Assign:
|
||||
When you participating in an issue area, and you want to assign to others
|
||||
to distribute this task or self-assign to give a solution. You can use the comment bellow.
|
||||
* Write the word `/assign githubname` in a comment, the robot will automatically assign to the corresponding person.
|
||||
* Specially, write the word `/assign` in a comment, you can assgin this task to yourself.
|
||||
14
.github/comment.userlist
vendored
Normal file
14
.github/comment.userlist
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
resouer
|
||||
wonderflow
|
||||
hongchaodeng
|
||||
zzxwill
|
||||
ryanzhang-oss
|
||||
captainroy-hy
|
||||
wangyikewxgm
|
||||
BinaryHB0916
|
||||
yangsoon
|
||||
wangyuan249
|
||||
chivalryq
|
||||
FogDong
|
||||
leejanee
|
||||
barnettZQG
|
||||
15
.github/how-to.md
vendored
Normal file
15
.github/how-to.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# Github Utilities
|
||||
|
||||
## How to add a custom runner
|
||||
|
||||
1. Create an ECS that can connect github. Create a normal user(DON'T use `root`).
|
||||
2. Install Dependencies:
|
||||
- Kind
|
||||
- Docker `apt install docker.io`, and the user to docker group(`usermod -aG docker <user>`)
|
||||
- Kubectl
|
||||
- Go(1.14 for now, must align with CI)
|
||||
- Helm v3
|
||||
- ginkgo
|
||||
- Add all these dependencies to $PATH.
|
||||
3. Install Custom runner agent https://docs.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners
|
||||
4. Run the runner as service https://docs.github.com/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service
|
||||
153
.github/issue-commands.json
vendored
Normal file
153
.github/issue-commands.json
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
[
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "needsMoreInfo",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "needs more info"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "needsInvestigation",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "needs investigation"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "assign",
|
||||
"allowUsers": ["*"]
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "type/bug",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "type/bug"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "type/docs",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "type/docs"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "type/enhancement",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "type/enhancement"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "priority/critical",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "priority/critical"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "priority/important-soon",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "priority/important-soon"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "priority/important-longterm",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "priority/important-longterm"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "priority/nice-to-have",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "priority/nice-to-have"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "priority/awaiting-more-evidence",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "priority/awaiting-more-evidence"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "priority/unscheduled",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "priority/unscheduled"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "area/appconfig",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "area/appconfig"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "area/application",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "area/application"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "area/component",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "area/component"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "area/controller",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "area/controller"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "area/cue",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "area/cue"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "area/trait",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "area/trait"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "duplicate",
|
||||
"allowUsers": [],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "type/duplicate"
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "bot/duplicate",
|
||||
"addLabel": "type/duplicate",
|
||||
"removeLabel": "bot/duplicate",
|
||||
"action": "close",
|
||||
"comment": "Thanks for creating this issue! It looks like this has already been reported by another user. We’ve closed this in favor of the existing one. Please consider adding any details you think is missing to that issue.\n\nTo avoid having your issue closed in the future, please read our [CONTRIBUTING](https://github.com/oam-dev/kubevela/blob/master/CONTRIBUTING.md) guidelines.\n\nHappy graphing!"
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "bot/no new info",
|
||||
"action": "close",
|
||||
"comment": "We've closed this issue since it needs more information and hasn't had any activity recently. We can re-open it after you you add more information. To avoid having your issue closed in the future, please read our [CONTRIBUTING](https://github.com/oam-dev/kubevela/blob/master/CONTRIBUTING.md) guidelines.\n\nHappy graphing!"
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "bot/close feature request",
|
||||
"action": "close",
|
||||
"comment": "This feature request has been open for a long time with few received upvotes or comments, so we are closing it. We're trying to limit open GitHub issues in order to better track planned work and features. \r\n\r\nThis doesn't mean that we'll never ever implement it or that we will never accept a PR for it. A closed issue can still attract upvotes and act as a ticket to track feature demand\/interest. \r\n\r\nThank You to you for taking the time to create this issue!"
|
||||
}
|
||||
]
|
||||
30
.github/workflows/codeql-analysis.yml
vendored
Normal file
30
.github/workflows/codeql-analysis.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, release-* ]
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'go' ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
13
.github/workflows/commit-lint.yml
vendored
Normal file
13
.github/workflows/commit-lint.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
name: Lint Commit Messages
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
commitlint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: wagoid/commitlint-github-action@v4
|
||||
with:
|
||||
helpURL: https://github.com/oam-dev/kubevela/blob/master/contribute/create-pull-request.md#commit-message-format
|
||||
25
.github/workflows/dashboard.yml
vendored
25
.github/workflows/dashboard.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Dashboard
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./dashboard
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
|
||||
25
.github/workflows/docker.yml
vendored
25
.github/workflows/docker.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Publish to Registry
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Publish to Github Docker Package Registry
|
||||
uses: elgohr/Publish-Docker-Github-Action@2.21
|
||||
with:
|
||||
name: oam-dev/kubevela/vela-core
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
registry: docker.pkg.github.com
|
||||
tags: "latest"
|
||||
- name: Publish to Docker Hub Registry
|
||||
uses: elgohr/Publish-Docker-Github-Action@2.21
|
||||
with:
|
||||
name: oamdev/vela-core
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
tags: "latest"
|
||||
103
.github/workflows/e2e-multicluster-test.yml
vendored
Normal file
103
.github/workflows/e2e-multicluster-test.yml
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
name: E2E MultiCluster Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
workflow_dispatch: {}
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.16'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
KIND_VERSION: 'v0.7.0'
|
||||
|
||||
jobs:
|
||||
|
||||
detect-noop:
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
steps:
|
||||
- name: Detect No-op Changes
|
||||
id: noop
|
||||
uses: fkirc/skip-duplicate-actions@v3.3.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
|
||||
concurrent_skipping: false
|
||||
|
||||
e2e-multi-cluster-tests:
|
||||
runs-on: aliyun
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
go get -v -t -d ./...
|
||||
|
||||
- name: Setup Kind
|
||||
uses: engineerd/setup-kind@v0.5.0
|
||||
with:
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
skipClusterCreation: true
|
||||
|
||||
- name: Setup Kind Cluster (Worker)
|
||||
run: |
|
||||
kind delete cluster --name worker
|
||||
kind create cluster --image kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4 --name worker
|
||||
kubectl version
|
||||
kubectl cluster-info
|
||||
kind get kubeconfig --name worker --internal > /tmp/worker.kubeconfig
|
||||
kind get kubeconfig --name worker > /tmp/worker.client.kubeconfig
|
||||
|
||||
- name: Setup Kind Cluster (Hub)
|
||||
run: |
|
||||
kind delete cluster
|
||||
kind create cluster --image kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4
|
||||
kubectl version
|
||||
kubectl cluster-info
|
||||
|
||||
- name: Load Image to kind cluster (Hub)
|
||||
run: make kind-load
|
||||
|
||||
- name: Cleanup for e2e tests
|
||||
run: |
|
||||
make e2e-cleanup
|
||||
make e2e-setup-core
|
||||
|
||||
- name: Run e2e multicluster tests
|
||||
run: make e2e-multicluster-test
|
||||
|
||||
- name: Stop kubevela, get profile
|
||||
run: make end-e2e-core
|
||||
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: /tmp/e2e-profile.out,/tmp/e2e_multicluster_test.out
|
||||
flags: e2e-multicluster-test
|
||||
name: codecov-umbrella
|
||||
|
||||
- name: Clean e2e profile
|
||||
run: rm /tmp/e2e-profile.out
|
||||
|
||||
- name: Cleanup image
|
||||
if: ${{ always() }}
|
||||
run: make image-cleanup
|
||||
102
.github/workflows/e2e-rollout-test.yml
vendored
Normal file
102
.github/workflows/e2e-rollout-test.yml
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
name: E2E Rollout Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
workflow_dispatch: {}
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.16'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
KIND_VERSION: 'v0.7.0'
|
||||
|
||||
jobs:
|
||||
|
||||
detect-noop:
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
steps:
|
||||
- name: Detect No-op Changes
|
||||
id: noop
|
||||
uses: fkirc/skip-duplicate-actions@v3.3.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
|
||||
concurrent_skipping: false
|
||||
|
||||
e2e-rollout-tests:
|
||||
runs-on: aliyun
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
go get -v -t -d ./...
|
||||
|
||||
- name: Setup Kind
|
||||
uses: engineerd/setup-kind@v0.5.0
|
||||
with:
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
skipClusterCreation: true
|
||||
|
||||
- name: Setup Kind Cluster
|
||||
run: |
|
||||
kind delete cluster
|
||||
kind create cluster --image kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4
|
||||
kubectl version
|
||||
kubectl cluster-info
|
||||
|
||||
- name: Load Image to kind cluster
|
||||
run: make kind-load
|
||||
|
||||
- name: Run Make
|
||||
run: make
|
||||
|
||||
- name: Run Make Manager
|
||||
run: make manager
|
||||
|
||||
- name: Prepare for e2e tests
|
||||
run: |
|
||||
make e2e-cleanup
|
||||
make e2e-setup
|
||||
helm lint ./charts/vela-core
|
||||
helm test -n vela-system kubevela --timeout 5m
|
||||
|
||||
- name: Run e2e tests
|
||||
run: make e2e-rollout-test
|
||||
|
||||
- name: Stop kubevela, get profile
|
||||
run: make end-e2e
|
||||
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: /tmp/e2e-profile.out,/tmp/oam-e2e-profile.out
|
||||
flags: e2e-rollout-tests
|
||||
name: codecov-umbrella
|
||||
|
||||
- name: Clean e2e profile
|
||||
run: rm /tmp/e2e-profile.out /tmp/oam-e2e-profile.out
|
||||
|
||||
- name: Cleanup image
|
||||
if: ${{ always() }}
|
||||
run: make image-cleanup
|
||||
105
.github/workflows/e2e-test.yml
vendored
Normal file
105
.github/workflows/e2e-test.yml
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
name: E2E Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
workflow_dispatch: {}
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.16'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
KIND_VERSION: 'v0.7.0'
|
||||
|
||||
jobs:
|
||||
|
||||
detect-noop:
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
steps:
|
||||
- name: Detect No-op Changes
|
||||
id: noop
|
||||
uses: fkirc/skip-duplicate-actions@v3.3.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
|
||||
concurrent_skipping: false
|
||||
|
||||
e2e-tests:
|
||||
runs-on: aliyun
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
go get -v -t -d ./...
|
||||
|
||||
- name: Setup Kind
|
||||
uses: engineerd/setup-kind@v0.5.0
|
||||
with:
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
skipClusterCreation: true
|
||||
|
||||
- name: Setup Kind Cluster
|
||||
run: |
|
||||
kind delete cluster
|
||||
kind create cluster --image kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4
|
||||
kubectl version
|
||||
kubectl cluster-info
|
||||
|
||||
- name: Load Image to kind cluster
|
||||
run: make kind-load
|
||||
|
||||
- name: Run Make
|
||||
run: make
|
||||
|
||||
- name: Run Make Manager
|
||||
run: make manager
|
||||
|
||||
- name: Prepare for e2e tests
|
||||
run: |
|
||||
make e2e-cleanup
|
||||
make e2e-setup
|
||||
helm lint ./charts/vela-core
|
||||
helm test -n vela-system kubevela --timeout 5m
|
||||
|
||||
- name: Run api e2e tests
|
||||
run: make e2e-api-test
|
||||
|
||||
- name: Run e2e tests
|
||||
run: make e2e-test
|
||||
|
||||
- name: Stop kubevela, get profile
|
||||
run: make end-e2e
|
||||
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: /tmp/e2e-profile.out,/tmp/oam-e2e-profile.out
|
||||
flags: e2etests
|
||||
name: codecov-umbrella
|
||||
|
||||
- name: Clean e2e profile
|
||||
run: rm /tmp/e2e-profile.out /tmp/oam-e2e-profile.out
|
||||
|
||||
- name: Cleanup image
|
||||
if: ${{ always() }}
|
||||
run: make image-cleanup
|
||||
51
.github/workflows/e2e.yml
vendored
51
.github/workflows/e2e.yml
vendored
@@ -1,51 +0,0 @@
|
||||
name: E2E
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go 1.13
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.13
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
go get -v -t -d ./...
|
||||
|
||||
- name: Install ginkgo
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y golang-ginkgo-dev
|
||||
|
||||
- name: Setup Kind Cluster
|
||||
uses: engineerd/setup-kind@v0.4.0
|
||||
with:
|
||||
version: "v0.7.0"
|
||||
|
||||
- name: install Kubebuilder
|
||||
uses: RyanSiu1995/kubebuilder-action@v1
|
||||
|
||||
- name: Run Make
|
||||
run: make
|
||||
|
||||
- name: Run Make Manager
|
||||
run: make manager
|
||||
|
||||
- name: Run e2e tests
|
||||
run: |
|
||||
make e2e-setup
|
||||
make e2e-test
|
||||
make e2e-api-test
|
||||
make e2e-cleanup
|
||||
165
.github/workflows/go.yml
vendored
165
.github/workflows/go.yml
vendored
@@ -2,36 +2,173 @@ name: Go
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
workflow_dispatch: {}
|
||||
pull_request:
|
||||
branches: [master]
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.16'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
KIND_VERSION: 'v0.7.0'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
detect-noop:
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
steps:
|
||||
- name: Set up Go 1.13
|
||||
- name: Detect No-op Changes
|
||||
id: noop
|
||||
uses: fkirc/skip-duplicate-actions@v3.3.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
|
||||
concurrent_skipping: false
|
||||
|
||||
compatibility-test:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.13
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Cache Go Dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .work/pkg
|
||||
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: ${{ runner.os }}-pkg-
|
||||
|
||||
- name: Install ginkgo
|
||||
run: |
|
||||
sudo apt-get update
|
||||
run: |
|
||||
sudo apt-get install -y golang-ginkgo-dev
|
||||
|
||||
- name: Setup Kind Cluster
|
||||
uses: engineerd/setup-kind@v0.4.0
|
||||
uses: engineerd/setup-kind@v0.5.0
|
||||
with:
|
||||
version: "v0.7.0"
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
|
||||
- name: install Kubebuilder
|
||||
uses: RyanSiu1995/kubebuilder-action@v1
|
||||
uses: RyanSiu1995/kubebuilder-action@v1.2
|
||||
with:
|
||||
version: 3.1.0
|
||||
kubebuilderOnly: false
|
||||
kubernetesVersion: v1.21.2
|
||||
|
||||
- name: Run Make test
|
||||
run: make test
|
||||
- name: Run Make compatibility-test
|
||||
run: make compatibility-test
|
||||
|
||||
- name: Clean up testdata
|
||||
run: make compatibility-testdata-cleanup
|
||||
|
||||
staticcheck:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Cache Go Dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .work/pkg
|
||||
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: ${{ runner.os }}-pkg-
|
||||
|
||||
- name: Install StaticCheck
|
||||
run: GO111MODULE=off go get honnef.co/go/tools/cmd/staticcheck
|
||||
|
||||
- name: Static Check
|
||||
run: staticcheck ./...
|
||||
|
||||
- name: License Header Check
|
||||
run: make check-license-header
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Cache Go Dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .work/pkg
|
||||
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: ${{ runner.os }}-pkg-
|
||||
|
||||
# This action uses its own setup-go, which always seems to use the latest
|
||||
# stable version of Go. We could run 'make lint' to ensure our desired Go
|
||||
# version, but we prefer this action because it leaves 'annotations' (i.e.
|
||||
# it comments on PRs to point out linter violations).
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v2
|
||||
with:
|
||||
version: ${{ env.GOLANGCI_VERSION }}
|
||||
|
||||
check-diff:
|
||||
runs-on: aliyun
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Cache Go Dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .work/pkg
|
||||
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: ${{ runner.os }}-pkg-
|
||||
|
||||
- name: Check code formatting
|
||||
run: go install golang.org/x/tools/cmd/goimports && make fmt
|
||||
|
||||
- name: Run cross-build
|
||||
run: make cross-build
|
||||
|
||||
- name: Check Diff
|
||||
run: make check-diff
|
||||
|
||||
- name: Cleanup binary
|
||||
run: make build-cleanup
|
||||
|
||||
24
.github/workflows/issue-commands.yml
vendored
Normal file
24
.github/workflows/issue-commands.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: Run commands when issues are labeled or comments added
|
||||
on:
|
||||
issues:
|
||||
types: [labeled, opened]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: "oam-dev/kubevela-github-actions"
|
||||
path: ./actions
|
||||
ref: v0.4.1
|
||||
- name: Install Actions
|
||||
run: npm install --production --prefix ./actions
|
||||
- name: Run Commands
|
||||
uses: ./actions/commands
|
||||
with:
|
||||
token: ${{secrets.VELA_BOT_TOKEN}}
|
||||
configPath: issue-commands
|
||||
26
.github/workflows/license.yml
vendored
Normal file
26
.github/workflows/license.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: license
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
workflow_dispatch: {}
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
jobs:
|
||||
license_check:
|
||||
runs-on: ubuntu-latest
|
||||
name: Check for unapproved licenses
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
- name: Install dependencies
|
||||
run: gem install license_finder
|
||||
- name: Run tests
|
||||
run: license_finder --decisions_file .license/dependency_decisions.yml
|
||||
184
.github/workflows/registry.yml
vendored
Normal file
184
.github/workflows/registry.yml
vendored
Normal file
@@ -0,0 +1,184 @@
|
||||
name: Registry
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
env:
|
||||
BUCKET: ${{ secrets.OSS_BUCKET }}
|
||||
ENDPOINT: ${{ secrets.OSS_ENDPOINT }}
|
||||
ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
|
||||
ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
|
||||
ARTIFACT_HUB_REPOSITORY_ID: ${{ secrets.ARTIFACT_HUB_REPOSITORY_ID }}
|
||||
|
||||
jobs:
|
||||
publish-images:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=${GITHUB_REF#refs/tags/}
|
||||
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
|
||||
VERSION=latest
|
||||
fi
|
||||
echo ::set-output name=VERSION::${VERSION}
|
||||
- name: Get git revision
|
||||
id: vars
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=git_revision::$(git rev-parse --short HEAD)"
|
||||
- name: Login ghcr.io
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Login docker.io
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: docker.io
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
driver-opts: image=moby/buildkit:master
|
||||
- uses: docker/build-push-action@v2
|
||||
name: Build & Pushing
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
labels: |-
|
||||
org.opencontainers.image.source=https://github.com/${{ github.repository }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
build-args: |
|
||||
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
|
||||
VERSION=${{ steps.get_version.outputs.VERSION }}
|
||||
tags: |-
|
||||
ghcr.io/${{ github.repository }}/vela-core:${{ steps.get_version.outputs.VERSION }}
|
||||
docker.io/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
|
||||
- uses: docker/build-push-action@v2
|
||||
name: Build & Pushing runtime rollout
|
||||
with:
|
||||
context: .
|
||||
file: runtime/rollout/Dockerfile
|
||||
labels: |-
|
||||
org.opencontainers.image.source=https://github.com/${{ github.repository }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
build-args: |
|
||||
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
|
||||
VERSION=${{ steps.get_version.outputs.VERSION }}
|
||||
tags: |-
|
||||
ghcr.io/${{ github.repository }}/vela-rollout:${{ steps.get_version.outputs.VERSION }}
|
||||
docker.io/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
|
||||
|
||||
publish-charts:
|
||||
env:
|
||||
HELM_CHARTS_DIR: charts
|
||||
HELM_CHART: charts/vela-core
|
||||
MINIMAL_HELM_CHART: charts/vela-minimal
|
||||
LEGACY_HELM_CHART: legacy/charts/vela-core-legacy
|
||||
OAM_RUNTIME_HELM_CHART: charts/oam-runtime
|
||||
VELA_ROLLOUT_HELM_CHART: runtime/rollout/charts
|
||||
LOCAL_OSS_DIRECTORY: .oss/
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Get git revision
|
||||
id: vars
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=git_revision::$(git rev-parse --short HEAD)"
|
||||
- name: Install Helm
|
||||
uses: azure/setup-helm@v1
|
||||
with:
|
||||
version: v3.4.0
|
||||
- name: Prepare legacy chart
|
||||
run: |
|
||||
rsync -r $LEGACY_HELM_CHART $HELM_CHARTS_DIR
|
||||
rsync -r $HELM_CHART/* $LEGACY_HELM_CHART --exclude=Chart.yaml --exclude=crds
|
||||
- name: Prepare vela chart
|
||||
run: |
|
||||
rsync -r $VELA_ROLLOUT_HELM_CHART $HELM_CHARTS_DIR
|
||||
- uses: oprypin/find-latest-tag@v1
|
||||
with:
|
||||
repository: oam-dev/kubevela
|
||||
releases-only: true
|
||||
id: latest_tag
|
||||
- name: Tag helm chart image
|
||||
run: |
|
||||
latest_repo_tag=${{ steps.latest_tag.outputs.tag }}
|
||||
sub="."
|
||||
major="$(cut -d"$sub" -f1 <<<"$latest_repo_tag")"
|
||||
minor="$(cut -d"$sub" -f2 <<<"$latest_repo_tag")"
|
||||
patch="0"
|
||||
current_repo_tag="$major.$minor.$patch"
|
||||
image_tag=${GITHUB_REF#refs/tags/}
|
||||
chart_version=$latest_repo_tag
|
||||
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
|
||||
image_tag=latest
|
||||
chart_version=${current_repo_tag}-nightly-build
|
||||
fi
|
||||
sed -i "s/latest/${image_tag}/g" $HELM_CHART/values.yaml
|
||||
sed -i "s/latest/${image_tag}/g" $MINIMAL_HELM_CHART/values.yaml
|
||||
sed -i "s/latest/${image_tag}/g" $LEGACY_HELM_CHART/values.yaml
|
||||
sed -i "s/latest/${image_tag}/g" $OAM_RUNTIME_HELM_CHART/values.yaml
|
||||
sed -i "s/latest/${image_tag}/g" $VELA_ROLLOUT_HELM_CHART/values.yaml
|
||||
chart_smever=${chart_version#"v"}
|
||||
sed -i "s/0.1.0/$chart_smever/g" $HELM_CHART/Chart.yaml
|
||||
sed -i "s/0.1.0/$chart_smever/g" $MINIMAL_HELM_CHART/Chart.yaml
|
||||
sed -i "s/0.1.0/$chart_smever/g" $LEGACY_HELM_CHART/Chart.yaml
|
||||
sed -i "s/0.1.0/$chart_smever/g" $OAM_RUNTIME_HELM_CHART/Chart.yaml
|
||||
sed -i "s/0.1.0/$chart_smever/g" $VELA_ROLLOUT_HELM_CHART/Chart.yaml
|
||||
- name: Install ossutil
|
||||
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
|
||||
- name: Configure Alibaba Cloud OSSUTIL
|
||||
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT} -c .ossutilconfig
|
||||
- name: sync cloud to local
|
||||
run: ./ossutil --config-file .ossutilconfig sync oss://$BUCKET/core $LOCAL_OSS_DIRECTORY
|
||||
- name: add artifacthub stuff to the repo
|
||||
run: |
|
||||
rsync README.md $HELM_CHART/README.md
|
||||
rsync README.md $LEGACY_HELM_CHART/README.md
|
||||
rsync README.md $OAM_RUNTIME_HELM_CHART/README.md
|
||||
rsync README.md $VELA_ROLLOUT_HELM_CHART/README.md
|
||||
sed -i "s/ARTIFACT_HUB_REPOSITORY_ID/$ARTIFACT_HUB_REPOSITORY_ID/g" hack/artifacthub/artifacthub-repo.yml
|
||||
rsync hack/artifacthub/artifacthub-repo.yml $LOCAL_OSS_DIRECTORY
|
||||
- name: Package helm charts
|
||||
run: |
|
||||
helm package $HELM_CHART --destination $LOCAL_OSS_DIRECTORY
|
||||
helm package $MINIMAL_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
|
||||
helm package $LEGACY_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
|
||||
helm package $OAM_RUNTIME_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
|
||||
helm package $VELA_ROLLOUT_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
|
||||
helm repo index --url https://$BUCKET.$ENDPOINT/core $LOCAL_OSS_DIRECTORY
|
||||
- name: sync local to cloud
|
||||
run: ./ossutil --config-file .ossutilconfig sync $LOCAL_OSS_DIRECTORY oss://$BUCKET/core -f
|
||||
|
||||
publish-capabilities:
|
||||
env:
|
||||
CAPABILITY_BUCKET: kubevela-registry
|
||||
CAPABILITY_DIR: capabilities
|
||||
CAPABILITY_ENDPOINT: oss-cn-beijing.aliyuncs.com
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Install ossutil
|
||||
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
|
||||
- name: Configure Alibaba Cloud OSSUTIL
|
||||
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${CAPABILITY_ENDPOINT} -c .ossutilconfig
|
||||
- name: sync capabilities bucket to local
|
||||
run: ./ossutil --config-file .ossutilconfig sync oss://$CAPABILITY_BUCKET $CAPABILITY_DIR
|
||||
- name: rsync all capabilites
|
||||
run: rsync vela-templates/registry/auto-gen/* $CAPABILITY_DIR
|
||||
- name: sync local to cloud
|
||||
run: ./ossutil --config-file .ossutilconfig sync $CAPABILITY_DIR oss://$CAPABILITY_BUCKET -f
|
||||
134
.github/workflows/release.yml
vendored
134
.github/workflows/release.yml
vendored
@@ -4,106 +4,126 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
publish-cli:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
VELA_VERSION: ${{ github.ref }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- name: Set up Go 1.13
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.13
|
||||
go-version: 1.16
|
||||
id: go
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
- name: Use Node.js 10.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 10.x
|
||||
- name: Run npm install
|
||||
run: make npm-install
|
||||
- name: Run npm build
|
||||
run: make npm-build
|
||||
- name: Run generate-source
|
||||
run: make generate-source
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
|
||||
- name: Tag helm chart image
|
||||
run: |
|
||||
sed -i 's/latest/${{ steps.get_version.outputs.VERSION }}/g' charts/vela-core/values.yaml
|
||||
sed -i 's/0.1.0/${{ steps.get_version.outputs.VERSION }}/g' charts/vela-core/Chart.yaml
|
||||
- name: Run cross-build
|
||||
run: make cross-build
|
||||
- name: Run compress binary
|
||||
run: make compress
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
|
||||
- name: Upload Linux tar.gz
|
||||
- name: Get release
|
||||
id: get_release
|
||||
uses: bruceadams/get-release@v1.2.2
|
||||
- name: Upload Vela Linux amd64 tar.gz
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela-linux-amd64.tar.gz
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela/vela-linux-amd64.tar.gz
|
||||
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Linux zip
|
||||
- name: Upload Vela Linux amd64 zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela-linux-amd64.zip
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela/vela-linux-amd64.zip
|
||||
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload MacOS tar.gz
|
||||
- name: Upload Vela MacOS tar.gz
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela-darwin-amd64.tar.gz
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela/vela-darwin-amd64.tar.gz
|
||||
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload MacOS zip
|
||||
- name: Upload Vela MacOS zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela-darwin-amd64.zip
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela/vela-darwin-amd64.zip
|
||||
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Windows tar.gz
|
||||
- name: Upload Vela Windows tar.gz
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela-windows-amd64.tar.gz
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela/vela-windows-amd64.tar.gz
|
||||
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Windows zip
|
||||
- name: Upload Vela Windows zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela-windows-amd64.zip
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela/vela-windows-amd64.zip
|
||||
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela Linux amd64 tar.gz
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/kubectl-vela/kubectl-vela-linux-amd64.tar.gz
|
||||
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela Linux amd64 zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/kubectl-vela/kubectl-vela-linux-amd64.zip
|
||||
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela MacOS tar.gz
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/kubectl-vela/kubectl-vela-darwin-amd64.tar.gz
|
||||
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela MacOS zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/kubectl-vela/kubectl-vela-darwin-amd64.zip
|
||||
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela Windows tar.gz
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/kubectl-vela/kubectl-vela-windows-amd64.tar.gz
|
||||
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela Windows zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/kubectl-vela/kubectl-vela-windows-amd64.zip
|
||||
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Checksums
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/sha256sums.txt
|
||||
asset_name: sha256sums.txt
|
||||
asset_content_type: text/plain
|
||||
- name: Publish to Github Docker Package Registry
|
||||
uses: elgohr/Publish-Docker-Github-Action@2.21
|
||||
with:
|
||||
name: oam-dev/kubevela/vela-core
|
||||
username: $GITHUB_ACTOR
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
registry: docker.pkg.github.com
|
||||
tags: "${{ steps.get_version.outputs.VERSION }}"
|
||||
- name: Publish to Docker Hub Registry
|
||||
uses: elgohr/Publish-Docker-Github-Action@2.21
|
||||
with:
|
||||
name: oamdev/vela-core
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
tags: "${{ steps.get_version.outputs.VERSION }}"
|
||||
- name: Update kubectl plugin version in krew-index
|
||||
uses: rajatjindal/krew-release-bot@v0.0.38
|
||||
|
||||
37
.github/workflows/sync-api.yml
vendored
Normal file
37
.github/workflows/sync-api.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: sync-api
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'apis/**'
|
||||
- 'pkg/oam/**'
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
sync-core-api:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Set up Go 1.16
|
||||
uses: actions/setup-go@v1
|
||||
env:
|
||||
GO_VERSION: '1.16'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
|
||||
|
||||
- name: Sync to kubevela-core-api Repo
|
||||
env:
|
||||
SSH_DEPLOY_KEY: ${{ secrets.VELA_API_DEPLOY }}
|
||||
VERSION: ${{ steps.get_version.outputs.VERSION }}
|
||||
COMMIT_ID: ${{ github.sha }}
|
||||
run: |
|
||||
bash ./hack/apis/clientgen.sh
|
||||
bash ./hack/apis/sync.sh
|
||||
10
.github/workflows/timed-task.yml
vendored
Normal file
10
.github/workflows/timed-task.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
name: Timed Task
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 * * * *'
|
||||
jobs:
|
||||
clean-image:
|
||||
runs-on: aliyun
|
||||
steps:
|
||||
- name: Cleanup image
|
||||
run: docker image prune -f
|
||||
85
.github/workflows/unit-test.yml
vendored
Normal file
85
.github/workflows/unit-test.yml
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
name: Unit-Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
workflow_dispatch: {}
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.16'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
KIND_VERSION: 'v0.7.0'
|
||||
|
||||
jobs:
|
||||
|
||||
detect-noop:
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
steps:
|
||||
- name: Detect No-op Changes
|
||||
id: noop
|
||||
uses: fkirc/skip-duplicate-actions@v3.3.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
|
||||
concurrent_skipping: false
|
||||
|
||||
unit-tests:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Cache Go Dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .work/pkg
|
||||
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: ${{ runner.os }}-pkg-
|
||||
|
||||
- name: Install ginkgo
|
||||
run: |
|
||||
sudo apt-get install -y golang-ginkgo-dev
|
||||
|
||||
- name: Setup Kind Cluster
|
||||
uses: engineerd/setup-kind@v0.5.0
|
||||
with:
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
|
||||
- name: install Kubebuilder
|
||||
uses: RyanSiu1995/kubebuilder-action@v1.2
|
||||
with:
|
||||
version: 3.1.0
|
||||
kubebuilderOnly: false
|
||||
kubernetesVersion: v1.21.2
|
||||
|
||||
- name: Run Make test
|
||||
run: make test
|
||||
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
file: ./coverage.txt
|
||||
flags: unittests
|
||||
name: codecov-umbrella
|
||||
20
.gitignore
vendored
20
.gitignore
vendored
@@ -13,6 +13,7 @@ e2e/vela
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
coverage.txt
|
||||
|
||||
# Kubernetes Generated files - skip generated files, except for vendored files
|
||||
|
||||
@@ -24,6 +25,7 @@ e2e/vela
|
||||
*.swo
|
||||
*~
|
||||
.DS_Store
|
||||
_.yaml
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
vendor/
|
||||
@@ -33,16 +35,14 @@ vendor/
|
||||
|
||||
pkg/test/vela
|
||||
config/crd/bases
|
||||
tmp/
|
||||
_tmp/
|
||||
|
||||
cmd/vela/fake/source.go
|
||||
references/cmd/cli/fake/source.go
|
||||
references/cmd/cli/fake/chart_source.go
|
||||
charts/vela-core/crds/_.yaml
|
||||
.test_vela
|
||||
|
||||
# Dashboard
|
||||
dashboard/node_modules/
|
||||
.eslintcache
|
||||
dashboard/dist/
|
||||
dashboard/package-lock.json
|
||||
dashboard/src/.umi/
|
||||
package-lock.json
|
||||
dashboard/src/.umi-production/
|
||||
.vela/
|
||||
|
||||
# check docs
|
||||
git-page/
|
||||
209
.golangci.yml
Normal file
209
.golangci.yml
Normal file
@@ -0,0 +1,209 @@
|
||||
run:
|
||||
timeout: 10m
|
||||
|
||||
skip-files:
|
||||
- "zz_generated\\..+\\.go$"
|
||||
- ".*_test.go$"
|
||||
|
||||
skip-dirs:
|
||||
- "hack"
|
||||
- "e2e"
|
||||
|
||||
output:
|
||||
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
|
||||
format: colored-line-number
|
||||
|
||||
linters-settings:
|
||||
errcheck:
|
||||
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
|
||||
# default is false: such cases aren't reported by default.
|
||||
check-type-assertions: false
|
||||
|
||||
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
|
||||
# default is false: such cases aren't reported by default.
|
||||
check-blank: false
|
||||
|
||||
# [deprecated] comma-separated list of pairs of the form pkg:regex
|
||||
# the regex is used to ignore names within pkg. (default "fmt:.*").
|
||||
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
|
||||
ignore: fmt:.*,io/ioutil:^Read.*
|
||||
|
||||
exhaustive:
|
||||
# indicates that switch statements are to be considered exhaustive if a
|
||||
# 'default' case is present, even if all enum members aren't listed in the
|
||||
# switch
|
||||
default-signifies-exhaustive: true
|
||||
|
||||
govet:
|
||||
# report about shadowed variables
|
||||
check-shadowing: false
|
||||
|
||||
golint:
|
||||
# minimal confidence for issues, default is 0.8
|
||||
min-confidence: 0.8
|
||||
|
||||
gofmt:
|
||||
# simplify code: gofmt with `-s` option, true by default
|
||||
simplify: true
|
||||
|
||||
goimports:
|
||||
# put imports beginning with prefix after 3rd-party packages;
|
||||
# it's a comma-separated list of prefixes
|
||||
local-prefixes: github.com/oam-dev/kubevela
|
||||
|
||||
gocyclo:
|
||||
# minimal code complexity to report, 30 by default (but we recommend 10-20)
|
||||
min-complexity: 30
|
||||
|
||||
maligned:
|
||||
# print struct with more effective memory layout or not, false by default
|
||||
suggest-new: true
|
||||
|
||||
dupl:
|
||||
# tokens count to trigger issue, 150 by default
|
||||
threshold: 100
|
||||
|
||||
goconst:
|
||||
# minimal length of string constant, 3 by default
|
||||
min-len: 3
|
||||
# minimal occurrences count to trigger, 3 by default
|
||||
min-occurrences: 5
|
||||
|
||||
lll:
|
||||
# tab width in spaces. Default to 1.
|
||||
tab-width: 1
|
||||
|
||||
unused:
|
||||
# treat code as a program (not a library) and report unused exported identifiers; default is false.
|
||||
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
|
||||
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
|
||||
# with golangci-lint call it on a directory with the changed file.
|
||||
check-exported: false
|
||||
|
||||
unparam:
|
||||
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
|
||||
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
|
||||
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
|
||||
# with golangci-lint call it on a directory with the changed file.
|
||||
check-exported: false
|
||||
|
||||
nakedret:
|
||||
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
|
||||
max-func-lines: 30
|
||||
|
||||
gocritic:
|
||||
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
|
||||
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
|
||||
enabled-tags:
|
||||
- performance
|
||||
|
||||
settings: # settings passed to gocritic
|
||||
captLocal: # must be valid enabled check name
|
||||
paramsOnly: true
|
||||
rangeValCopy:
|
||||
sizeThreshold: 32
|
||||
|
||||
makezero:
|
||||
# Allow only slices initialized with a length of zero. Default is false.
|
||||
always: false
|
||||
|
||||
linters:
|
||||
enable:
|
||||
- megacheck
|
||||
- govet
|
||||
- gocyclo
|
||||
- gocritic
|
||||
- goconst
|
||||
- goimports
|
||||
- gofmt # We enable this as well as goimports for its simplify mode.
|
||||
- golint
|
||||
- unconvert
|
||||
- misspell
|
||||
- nakedret
|
||||
|
||||
presets:
|
||||
- bugs
|
||||
- unused
|
||||
fast: false
|
||||
|
||||
|
||||
issues:
|
||||
# Excluding configuration per-path and per-linter
|
||||
exclude-rules:
|
||||
# Exclude some linters from running on tests files.
|
||||
- path: _test(ing)?\.go
|
||||
linters:
|
||||
- gocyclo
|
||||
- errcheck
|
||||
- dupl
|
||||
- gosec
|
||||
- scopelint
|
||||
- unparam
|
||||
|
||||
# Ease some gocritic warnings on test files.
|
||||
- path: _test\.go
|
||||
text: "(unnamedResult|exitAfterDefer)"
|
||||
linters:
|
||||
- gocritic
|
||||
|
||||
# These are performance optimisations rather than style issues per se.
|
||||
# They warn when function arguments or range values copy a lot of memory
|
||||
# rather than using a pointer.
|
||||
- text: "(hugeParam|rangeValCopy):"
|
||||
linters:
|
||||
- gocritic
|
||||
|
||||
# This "TestMain should call os.Exit to set exit code" warning is not clever
|
||||
# enough to notice that we call a helper method that calls os.Exit.
|
||||
- text: "SA3000:"
|
||||
linters:
|
||||
- staticcheck
|
||||
|
||||
- text: "k8s.io/api/core/v1"
|
||||
linters:
|
||||
- goimports
|
||||
|
||||
# This is a "potential hardcoded credentials" warning. It's triggered by
|
||||
# any variable with 'secret' in the same, and thus hits a lot of false
|
||||
# positives in Kubernetes land where a Secret is an object type.
|
||||
- text: "G101:"
|
||||
linters:
|
||||
- gosec
|
||||
- gas
|
||||
|
||||
# This is an 'errors unhandled' warning that duplicates errcheck.
|
||||
- text: "G104:"
|
||||
linters:
|
||||
- gosec
|
||||
- gas
|
||||
|
||||
# The Azure AddToUserAgent method appends to the existing user agent string.
|
||||
# It returns an error if you pass it an empty string lettinga you know the
|
||||
# user agent did not change, making it more of a warning.
|
||||
- text: \.AddToUserAgent
|
||||
linters:
|
||||
- errcheck
|
||||
|
||||
- text: "don't use an underscore"
|
||||
linters:
|
||||
- golint
|
||||
|
||||
# Independently from option `exclude` we use default exclude patterns,
|
||||
# it can be disabled by this option. To list all
|
||||
# excluded by default patterns execute `golangci-lint run --help`.
|
||||
# Default value for this option is true.
|
||||
exclude-use-default: false
|
||||
|
||||
# Show only new issues: if there are unstaged changes or untracked files,
|
||||
# only those changes are analyzed, else only changes in HEAD~ are analyzed.
|
||||
# It's a super-useful option for integration of golangci-lint into existing
|
||||
# large codebase. It's not practical to fix all existing issues at the moment
|
||||
# of integration: much better don't allow issues in new code.
|
||||
# Default is false.
|
||||
new: false
|
||||
|
||||
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
|
||||
max-per-linter: 0
|
||||
|
||||
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
|
||||
max-same-issues: 0
|
||||
47
.krew.yaml
Normal file
47
.krew.yaml
Normal file
@@ -0,0 +1,47 @@
|
||||
apiVersion: krew.googlecontainertools.github.com/v1alpha2
|
||||
kind: Plugin
|
||||
metadata:
|
||||
name: vela
|
||||
spec:
|
||||
version: "{{ .TagName }}"
|
||||
platforms:
|
||||
- selector:
|
||||
matchLabels:
|
||||
os: linux
|
||||
arch: amd64
|
||||
{{addURIAndSha "https://github.com/oam-dev/kubevela/releases/download/{{ .TagName }}/kubectl-vela-{{ .TagName }}-linux-amd64.tar.gz" .TagName }}
|
||||
files:
|
||||
- from: "*/kubectl-vela"
|
||||
to: "."
|
||||
- from: "*/LICENSE"
|
||||
to: "."
|
||||
bin: "kubectl-vela"
|
||||
- selector:
|
||||
matchLabels:
|
||||
os: darwin
|
||||
arch: amd64
|
||||
{{addURIAndSha "https://github.com/oam-dev/kubevela/releases/download/{{ .TagName }}/kubectl-vela-{{ .TagName }}-darwin-amd64.tar.gz" .TagName }}
|
||||
files:
|
||||
- from: "*/kubectl-vela"
|
||||
to: "."
|
||||
- from: "*/LICENSE"
|
||||
to: "."
|
||||
bin: "kubectl-vela"
|
||||
- selector:
|
||||
matchLabels:
|
||||
os: windows
|
||||
arch: amd64
|
||||
{{addURIAndSha "https://github.com/oam-dev/kubevela/releases/download/{{ .TagName }}/kubectl-vela-{{ .TagName }}-windows-amd64.zip" .TagName }}
|
||||
files:
|
||||
- from: "*/kubectl-vela.exe"
|
||||
to: "."
|
||||
- from: "*/LICENSE"
|
||||
to: "."
|
||||
bin: "kubectl-vela.exe"
|
||||
shortDescription: Easily interact with KubeVela
|
||||
homepage: https://kubevela.io
|
||||
description: |
|
||||
kubectl vela is a kubectl plugin from the KubeVela project. KubeVela is
|
||||
a modern application platform that is fully self-service, and adapts to
|
||||
your needs when you grow. This plugin allows you to better view, manage
|
||||
and maintain KubeVela applications.
|
||||
19
.license/README.md
Normal file
19
.license/README.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# License Checker
|
||||
|
||||
Our license checker CI rely on https://github.com/pivotal/LicenseFinder.
|
||||
|
||||
## How to add a new license?
|
||||
|
||||
LicenseFinder is a ruby project, so make sure you have ruby installed.
|
||||
|
||||
### Install the tool
|
||||
|
||||
```shell
|
||||
gem install license_finder
|
||||
```
|
||||
|
||||
### Add a license
|
||||
|
||||
```shell
|
||||
license_finder permitted_licenses add MIT --decisions_file .license/dependency_decisions.yml
|
||||
```
|
||||
43
.license/dependency_decisions.yml
Normal file
43
.license/dependency_decisions.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
- - :permit
|
||||
- MIT
|
||||
- :who:
|
||||
:why:
|
||||
:versions: []
|
||||
:when: 2021-03-12 07:35:34.645031000 Z
|
||||
- - :permit
|
||||
- Apache 2.0
|
||||
- :who:
|
||||
:why:
|
||||
:versions: []
|
||||
:when: 2021-03-12 07:19:18.243194000 Z
|
||||
- - :permit
|
||||
- New BSD
|
||||
- :who:
|
||||
:why:
|
||||
:versions: []
|
||||
:when: 2021-03-12 07:19:28.540675000 Z
|
||||
- - :permit
|
||||
- Simplified BSD
|
||||
- :who:
|
||||
:why:
|
||||
:versions: []
|
||||
:when: 2021-03-12 07:20:01.774212000 Z
|
||||
- - :permit
|
||||
- Mozilla Public License 2.0
|
||||
- :who:
|
||||
:why:
|
||||
:versions: []
|
||||
:when: 2021-03-12 07:21:05.194536000 Z
|
||||
- - :permit
|
||||
- unknown
|
||||
- :who:
|
||||
:why:
|
||||
:versions: []
|
||||
:when: 2021-03-12 07:21:43.379269000 Z
|
||||
- - :permit
|
||||
- ISC
|
||||
- :who:
|
||||
:why:
|
||||
:versions: []
|
||||
:when: 2021-03-12 07:22:07.265966000 Z
|
||||
3
CODE_OF_CONDUCT.md
Normal file
3
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Code of Conduct
|
||||
|
||||
KubeVela follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
|
||||
139
CONTRIBUTING.md
139
CONTRIBUTING.md
@@ -1,115 +1,66 @@
|
||||
# CONTRIBUTING
|
||||
# CONTRIBUTING Guide
|
||||
|
||||
This doc explains how to set up a development environment, so you can get started
|
||||
contributing to `kubevela` or build a PoC (Proof of Concept).
|
||||
## About KubeVela
|
||||
|
||||
## Prerequisites
|
||||
KubeVela project is initialized and maintained by the cloud native community since day 0 with [bootstrapping contributors from 8+ different organizations](https://github.com/oam-dev/kubevela/graphs/contributors).
|
||||
We intend for KubeVela to have an open governance since the very beginning and donate the project to neutral foundation as soon as it's released.
|
||||
To help us create a safe and positive community experience for all, we require all participants to adhere to the [Code of Conduct](./CODE_OF_CONDUCT.md).
|
||||
|
||||
1. Golang version 1.12+
|
||||
2. Kubernetes version v1.15+ with `~/.kube/config` configured.
|
||||
3. OAM Kubernetes Runtime installed.
|
||||
4. Kustomize version 3.8+
|
||||
5. ginkgo 1.14.0+ (just for [E2E test](https://github.com/oam-dev/kubevela/blob/master/DEVELOPMENT.md#e2e-test))
|
||||
6. golangci-lint 1.31.0+, it will install automatically if you run `make`, you can [install it manually](https://golangci-lint.run/usage/install/#local-installation) if the installation is too slow.
|
||||
This document is a guide to help you through the process of contributing to KubeVela.
|
||||
|
||||
## Build
|
||||
* Clone this project
|
||||
## Become a contributor
|
||||
|
||||
```shell script
|
||||
git clone git@github.com:oam-dev/kubevela.git
|
||||
```
|
||||
You can contribute to KubeVela in several ways. Here are some examples:
|
||||
|
||||
* Install Template CRD into your cluster
|
||||
* Contribute to the KubeVela codebase.
|
||||
* Contribute to the [KubeVela docs](https://github.com/oam-dev/kubevela.io).
|
||||
* Report and triage bugs.
|
||||
* Develop community CRD operators as workload or trait and contribute to [catalog](https://github.com/oam-dev/catalog).
|
||||
* Write technical documentation and blog posts, for users and contributors.
|
||||
* Organize meetups and user groups in your local area.
|
||||
* Help others by answering questions about KubeVela.
|
||||
|
||||
```shell script
|
||||
make install
|
||||
```
|
||||
For more ways to contribute, check out the [Open Source Guides](https://opensource.guide/how-to-contribute/).
|
||||
|
||||
* Install template object
|
||||
|
||||
```shell script
|
||||
kubectl apply -f config/samples/
|
||||
```
|
||||
### Report bugs
|
||||
|
||||
## Develop & Debug
|
||||
If you change Template CRD, remember to rerun `make install`.
|
||||
Before submitting a new issue, try to make sure someone hasn't already reported the problem.
|
||||
Look through the [existing issues](https://github.com/oam-dev/kubevela/issues) for similar issues.
|
||||
|
||||
Use the following command to develop and debug.
|
||||
Report a bug by submitting a [bug report](https://github.com/oam-dev/kubevela/issues/new?assignees=&labels=kind%2Fbug&template=bug_report.md&title=).
|
||||
Make sure that you provide as much information as possible on how to reproduce the bug.
|
||||
|
||||
```shell script
|
||||
$ cd cmd/vela
|
||||
$ go run main.go COMMAND [FLAG]
|
||||
```
|
||||
Follow the issue template and add additional information that will help us replicate the problem.
|
||||
|
||||
For example, use the following command to create and run an application.
|
||||
```shell script
|
||||
$ go run main.go run containerized app2057 nginx:1.9.4
|
||||
Creating AppConfig app2057
|
||||
SUCCEED
|
||||
#### Security issues
|
||||
|
||||
$ kubectl get oam
|
||||
NAME WORKLOAD-KIND
|
||||
component.core.oam.dev/app2057 ContainerizedWorkload
|
||||
If you believe you've found a security vulnerability, please read our [security policy](https://github.com/oam-dev/kubevela/blob/master/SECURITY.md) for more details.
|
||||
|
||||
NAME AGE
|
||||
containerizedworkload.core.oam.dev/poc 53m
|
||||
### Suggest enhancements
|
||||
|
||||
NAME AGE
|
||||
applicationconfiguration.core.oam.dev/app2057 69s
|
||||
If you have an idea to improve KubeVela, submit an [feature request](https://github.com/oam-dev/kubevela/issues/new?assignees=&labels=kind%2Ffeature&template=feature_request.md&title=%5BFeature%5D).
|
||||
|
||||
NAME DEFINITION-NAME
|
||||
traitdefinition.core.oam.dev/simplerollouttraits.extend.oam.dev simplerollouttraits.extend.oam.dev
|
||||
### Triage issues
|
||||
|
||||
NAME DEFINITION-NAME
|
||||
workloaddefinition.core.oam.dev/containerizedworkloads.core.oam.dev containerizedworkloads.core.oam.dev
|
||||
workloaddefinition.core.oam.dev/deployments.apps deployments.apps
|
||||
workloaddefinition.core.oam.dev/statefulsets.apps statefulsets.apps
|
||||
```
|
||||
If you don't have the knowledge or time to code, consider helping with _issue triage_. The community will thank you for saving them time by spending some of yours.
|
||||
|
||||
## E2E test
|
||||
```
|
||||
$ make e2e-test
|
||||
Running Suite: Trait Suite
|
||||
==========================
|
||||
Random Seed: 1596559178
|
||||
Will run 5 of 5 specs
|
||||
Read more about the ways you can [Triage issues](/contribute/triage-issues.md).
|
||||
|
||||
Trait env init
|
||||
should print env initiation successful message
|
||||
kubevela/e2e/commonContext.go:14
|
||||
Create env succeed, current env is default
|
||||
•
|
||||
------------------------------
|
||||
Trait env set
|
||||
should show env set message
|
||||
kubevela/e2e/commonContext.go:40
|
||||
Set env succeed, current env is default
|
||||
•
|
||||
------------------------------
|
||||
Trait run
|
||||
should print successful creation information
|
||||
kubevela/e2e/commonContext.go:76
|
||||
Creating AppConfig app-trait-basic
|
||||
SUCCEED
|
||||
•
|
||||
------------------------------
|
||||
Trait kubevela attach trait
|
||||
should print successful attached information
|
||||
kubevela/e2e/trait/trait_test.go:24
|
||||
Applying trait for app
|
||||
Succeeded!
|
||||
•
|
||||
------------------------------
|
||||
Trait delete
|
||||
should print successful deletion information
|
||||
kubevela/e2e/commonContext.go:85
|
||||
Deleting AppConfig "app-trait-basic"
|
||||
DELETE SUCCEED
|
||||
•
|
||||
Ran 5 of 5 Specs in 9.717 seconds
|
||||
SUCCESS! -- 5 Passed | 0 Failed | 0 Pending | 0 Skipped
|
||||
PASS
|
||||
```
|
||||
### Answering questions
|
||||
|
||||
## Make a pull request
|
||||
Remember to write unit-test and e2e test before making a pull request.
|
||||
If you have a question and you can't find the answer in the [documentation](https://kubevela.io/docs/),
|
||||
the next step is to ask it on the [github discussion](https://github.com/oam-dev/kubevela/discussions).
|
||||
|
||||
It's important to us to help these users, and we'd love your help. You can help other KubeVela users by answering [their questions](https://github.com/oam-dev/kubevela/discussions).
|
||||
|
||||
### Your first contribution
|
||||
|
||||
Unsure where to begin contributing to KubeVela? Start by browsing issues labeled `good first issue` or `help wanted`.
|
||||
|
||||
- [Good first issue](https://github.com/oam-dev/kubevela/labels/good%20first%20issue) issues are generally straightforward to complete.
|
||||
- [Help wanted](https://github.com/oam-dev/kubevela/labels/help%20wanted) issues are problems we would like the community to help us with regardless of complexity.
|
||||
|
||||
If you're looking to make a code change, see how to set up your environment for [local development](contribute/developer-guide.md).
|
||||
|
||||
When you're ready to contribute, it's time to [Create a pull request](/contribute/create-pull-request.md).
|
||||
|
||||
42
Dockerfile
42
Dockerfile
@@ -1,5 +1,5 @@
|
||||
# Build the manager binary
|
||||
FROM golang:1.13 as builder
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16-alpine as builder
|
||||
|
||||
WORKDIR /workspace
|
||||
# Copy the Go Modules manifests
|
||||
@@ -11,18 +11,40 @@ RUN go mod download
|
||||
|
||||
# Copy the go source
|
||||
COPY cmd/core/main.go main.go
|
||||
COPY api/ api/
|
||||
COPY cmd/apiserver/main.go cmd/apiserver/main.go
|
||||
COPY apis/ apis/
|
||||
COPY pkg/ pkg/
|
||||
COPY version/ version/
|
||||
|
||||
# Build
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
|
||||
ARG TARGETARCH
|
||||
ARG VERSION
|
||||
ARG GITVERSION
|
||||
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
|
||||
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
|
||||
-o manager-${TARGETARCH} main.go
|
||||
|
||||
# Use distroless as minimal base image to package the manager binary
|
||||
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
|
||||
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
|
||||
-o apiserver-${TARGETARCH} cmd/apiserver/main.go
|
||||
|
||||
# Use alpine as base image due to the discussion in issue #1448
|
||||
# You can replace distroless as minimal base image to package the manager binary
|
||||
# Refer to https://github.com/GoogleContainerTools/distroless for more details
|
||||
# oamdev/gcr.io-distroless-static:nonroot is syncd from gcr.io/distroless/static:nonroot as somewhere can't reach gcr.io
|
||||
FROM oamdev/gcr.io-distroless-static:nonroot
|
||||
WORKDIR /
|
||||
COPY --from=builder /workspace/manager .
|
||||
USER nonroot:nonroot
|
||||
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
|
||||
ARG BASE_IMAGE
|
||||
FROM ${BASE_IMAGE:-alpine:latest}
|
||||
# This is required by daemon connnecting with cri
|
||||
RUN apk add --no-cache ca-certificates bash
|
||||
|
||||
ENTRYPOINT ["/manager"]
|
||||
WORKDIR /
|
||||
|
||||
ARG TARGETARCH
|
||||
COPY --from=builder /workspace/manager-${TARGETARCH} /usr/local/bin/manager
|
||||
COPY --from=builder /workspace/apiserver-${TARGETARCH} /usr/local/bin/apiserver
|
||||
|
||||
COPY entrypoint.sh /usr/local/bin/
|
||||
|
||||
ENTRYPOINT ["entrypoint.sh"]
|
||||
|
||||
CMD ["manager"]
|
||||
|
||||
55
Dockerfile.e2e
Normal file
55
Dockerfile.e2e
Normal file
@@ -0,0 +1,55 @@
|
||||
# Build the manager binary
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16-alpine as builder
|
||||
|
||||
WORKDIR /workspace
|
||||
# Copy the Go Modules manifests
|
||||
COPY go.mod go.mod
|
||||
COPY go.sum go.sum
|
||||
# cache deps before building and copying source so that we don't need to re-download as much
|
||||
# and so that source changes don't invalidate our downloaded layer
|
||||
RUN go mod download
|
||||
|
||||
# Copy the go source
|
||||
COPY cmd/core/main.go main.go
|
||||
COPY cmd/core/main_e2e_test.go main_e2e_test.go
|
||||
COPY cmd/apiserver/main.go cmd/apiserver/main.go
|
||||
COPY cmd/ cmd/
|
||||
COPY apis/ apis/
|
||||
COPY pkg/ pkg/
|
||||
COPY version/ version/
|
||||
|
||||
# Build
|
||||
ARG TARGETARCH
|
||||
ARG VERSION
|
||||
ARG GITVERSION
|
||||
|
||||
RUN apk add gcc musl-dev libc-dev ;\
|
||||
GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
|
||||
go test -c -o manager-${TARGETARCH} -cover -covermode=atomic -coverpkg ./... .
|
||||
|
||||
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
|
||||
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
|
||||
-o apiserver-${TARGETARCH} cmd/apiserver/main.go
|
||||
|
||||
# Use alpine as base image due to the discussion in issue #1448
|
||||
# You can replace distroless as minimal base image to package the manager binary
|
||||
# Refer to https://github.com/GoogleContainerTools/distroless for more details
|
||||
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
|
||||
ARG BASE_IMAGE
|
||||
FROM ${BASE_IMAGE:-alpine:latest}
|
||||
# This is required by daemon connnecting with cri
|
||||
RUN apk add --no-cache ca-certificates bash
|
||||
|
||||
WORKDIR /
|
||||
|
||||
ARG TARGETARCH
|
||||
COPY --from=builder /workspace/manager-${TARGETARCH} /usr/local/bin/manager
|
||||
COPY --from=builder /workspace/apiserver-${TARGETARCH} /usr/local/bin/apiserver
|
||||
|
||||
COPY entrypoint.sh /usr/local/bin/
|
||||
|
||||
VOLUME ["/workspace/data"]
|
||||
|
||||
ENTRYPOINT ["entrypoint.sh"]
|
||||
|
||||
CMD ["manager"]
|
||||
323
ISSUE_TRIAGE.md
Normal file
323
ISSUE_TRIAGE.md
Normal file
@@ -0,0 +1,323 @@
|
||||
# Triage issues
|
||||
|
||||
The main goal of issue triage is to categorize all incoming KubeVela issues and make sure each issue has all basic
|
||||
information needed for anyone else to understand and be able to start working on it.
|
||||
|
||||
> **Note:** This information is for OAM/KubeVela project Maintainers, Owners, and Admins.
|
||||
> If you are a Contributor, then you will not be able to perform most of the tasks in this topic.
|
||||
|
||||
The core maintainers of the OAM/KubeVela project are responsible for categorizing all incoming issues and delegating
|
||||
any critical or important issue to other maintainers. Currently one maintainer each week is responsible.
|
||||
Besides that part, triage provides an important way to contribute to an open source project.
|
||||
|
||||
Triage helps ensure issues resolve quickly by:
|
||||
|
||||
- Ensuring the issue's intent and purpose is conveyed precisely. This is necessary because it can be difficult for
|
||||
an issue to explain how an end user experiences a problem and what actions they took.
|
||||
- Giving a contributor the information they need before they commit to resolving an issue.
|
||||
- Lowering the issue count by preventing duplicate issues.
|
||||
- Streamlining the development process by preventing duplicate discussions.
|
||||
|
||||
If you don't have the knowledge or time to code, consider helping with triage.
|
||||
The community will thank you for saving them time by spending some of yours.
|
||||
|
||||
## Simplified flowchart diagram of the issue triage process
|
||||
|
||||
<!-- https://textik.com/#908a27a44c590528 -->
|
||||
```
|
||||
+-----------------------------+
|
||||
| |
|
||||
| New Issues Opened |
|
||||
+-----------------+ |
|
||||
| | Or More information needed |
|
||||
| | |
|
||||
| +--------------+--------------+
|
||||
| Ask for more info |
|
||||
| |
|
||||
| +--------------+------------+
|
||||
| | | Yes
|
||||
| | All informatio needed |
|
||||
| +-----------+ to categorize the issue? +---------------+
|
||||
| | No | | |
|
||||
| | +---------------------------+ |
|
||||
| | +-----------+-----------+ +---------------------------+
|
||||
+------------+-----+-----+ | | Yes | |
|
||||
| | | Needs investigation ? +---------+ label: needs investigation|
|
||||
| label: needs more info | | | | |
|
||||
| | +----------+------------+ +-------------+-------------+
|
||||
+------------------------+ | |
|
||||
| No |
|
||||
| |
|
||||
+----------+----------+ investigate |
|
||||
| label: type/* | |
|
||||
| label: area/* +--------------------------+
|
||||
| |
|
||||
+--|-------------|----+
|
||||
| | Yes
|
||||
| +-------|-------------+ +-------------------+
|
||||
| | needs priority? +----+ label: priority/* |
|
||||
| +-------|-------------+ +----------|--------+
|
||||
| | No |
|
||||
| | |
|
||||
+----- ------|---+ +--|----- --+ |
|
||||
| close issue + ---- + done +---------------------+
|
||||
+----------------+ +-----------+
|
||||
```
|
||||
|
||||
## 1. Find uncategorized issues
|
||||
|
||||
To get started with issue triage and finding issues that haven't been triaged you have two alternatives.
|
||||
|
||||
### Browse unlabeled issues
|
||||
|
||||
The easiest and straight forward way of getting started and finding issues that haven't been triaged is to browse
|
||||
[unlabeled issues](https://github.com/oam-dev/kubevela/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and starting from
|
||||
the bottom and working yourself to the top.
|
||||
|
||||
### Subscribe to all notifications
|
||||
|
||||
The more advanced, but recommended way is to subscribe to all notifications from this repository which means that
|
||||
all new issues, pull requests, comments and important status changes are sent to your configured email address.
|
||||
Read this [guide](https://help.github.com/en/articles/watching-and-unwatching-repositories#watching-a-single-repository)
|
||||
for help with setting this up.
|
||||
|
||||
It's highly recommended that you setup filters to automatically remove emails from the inbox and label/categorize
|
||||
them accordingly to make it easy for you to understand when you need to act upon a notification or where to look for
|
||||
finding issues that haven't been triaged etc.
|
||||
|
||||
|
||||
## 2. Ensure the issue contains basic information
|
||||
|
||||
Before triaging an issue very far, make sure that the issue's author provided the standard issue information.
|
||||
This will help you make an educated recommendation on how to categorize the issue.
|
||||
The KubeVela project utilizes [GitHub issue templates](https://help.github.com/en/articles/creating-issue-templates-for-your-repository)
|
||||
to guide contributors to provide standard information that must be included for each type of template or type of issue.
|
||||
|
||||
### Standard issue information that must be included
|
||||
|
||||
Given a certain [issue template]([template](https://github.com/oam-dev/kubevela/issues/new/choose)) have been used
|
||||
by the issue author or depending how the issue is perceived by the issue triage responsible, the following should
|
||||
help you understand what standard issue information that must be included.
|
||||
|
||||
#### Bug reports
|
||||
|
||||
Should explain what happened, what was expected and how to reproduce it together with any additional information that
|
||||
may help giving a complete picture of what happened such as screenshots, application related YAMLs, and any environment
|
||||
related information that's applicable and/or maybe related to the reported problem:
|
||||
- KubeVela version
|
||||
- K8s cluster version KubeVela is installed on
|
||||
- Which other K8s CRD controllers used
|
||||
- Development environment like Go versions, if applicable
|
||||
|
||||
#### Enhancement requests
|
||||
|
||||
Should explain what enhancement or feature that the author wants to be added and why that is needed.
|
||||
|
||||
### Good practices
|
||||
|
||||
To make it easier for everyone to understand and find issues they're searching for it's suggested as a general rule of thumbs to:
|
||||
|
||||
- Make sure that issue titles are named to explain the subject of the issue, has a correct spelling and doesn't include irrelevant information and/or sensitive information.
|
||||
- Make sure that issue descriptions doesn't include irrelevant information, information from template that haven't been filled out and/or sensitive information.
|
||||
- Do your best effort to change title and description or request suggested changes by adding a comment.
|
||||
|
||||
> **Note:** Above rules is applicable to both new and existing issues of the KubeVela project.
|
||||
|
||||
### Do you have all the information needed to categorize an issue?
|
||||
|
||||
Depending on the issue, you might not feel all this information is needed. Use your best judgement.
|
||||
If you cannot triage an issue using what its author provided, explain kindly to the author that they must provide the
|
||||
above information to clarify the problem. Label issue with `needs more info` and add any related `area/*` or `type/*` labels.
|
||||
|
||||
If the author provides the standard information but you are still unable to triage the issue, request additional information.
|
||||
Do this kindly and politely because you are asking for more of the author's time.
|
||||
|
||||
If the author does not respond to the requested information within the timespan of a week,
|
||||
close the issue with a kind note stating that the author can request for the issue to be reopened when the necessary information is provided.
|
||||
|
||||
When you feel you have all the information needed you're ready to [categorizing the issue](#3-categorizing-an-issue).
|
||||
|
||||
If you receive a notification with additional information provided but you are not anymore on issue triage and
|
||||
you feel you do not have time to handle it, you should delegate it to the current person on issue triage.
|
||||
|
||||
## 3. Categorizing an issue
|
||||
|
||||
An issue can have multiple of the following labels. Typically, a properly categorized issue should at least have:
|
||||
|
||||
- One label identifying its type (`type/*`).
|
||||
- One or multiple labels identifying the functional areas of interest or component (`area/*`), if applicable.
|
||||
|
||||
| Label | Description |
|
||||
| ------------------------ | ------------------------------------------------------------------------- |
|
||||
| `type/bug` | A feature isn't working as expected given design or documentation. |
|
||||
| `type/enhancement` | Request for a new feature or enhancement. |
|
||||
| `type/docs` | Documentation problem or enhancement. |
|
||||
| `type/question` | Issue is a question or is perceived as such. |
|
||||
| `type/duplicate` | An existing issue of the same subject/request have already been reported. |
|
||||
| `type/wontfix` | A reported bug works as intended/by design. |
|
||||
| `type/invalid` | A reported bug with invalid usage. |
|
||||
| `area/*` | Subject is related to a functional area of interest or component. |
|
||||
|
||||
### Duplicate issues
|
||||
|
||||
Make sure it's not a duplicate by searching existing issues using related terms from the issue title and description.
|
||||
If you think you know there is an existing issue, but can't find it, please reach out to one of the maintainers and ask for help.
|
||||
If you identify that the issue is a duplicate of an existing issue:
|
||||
|
||||
1. Add a comment `/duplicate of #<issue number>`. GitHub will recognize this and add some additional context to the issue activity.
|
||||
2. The KubeVela bot will do the rest, adding the correct label and closing comment
|
||||
3. Optionally add any related `area/*` labels.
|
||||
|
||||
### Bug reports
|
||||
|
||||
If it's not perfectly clear that it's an actual bug, quickly try to reproduce it.
|
||||
|
||||
**It's a bug/it can be reproduced:**
|
||||
|
||||
1. Add a comment describing detailed steps for how to reproduce it, if applicable.
|
||||
2. Label the issue `type/bug` and at least one `area/*` label.
|
||||
3. If you know that maintainers won't be able to put any resources into it for some time then label the issue
|
||||
with `help wanted` and optionally `good first issue` together with pointers on which code to update to fix the bug.
|
||||
This should signal to the community that we would appreciate any help we can get to resolve this.
|
||||
4. Move on to [prioritizing the issue](#4-prioritization-of-issues).
|
||||
|
||||
**It can't be reproduced:**
|
||||
1. Either [ask for more information](#2-ensure-the-issue-contains-basic-information) needed to investigate it more thoroughly.
|
||||
2. Either [delegate further investigations](#investigation-of-issues) to someone else.
|
||||
|
||||
**It works as intended/by design:**
|
||||
1. Kindly and politely add a comment explaining briefly why we think it works as intended and close the issue.
|
||||
2. Label the issue `type/wontfix`.
|
||||
|
||||
### Enhancement/feature?
|
||||
|
||||
1. Label the issue `type/enhancement` and at least one `area/*` label.
|
||||
2. Move on to [prioritizing the issue](#4-prioritization-of-issues).
|
||||
|
||||
### Documentation issue?
|
||||
|
||||
First, evaluate if the documentation makes sense to be included in the KubeVela project:
|
||||
|
||||
- Is this something we want/can maintain as a project?
|
||||
- Is this referring to usage of some specific integration/tool and in that case is that a popular use case in combination with KubeVela?
|
||||
- If unsure, kindly and politely add a comment explaining that we would need [upvotes](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments)
|
||||
to identify that lots of other users want/need this.
|
||||
|
||||
Second, label the issue `type/docs` and at least one `area/*` label.
|
||||
|
||||
**Minor typo/error/lack of information:**
|
||||
|
||||
There's a minor typo/error/lack of information that adds a lot of confusion for users and given the amount of work is a big win to make sure fixing it:
|
||||
1. Either update the documentation yourself and open a pull request.
|
||||
2. Either delegate the work to someone else by assigning that person to the issue and add the issue to next major/minor milestone.
|
||||
|
||||
**Major error/lack of information:**
|
||||
|
||||
1. Label the issue with `help wanted` and `good first issue`, if applicable, to signal that we find this important to
|
||||
fix and we would appreciate any help we can get from the community.
|
||||
2. Move on to [prioritizing the issue](#4-prioritization-of-issues).
|
||||
|
||||
### Support requests and questions
|
||||
|
||||
1. Kindly and politely direct the issue author to the [github discussion](https://github.com/oam-dev/kubevela/discussions)
|
||||
and explain that issue is mainly used for tracking bugs and feature requests.
|
||||
If possible, it's usually a good idea to add some pointers to the issue author's question.
|
||||
2. Close the issue and label it with `type/question`.
|
||||
|
||||
## 4. Prioritization of issues
|
||||
|
||||
In general bugs and enhancement issues should be labeled with a priority.
|
||||
|
||||
This is the most difficult thing with triaging issues since it requires a lot of knowledge, context and experience
|
||||
before being able to think of and start feel comfortable adding a certain priority label.
|
||||
|
||||
The key here is asking for help and discuss issues to understand how more experienced project members think and reason.
|
||||
By doing that you learn more and eventually be more and more comfortable with prioritizing issues.
|
||||
|
||||
In case there is an uncertainty around the prioritization of an issue, please ask the maintainers for help.
|
||||
|
||||
| Label | Description |
|
||||
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `priority/critical` | Highest priority. Must be actively worked on as someone's top priority right now. |
|
||||
| `priority/important-soon` | Must be staffed and worked on either currently, or very soon, ideally in time for the next release. |
|
||||
| `priority/important-longterm` | Important over the long term, but may not be staffed and/or may need multiple releases to complete. |
|
||||
| `priority/nice-to-have` | It's a good idea, but not scheduled for any release. |
|
||||
| `priority/awaiting-more-evidence` | Lowest priority. Possibly useful, but not yet enough interest in it. |
|
||||
| `priority/unscheduled` | Something to look into before and to be discussed during the planning of the next (upcoming) major/minor stable release. |
|
||||
|
||||
**Critical bugs**
|
||||
|
||||
1. If a bug has been categorized and any of the following criteria apply, the bug should be labeled as critical and
|
||||
must be actively worked on as someone's top priority right now.
|
||||
|
||||
- Results in any crash or data loss.
|
||||
- Critical security or performance issues
|
||||
- Problem that makes a feature unusable
|
||||
- Multiple users experience a severe problem affecting their business, users etc.
|
||||
|
||||
2. Label the issue `priority/critical`.
|
||||
3. Add the issue to the next upcoming patch release milestone. Create a new milestone if there are none.
|
||||
4. Escalate the problem to the maintainers.
|
||||
5. Assign or ask a maintainer for help assigning someone to make this issue their top priority right now.
|
||||
|
||||
**Important short-term**
|
||||
|
||||
1. Label the issue `priority/important-soon`.
|
||||
2. Add the issue to the next upcoming patch or major/minor stable release milestone. Ask maintainers for help if unsure if it's a patch or not.
|
||||
Create a new milestone if there are none.
|
||||
3. Make sure to add the issue to a suitable backlog of a GitHub project and prioritize it or assign someone to work on it now or very soon.
|
||||
4. Consider requesting [help from the community](#5-requesting-help-from-the-community), even though it may be problematic given a short amount of time until it should be released.
|
||||
|
||||
**Important long-term**
|
||||
|
||||
1. Label the issue `priority/important-longterm`.
|
||||
2. Consider requesting [help from the community](#5-requesting-help-from-the-community).
|
||||
|
||||
**Nice to have**
|
||||
|
||||
1. Label the issue `priority/nice-to-have`.
|
||||
2. Consider requesting [help from the community](#5-requesting-help-from-the-community).
|
||||
|
||||
**Not critical, but unsure?**
|
||||
|
||||
1. Label the issue `priority/unscheduled`.
|
||||
2. Consider requesting [help from the community](#5-requesting-help-from-the-community).
|
||||
|
||||
## 5. Requesting help from the community
|
||||
|
||||
Depending on the issue and/or priority, it's always a good idea to consider signalling to the community that help from community
|
||||
is appreciated and needed in case an issue is not prioritized to be worked on by maintainers. Use your best judgement.
|
||||
In general, requesting help from the community means that a contribution has a good chance of getting accepted and merged.
|
||||
|
||||
1. Kindly and politely add a comment to signal to users subscribed to updates of the issue.
|
||||
- Explain that the issue would be nice to get resolved, but it isn't prioritized to work on by maintainers for an unforeseen future.
|
||||
- If possible or applicable, try to help contributors getting starting by adding pointers and references to
|
||||
what code/files need to be changed and/or ideas of a good way to solve/implement the issue.
|
||||
2. Label the issue with `help wanted`.
|
||||
3. If applicable, label the issue with `good first issue` to denote that the issue is suitable for a beginner to work on.
|
||||
4. If possible, try to estimate the amount of work by adding `effort/small`, `effort/medium` or `effort/large`.
|
||||
|
||||
## Investigation of issues
|
||||
|
||||
When an issue has all basic information provided, but the triage responsible haven't been able to reproduce the reported
|
||||
problem at a first glance, the issue is labeled [Needs investigation](https://github.com/oam-dev/kubevela/labels/needs%20investigation).
|
||||
Depending on the perceived severity and/or number of [upvotes](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments),
|
||||
the investigation will either be delegated to another maintainer for further investigation or put on hold until someone else (maintainer or contributor)
|
||||
picks it up and eventually starts investigating it.
|
||||
|
||||
Investigating issues can be a very time consuming task, especially for the maintainers, provide as much related info will
|
||||
make it easier for maintainers to investigate.
|
||||
|
||||
Even if you don't have the time or knowledge to investigate an issue we highly recommend that you [upvote](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments)
|
||||
the issue if you happen to have the same problem. If you have further details that may help investigating the issue
|
||||
please provide as much information as possible.
|
||||
|
||||
## Automation
|
||||
|
||||
We have some automation that triggers on comments or labels being added to issues.
|
||||
Many of these automated behaviors are defined in [issue-commands.json](https://github.com/oam-dev/kubevela/blob/master/.github/issue-commands.json).
|
||||
|
||||
* Add comment `/duplicate #<number>` to have `type/duplicate` label, the issue number is required for remind where is the other issue.
|
||||
* Add label `bot/no new info` for bot to close an issue where we asked for more info but has not received any updates in at least 14 days.
|
||||
|
||||
Read more bot actions on [bot.md](https://github.com/oam-dev/kubevela/blob/master/.github/bot.md)
|
||||
349
Makefile
349
Makefile
@@ -1,14 +1,32 @@
|
||||
# Vela version
|
||||
VELA_VERSION ?= 0.1.0
|
||||
VELA_VERSION ?= master
|
||||
# Repo info
|
||||
GIT_COMMIT ?= git-$(shell git rev-parse --short HEAD)
|
||||
VELA_VERSION_VAR := github.com/oam-dev/kubevela/version.VelaVersion
|
||||
VELA_GITVERSION_VAR := github.com/oam-dev/kubevela/version.GitRevision
|
||||
LDFLAGS ?= "-X $(VELA_VERSION_VAR)=$(VELA_VERSION) -X $(VELA_GITVERSION_VAR)=$(GIT_COMMIT) -X main.chartTGZSource=$$(cat -) -s -w"
|
||||
GIT_COMMIT ?= git-$(shell git rev-parse --short HEAD)
|
||||
GIT_COMMIT_LONG ?= $(shell git rev-parse HEAD)
|
||||
VELA_VERSION_KEY := github.com/oam-dev/kubevela/version.VelaVersion
|
||||
VELA_GITVERSION_KEY := github.com/oam-dev/kubevela/version.GitRevision
|
||||
LDFLAGS ?= "-s -w -X $(VELA_VERSION_KEY)=$(VELA_VERSION) -X $(VELA_GITVERSION_KEY)=$(GIT_COMMIT)"
|
||||
|
||||
GOX = go run github.com/mitchellh/gox
|
||||
TARGETS := darwin/amd64 linux/amd64 windows/amd64
|
||||
DIST_DIRS := find * -type d -exec
|
||||
GOBUILD_ENV = GO111MODULE=on CGO_ENABLED=0
|
||||
GOX = go run github.com/mitchellh/gox
|
||||
TARGETS := darwin/amd64 linux/amd64 windows/amd64
|
||||
DIST_DIRS := find * -type d -exec
|
||||
|
||||
TIME_LONG = `date +%Y-%m-%d' '%H:%M:%S`
|
||||
TIME_SHORT = `date +%H:%M:%S`
|
||||
TIME = $(TIME_SHORT)
|
||||
|
||||
BLUE := $(shell printf "\033[34m")
|
||||
YELLOW := $(shell printf "\033[33m")
|
||||
RED := $(shell printf "\033[31m")
|
||||
GREEN := $(shell printf "\033[32m")
|
||||
CNone := $(shell printf "\033[0m")
|
||||
|
||||
INFO = echo ${TIME} ${BLUE}[ .. ]${CNone}
|
||||
WARN = echo ${TIME} ${YELLOW}[WARN]${CNone}
|
||||
ERR = echo ${TIME} ${RED}[FAIL]${CNone}
|
||||
OK = echo ${TIME} ${GREEN}[ OK ]${CNone}
|
||||
FAIL = (echo ${TIME} ${RED}[FAIL]${CNone} && false)
|
||||
|
||||
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
|
||||
ifeq (,$(shell go env GOBIN))
|
||||
@@ -17,134 +35,222 @@ else
|
||||
GOBIN=$(shell go env GOBIN)
|
||||
endif
|
||||
|
||||
# Image URL to use all building/pushing image targets
|
||||
VELA_CORE_IMAGE ?= vela-core:latest
|
||||
VELA_CORE_TEST_IMAGE ?= vela-core-test:$(GIT_COMMIT)
|
||||
VELA_RUNTIME_ROLLOUT_IMAGE ?= vela-runtime-rollout:latest
|
||||
|
||||
all: build
|
||||
|
||||
# Run tests
|
||||
test: fmt vet lint
|
||||
go test ./pkg/... -coverprofile cover.out
|
||||
test: vet lint staticcheck
|
||||
go test -coverprofile=coverage.txt ./pkg/... ./cmd/...
|
||||
go test ./references/appfile/... ./references/cli/... ./references/common/... ./references/plugins/...
|
||||
@$(OK) unit-tests pass
|
||||
|
||||
# Build manager binary
|
||||
build: fmt vet lint
|
||||
go run hack/chart/generate.go | go build -o bin/vela -ldflags ${LDFLAGS} cmd/vela/main.go
|
||||
# Build vela cli binary
|
||||
build: fmt vet lint staticcheck vela-cli kubectl-vela
|
||||
@$(OK) build succeed
|
||||
|
||||
npm-build:
|
||||
cd dashboard && npm run build && cd ./..
|
||||
vela-cli:
|
||||
$(GOBUILD_ENV) go build -o bin/vela -a -ldflags $(LDFLAGS) ./references/cmd/cli/main.go
|
||||
|
||||
npm-install:
|
||||
cd dashboard && npm install && cd ./..
|
||||
kubectl-vela:
|
||||
$(GOBUILD_ENV) go build -o bin/kubectl-vela -a -ldflags $(LDFLAGS) ./cmd/plugin/main.go
|
||||
|
||||
generate-source:
|
||||
go run hack/frontend/source.go
|
||||
doc-gen:
|
||||
rm -r docs/en/cli/*
|
||||
go run hack/docgen/gen.go
|
||||
|
||||
PWD := $(shell pwd)
|
||||
cross-build:
|
||||
go run hack/chart/generate.go | GO111MODULE=on CGO_ENABLED=0 $(GOX) -ldflags $(LDFLAGS) -parallel=3 -output="_bin/{{.OS}}-{{.Arch}}/vela" -osarch='$(TARGETS)' ./cmd/vela/
|
||||
rm -rf _bin
|
||||
go get github.com/mitchellh/gox@v0.4.0
|
||||
$(GOBUILD_ENV) $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/vela/{{.OS}}-{{.Arch}}/vela" -osarch='$(TARGETS)' ./references/cmd/cli
|
||||
$(GOBUILD_ENV) $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/kubectl-vela/{{.OS}}-{{.Arch}}/kubectl-vela" -osarch='$(TARGETS)' ./cmd/plugin
|
||||
$(GOBUILD_ENV) $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/apiserver/{{.OS}}-{{.Arch}}/apiserver" -osarch="$(TARGETS)" ./cmd/apiserver
|
||||
|
||||
build-cleanup:
|
||||
rm -rf _bin
|
||||
|
||||
compress:
|
||||
( \
|
||||
cd _bin && \
|
||||
$(DIST_DIRS) cp ../LICENSE {} \; && \
|
||||
$(DIST_DIRS) cp ../README.md {} \; && \
|
||||
echo "\n## Release Info\nVERSION: $(VELA_VERSION)" >> README.md && \
|
||||
echo "GIT_COMMIT: $(GIT_COMMIT_LONG)\n" >> README.md && \
|
||||
cd _bin/vela && \
|
||||
$(DIST_DIRS) cp ../../LICENSE {} \; && \
|
||||
$(DIST_DIRS) cp ../../README.md {} \; && \
|
||||
$(DIST_DIRS) tar -zcf vela-{}.tar.gz {} \; && \
|
||||
$(DIST_DIRS) zip -r vela-{}.zip {} \; && \
|
||||
sha256sum vela-* > sha256sums.txt \
|
||||
cd ../kubectl-vela && \
|
||||
$(DIST_DIRS) cp ../../LICENSE {} \; && \
|
||||
$(DIST_DIRS) cp ../../README.md {} \; && \
|
||||
$(DIST_DIRS) tar -zcf kubectl-vela-{}.tar.gz {} \; && \
|
||||
$(DIST_DIRS) zip -r kubectl-vela-{}.zip {} \; && \
|
||||
cd .. && \
|
||||
sha256sum vela/vela-* kubectl-vela/kubectl-vela-* > sha256sums.txt \
|
||||
)
|
||||
|
||||
# Run against the configured Kubernetes cluster in ~/.kube/config
|
||||
run: fmt vet
|
||||
go run ./cmd/core/main.go
|
||||
run:
|
||||
go run ./cmd/core/main.go --application-revision-limit 5
|
||||
|
||||
run-apiserver:
|
||||
go run ./cmd/apiserver/main.go
|
||||
|
||||
# Run go fmt against code
|
||||
fmt:
|
||||
fmt: goimports installcue
|
||||
go fmt ./...
|
||||
|
||||
$(GOIMPORTS) -local github.com/oam-dev/kubevela -w $$(go list -f {{.Dir}} ./...)
|
||||
$(CUE) fmt ./vela-templates/definitions/internal/*
|
||||
$(CUE) fmt ./vela-templates/definitions/registry/*
|
||||
$(CUE) fmt ./pkg/stdlib/pkgs/*
|
||||
$(CUE) fmt ./pkg/stdlib/op.cue
|
||||
$(CUE) fmt ./pkg/workflow/tasks/template/static/*
|
||||
# Run go vet against code
|
||||
vet:
|
||||
go vet ./...
|
||||
|
||||
staticcheck: staticchecktool
|
||||
$(STATICCHECK) ./...
|
||||
|
||||
lint: golangci
|
||||
$(GOLANGCILINT) run --timeout 10m -E golint,goimports ./...
|
||||
$(GOLANGCILINT) run ./...
|
||||
|
||||
reviewable: manifests fmt vet lint staticcheck
|
||||
go mod tidy
|
||||
|
||||
# Execute auto-gen code commands and ensure branch is clean.
|
||||
check-diff: reviewable
|
||||
git --no-pager diff
|
||||
git diff --quiet || ($(ERR) please run 'make reviewable' to include all changes && false)
|
||||
@$(OK) branch is clean
|
||||
|
||||
# Build the docker image
|
||||
docker-build: test
|
||||
docker build . -t ${IMG}
|
||||
docker-build:
|
||||
docker build --build-arg=VERSION=$(VELA_VERSION) --build-arg=GITVERSION=$(GIT_COMMIT) -t $(VELA_CORE_IMAGE) .
|
||||
|
||||
# Build the runtime docker image
|
||||
docker-build-runtime-rollout:
|
||||
docker build --build-arg=VERSION=$(VELA_VERSION) --build-arg=GITVERSION=$(GIT_COMMIT) -t $(VELA_RUNTIME_ROLLOUT_IMAGE) -f runtime/rollout/Dockerfile .
|
||||
|
||||
# Push the docker image
|
||||
docker-push:
|
||||
docker push ${IMG}
|
||||
docker push $(VELA_CORE_IMAGE)
|
||||
|
||||
e2e-setup-core:
|
||||
sh ./hack/e2e/modify_charts.sh
|
||||
helm upgrade --install --create-namespace --namespace vela-system --set image.pullPolicy=IfNotPresent --set image.repository=vela-core-test --set applicationRevisionLimit=5 --set dependCheckWait=10s --set image.tag=$(GIT_COMMIT) --set multicluster.enabled=true --wait kubevela ./charts/vela-core
|
||||
kubectl wait --for=condition=Available deployment/kubevela-vela-core -n vela-system --timeout=180s
|
||||
|
||||
e2e-setup:
|
||||
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.9.0/kruise-chart.tgz --set featureGates="PreDownloadImageForInPlaceUpdate=true"
|
||||
sh ./hack/e2e/modify_charts.sh
|
||||
helm upgrade --install --create-namespace --namespace vela-system --set image.pullPolicy=IfNotPresent --set image.repository=vela-core-test --set applicationRevisionLimit=5 --set dependCheckWait=10s --set image.tag=$(GIT_COMMIT) --wait kubevela ./charts/vela-core
|
||||
helm upgrade --install --create-namespace --namespace oam-runtime-system --set image.pullPolicy=IfNotPresent --set image.repository=vela-core-test --set dependCheckWait=10s --set image.tag=$(GIT_COMMIT) --wait oam-runtime ./charts/oam-runtime
|
||||
bin/vela addon enable fluxcd
|
||||
bin/vela addon enable terraform
|
||||
ginkgo version
|
||||
ginkgo -v -r e2e/setup
|
||||
bin/vela dashboard &
|
||||
|
||||
e2e-test:
|
||||
# Run e2e test
|
||||
ginkgo -v -skipPackage setup,apiserver -r e2e
|
||||
timeout 600s bash -c -- 'while true; do kubectl get ns flux-system; if [ $$? -eq 0 ] ; then break; else sleep 5; fi;done'
|
||||
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-core,app.kubernetes.io/instance=kubevela -n vela-system --timeout=600s
|
||||
kubectl wait --for=condition=Ready pod -l app=source-controller -n flux-system --timeout=600s
|
||||
kubectl wait --for=condition=Ready pod -l app=helm-controller -n flux-system --timeout=600s
|
||||
|
||||
e2e-api-test:
|
||||
# Run e2e test
|
||||
ginkgo -v -r e2e/apiserver
|
||||
ginkgo -v -skipPackage capability,setup,application -r e2e
|
||||
ginkgo -v -r e2e/application
|
||||
|
||||
e2e-test:
|
||||
# Run e2e test
|
||||
ginkgo -v --skip="rollout related e2e-test." ./test/e2e-test
|
||||
@$(OK) tests pass
|
||||
|
||||
e2e-rollout-test:
|
||||
ginkgo -v --focus="rollout related e2e-test." ./test/e2e-test
|
||||
@$(OK) tests pass
|
||||
|
||||
e2e-multicluster-test:
|
||||
go test -v -coverpkg=./... -coverprofile=/tmp/e2e_multicluster_test.out ./test/e2e-multicluster-test
|
||||
@$(OK) tests pass
|
||||
|
||||
compatibility-test: vet lint staticcheck generate-compatibility-testdata
|
||||
# Run compatibility test with old crd
|
||||
COMPATIBILITY_TEST=TRUE go test -race ./pkg/...
|
||||
@$(OK) compatibility-test pass
|
||||
|
||||
generate-compatibility-testdata:
|
||||
mkdir -p ./test/compatibility-test/testdata
|
||||
go run ./test/compatibility-test/convert/main.go ./charts/vela-core/crds ./test/compatibility-test/testdata
|
||||
|
||||
compatibility-testdata-cleanup:
|
||||
rm -f ./test/compatibility-test/testdata/*
|
||||
|
||||
e2e-cleanup:
|
||||
# Clean up
|
||||
rm -rf ~/.vela
|
||||
|
||||
|
||||
# Image URL to use all building/pushing image targets
|
||||
IMG ?= vela-core:latest
|
||||
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
|
||||
CRD_OPTIONS ?= "crd:crdVersions=v1"
|
||||
|
||||
# Run tests
|
||||
core-test: generate fmt vet manifests
|
||||
go test ./pkg/... -coverprofile cover.out
|
||||
|
||||
# Build manager binary
|
||||
manager: generate fmt vet lint manifests
|
||||
go build -o bin/manager ./cmd/core/main.go
|
||||
|
||||
# Run against the configured Kubernetes cluster in ~/.kube/config
|
||||
core-run: generate fmt vet manifests
|
||||
go run ./cmd/core/main.go
|
||||
|
||||
# Install CRDs into a cluster
|
||||
core-install: manifests
|
||||
kustomize build config/crd | kubectl apply -f -
|
||||
|
||||
# Uninstall CRDs from a cluster
|
||||
core-uninstall: manifests
|
||||
kustomize build config/crd | kubectl delete -f -
|
||||
|
||||
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
|
||||
core-deploy: manifests
|
||||
cd config/manager && kustomize edit set image controller=${IMG}
|
||||
kustomize build config/default | kubectl apply -f -
|
||||
|
||||
# Generate manifests e.g. CRD, RBAC etc.
|
||||
manifests: controller-gen
|
||||
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=charts/vela-core/crds
|
||||
|
||||
# Generate code
|
||||
generate: controller-gen
|
||||
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
|
||||
|
||||
# find or download controller-gen
|
||||
# download controller-gen if necessary
|
||||
controller-gen:
|
||||
ifeq (, $(shell which controller-gen))
|
||||
@{ \
|
||||
set -e ;\
|
||||
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
|
||||
cd $$CONTROLLER_GEN_TMP_DIR ;\
|
||||
go mod init tmp ;\
|
||||
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.5 ;\
|
||||
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
|
||||
}
|
||||
CONTROLLER_GEN=$(GOBIN)/controller-gen
|
||||
else
|
||||
CONTROLLER_GEN=$(shell which controller-gen)
|
||||
image-cleanup:
|
||||
# Delete Docker image
|
||||
ifneq ($(shell docker images -q $(VELA_CORE_TEST_IMAGE)),)
|
||||
docker rmi -f $(VELA_CORE_TEST_IMAGE)
|
||||
endif
|
||||
|
||||
GOLANGCILINT_VERSION ?= v1.29.0
|
||||
end-e2e-core:
|
||||
sh ./hack/e2e/end_e2e_core.sh
|
||||
|
||||
end-e2e:
|
||||
sh ./hack/e2e/end_e2e.sh
|
||||
|
||||
# load docker image to the kind cluster
|
||||
kind-load:
|
||||
docker build -t $(VELA_CORE_TEST_IMAGE) -f Dockerfile.e2e .
|
||||
kind load docker-image $(VELA_CORE_TEST_IMAGE) || { echo >&2 "kind not installed or error loading image: $(VELA_CORE_TEST_IMAGE)"; exit 1; }
|
||||
|
||||
# Run tests
|
||||
core-test: fmt vet manifests
|
||||
go test ./pkg/... -coverprofile cover.out
|
||||
|
||||
# Build vela core manager and apiserver binary
|
||||
manager: fmt vet lint manifests
|
||||
$(GOBUILD_ENV) go build -o bin/manager -a -ldflags $(LDFLAGS) ./cmd/core/main.go
|
||||
$(GOBUILD_ENV) go build -o bin/apiserver -a -ldflags $(LDFLAGS) ./cmd/apiserver/main.go
|
||||
|
||||
vela-runtime-rollout-manager: fmt vet lint manifests
|
||||
$(GOBUILD_ENV) go build -o ./runtime/rollout/bin/manager -a -ldflags $(LDFLAGS) ./runtime/rollout/cmd/main.go
|
||||
|
||||
# Run against the configured Kubernetes cluster in ~/.kube/config
|
||||
core-run: fmt vet manifests
|
||||
go run ./cmd/core/main.go
|
||||
|
||||
# Run against the configured Kubernetes cluster in ~/.kube/config with debug logs
|
||||
core-debug-run: fmt vet manifests
|
||||
go run ./cmd/core/main.go --log-debug=true
|
||||
|
||||
# Install CRDs and Definitions of Vela Core into a cluster, this is for develop convenient.
|
||||
core-install: manifests
|
||||
kubectl apply -f hack/namespace.yaml
|
||||
kubectl apply -f charts/vela-core/crds/
|
||||
@$(OK) install succeed
|
||||
|
||||
# Uninstall CRDs and Definitions of Vela Core from a cluster, this is for develop convenient.
|
||||
core-uninstall: manifests
|
||||
kubectl delete -f charts/vela-core/crds/
|
||||
|
||||
# Generate manifests e.g. CRD, RBAC etc.
|
||||
manifests: installcue kustomize
|
||||
go generate $(foreach t,pkg apis,./$(t)/...)
|
||||
# TODO(yangsoon): kustomize will merge all CRD into a whole file, it may not work if we want patch more than one CRD in this way
|
||||
$(KUSTOMIZE) build config/crd -o config/crd/base/core.oam.dev_applications.yaml
|
||||
./hack/crd/cleanup.sh
|
||||
go run ./hack/crd/dispatch/dispatch.go config/crd/base charts/vela-core/crds charts/oam-runtime/crds runtime/ charts/vela-minimal/crds
|
||||
rm -f config/crd/base/*
|
||||
./vela-templates/gen_definitions.sh
|
||||
go run ./vela-templates/gen_addons.go
|
||||
|
||||
GOLANGCILINT_VERSION ?= v1.38.0
|
||||
HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
|
||||
HOSTARCH := $(shell uname -m)
|
||||
ifeq ($(HOSTARCH),x86_64)
|
||||
@@ -163,3 +269,62 @@ GOLANGCILINT=$(GOBIN)/golangci-lint
|
||||
else
|
||||
GOLANGCILINT=$(shell which golangci-lint)
|
||||
endif
|
||||
|
||||
.PHONY: staticchecktool
|
||||
staticchecktool:
|
||||
ifeq (, $(shell which staticcheck))
|
||||
@{ \
|
||||
set -e ;\
|
||||
echo 'installing honnef.co/go/tools/cmd/staticcheck ' ;\
|
||||
GO111MODULE=off go get honnef.co/go/tools/cmd/staticcheck ;\
|
||||
}
|
||||
STATICCHECK=$(GOBIN)/staticcheck
|
||||
else
|
||||
STATICCHECK=$(shell which staticcheck)
|
||||
endif
|
||||
|
||||
.PHONY: goimports
|
||||
goimports:
|
||||
ifeq (, $(shell which goimports))
|
||||
@{ \
|
||||
set -e ;\
|
||||
GO111MODULE=off go get -u golang.org/x/tools/cmd/goimports ;\
|
||||
}
|
||||
GOIMPORTS=$(GOBIN)/goimports
|
||||
else
|
||||
GOIMPORTS=$(shell which goimports)
|
||||
endif
|
||||
|
||||
.PHONY: installcue
|
||||
installcue:
|
||||
ifeq (, $(shell which cue))
|
||||
@{ \
|
||||
set -e ;\
|
||||
GO111MODULE=off go get -u cuelang.org/go/cmd/cue ;\
|
||||
}
|
||||
CUE=$(GOBIN)/cue
|
||||
else
|
||||
CUE=$(shell which cue)
|
||||
endif
|
||||
|
||||
KUSTOMIZE_VERSION ?= 3.8.2
|
||||
|
||||
.PHONY: kustomize
|
||||
kustomize:
|
||||
ifeq (, $(shell kustomize version | grep $(KUSTOMIZE_VERSION)))
|
||||
@{ \
|
||||
set -e ;\
|
||||
echo 'installing kustomize-v$(KUSTOMIZE_VERSION) into $(GOBIN)' ;\
|
||||
curl -s https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh | bash -s $(KUSTOMIZE_VERSION) $(GOBIN);\
|
||||
echo 'Install succeed' ;\
|
||||
}
|
||||
KUSTOMIZE=$(GOBIN)/kustomize
|
||||
else
|
||||
KUSTOMIZE=$(shell which kustomize)
|
||||
endif
|
||||
|
||||
check-license-header:
|
||||
./hack/licence/header-check.sh
|
||||
|
||||
def-install:
|
||||
./hack/utils/installdefinition.sh
|
||||
|
||||
12
OWNERS
Normal file
12
OWNERS
Normal file
@@ -0,0 +1,12 @@
|
||||
approvers:
|
||||
- kubevela-controller
|
||||
- kubevela-devex
|
||||
- kubevela-dashboard-approver
|
||||
|
||||
reviewers:
|
||||
- kubevela-controller
|
||||
- oam-spec
|
||||
- kubevela-dashboard-reviewer
|
||||
|
||||
members:
|
||||
- community-collaborators
|
||||
44
OWNERS_ALIASES
Normal file
44
OWNERS_ALIASES
Normal file
@@ -0,0 +1,44 @@
|
||||
aliases:
|
||||
kubevela-devex:
|
||||
- hongchaodeng
|
||||
- wonderflow
|
||||
|
||||
kubevela-dashboard-approver:
|
||||
- zzxwill
|
||||
- hongchaodeng
|
||||
|
||||
kubevela-dashboard-reviewer:
|
||||
- sunny0826
|
||||
- hanxie-crypto
|
||||
|
||||
kubevela-controller:
|
||||
- resouer
|
||||
- wonderflow
|
||||
- hongchaodeng
|
||||
- zzxwill
|
||||
- ryanzhang-oss
|
||||
- captainroy-hy
|
||||
|
||||
oam-spec: # inherit from https://github.com/oam-dev/spec/blob/master/OWNERS.md
|
||||
- hongchaodeng
|
||||
- resouer
|
||||
|
||||
community-collaborators:
|
||||
- Fei-Guo
|
||||
- szihai
|
||||
|
||||
bootstrap-contributors: # thank you for bootstrapping KubeVela at the very early stage!
|
||||
- xiaoyuaiheshui
|
||||
- Ghostbaby
|
||||
- wenxinnnnn
|
||||
- silenceper
|
||||
- erdun
|
||||
- sunny0826
|
||||
- mosesyou
|
||||
- artursouza
|
||||
- wonderflow
|
||||
- hongchaodeng
|
||||
- ryanzhang-oss
|
||||
- woshilanren11
|
||||
- hanxie-crypto
|
||||
- zzxwill
|
||||
7
PROJECT
7
PROJECT
@@ -1,7 +0,0 @@
|
||||
domain: oam.dev
|
||||
repo: github.com/oam-dev/kubevela
|
||||
resources:
|
||||
- group: standard
|
||||
kind: Route
|
||||
version: v1alpha1
|
||||
version: "2"
|
||||
137
README.md
137
README.md
@@ -1,110 +1,63 @@
|
||||

|
||||
[](https://goreportcard.com/report/github.com/oam-dev/kubevela)
|
||||

|
||||
[](https://codecov.io/gh/oam-dev/kubevela)
|
||||
[](/LICENSE)
|
||||
[](https://github.com/oam-dev/kubevela/releases)
|
||||
[](https://www.tickgit.com/browse?repo=github.com/oam-dev/kubevela)
|
||||
[](https://twitter.com/oam_dev)
|
||||
[](https://artifacthub.io/packages/search?repo=kubevela)
|
||||
|
||||

|
||||
|
||||
*Make shipping applications more enjoyable.*
|
||||
|
||||
# KubeVela
|
||||
|
||||
The Open Application Platform based on Kubernetes and OAM.
|
||||
KubeVela is a modern application platform that makes deploying and managing applications across today's hybrid, multi-cloud environments easier and faster.
|
||||
|
||||
:rotating_light: **Warning: The project is still under heavy development, its UI/UX is also for demo purpose, please don't look inside unless you know what you are doing** Please contact @wonderflow if you are interested in its full story or becoming one of the boostrap contributors/maintainers. :rotating_light:
|
||||
## Features
|
||||
|
||||
## Install
|
||||
**Application Centric** - KubeVela introduces [Open Application Model (OAM)](https://oam.dev/) as the consistent yet higher level API to capture a full deployment of microservices on top of hybrid environments. Placement strategy, traffic shifting and rolling update are declared at application level. No infrastructure level concern, simply deploy.
|
||||
|
||||
### Prerequisites
|
||||
- Kubernetes cluster running Kubernetes v1.15.0 or greater
|
||||
- kubectl current context is configured for the target cluster install
|
||||
- ```kubectl config current-context```
|
||||
**Programmable Workflow** - KubeVela leverages [CUE](https://cuelang.org/) to implement its model layer. This allows you to declare application deployment workflow as a DAG, with all steps and application's needs glued together in programmable approach. No restrictions, natively extensible.
|
||||
|
||||
### Get the Vela CLI
|
||||
**Runtime Agnostic** - KubeVela works as an application delivery control plane that is fully runtime agnostic. It can deploy and manage any application components including containers, cloud functions, databases, or even EC2 instances across hybrid environments, following the workflow you defined.
|
||||
|
||||
Download the `vela` binary from the [Releases page](https://github.com/oam-dev/kubevela/releases). Unpack the `vela` binary and add it to `$PATH` to get started.
|
||||
## Getting Started
|
||||
|
||||
```shell
|
||||
sudo mv ./vela /usr/local/bin/vela
|
||||
```
|
||||
- [Introduction](https://kubevela.io/docs)
|
||||
- [Installation](https://kubevela.io/docs/install)
|
||||
- [Design Your First Deployment Plan](https://kubevela.io/docs/quick-start)
|
||||
|
||||
### Install Vela Core
|
||||
## Documentation
|
||||
|
||||
```shell script
|
||||
$ vela install
|
||||
```
|
||||
Full documentation is available on the [KubeVela website](https://kubevela.io/).
|
||||
|
||||
This command will install vela core controller into your K8s cluster, along with built-in workloads and traits.
|
||||
## Community
|
||||
|
||||
## Demos
|
||||
- Slack: [CNCF Slack](https://slack.cncf.io/) #kubevela channel (*English*)
|
||||
- Gitter: [oam-dev](https://gitter.im/oam-dev/community) (*English*)
|
||||
- [DingTalk Group](https://page.dingtalk.com/wow/dingtalk/act/en-home): `23310022` (*Chinese*)
|
||||
- Wechat Group (*Chinese*): Broker wechat to add you into the user group.
|
||||
|
||||
<img src="https://static.kubevela.net/images/barnett-wechat.jpg" width="200" />
|
||||
- Bi-weekly Community Call: [Meeting Notes](https://docs.google.com/document/d/1nqdFEyULekyksFHtFvgvFAYE-0AMHKoS3RMnaKsarjs)
|
||||
|
||||
#### Check workloads
|
||||
## Talks and Conferences
|
||||
|
||||
```
|
||||
$ vela workloads
|
||||
NAME DEFINITION
|
||||
backend containerizeds.standard.oam.dev
|
||||
task jobs
|
||||
webservice containerizeds.standard.oam.dev
|
||||
```
|
||||
| Engagement | Link |
|
||||
|:-----------|:------------|
|
||||
| 🎤 Talks | - [KubeVela - The Modern App Delivery System in Alibaba](https://docs.google.com/presentation/d/1CWCLcsKpDQB3bBDTfdv2BZ8ilGGJv2E8L-iOA5HMrV0/edit?usp=sharing) |
|
||||
| 🌎 KubeCon | - [ [NA 2020] Standardizing Cloud Native Application Delivery Across Different Clouds](https://www.youtube.com/watch?v=0yhVuBIbHcI) <br> - [ [EU 2021] Zero Pain Microservice Development and Deployment with Dapr and KubeVela](https://sched.co/iE4S) |
|
||||
| 📺 Conferences | - [Dapr, Rudr, OAM: Mark Russinovich presents next gen app development & deployment](https://www.youtube.com/watch?v=eJCu6a-x9uo) <br> - [Mark Russinovich presents "The Future of Cloud Native Applications with OAM and Dapr"](https://myignite.techcommunity.microsoft.com/sessions/82059)|
|
||||
|
||||
#### workload run
|
||||
```shell script
|
||||
$ vela comp run -t webservice app123 -p 80 --image nginx:1.9.4
|
||||
Creating AppConfig app123
|
||||
SUCCEED
|
||||
## Contributing
|
||||
Check out [CONTRIBUTING](./CONTRIBUTING.md) to see how to develop with KubeVela.
|
||||
|
||||
$ vela comp status app123
|
||||
## Report Vulnerability
|
||||
|
||||
$ vela comp ls
|
||||
NAME APP WORKLOAD TRAITS STATUS CREATED-TIME
|
||||
app123 app123 deployment Deployed 2020-08-27 10:56:41 +0800 CST
|
||||
```
|
||||
|
||||
#### app
|
||||
|
||||
```
|
||||
$ vela app ls
|
||||
app123
|
||||
|
||||
$ vela app delete app123
|
||||
Deleting AppConfig "app123"
|
||||
DELETE SUCCEED
|
||||
```
|
||||
|
||||
#### Auto-Completion
|
||||
|
||||
##### bash
|
||||
|
||||
```shell script
|
||||
To load completions in your current shell session:
|
||||
$ source <(vela completion bash)
|
||||
|
||||
To load completions for every new session, execute once:
|
||||
Linux:
|
||||
$ vela completion bash > /etc/bash_completion.d/vela
|
||||
MacOS:
|
||||
$ vela completion bash > /usr/local/etc/bash_completion.d/vela
|
||||
```
|
||||
|
||||
##### zsh
|
||||
|
||||
```shell script
|
||||
To load completions in your current shell session:
|
||||
$ source <(vela completion zsh)
|
||||
|
||||
To load completions for every new session, execute once:
|
||||
$ vela completion zsh > "${fpath[1]}/_vela"
|
||||
```
|
||||
|
||||
### Clean your environment
|
||||
|
||||
```shell script
|
||||
$ helm uninstall vela-core -n oam-system
|
||||
release "vela-core" uninstalled
|
||||
```
|
||||
|
||||
```shell script
|
||||
$ kubectl delete crd workloaddefinitions.core.oam.dev traitdefinitions.core.oam.dev
|
||||
customresourcedefinition.apiextensions.k8s.io "workloaddefinitions.core.oam.dev" deleted
|
||||
customresourcedefinition.apiextensions.k8s.io "traitdefinitions.core.oam.dev" deleted
|
||||
```
|
||||
|
||||
```shell script
|
||||
$ rm -r ~/.vela
|
||||
```
|
||||
|
||||
## CONTRIBUTING
|
||||
Check out [CONTRIBUTING.md](./CONTRIBUTING.md) to see how to develop with KubeVela.
|
||||
Security is a first priority thing for us at KubeVela. If you come across a related issue, please send email to security@mail.kubevela.io .
|
||||
|
||||
## Code of Conduct
|
||||
KubeVela adopts [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
|
||||
|
||||
20
SECURITY.md
Normal file
20
SECURITY.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Security Policy
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you've found a security issue that you'd like to disclose confidentially please send email to security@mail.kubevela.io .
|
||||
|
||||
### Who Reads Email Sent to security@mail.kubevela.io?
|
||||
|
||||
Only a restricted and carefully chosen group of KubeVela maintainers will have access to material sent to the security@mail.kubevela.io address.
|
||||
No outside users can subscribe to this list.
|
||||
|
||||
### What to Send to security@mail.kubevela.io
|
||||
|
||||
Please provide as much information about your system and the issue as possible when contacting the list.
|
||||
|
||||
## How We Respond
|
||||
|
||||
Email sent to security@mail.kubevela.io is read and acknowledged with a non-automated response within three working days.
|
||||
For issues that are complicated and require significant attention,
|
||||
we will open an investigation and will provide you with a mechanism to check the status of our progress at any time.
|
||||
@@ -1,11 +0,0 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type Args struct {
|
||||
Config *rest.Config
|
||||
Schema *runtime.Scheme
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
/*
|
||||
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"cuelang.org/go/cue"
|
||||
"github.com/spf13/pflag"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type Source struct {
|
||||
RepoName string `json:"repoName"`
|
||||
ChartName string `json:"chartName,omitempty"`
|
||||
}
|
||||
|
||||
type CrdInfo struct {
|
||||
APIVersion string `json:"apiVersion"`
|
||||
Kind string `json:"kind"`
|
||||
}
|
||||
|
||||
// Capability defines the content of a capability
|
||||
type Capability struct {
|
||||
Name string `json:"name"`
|
||||
Type CapType `json:"type"`
|
||||
CueTemplate string `json:"template,omitempty"`
|
||||
Parameters []Parameter `json:"parameters,omitempty"`
|
||||
DefinitionPath string `json:"definition"`
|
||||
CrdName string `json:"crdName,omitempty"`
|
||||
Center string `json:"center,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
|
||||
//trait only
|
||||
AppliesTo []string `json:"appliesTo,omitempty"`
|
||||
|
||||
// Plugin Source
|
||||
Source *Source `json:"source,omitempty"`
|
||||
Install *Installation `json:"install,omitempty"`
|
||||
CrdInfo *CrdInfo `json:"crdInfo,omitempty"`
|
||||
}
|
||||
|
||||
type Chart struct {
|
||||
Repo string `json:"repo"`
|
||||
URL string `json:"url"`
|
||||
Name string `json:"name"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
type Installation struct {
|
||||
Helm Chart `json:"helm"`
|
||||
}
|
||||
|
||||
type CapType string
|
||||
|
||||
const (
|
||||
TypeWorkload CapType = "workload"
|
||||
TypeTrait CapType = "trait"
|
||||
TypeScope CapType = "scope"
|
||||
)
|
||||
|
||||
type Parameter struct {
|
||||
Name string `json:"name"`
|
||||
Short string `json:"short,omitempty"`
|
||||
Required bool `json:"required,omitempty"`
|
||||
Default interface{} `json:"default,omitempty"`
|
||||
Usage string `json:"usage,omitempty"`
|
||||
Type cue.Kind `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// ConvertTemplateJSON2Object convert spec.extension to object
|
||||
func ConvertTemplateJSON2Object(in *runtime.RawExtension) (Capability, error) {
|
||||
var t Capability
|
||||
var extension Capability
|
||||
if in == nil {
|
||||
return t, fmt.Errorf("extension field is nil")
|
||||
}
|
||||
if in.Raw == nil {
|
||||
return t, fmt.Errorf("template object is nil")
|
||||
}
|
||||
err := json.Unmarshal(in.Raw, &extension)
|
||||
if err == nil {
|
||||
t = extension
|
||||
}
|
||||
return t, err
|
||||
}
|
||||
|
||||
func SetFlagBy(flags *pflag.FlagSet, v Parameter) {
|
||||
switch v.Type {
|
||||
case cue.IntKind:
|
||||
var vv int64
|
||||
switch val := v.Default.(type) {
|
||||
case int64:
|
||||
vv = val
|
||||
case json.Number:
|
||||
vv, _ = val.Int64()
|
||||
case int:
|
||||
vv = int64(val)
|
||||
case float64:
|
||||
vv = int64(val)
|
||||
}
|
||||
flags.Int64P(v.Name, v.Short, vv, v.Usage)
|
||||
case cue.StringKind:
|
||||
flags.StringP(v.Name, v.Short, v.Default.(string), v.Usage)
|
||||
case cue.BoolKind:
|
||||
flags.BoolP(v.Name, v.Short, v.Default.(bool), v.Usage)
|
||||
case cue.NumberKind, cue.FloatKind:
|
||||
var vv float64
|
||||
switch val := v.Default.(type) {
|
||||
case int64:
|
||||
vv = float64(val)
|
||||
case json.Number:
|
||||
vv, _ = val.Float64()
|
||||
case int:
|
||||
vv = float64(val)
|
||||
case float64:
|
||||
vv = val
|
||||
}
|
||||
flags.Float64P(v.Name, v.Short, vv, v.Usage)
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package types
|
||||
|
||||
const (
|
||||
DefaultOAMNS = "oam-system"
|
||||
DefaultOAMReleaseName = "vela-core"
|
||||
DefaultOAMRuntimeChartName = "vela-core"
|
||||
DefaultOAMVersion = ">0.0.0-0"
|
||||
|
||||
DefaultEnvName = "default"
|
||||
DefaultAppNamespace = "default"
|
||||
)
|
||||
|
||||
const (
|
||||
AnnAPIVersion = "definition.oam.dev/apiVersion"
|
||||
AnnKind = "definition.oam.dev/kind"
|
||||
|
||||
// Indicate which workloadDefinition generate from
|
||||
AnnWorkloadDef = "workload.oam.dev/name"
|
||||
// Indicate which traitDefinition generate from
|
||||
AnnTraitDef = "trait.oam.dev/name"
|
||||
)
|
||||
|
||||
const (
|
||||
StatusDeployed = "Deployed"
|
||||
StatusStaging = "Staging"
|
||||
)
|
||||
|
||||
type EnvMeta struct {
|
||||
Name string `json:"name"`
|
||||
Current string `json:"current,omitempty"`
|
||||
Namespace string `json:"namespace"`
|
||||
}
|
||||
|
||||
const (
|
||||
TagCommandType = "commandType"
|
||||
|
||||
TypeStart = "Getting Started"
|
||||
TypeApp = "Applications"
|
||||
TypeTraits = "Traits"
|
||||
TypeRelease = "Release"
|
||||
TypeOthers = "Others"
|
||||
TypeSystem = "System"
|
||||
)
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
cpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
|
||||
"github.com/crossplane/oam-kubernetes-runtime/pkg/oam"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// ContainerizedSpec defines the desired state of Containerized
|
||||
type ContainerizedSpec struct {
|
||||
// Replicas is the desired number of replicas of the given podSpec.
|
||||
// These are replicas in the sense that they are instantiations of the same podSpec.
|
||||
// If unspecified, defaults to 1.
|
||||
Replicas *int32 `json:"replicas"`
|
||||
|
||||
// PodSpec describes the pods that will be created,
|
||||
// we omit the meta part as it will be exactly the same as the containerized
|
||||
PodSpec v1.PodSpec `json:"podSpec"`
|
||||
}
|
||||
|
||||
// ContainerizedStatus defines the observed state of Containerized
|
||||
type ContainerizedStatus struct {
|
||||
cpv1alpha1.ConditionedStatus `json:",inline"`
|
||||
|
||||
// Resources managed by this workload.
|
||||
Resources []cpv1alpha1.TypedReference `json:"resources,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// Containerized is the Schema for the containerizeds API
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:subresource:status
|
||||
type Containerized struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ContainerizedSpec `json:"spec,omitempty"`
|
||||
Status ContainerizedStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ContainerizedList contains a list of Containerized
|
||||
type ContainerizedList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Containerized `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&Containerized{}, &ContainerizedList{})
|
||||
}
|
||||
|
||||
var _ oam.Workload = &Containerized{}
|
||||
|
||||
func (in *Containerized) SetConditions(c ...cpv1alpha1.Condition) {
|
||||
in.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
func (in *Containerized) GetCondition(c cpv1alpha1.ConditionType) cpv1alpha1.Condition {
|
||||
return in.Status.GetCondition(c)
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
|
||||
"github.com/crossplane/oam-kubernetes-runtime/pkg/oam"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
)
|
||||
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
// MetricsTraitSpec defines the desired state of MetricsTrait
|
||||
type MetricsTraitSpec struct {
|
||||
// An endpoint to be monitored by a ServiceMonitor.
|
||||
ScrapeService ScapeServiceEndPoint `json:"scrapeService"`
|
||||
// WorkloadReference to the workload whose metrics needs to be exposed
|
||||
WorkloadReference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"`
|
||||
}
|
||||
|
||||
// ScapeServiceEndPoint defines a scrapeable endpoint serving Prometheus metrics.
|
||||
type ScapeServiceEndPoint struct {
|
||||
// The format of the metrics data,
|
||||
// The default and only supported format is "prometheus" for now
|
||||
Format string `json:"format,omitempty"`
|
||||
// Number or name of the port to access on the pods targeted by the service.
|
||||
// When this field has value implies that we need to create a service for the workload
|
||||
// Mutually exclusive with port.
|
||||
TargetPort intstr.IntOrString `json:"port,omitempty"`
|
||||
// Route service traffic to pods with label keys and values matching this
|
||||
// The default is the labels in the workload
|
||||
// Mutually exclusive with port.
|
||||
TargetSelector map[string]string `json:"selector,omitempty"`
|
||||
// HTTP path to scrape for metrics.
|
||||
// default is /metrics
|
||||
// +optional
|
||||
Path string `json:"path,omitempty"`
|
||||
// Scheme at which metrics should be scraped
|
||||
// The default and only supported scheme is "http"
|
||||
// +optional
|
||||
Scheme string `json:"scheme,omitempty"`
|
||||
// The default is true
|
||||
// +optional
|
||||
Enabled *bool `json:"enabled,omitempty"`
|
||||
}
|
||||
|
||||
// MetricsTraitStatus defines the observed state of MetricsTrait
|
||||
type MetricsTraitStatus struct {
|
||||
runtimev1alpha1.ConditionedStatus `json:",inline"`
|
||||
|
||||
// ServiceMonitorNames managed by this trait
|
||||
ServiceMonitorNames []string `json:"serviceMonitorName,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// MetricsTrait is the Schema for the metricstraits API
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:subresource:status
|
||||
type MetricsTrait struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec MetricsTraitSpec `json:"spec"`
|
||||
Status MetricsTraitStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// MetricsTraitList contains a list of MetricsTrait
|
||||
type MetricsTraitList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []MetricsTrait `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&MetricsTrait{}, &MetricsTraitList{})
|
||||
}
|
||||
|
||||
var _ oam.Trait = &MetricsTrait{}
|
||||
|
||||
func (tr *MetricsTrait) SetConditions(c ...runtimev1alpha1.Condition) {
|
||||
tr.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
func (tr *MetricsTrait) GetCondition(c runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
|
||||
return tr.Status.GetCondition(c)
|
||||
}
|
||||
|
||||
// GetWorkloadReference of this ManualScalerTrait.
|
||||
func (tr *MetricsTrait) GetWorkloadReference() runtimev1alpha1.TypedReference {
|
||||
return tr.Spec.WorkloadReference
|
||||
}
|
||||
|
||||
// SetWorkloadReference of this ManualScalerTrait.
|
||||
func (tr *MetricsTrait) SetWorkloadReference(r runtimev1alpha1.TypedReference) {
|
||||
tr.Spec.WorkloadReference = r
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
/*
|
||||
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
|
||||
"github.com/crossplane/oam-kubernetes-runtime/pkg/oam"
|
||||
"k8s.io/api/networking/v1beta1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
)
|
||||
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
// RouteSpec defines the desired state of Route
|
||||
type RouteSpec struct {
|
||||
// WorkloadReference to the workload whose metrics needs to be exposed
|
||||
WorkloadReference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"`
|
||||
|
||||
// Host is the host of the route
|
||||
Host string `json:"host"`
|
||||
|
||||
// Path is location Path, default for "/"
|
||||
Path string `json:"path,omitempty"`
|
||||
|
||||
// TLS indicate route trait will create SSL secret using cert-manager with specified issuer
|
||||
// If this is nil, route trait will use a selfsigned issuer
|
||||
TLS *TLS `json:"tls,omitempty"`
|
||||
|
||||
// DefaultBackend uses serviceName
|
||||
DefaultBackend *v1beta1.IngressBackend `json:"defaultBackend,omitempty"`
|
||||
|
||||
// RewriteTarget will rewrite request from Path to RewriteTarget path.
|
||||
RewriteTarget string `json:"rewriteTarget,omitempty"`
|
||||
|
||||
// CustomHeaders pass a custom list of headers to the backend service.
|
||||
CustomHeaders map[string]string `json:"customHeaders,omitempty"`
|
||||
|
||||
// Backend indicate how to connect backend service
|
||||
// If it's nil, will auto discovery
|
||||
Backend *Backend `json:"backend,omitempty"`
|
||||
}
|
||||
|
||||
type TLS struct {
|
||||
IssuerName string `json:"issuerName,omitempty"`
|
||||
|
||||
// Type indicate the issuer is ClusterIssuer or NamespaceIssuer
|
||||
Type IssuerType `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
type IssuerType string
|
||||
|
||||
const (
|
||||
ClusterIssuer IssuerType = "ClusterIssuer"
|
||||
NamespaceIssuer IssuerType = "Issuer"
|
||||
)
|
||||
|
||||
// Route will automatically discover podTemplate for Port and SelectLabels if they are not set.
|
||||
// If Port and SelectLabels are already set, discovery won't work.
|
||||
// If Port is not set, the first port discovered will be set.
|
||||
// If SelectLabels are not set, all selectorLabels discovered will be set.
|
||||
type Backend struct {
|
||||
// Protocol means backend-protocol, HTTP, HTTPS, GRPC, GRPCS, AJP and FCGI, By default uses HTTP
|
||||
Protocol string `json:"protocol,omitempty"`
|
||||
// ReadTimeout used for setting read timeout duration for backend service, the unit is second.
|
||||
ReadTimeout int `json:"readTimeout,omitempty"`
|
||||
// SendTimeout used for setting send timeout duration for backend service, the unit is second.
|
||||
SendTimeout int `json:"sendTimeout,omitempty"`
|
||||
// Port points to backend service port.
|
||||
Port intstr.IntOrString `json:"port,omitempty"`
|
||||
// SelectLabels for backend service.
|
||||
SelectLabels map[string]string `json:"selectLabels,omitempty"`
|
||||
}
|
||||
|
||||
// RouteStatus defines the observed state of Route
|
||||
type RouteStatus struct {
|
||||
Ingress *runtimev1alpha1.TypedReference `json:"ingress,omitempty"`
|
||||
Service *runtimev1alpha1.TypedReference `json:"service,omitempty"`
|
||||
runtimev1alpha1.ConditionedStatus `json:",inline"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:subresource:status
|
||||
// Route is the Schema for the routes API
|
||||
type Route struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec RouteSpec `json:"spec,omitempty"`
|
||||
Status RouteStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// RouteList contains a list of Route
|
||||
type RouteList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Route `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&Route{}, &RouteList{})
|
||||
}
|
||||
|
||||
var _ oam.Trait = &Route{}
|
||||
|
||||
func (r *Route) SetConditions(c ...runtimev1alpha1.Condition) {
|
||||
r.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
func (r *Route) GetCondition(c runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
|
||||
return r.Status.GetCondition(c)
|
||||
}
|
||||
|
||||
// GetWorkloadReference of this ManualScalerTrait.
|
||||
func (r *Route) GetWorkloadReference() runtimev1alpha1.TypedReference {
|
||||
return r.Spec.WorkloadReference
|
||||
}
|
||||
|
||||
// SetWorkloadReference of this ManualScalerTrait.
|
||||
func (r *Route) SetWorkloadReference(rt runtimev1alpha1.TypedReference) {
|
||||
r.Spec.WorkloadReference = rt
|
||||
}
|
||||
@@ -1,414 +0,0 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by controller-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
corev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
|
||||
"k8s.io/api/networking/v1beta1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Backend) DeepCopyInto(out *Backend) {
|
||||
*out = *in
|
||||
out.Port = in.Port
|
||||
if in.SelectLabels != nil {
|
||||
in, out := &in.SelectLabels, &out.SelectLabels
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend.
|
||||
func (in *Backend) DeepCopy() *Backend {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Backend)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Containerized) DeepCopyInto(out *Containerized) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Containerized.
|
||||
func (in *Containerized) DeepCopy() *Containerized {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Containerized)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Containerized) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ContainerizedList) DeepCopyInto(out *ContainerizedList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Containerized, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedList.
|
||||
func (in *ContainerizedList) DeepCopy() *ContainerizedList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ContainerizedList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ContainerizedList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ContainerizedSpec) DeepCopyInto(out *ContainerizedSpec) {
|
||||
*out = *in
|
||||
if in.Replicas != nil {
|
||||
in, out := &in.Replicas, &out.Replicas
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
in.PodSpec.DeepCopyInto(&out.PodSpec)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedSpec.
|
||||
func (in *ContainerizedSpec) DeepCopy() *ContainerizedSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ContainerizedSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ContainerizedStatus) DeepCopyInto(out *ContainerizedStatus) {
|
||||
*out = *in
|
||||
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
|
||||
if in.Resources != nil {
|
||||
in, out := &in.Resources, &out.Resources
|
||||
*out = make([]corev1alpha1.TypedReference, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedStatus.
|
||||
func (in *ContainerizedStatus) DeepCopy() *ContainerizedStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ContainerizedStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MetricsTrait) DeepCopyInto(out *MetricsTrait) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsTrait.
|
||||
func (in *MetricsTrait) DeepCopy() *MetricsTrait {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(MetricsTrait)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *MetricsTrait) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MetricsTraitList) DeepCopyInto(out *MetricsTraitList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]MetricsTrait, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsTraitList.
|
||||
func (in *MetricsTraitList) DeepCopy() *MetricsTraitList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(MetricsTraitList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *MetricsTraitList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MetricsTraitSpec) DeepCopyInto(out *MetricsTraitSpec) {
|
||||
*out = *in
|
||||
in.ScrapeService.DeepCopyInto(&out.ScrapeService)
|
||||
out.WorkloadReference = in.WorkloadReference
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsTraitSpec.
|
||||
func (in *MetricsTraitSpec) DeepCopy() *MetricsTraitSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(MetricsTraitSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MetricsTraitStatus) DeepCopyInto(out *MetricsTraitStatus) {
|
||||
*out = *in
|
||||
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
|
||||
if in.ServiceMonitorNames != nil {
|
||||
in, out := &in.ServiceMonitorNames, &out.ServiceMonitorNames
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsTraitStatus.
|
||||
func (in *MetricsTraitStatus) DeepCopy() *MetricsTraitStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(MetricsTraitStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Route) DeepCopyInto(out *Route) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route.
|
||||
func (in *Route) DeepCopy() *Route {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Route)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Route) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RouteList) DeepCopyInto(out *RouteList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Route, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteList.
|
||||
func (in *RouteList) DeepCopy() *RouteList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RouteList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RouteList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RouteSpec) DeepCopyInto(out *RouteSpec) {
|
||||
*out = *in
|
||||
out.WorkloadReference = in.WorkloadReference
|
||||
if in.TLS != nil {
|
||||
in, out := &in.TLS, &out.TLS
|
||||
*out = new(TLS)
|
||||
**out = **in
|
||||
}
|
||||
if in.DefaultBackend != nil {
|
||||
in, out := &in.DefaultBackend, &out.DefaultBackend
|
||||
*out = new(v1beta1.IngressBackend)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.CustomHeaders != nil {
|
||||
in, out := &in.CustomHeaders, &out.CustomHeaders
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Backend != nil {
|
||||
in, out := &in.Backend, &out.Backend
|
||||
*out = new(Backend)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteSpec.
|
||||
func (in *RouteSpec) DeepCopy() *RouteSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RouteSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RouteStatus) DeepCopyInto(out *RouteStatus) {
|
||||
*out = *in
|
||||
if in.Ingress != nil {
|
||||
in, out := &in.Ingress, &out.Ingress
|
||||
*out = new(corev1alpha1.TypedReference)
|
||||
**out = **in
|
||||
}
|
||||
if in.Service != nil {
|
||||
in, out := &in.Service, &out.Service
|
||||
*out = new(corev1alpha1.TypedReference)
|
||||
**out = **in
|
||||
}
|
||||
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteStatus.
|
||||
func (in *RouteStatus) DeepCopy() *RouteStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RouteStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ScapeServiceEndPoint) DeepCopyInto(out *ScapeServiceEndPoint) {
|
||||
*out = *in
|
||||
out.TargetPort = in.TargetPort
|
||||
if in.TargetSelector != nil {
|
||||
in, out := &in.TargetSelector, &out.TargetSelector
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Enabled != nil {
|
||||
in, out := &in.Enabled, &out.Enabled
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScapeServiceEndPoint.
|
||||
func (in *ScapeServiceEndPoint) DeepCopy() *ScapeServiceEndPoint {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ScapeServiceEndPoint)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TLS) DeepCopyInto(out *TLS) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLS.
|
||||
func (in *TLS) DeepCopy() *TLS {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TLS)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
18
apis/apis.go
Normal file
18
apis/apis.go
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package apis contains all api types of KubeVela
|
||||
package apis
|
||||
19
apis/core.oam.dev/common/doc.go
Normal file
19
apis/core.oam.dev/common/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package common contains types required for both v1alpha2 and v1beta1
|
||||
// +kubebuilder:object:generate=true
|
||||
package common
|
||||
487
apis/core.oam.dev/common/types.go
Normal file
487
apis/core.oam.dev/common/types.go
Normal file
@@ -0,0 +1,487 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package common
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
types "github.com/oam-dev/terraform-controller/api/types/crossplane-runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
|
||||
)
|
||||
|
||||
// Kube defines the encapsulation in raw Kubernetes resource format
|
||||
type Kube struct {
|
||||
// Template defines the raw Kubernetes resource
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Template runtime.RawExtension `json:"template"`
|
||||
|
||||
// Parameters defines configurable parameters
|
||||
Parameters []KubeParameter `json:"parameters,omitempty"`
|
||||
}
|
||||
|
||||
// ParameterValueType refers to a data type of parameter
|
||||
type ParameterValueType string
|
||||
|
||||
// data types of parameter value
|
||||
const (
|
||||
StringType ParameterValueType = "string"
|
||||
NumberType ParameterValueType = "number"
|
||||
BooleanType ParameterValueType = "boolean"
|
||||
)
|
||||
|
||||
// A KubeParameter defines a configurable parameter of a component.
|
||||
type KubeParameter struct {
|
||||
// Name of this parameter
|
||||
Name string `json:"name"`
|
||||
|
||||
// +kubebuilder:validation:Enum:=string;number;boolean
|
||||
// ValueType indicates the type of the parameter value, and
|
||||
// only supports basic data types: string, number, boolean.
|
||||
ValueType ParameterValueType `json:"type"`
|
||||
|
||||
// FieldPaths specifies an array of fields within this workload that will be
|
||||
// overwritten by the value of this parameter. All fields must be of the
|
||||
// same type. Fields are specified as JSON field paths without a leading
|
||||
// dot, for example 'spec.replicas'.
|
||||
FieldPaths []string `json:"fieldPaths"`
|
||||
|
||||
// +kubebuilder:default:=false
|
||||
// Required specifies whether or not a value for this parameter must be
|
||||
// supplied when authoring an Application.
|
||||
Required *bool `json:"required,omitempty"`
|
||||
|
||||
// Description of this parameter.
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// CUE defines the encapsulation in CUE format
|
||||
type CUE struct {
|
||||
// Template defines the abstraction template data of the capability, it will replace the old CUE template in extension field.
|
||||
// Template is a required field if CUE is defined in Capability Definition.
|
||||
Template string `json:"template"`
|
||||
}
|
||||
|
||||
// Schematic defines the encapsulation of this capability(workload/trait/scope),
|
||||
// the encapsulation can be defined in different ways, e.g. CUE/HCL(terraform)/KUBE(K8s Object)/HELM, etc...
|
||||
type Schematic struct {
|
||||
KUBE *Kube `json:"kube,omitempty"`
|
||||
|
||||
CUE *CUE `json:"cue,omitempty"`
|
||||
|
||||
HELM *Helm `json:"helm,omitempty"`
|
||||
|
||||
Terraform *Terraform `json:"terraform,omitempty"`
|
||||
}
|
||||
|
||||
// A Helm represents resources used by a Helm module
|
||||
type Helm struct {
|
||||
// Release records a Helm release used by a Helm module workload.
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Release runtime.RawExtension `json:"release"`
|
||||
|
||||
// HelmRelease records a Helm repository used by a Helm module workload.
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Repository runtime.RawExtension `json:"repository"`
|
||||
}
|
||||
|
||||
// Terraform is the struct to describe cloud resources managed by Hashicorp Terraform
|
||||
type Terraform struct {
|
||||
// Configuration is Terraform Configuration
|
||||
Configuration string `json:"configuration"`
|
||||
|
||||
// Type specifies which Terraform configuration it is, HCL or JSON syntax
|
||||
// +kubebuilder:default:=hcl
|
||||
// +kubebuilder:validation:Enum:=hcl;json;remote
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// ProviderReference specifies the reference to Provider
|
||||
ProviderReference *types.Reference `json:"providerRef,omitempty"`
|
||||
}
|
||||
|
||||
// A WorkloadTypeDescriptor refer to a Workload Type
|
||||
type WorkloadTypeDescriptor struct {
|
||||
// Type ref to a WorkloadDefinition via name
|
||||
Type string `json:"type,omitempty"`
|
||||
// Definition mutually exclusive to workload.type, a embedded WorkloadDefinition
|
||||
Definition WorkloadGVK `json:"definition,omitempty"`
|
||||
}
|
||||
|
||||
// WorkloadGVK refer to a Workload Type
|
||||
type WorkloadGVK struct {
|
||||
APIVersion string `json:"apiVersion"`
|
||||
Kind string `json:"kind"`
|
||||
}
|
||||
|
||||
// A DefinitionReference refers to a CustomResourceDefinition by name.
|
||||
type DefinitionReference struct {
|
||||
// Name of the referenced CustomResourceDefinition.
|
||||
Name string `json:"name"`
|
||||
|
||||
// Version indicate which version should be used if CRD has multiple versions
|
||||
// by default it will use the first one if not specified
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// A ChildResourceKind defines a child Kubernetes resource kind with a selector
|
||||
type ChildResourceKind struct {
|
||||
// APIVersion of the child resource
|
||||
APIVersion string `json:"apiVersion"`
|
||||
|
||||
// Kind of the child resource
|
||||
Kind string `json:"kind"`
|
||||
|
||||
// Selector to select the child resources that the workload wants to expose to traits
|
||||
Selector map[string]string `json:"selector,omitempty"`
|
||||
}
|
||||
|
||||
// Status defines the loop back status of the abstraction by using CUE template
|
||||
type Status struct {
|
||||
// CustomStatus defines the custom status message that could display to user
|
||||
// +optional
|
||||
CustomStatus string `json:"customStatus,omitempty"`
|
||||
// HealthPolicy defines the health check policy for the abstraction
|
||||
// +optional
|
||||
HealthPolicy string `json:"healthPolicy,omitempty"`
|
||||
}
|
||||
|
||||
// ApplicationPhase is a label for the condition of a application at the current time
|
||||
type ApplicationPhase string
|
||||
|
||||
const (
|
||||
// ApplicationRollingOut means the app is in the middle of rolling out
|
||||
ApplicationRollingOut ApplicationPhase = "rollingOut"
|
||||
// ApplicationStarting means the app is preparing for reconcile
|
||||
ApplicationStarting ApplicationPhase = "starting"
|
||||
// ApplicationRendering means the app is rendering
|
||||
ApplicationRendering ApplicationPhase = "rendering"
|
||||
// ApplicationPolicyGenerating means the app is generating policies
|
||||
ApplicationPolicyGenerating ApplicationPhase = "generatingPolicy"
|
||||
// ApplicationRunningWorkflow means the app is running workflow
|
||||
ApplicationRunningWorkflow ApplicationPhase = "runningWorkflow"
|
||||
// ApplicationWorkflowSuspending means the app's workflow is suspending
|
||||
ApplicationWorkflowSuspending ApplicationPhase = "workflowSuspending"
|
||||
// ApplicationWorkflowTerminated means the app's workflow is terminated
|
||||
ApplicationWorkflowTerminated ApplicationPhase = "workflowTerminated"
|
||||
// ApplicationWorkflowFinished means the app's workflow is finished
|
||||
ApplicationWorkflowFinished ApplicationPhase = "workflowFinished"
|
||||
// ApplicationRunning means the app finished rendering and applied result to the cluster
|
||||
ApplicationRunning ApplicationPhase = "running"
|
||||
// ApplicationUnhealthy means the app finished rendering and applied result to the cluster, but still unhealthy
|
||||
ApplicationUnhealthy ApplicationPhase = "unhealthy"
|
||||
)
|
||||
|
||||
// WorkflowState is a string that mark the workflow state
|
||||
type WorkflowState string
|
||||
|
||||
const (
|
||||
// WorkflowStateTerminated means workflow is terminated manually, and it won't be started unless the spec changed.
|
||||
WorkflowStateTerminated WorkflowState = "terminated"
|
||||
// WorkflowStateSuspended means workflow is suspended manually, and it can be resumed.
|
||||
WorkflowStateSuspended WorkflowState = "suspended"
|
||||
// WorkflowStateFinished means workflow is running successfully, all steps finished.
|
||||
WorkflowStateFinished WorkflowState = "finished"
|
||||
// WorkflowStateExecuting means workflow is still running or waiting some steps.
|
||||
WorkflowStateExecuting WorkflowState = "executing"
|
||||
)
|
||||
|
||||
// ApplicationComponentStatus record the health status of App component
|
||||
type ApplicationComponentStatus struct {
|
||||
Name string `json:"name"`
|
||||
Env string `json:"env,omitempty"`
|
||||
// WorkloadDefinition is the definition of a WorkloadDefinition, such as deployments/apps.v1
|
||||
WorkloadDefinition WorkloadGVK `json:"workloadDefinition,omitempty"`
|
||||
Healthy bool `json:"healthy"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Traits []ApplicationTraitStatus `json:"traits,omitempty"`
|
||||
Scopes []corev1.ObjectReference `json:"scopes,omitempty"`
|
||||
}
|
||||
|
||||
// ApplicationTraitStatus records the trait health status
|
||||
type ApplicationTraitStatus struct {
|
||||
Type string `json:"type"`
|
||||
Healthy bool `json:"healthy"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// Revision has name and revision number
|
||||
type Revision struct {
|
||||
Name string `json:"name"`
|
||||
Revision int64 `json:"revision"`
|
||||
|
||||
// RevisionHash record the hash value of the spec of ApplicationRevision object.
|
||||
RevisionHash string `json:"revisionHash,omitempty"`
|
||||
}
|
||||
|
||||
// RawComponent record raw component
|
||||
type RawComponent struct {
|
||||
// +kubebuilder:validation:EmbeddedResource
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Raw runtime.RawExtension `json:"raw"`
|
||||
}
|
||||
|
||||
// WorkflowStepStatus record the status of a workflow step
|
||||
type WorkflowStepStatus struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Phase WorkflowStepPhase `json:"phase,omitempty"`
|
||||
// A human readable message indicating details about why the workflowStep is in this state.
|
||||
Message string `json:"message,omitempty"`
|
||||
// A brief CamelCase message indicating details about why the workflowStep is in this state.
|
||||
Reason string `json:"reason,omitempty"`
|
||||
SubSteps *SubStepsStatus `json:"subSteps,omitempty"`
|
||||
}
|
||||
|
||||
// WorkflowSubStepStatus record the status of a workflow step
|
||||
type WorkflowSubStepStatus struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Phase WorkflowStepPhase `json:"phase,omitempty"`
|
||||
// A human readable message indicating details about why the workflowStep is in this state.
|
||||
Message string `json:"message,omitempty"`
|
||||
// A brief CamelCase message indicating details about why the workflowStep is in this state.
|
||||
Reason string `json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
// AppStatus defines the observed state of Application
|
||||
type AppStatus struct {
|
||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
|
||||
// The generation observed by the application controller.
|
||||
// +optional
|
||||
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
|
||||
|
||||
Rollout AppRolloutStatus `json:"rollout,omitempty"`
|
||||
|
||||
Phase ApplicationPhase `json:"status,omitempty"`
|
||||
|
||||
// Components record the related Components created by Application Controller
|
||||
Components []corev1.ObjectReference `json:"components,omitempty"`
|
||||
|
||||
// Services record the status of the application services
|
||||
Services []ApplicationComponentStatus `json:"services,omitempty"`
|
||||
|
||||
// ResourceTracker record the status of the ResourceTracker
|
||||
ResourceTracker *corev1.ObjectReference `json:"resourceTracker,omitempty"`
|
||||
|
||||
// Workflow record the status of workflow
|
||||
Workflow *WorkflowStatus `json:"workflow,omitempty"`
|
||||
|
||||
// LatestRevision of the application configuration it generates
|
||||
// +optional
|
||||
LatestRevision *Revision `json:"latestRevision,omitempty"`
|
||||
|
||||
// AppliedResources record the resources that the workflow step apply.
|
||||
AppliedResources []ClusterObjectReference `json:"appliedResources,omitempty"`
|
||||
}
|
||||
|
||||
// WorkflowStatus record the status of workflow
|
||||
type WorkflowStatus struct {
|
||||
AppRevision string `json:"appRevision,omitempty"`
|
||||
Mode WorkflowMode `json:"mode"`
|
||||
|
||||
Suspend bool `json:"suspend"`
|
||||
Terminated bool `json:"terminated"`
|
||||
|
||||
ContextBackend *corev1.ObjectReference `json:"contextBackend,omitempty"`
|
||||
Steps []WorkflowStepStatus `json:"steps,omitempty"`
|
||||
}
|
||||
|
||||
// SubStepsStatus record the status of workflow steps.
|
||||
type SubStepsStatus struct {
|
||||
StepIndex int `json:"stepIndex,omitempty"`
|
||||
Mode WorkflowMode `json:"mode,omitempty"`
|
||||
Steps []WorkflowSubStepStatus `json:"steps,omitempty"`
|
||||
}
|
||||
|
||||
// WorkflowStepPhase describes the phase of a workflow step.
|
||||
type WorkflowStepPhase string
|
||||
|
||||
const (
|
||||
// WorkflowStepPhaseSucceeded will make the controller run the next step.
|
||||
WorkflowStepPhaseSucceeded WorkflowStepPhase = "succeeded"
|
||||
// WorkflowStepPhaseFailed will make the controller stop the workflow and report error in `message`.
|
||||
WorkflowStepPhaseFailed WorkflowStepPhase = "failed"
|
||||
// WorkflowStepPhaseStopped will make the controller stop the workflow.
|
||||
WorkflowStepPhaseStopped WorkflowStepPhase = "stopped"
|
||||
// WorkflowStepPhaseRunning will make the controller continue the workflow.
|
||||
WorkflowStepPhaseRunning WorkflowStepPhase = "running"
|
||||
)
|
||||
|
||||
// DefinitionType describes the type of DefinitionRevision.
|
||||
// +kubebuilder:validation:Enum=Component;Trait;Policy;WorkflowStep
|
||||
type DefinitionType string
|
||||
|
||||
const (
|
||||
// ComponentType represents DefinitionRevision refer to type ComponentDefinition
|
||||
ComponentType DefinitionType = "Component"
|
||||
|
||||
// TraitType represents DefinitionRevision refer to type TraitDefinition
|
||||
TraitType DefinitionType = "Trait"
|
||||
|
||||
// PolicyType represents DefinitionRevision refer to type PolicyDefinition
|
||||
PolicyType DefinitionType = "Policy"
|
||||
|
||||
// WorkflowStepType represents DefinitionRevision refer to type WorkflowStepDefinition
|
||||
WorkflowStepType DefinitionType = "WorkflowStep"
|
||||
)
|
||||
|
||||
// WorkflowMode describes the mode of workflow
|
||||
type WorkflowMode string
|
||||
|
||||
const (
|
||||
// WorkflowModeDAG describes the DAG mode of workflow
|
||||
WorkflowModeDAG WorkflowMode = "DAG"
|
||||
// WorkflowModeStep describes the step by step mode of workflow
|
||||
WorkflowModeStep WorkflowMode = "StepByStep"
|
||||
)
|
||||
|
||||
// AppRolloutStatus defines the observed state of AppRollout
|
||||
type AppRolloutStatus struct {
|
||||
v1alpha1.RolloutStatus `json:",inline"`
|
||||
|
||||
// LastUpgradedTargetAppRevision contains the name of the app that we upgraded to
|
||||
// We will restart the rollout if this is not the same as the spec
|
||||
LastUpgradedTargetAppRevision string `json:"lastTargetAppRevision"`
|
||||
|
||||
// LastSourceAppRevision contains the name of the app that we need to upgrade from.
|
||||
// We will restart the rollout if this is not the same as the spec
|
||||
LastSourceAppRevision string `json:"LastSourceAppRevision,omitempty"`
|
||||
}
|
||||
|
||||
// ApplicationTrait defines the trait of application
|
||||
type ApplicationTrait struct {
|
||||
Type string `json:"type"`
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Properties *runtime.RawExtension `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// ApplicationComponent describe the component of application
|
||||
type ApplicationComponent struct {
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
// ExternalRevision specified the component revisionName
|
||||
ExternalRevision string `json:"externalRevision,omitempty"`
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Properties *runtime.RawExtension `json:"properties,omitempty"`
|
||||
|
||||
DependsOn []string `json:"dependsOn,omitempty"`
|
||||
Inputs StepInputs `json:"inputs,omitempty"`
|
||||
Outputs StepOutputs `json:"outputs,omitempty"`
|
||||
|
||||
// Traits define the trait of one component, the type must be array to keep the order.
|
||||
Traits []ApplicationTrait `json:"traits,omitempty"`
|
||||
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
// scopes in ApplicationComponent defines the component-level scopes
|
||||
// the format is <scope-type:scope-instance-name> pairs, the key represents type of `ScopeDefinition` while the value represent the name of scope instance.
|
||||
Scopes map[string]string `json:"scopes,omitempty"`
|
||||
}
|
||||
|
||||
// StepOutputs defines output variable of WorkflowStep
|
||||
type StepOutputs []outputItem
|
||||
|
||||
// StepInputs defines variable input of WorkflowStep
|
||||
type StepInputs []inputItem
|
||||
|
||||
type inputItem struct {
|
||||
ParameterKey string `json:"parameterKey"`
|
||||
From string `json:"from"`
|
||||
}
|
||||
|
||||
type outputItem struct {
|
||||
ValueFrom string `json:"valueFrom"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// ClusterSelector defines the rules to select a Cluster resource.
|
||||
// Either name or labels is needed.
|
||||
type ClusterSelector struct {
|
||||
// Name is the name of the cluster.
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// Labels defines the label selector to select the cluster.
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
}
|
||||
|
||||
// Distribution defines the replica distribution of an AppRevision to a cluster.
|
||||
type Distribution struct {
|
||||
// Replicas is the replica number.
|
||||
Replicas int `json:"replicas,omitempty"`
|
||||
}
|
||||
|
||||
// ClusterPlacement defines the cluster placement rules for an app revision.
|
||||
type ClusterPlacement struct {
|
||||
// ClusterSelector selects the cluster to deploy apps to.
|
||||
// If not specified, it indicates the host cluster per se.
|
||||
ClusterSelector *ClusterSelector `json:"clusterSelector,omitempty"`
|
||||
|
||||
// Distribution defines the replica distribution of an AppRevision to a cluster.
|
||||
Distribution Distribution `json:"distribution,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceCreatorRole defines the resource creator.
|
||||
type ResourceCreatorRole string
|
||||
|
||||
const (
|
||||
// PolicyResourceCreator create the policy resource.
|
||||
PolicyResourceCreator ResourceCreatorRole = "policy"
|
||||
// WorkflowResourceCreator create the resource in workflow.
|
||||
WorkflowResourceCreator ResourceCreatorRole = "workflow"
|
||||
)
|
||||
|
||||
// ClusterObjectReference defines the object reference with cluster.
|
||||
type ClusterObjectReference struct {
|
||||
Cluster string `json:"cluster,omitempty"`
|
||||
Creator ResourceCreatorRole `json:"creator,omitempty"`
|
||||
corev1.ObjectReference `json:",inline"`
|
||||
}
|
||||
|
||||
// RawExtensionPointer is the pointer of raw extension
|
||||
type RawExtensionPointer struct {
|
||||
RawExtension *runtime.RawExtension
|
||||
}
|
||||
|
||||
// MarshalJSON may get called on pointers or values, so implement MarshalJSON on value.
|
||||
// http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go
|
||||
func (re RawExtensionPointer) MarshalJSON() ([]byte, error) {
|
||||
if re.RawExtension == nil {
|
||||
return nil, nil
|
||||
}
|
||||
if re.RawExtension.Raw == nil {
|
||||
// TODO: this is to support legacy behavior of JSONPrinter and YAMLPrinter, which
|
||||
// expect to call json.Marshal on arbitrary versioned objects (even those not in
|
||||
// the scheme). pkg/kubectl/resource#AsVersionedObjects and its interaction with
|
||||
// kubectl get on objects not in the scheme needs to be updated to ensure that the
|
||||
// objects that are not part of the scheme are correctly put into the right form.
|
||||
if re.RawExtension.Object != nil {
|
||||
return json.Marshal(re.RawExtension.Object)
|
||||
}
|
||||
return []byte("null"), nil
|
||||
}
|
||||
// TODO: Check whether ContentType is actually JSON before returning it.
|
||||
return re.RawExtension.Raw, nil
|
||||
}
|
||||
670
apis/core.oam.dev/common/zz_generated.deepcopy.go
Normal file
670
apis/core.oam.dev/common/zz_generated.deepcopy.go
Normal file
@@ -0,0 +1,670 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by controller-gen. DO NOT EDIT.
|
||||
|
||||
package common
|
||||
|
||||
import (
|
||||
crossplane_runtime "github.com/oam-dev/terraform-controller/api/types/crossplane-runtime"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AppRolloutStatus) DeepCopyInto(out *AppRolloutStatus) {
|
||||
*out = *in
|
||||
in.RolloutStatus.DeepCopyInto(&out.RolloutStatus)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutStatus.
|
||||
func (in *AppRolloutStatus) DeepCopy() *AppRolloutStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AppRolloutStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AppStatus) DeepCopyInto(out *AppStatus) {
|
||||
*out = *in
|
||||
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
|
||||
in.Rollout.DeepCopyInto(&out.Rollout)
|
||||
if in.Components != nil {
|
||||
in, out := &in.Components, &out.Components
|
||||
*out = make([]v1.ObjectReference, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Services != nil {
|
||||
in, out := &in.Services, &out.Services
|
||||
*out = make([]ApplicationComponentStatus, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.ResourceTracker != nil {
|
||||
in, out := &in.ResourceTracker, &out.ResourceTracker
|
||||
*out = new(v1.ObjectReference)
|
||||
**out = **in
|
||||
}
|
||||
if in.Workflow != nil {
|
||||
in, out := &in.Workflow, &out.Workflow
|
||||
*out = new(WorkflowStatus)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.LatestRevision != nil {
|
||||
in, out := &in.LatestRevision, &out.LatestRevision
|
||||
*out = new(Revision)
|
||||
**out = **in
|
||||
}
|
||||
if in.AppliedResources != nil {
|
||||
in, out := &in.AppliedResources, &out.AppliedResources
|
||||
*out = make([]ClusterObjectReference, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppStatus.
|
||||
func (in *AppStatus) DeepCopy() *AppStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AppStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ApplicationComponent) DeepCopyInto(out *ApplicationComponent) {
|
||||
*out = *in
|
||||
if in.Properties != nil {
|
||||
in, out := &in.Properties, &out.Properties
|
||||
*out = new(runtime.RawExtension)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.DependsOn != nil {
|
||||
in, out := &in.DependsOn, &out.DependsOn
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Inputs != nil {
|
||||
in, out := &in.Inputs, &out.Inputs
|
||||
*out = make(StepInputs, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Outputs != nil {
|
||||
in, out := &in.Outputs, &out.Outputs
|
||||
*out = make(StepOutputs, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Traits != nil {
|
||||
in, out := &in.Traits, &out.Traits
|
||||
*out = make([]ApplicationTrait, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.Scopes != nil {
|
||||
in, out := &in.Scopes, &out.Scopes
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationComponent.
|
||||
func (in *ApplicationComponent) DeepCopy() *ApplicationComponent {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ApplicationComponent)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ApplicationComponentStatus) DeepCopyInto(out *ApplicationComponentStatus) {
|
||||
*out = *in
|
||||
out.WorkloadDefinition = in.WorkloadDefinition
|
||||
if in.Traits != nil {
|
||||
in, out := &in.Traits, &out.Traits
|
||||
*out = make([]ApplicationTraitStatus, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Scopes != nil {
|
||||
in, out := &in.Scopes, &out.Scopes
|
||||
*out = make([]v1.ObjectReference, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationComponentStatus.
|
||||
func (in *ApplicationComponentStatus) DeepCopy() *ApplicationComponentStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ApplicationComponentStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ApplicationTrait) DeepCopyInto(out *ApplicationTrait) {
|
||||
*out = *in
|
||||
if in.Properties != nil {
|
||||
in, out := &in.Properties, &out.Properties
|
||||
*out = new(runtime.RawExtension)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationTrait.
|
||||
func (in *ApplicationTrait) DeepCopy() *ApplicationTrait {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ApplicationTrait)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ApplicationTraitStatus) DeepCopyInto(out *ApplicationTraitStatus) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationTraitStatus.
|
||||
func (in *ApplicationTraitStatus) DeepCopy() *ApplicationTraitStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ApplicationTraitStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CUE) DeepCopyInto(out *CUE) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CUE.
|
||||
func (in *CUE) DeepCopy() *CUE {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CUE)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ChildResourceKind) DeepCopyInto(out *ChildResourceKind) {
|
||||
*out = *in
|
||||
if in.Selector != nil {
|
||||
in, out := &in.Selector, &out.Selector
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChildResourceKind.
|
||||
func (in *ChildResourceKind) DeepCopy() *ChildResourceKind {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ChildResourceKind)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterObjectReference) DeepCopyInto(out *ClusterObjectReference) {
|
||||
*out = *in
|
||||
out.ObjectReference = in.ObjectReference
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterObjectReference.
|
||||
func (in *ClusterObjectReference) DeepCopy() *ClusterObjectReference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterObjectReference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterPlacement) DeepCopyInto(out *ClusterPlacement) {
|
||||
*out = *in
|
||||
if in.ClusterSelector != nil {
|
||||
in, out := &in.ClusterSelector, &out.ClusterSelector
|
||||
*out = new(ClusterSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
out.Distribution = in.Distribution
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPlacement.
|
||||
func (in *ClusterPlacement) DeepCopy() *ClusterPlacement {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterPlacement)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterSelector) DeepCopyInto(out *ClusterSelector) {
|
||||
*out = *in
|
||||
if in.Labels != nil {
|
||||
in, out := &in.Labels, &out.Labels
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSelector.
|
||||
func (in *ClusterSelector) DeepCopy() *ClusterSelector {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterSelector)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DefinitionReference) DeepCopyInto(out *DefinitionReference) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefinitionReference.
|
||||
func (in *DefinitionReference) DeepCopy() *DefinitionReference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DefinitionReference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Distribution) DeepCopyInto(out *Distribution) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Distribution.
|
||||
func (in *Distribution) DeepCopy() *Distribution {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Distribution)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Helm) DeepCopyInto(out *Helm) {
|
||||
*out = *in
|
||||
in.Release.DeepCopyInto(&out.Release)
|
||||
in.Repository.DeepCopyInto(&out.Repository)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Helm.
|
||||
func (in *Helm) DeepCopy() *Helm {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Helm)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Kube) DeepCopyInto(out *Kube) {
|
||||
*out = *in
|
||||
in.Template.DeepCopyInto(&out.Template)
|
||||
if in.Parameters != nil {
|
||||
in, out := &in.Parameters, &out.Parameters
|
||||
*out = make([]KubeParameter, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kube.
|
||||
func (in *Kube) DeepCopy() *Kube {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Kube)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KubeParameter) DeepCopyInto(out *KubeParameter) {
|
||||
*out = *in
|
||||
if in.FieldPaths != nil {
|
||||
in, out := &in.FieldPaths, &out.FieldPaths
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Required != nil {
|
||||
in, out := &in.Required, &out.Required
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.Description != nil {
|
||||
in, out := &in.Description, &out.Description
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeParameter.
|
||||
func (in *KubeParameter) DeepCopy() *KubeParameter {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KubeParameter)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RawComponent) DeepCopyInto(out *RawComponent) {
|
||||
*out = *in
|
||||
in.Raw.DeepCopyInto(&out.Raw)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawComponent.
|
||||
func (in *RawComponent) DeepCopy() *RawComponent {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RawComponent)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RawExtensionPointer) DeepCopyInto(out *RawExtensionPointer) {
|
||||
*out = *in
|
||||
if in.RawExtension != nil {
|
||||
in, out := &in.RawExtension, &out.RawExtension
|
||||
*out = new(runtime.RawExtension)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawExtensionPointer.
|
||||
func (in *RawExtensionPointer) DeepCopy() *RawExtensionPointer {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RawExtensionPointer)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Revision) DeepCopyInto(out *Revision) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Revision.
|
||||
func (in *Revision) DeepCopy() *Revision {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Revision)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Schematic) DeepCopyInto(out *Schematic) {
|
||||
*out = *in
|
||||
if in.KUBE != nil {
|
||||
in, out := &in.KUBE, &out.KUBE
|
||||
*out = new(Kube)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.CUE != nil {
|
||||
in, out := &in.CUE, &out.CUE
|
||||
*out = new(CUE)
|
||||
**out = **in
|
||||
}
|
||||
if in.HELM != nil {
|
||||
in, out := &in.HELM, &out.HELM
|
||||
*out = new(Helm)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Terraform != nil {
|
||||
in, out := &in.Terraform, &out.Terraform
|
||||
*out = new(Terraform)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Schematic.
|
||||
func (in *Schematic) DeepCopy() *Schematic {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Schematic)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Status) DeepCopyInto(out *Status) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status.
|
||||
func (in *Status) DeepCopy() *Status {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Status)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in StepInputs) DeepCopyInto(out *StepInputs) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(StepInputs, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepInputs.
|
||||
func (in StepInputs) DeepCopy() StepInputs {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(StepInputs)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in StepOutputs) DeepCopyInto(out *StepOutputs) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(StepOutputs, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepOutputs.
|
||||
func (in StepOutputs) DeepCopy() StepOutputs {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(StepOutputs)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SubStepsStatus) DeepCopyInto(out *SubStepsStatus) {
|
||||
*out = *in
|
||||
if in.Steps != nil {
|
||||
in, out := &in.Steps, &out.Steps
|
||||
*out = make([]WorkflowSubStepStatus, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubStepsStatus.
|
||||
func (in *SubStepsStatus) DeepCopy() *SubStepsStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SubStepsStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Terraform) DeepCopyInto(out *Terraform) {
|
||||
*out = *in
|
||||
if in.ProviderReference != nil {
|
||||
in, out := &in.ProviderReference, &out.ProviderReference
|
||||
*out = new(crossplane_runtime.Reference)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Terraform.
|
||||
func (in *Terraform) DeepCopy() *Terraform {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Terraform)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkflowStatus) DeepCopyInto(out *WorkflowStatus) {
|
||||
*out = *in
|
||||
if in.ContextBackend != nil {
|
||||
in, out := &in.ContextBackend, &out.ContextBackend
|
||||
*out = new(v1.ObjectReference)
|
||||
**out = **in
|
||||
}
|
||||
if in.Steps != nil {
|
||||
in, out := &in.Steps, &out.Steps
|
||||
*out = make([]WorkflowStepStatus, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStatus.
|
||||
func (in *WorkflowStatus) DeepCopy() *WorkflowStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkflowStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkflowStepStatus) DeepCopyInto(out *WorkflowStepStatus) {
|
||||
*out = *in
|
||||
if in.SubSteps != nil {
|
||||
in, out := &in.SubSteps, &out.SubSteps
|
||||
*out = new(SubStepsStatus)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStepStatus.
|
||||
func (in *WorkflowStepStatus) DeepCopy() *WorkflowStepStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkflowStepStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkflowSubStepStatus) DeepCopyInto(out *WorkflowSubStepStatus) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowSubStepStatus.
|
||||
func (in *WorkflowSubStepStatus) DeepCopy() *WorkflowSubStepStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkflowSubStepStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkloadGVK) DeepCopyInto(out *WorkloadGVK) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadGVK.
|
||||
func (in *WorkloadGVK) DeepCopy() *WorkloadGVK {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkloadGVK)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkloadTypeDescriptor) DeepCopyInto(out *WorkloadTypeDescriptor) {
|
||||
*out = *in
|
||||
out.Definition = in.Definition
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadTypeDescriptor.
|
||||
func (in *WorkloadTypeDescriptor) DeepCopy() *WorkloadTypeDescriptor {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkloadTypeDescriptor)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
282
apis/core.oam.dev/condition/condition.go
Normal file
282
apis/core.oam.dev/condition/condition.go
Normal file
@@ -0,0 +1,282 @@
|
||||
/*
|
||||
|
||||
// This file is originally from https://github.com/crossplane/crossplane-runtime/blob/master/apis/common/v1/condition.go
|
||||
// We copy it here to reduce dependency and add more
|
||||
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
Copyright 2019 The Crossplane Authors.
|
||||
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package condition
|
||||
|
||||
import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// A ConditionType represents a condition a resource could be in.
|
||||
// nolint:golint
|
||||
type ConditionType string
|
||||
|
||||
// Condition types.
|
||||
const (
|
||||
// TypeReady resources are believed to be ready to handle work.
|
||||
TypeReady ConditionType = "Ready"
|
||||
|
||||
// TypeSynced resources are believed to be in sync with the
|
||||
// Kubernetes resources that manage their lifecycle.
|
||||
TypeSynced ConditionType = "Synced"
|
||||
)
|
||||
|
||||
// A ConditionReason represents the reason a resource is in a condition.
|
||||
// nolint:golint
|
||||
type ConditionReason string
|
||||
|
||||
// Reasons a resource is or is not ready.
|
||||
const (
|
||||
ReasonAvailable ConditionReason = "Available"
|
||||
ReasonUnavailable ConditionReason = "Unavailable"
|
||||
ReasonCreating ConditionReason = "Creating"
|
||||
ReasonDeleting ConditionReason = "Deleting"
|
||||
)
|
||||
|
||||
// Reasons a resource is or is not synced.
|
||||
const (
|
||||
ReasonReconcileSuccess ConditionReason = "ReconcileSuccess"
|
||||
ReasonReconcileError ConditionReason = "ReconcileError"
|
||||
)
|
||||
|
||||
// A Condition that may apply to a resource.
|
||||
type Condition struct {
|
||||
// Type of this condition. At most one of each condition type may apply to
|
||||
// a resource at any point in time.
|
||||
Type ConditionType `json:"type"`
|
||||
|
||||
// Status of this condition; is it currently True, False, or Unknown?
|
||||
Status corev1.ConditionStatus `json:"status"`
|
||||
|
||||
// LastTransitionTime is the last time this condition transitioned from one
|
||||
// status to another.
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime"`
|
||||
|
||||
// A Reason for this condition's last transition from one status to another.
|
||||
Reason ConditionReason `json:"reason"`
|
||||
|
||||
// A Message containing details about this condition's last transition from
|
||||
// one status to another, if any.
|
||||
// +optional
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// Equal returns true if the condition is identical to the supplied condition,
|
||||
// ignoring the LastTransitionTime.
|
||||
func (c Condition) Equal(other Condition) bool {
|
||||
return c.Type == other.Type &&
|
||||
c.Status == other.Status &&
|
||||
c.Reason == other.Reason &&
|
||||
c.Message == other.Message
|
||||
}
|
||||
|
||||
// WithMessage returns a condition by adding the provided message to existing
|
||||
// condition.
|
||||
func (c Condition) WithMessage(msg string) Condition {
|
||||
c.Message = msg
|
||||
return c
|
||||
}
|
||||
|
||||
// NOTE(negz): Conditions are implemented as a slice rather than a map to comply
|
||||
// with Kubernetes API conventions. Ideally we'd comply by using a map that
|
||||
// marshalled to a JSON array, but doing so confuses the CRD schema generator.
|
||||
// https://github.com/kubernetes/community/blob/9bf8cd/contributors/devel/sig-architecture/api-conventions.md#lists-of-named-subobjects-preferred-over-maps
|
||||
|
||||
// NOTE(negz): Do not manipulate Conditions directly. Use the Set method.
|
||||
|
||||
// A ConditionedStatus reflects the observed status of a resource. Only
|
||||
// one condition of each type may exist.
|
||||
type ConditionedStatus struct {
|
||||
// Conditions of the resource.
|
||||
// +optional
|
||||
Conditions []Condition `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// NewConditionedStatus returns a stat with the supplied conditions set.
|
||||
func NewConditionedStatus(c ...Condition) *ConditionedStatus {
|
||||
s := &ConditionedStatus{}
|
||||
s.SetConditions(c...)
|
||||
return s
|
||||
}
|
||||
|
||||
// GetCondition returns the condition for the given ConditionType if exists,
|
||||
// otherwise returns nil
|
||||
func (s *ConditionedStatus) GetCondition(ct ConditionType) Condition {
|
||||
for _, c := range s.Conditions {
|
||||
if c.Type == ct {
|
||||
return c
|
||||
}
|
||||
}
|
||||
|
||||
return Condition{Type: ct, Status: corev1.ConditionUnknown}
|
||||
}
|
||||
|
||||
// SetConditions sets the supplied conditions, replacing any existing conditions
|
||||
// of the same type. This is a no-op if all supplied conditions are identical,
|
||||
// ignoring the last transition time, to those already set.
|
||||
func (s *ConditionedStatus) SetConditions(c ...Condition) {
|
||||
for _, new := range c {
|
||||
exists := false
|
||||
for i, existing := range s.Conditions {
|
||||
if existing.Type != new.Type {
|
||||
continue
|
||||
}
|
||||
|
||||
if existing.Equal(new) {
|
||||
exists = true
|
||||
continue
|
||||
}
|
||||
|
||||
s.Conditions[i] = new
|
||||
exists = true
|
||||
}
|
||||
if !exists {
|
||||
s.Conditions = append(s.Conditions, new)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Equal returns true if the status is identical to the supplied status,
|
||||
// ignoring the LastTransitionTimes and order of statuses.
|
||||
func (s *ConditionedStatus) Equal(other *ConditionedStatus) bool {
|
||||
if s == nil || other == nil {
|
||||
return s == nil && other == nil
|
||||
}
|
||||
|
||||
if len(other.Conditions) != len(s.Conditions) {
|
||||
return false
|
||||
}
|
||||
|
||||
sc := make([]Condition, len(s.Conditions))
|
||||
copy(sc, s.Conditions)
|
||||
|
||||
oc := make([]Condition, len(other.Conditions))
|
||||
copy(oc, other.Conditions)
|
||||
|
||||
// We should not have more than one condition of each type.
|
||||
sort.Slice(sc, func(i, j int) bool { return sc[i].Type < sc[j].Type })
|
||||
sort.Slice(oc, func(i, j int) bool { return oc[i].Type < oc[j].Type })
|
||||
|
||||
for i := range sc {
|
||||
if !sc[i].Equal(oc[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// Creating returns a condition that indicates the resource is currently
|
||||
// being created.
|
||||
func Creating() Condition {
|
||||
return Condition{
|
||||
Type: TypeReady,
|
||||
Status: corev1.ConditionFalse,
|
||||
LastTransitionTime: metav1.Now(),
|
||||
Reason: ReasonCreating,
|
||||
}
|
||||
}
|
||||
|
||||
// Deleting returns a condition that indicates the resource is currently
|
||||
// being deleted.
|
||||
func Deleting() Condition {
|
||||
return Condition{
|
||||
Type: TypeReady,
|
||||
Status: corev1.ConditionFalse,
|
||||
LastTransitionTime: metav1.Now(),
|
||||
Reason: ReasonDeleting,
|
||||
}
|
||||
}
|
||||
|
||||
// Available returns a condition that indicates the resource is
|
||||
// currently observed to be available for use.
|
||||
func Available() Condition {
|
||||
return Condition{
|
||||
Type: TypeReady,
|
||||
Status: corev1.ConditionTrue,
|
||||
LastTransitionTime: metav1.Now(),
|
||||
Reason: ReasonAvailable,
|
||||
}
|
||||
}
|
||||
|
||||
// Unavailable returns a condition that indicates the resource is not
|
||||
// currently available for use. Unavailable should be set only when Crossplane
|
||||
// expects the resource to be available but knows it is not, for example
|
||||
// because its API reports it is unhealthy.
|
||||
func Unavailable() Condition {
|
||||
return Condition{
|
||||
Type: TypeReady,
|
||||
Status: corev1.ConditionFalse,
|
||||
LastTransitionTime: metav1.Now(),
|
||||
Reason: ReasonUnavailable,
|
||||
}
|
||||
}
|
||||
|
||||
// ReconcileSuccess returns a condition indicating that Crossplane successfully
|
||||
// completed the most recent reconciliation of the resource.
|
||||
func ReconcileSuccess() Condition {
|
||||
return Condition{
|
||||
Type: TypeSynced,
|
||||
Status: corev1.ConditionTrue,
|
||||
LastTransitionTime: metav1.Now(),
|
||||
Reason: ReasonReconcileSuccess,
|
||||
}
|
||||
}
|
||||
|
||||
// ReconcileError returns a condition indicating that Crossplane encountered an
|
||||
// error while reconciling the resource. This could mean Crossplane was
|
||||
// unable to update the resource to reflect its desired state, or that
|
||||
// Crossplane was unable to determine the current actual state of the resource.
|
||||
func ReconcileError(err error) Condition {
|
||||
return Condition{
|
||||
Type: TypeSynced,
|
||||
Status: corev1.ConditionFalse,
|
||||
LastTransitionTime: metav1.Now(),
|
||||
Reason: ReasonReconcileError,
|
||||
Message: err.Error(),
|
||||
}
|
||||
}
|
||||
|
||||
// ReadyCondition generate ready condition for conditionType
|
||||
func ReadyCondition(tpy string) Condition {
|
||||
return Condition{
|
||||
Type: ConditionType(tpy),
|
||||
Status: corev1.ConditionTrue,
|
||||
Reason: ReasonAvailable,
|
||||
LastTransitionTime: metav1.NewTime(time.Now()),
|
||||
}
|
||||
}
|
||||
|
||||
// ErrorCondition generate error condition for conditionType and error
|
||||
func ErrorCondition(tpy string, err error) Condition {
|
||||
return Condition{
|
||||
Type: ConditionType(tpy),
|
||||
Status: corev1.ConditionFalse,
|
||||
LastTransitionTime: metav1.NewTime(time.Now()),
|
||||
Reason: ReasonReconcileError,
|
||||
Message: err.Error(),
|
||||
}
|
||||
}
|
||||
221
apis/core.oam.dev/condition/condition_test.go
Normal file
221
apis/core.oam.dev/condition/condition_test.go
Normal file
@@ -0,0 +1,221 @@
|
||||
// This file is originally from https://github.com/crossplane/crossplane-runtime/blob/master/apis/common/v1/condition_test.go
|
||||
// We copy it here to reduce dependency
|
||||
|
||||
/*
|
||||
Copyright 2019 The Crossplane Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package condition
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/pkg/errors"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
func TestConditionEqual(t *testing.T) {
|
||||
cases := map[string]struct {
|
||||
a Condition
|
||||
b Condition
|
||||
want bool
|
||||
}{
|
||||
"IdenticalIgnoringTimestamp": {
|
||||
a: Condition{Type: TypeReady, LastTransitionTime: metav1.Now()},
|
||||
b: Condition{Type: TypeReady, LastTransitionTime: metav1.Now()},
|
||||
want: true,
|
||||
},
|
||||
"DifferentType": {
|
||||
a: Condition{Type: TypeReady},
|
||||
b: Condition{Type: TypeSynced},
|
||||
want: false,
|
||||
},
|
||||
"DifferentStatus": {
|
||||
a: Condition{Status: corev1.ConditionTrue},
|
||||
b: Condition{Status: corev1.ConditionFalse},
|
||||
want: false,
|
||||
},
|
||||
"DifferentReason": {
|
||||
a: Condition{Reason: ReasonCreating},
|
||||
b: Condition{Reason: ReasonDeleting},
|
||||
want: false,
|
||||
},
|
||||
"DifferentMessage": {
|
||||
a: Condition{Message: "cool"},
|
||||
b: Condition{Message: "uncool"},
|
||||
want: false,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range cases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
got := tc.a.Equal(tc.b)
|
||||
|
||||
if diff := cmp.Diff(tc.want, got); diff != "" {
|
||||
t.Errorf("a.Equal(b): -want, +got:\n%s", diff)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestConditionedStatusEqual(t *testing.T) {
|
||||
cases := map[string]struct {
|
||||
a *ConditionedStatus
|
||||
b *ConditionedStatus
|
||||
want bool
|
||||
}{
|
||||
"Identical": {
|
||||
a: NewConditionedStatus(Available(), ReconcileSuccess()),
|
||||
b: NewConditionedStatus(Available(), ReconcileSuccess()),
|
||||
want: true,
|
||||
},
|
||||
"IdenticalExceptOrder": {
|
||||
a: NewConditionedStatus(Unavailable(), ReconcileSuccess()),
|
||||
b: NewConditionedStatus(ReconcileSuccess(), Unavailable()),
|
||||
want: true,
|
||||
},
|
||||
"DifferentLength": {
|
||||
a: NewConditionedStatus(Available(), ReconcileSuccess()),
|
||||
b: NewConditionedStatus(ReconcileSuccess()),
|
||||
want: false,
|
||||
},
|
||||
"DifferentCondition": {
|
||||
a: NewConditionedStatus(Creating(), ReconcileSuccess()),
|
||||
b: NewConditionedStatus(Creating(), ReconcileError(errors.New("boom"))),
|
||||
want: false,
|
||||
},
|
||||
"AIsNil": {
|
||||
a: nil,
|
||||
b: NewConditionedStatus(Deleting(), ReconcileSuccess()),
|
||||
want: false,
|
||||
},
|
||||
"BIsNil": {
|
||||
a: NewConditionedStatus(Available(), ReconcileSuccess()),
|
||||
b: nil,
|
||||
want: false,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range cases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
got := tc.a.Equal(tc.b)
|
||||
|
||||
if diff := cmp.Diff(tc.want, got); diff != "" {
|
||||
t.Errorf("a.Equal(b): -want, +got:\n%s", diff)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetConditions(t *testing.T) {
|
||||
cases := map[string]struct {
|
||||
cs *ConditionedStatus
|
||||
c []Condition
|
||||
want *ConditionedStatus
|
||||
}{
|
||||
"TypeIsIdentical": {
|
||||
cs: NewConditionedStatus(Available()),
|
||||
c: []Condition{Available()},
|
||||
want: NewConditionedStatus(Available()),
|
||||
},
|
||||
"TypeIsDifferent": {
|
||||
cs: NewConditionedStatus(Creating()),
|
||||
c: []Condition{Available()},
|
||||
want: NewConditionedStatus(Available()),
|
||||
},
|
||||
"TypeDoesNotExist": {
|
||||
cs: NewConditionedStatus(ReconcileSuccess()),
|
||||
c: []Condition{Available()},
|
||||
want: NewConditionedStatus(ReconcileSuccess(), Available()),
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range cases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
tc.cs.SetConditions(tc.c...)
|
||||
|
||||
got := tc.cs
|
||||
if diff := cmp.Diff(tc.want, got); diff != "" {
|
||||
t.Errorf("tc.cs.SetConditions(...): -want, +got:\n%s", diff)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetCondition(t *testing.T) {
|
||||
cases := map[string]struct {
|
||||
cs *ConditionedStatus
|
||||
t ConditionType
|
||||
want Condition
|
||||
}{
|
||||
"ConditionExists": {
|
||||
cs: NewConditionedStatus(Available()),
|
||||
t: TypeReady,
|
||||
want: Available(),
|
||||
},
|
||||
"ConditionDoesNotExist": {
|
||||
cs: NewConditionedStatus(Available()),
|
||||
t: TypeSynced,
|
||||
want: Condition{
|
||||
Type: TypeSynced,
|
||||
Status: corev1.ConditionUnknown,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range cases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
got := tc.cs.GetCondition(tc.t)
|
||||
if diff := cmp.Diff(tc.want, got); diff != "" {
|
||||
t.Errorf("tc.cs.GetConditions(...): -want, +got:\n%s", diff)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestConditionWithMessage(t *testing.T) {
|
||||
testMsg := "Something went wrong on cloud side"
|
||||
cases := map[string]struct {
|
||||
c Condition
|
||||
msg string
|
||||
want Condition
|
||||
}{
|
||||
"MessageAdded": {
|
||||
c: Condition{Type: TypeReady, Reason: ReasonUnavailable},
|
||||
msg: testMsg,
|
||||
want: Condition{Type: TypeReady, Reason: ReasonUnavailable, Message: testMsg},
|
||||
},
|
||||
"MessageChanged": {
|
||||
c: Condition{Type: TypeReady, Reason: ReasonUnavailable, Message: "Some other message"},
|
||||
msg: testMsg,
|
||||
want: Condition{Type: TypeReady, Reason: ReasonUnavailable, Message: testMsg},
|
||||
},
|
||||
"MessageCleared": {
|
||||
c: Condition{Type: TypeReady, Reason: ReasonUnavailable, Message: testMsg},
|
||||
msg: "",
|
||||
want: Condition{Type: TypeReady, Reason: ReasonUnavailable},
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range cases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
got := tc.c.WithMessage(tc.msg)
|
||||
|
||||
if diff := cmp.Diff(tc.want, got); diff != "" {
|
||||
t.Errorf("a.Equal(b): -want, +got:\n%s", diff)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
19
apis/core.oam.dev/condition/doc.go
Normal file
19
apis/core.oam.dev/condition/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package condition contains condition types
|
||||
// +kubebuilder:object:generate=true
|
||||
package condition
|
||||
59
apis/core.oam.dev/condition/zz_generated.deepcopy.go
Normal file
59
apis/core.oam.dev/condition/zz_generated.deepcopy.go
Normal file
@@ -0,0 +1,59 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by controller-gen. DO NOT EDIT.
|
||||
|
||||
package condition
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Condition) DeepCopyInto(out *Condition) {
|
||||
*out = *in
|
||||
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
|
||||
func (in *Condition) DeepCopy() *Condition {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Condition)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ConditionedStatus) DeepCopyInto(out *ConditionedStatus) {
|
||||
*out = *in
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]Condition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionedStatus.
|
||||
func (in *ConditionedStatus) DeepCopy() *ConditionedStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ConditionedStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
39
apis/core.oam.dev/groupversion_info.go
Normal file
39
apis/core.oam.dev/groupversion_info.go
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package core_oam_dev contains API Schema definitions for the core.oam.dev v1alpha2 API group
|
||||
package core_oam_dev
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha1"
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2"
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1"
|
||||
)
|
||||
|
||||
func init() {
|
||||
// Register the types with the Scheme so the resources can map objects to GroupVersionKinds and back
|
||||
AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme, v1alpha2.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme)
|
||||
}
|
||||
|
||||
// AddToSchemes may be used to add all resources defined in the project to a Scheme
|
||||
var AddToSchemes runtime.SchemeBuilder
|
||||
|
||||
// AddToScheme adds all Resources to the Scheme
|
||||
func AddToScheme(s *runtime.Scheme) error {
|
||||
return AddToSchemes.AddToScheme(s)
|
||||
}
|
||||
22
apis/core.oam.dev/v1alpha1/doc.go
Normal file
22
apis/core.oam.dev/v1alpha1/doc.go
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1alpha1 contains resources relating to the Open Application Model.
|
||||
// See https://github.com/oam-dev/spec for more details.
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=core.oam.dev
|
||||
// +versionName=v1alpha1
|
||||
package v1alpha1
|
||||
175
apis/core.oam.dev/v1alpha1/envbinding_types.go
Normal file
175
apis/core.oam.dev/v1alpha1/envbinding_types.go
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
)
|
||||
|
||||
// ClusterManagementEngine represents a multi-cluster management solution
|
||||
type ClusterManagementEngine string
|
||||
|
||||
const (
|
||||
// OCMEngine represents Open-Cluster-Management multi-cluster management solution
|
||||
OCMEngine ClusterManagementEngine = "ocm"
|
||||
|
||||
// SingleClusterEngine represents single cluster ClusterManagerEngine
|
||||
SingleClusterEngine ClusterManagementEngine = "single-cluster"
|
||||
|
||||
// ClusterGatewayEngine represents multi-cluster management solution with cluster-gateway
|
||||
ClusterGatewayEngine ClusterManagementEngine = "cluster-gateway"
|
||||
)
|
||||
|
||||
// EnvBindingPhase is a label for the condition of a EnvBinding at the current time
|
||||
type EnvBindingPhase string
|
||||
|
||||
const (
|
||||
// EnvBindingPrepare means EnvBinding is preparing the pre-work for cluster scheduling
|
||||
EnvBindingPrepare EnvBindingPhase = "preparing"
|
||||
|
||||
// EnvBindingRendering means EnvBinding is rendering the apps in different envs
|
||||
EnvBindingRendering EnvBindingPhase = "rendering"
|
||||
|
||||
// EnvBindingScheduling means EnvBinding is deciding which cluster the apps is scheduled to.
|
||||
EnvBindingScheduling EnvBindingPhase = "scheduling"
|
||||
|
||||
// EnvBindingFinished means EnvBinding finished env binding
|
||||
EnvBindingFinished EnvBindingPhase = "finished"
|
||||
)
|
||||
|
||||
// EnvPatch specify the parameter configuration for different environments
|
||||
type EnvPatch struct {
|
||||
Components []common.ApplicationComponent `json:"components"`
|
||||
}
|
||||
|
||||
// NamespaceSelector defines the rules to select a Namespace resource.
|
||||
// Either name or labels is needed.
|
||||
type NamespaceSelector struct {
|
||||
// Name is the name of the namespace.
|
||||
Name string `json:"name,omitempty"`
|
||||
// Labels defines the label selector to select the namespace.
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
}
|
||||
|
||||
// EnvPlacement defines the placement rules for an app.
|
||||
type EnvPlacement struct {
|
||||
ClusterSelector *common.ClusterSelector `json:"clusterSelector,omitempty"`
|
||||
NamespaceSelector *NamespaceSelector `json:"namespaceSelector,omitempty"`
|
||||
}
|
||||
|
||||
// EnvSelector defines which components should this env contains
|
||||
type EnvSelector struct {
|
||||
Components []string `json:"components,omitempty"`
|
||||
}
|
||||
|
||||
// EnvConfig is the configuration for different environments.
|
||||
type EnvConfig struct {
|
||||
Name string `json:"name"`
|
||||
Placement EnvPlacement `json:"placement,omitempty"`
|
||||
Selector *EnvSelector `json:"selector,omitempty"`
|
||||
Patch EnvPatch `json:"patch"`
|
||||
}
|
||||
|
||||
// AppTemplate represents a application to be configured.
|
||||
type AppTemplate struct {
|
||||
// +kubebuilder:validation:EmbeddedResource
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
runtime.RawExtension `json:",inline"`
|
||||
}
|
||||
|
||||
// ClusterDecision recorded the mapping of environment and cluster
|
||||
type ClusterDecision struct {
|
||||
Env string `json:"env"`
|
||||
Cluster string `json:"cluster,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
|
||||
// A ConfigMapReference is a reference to a configMap in an arbitrary namespace.
|
||||
type ConfigMapReference struct {
|
||||
// Name of the secret.
|
||||
Name string `json:"name"`
|
||||
|
||||
// Namespace of the secret.
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
|
||||
// A EnvBindingSpec defines the desired state of a EnvBinding.
|
||||
type EnvBindingSpec struct {
|
||||
Engine ClusterManagementEngine `json:"engine,omitempty"`
|
||||
|
||||
// AppTemplate indicates the application template.
|
||||
AppTemplate AppTemplate `json:"appTemplate"`
|
||||
|
||||
Envs []EnvConfig `json:"envs"`
|
||||
|
||||
// OutputResourcesTo specifies the namespace and name of a ConfigMap
|
||||
// which store the resources rendered after differentiated configuration
|
||||
// +optional
|
||||
OutputResourcesTo *ConfigMapReference `json:"outputResourcesTo,omitempty"`
|
||||
}
|
||||
|
||||
// A EnvBindingStatus is the status of EnvBinding
|
||||
type EnvBindingStatus struct {
|
||||
// ConditionedStatus reflects the observed status of a resource
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
|
||||
Phase EnvBindingPhase `json:"phase,omitempty"`
|
||||
|
||||
ClusterDecisions []ClusterDecision `json:"clusterDecisions,omitempty"`
|
||||
|
||||
// ResourceTracker record the status of the ResourceTracker
|
||||
ResourceTracker *corev1.ObjectReference `json:"resourceTracker,omitempty"`
|
||||
}
|
||||
|
||||
// EnvBinding is the Schema for the EnvBinding API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=envbind
|
||||
// +kubebuilder:printcolumn:name="ENGINE",type=string,JSONPath=`.spec.engine`
|
||||
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.phase`
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
type EnvBinding struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec EnvBindingSpec `json:"spec,omitempty"`
|
||||
Status EnvBindingStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// EnvBindingList contains a list of EnvBinding.
|
||||
type EnvBindingList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []EnvBinding `json:"items"`
|
||||
}
|
||||
|
||||
// SetConditions set condition for EnvBinding
|
||||
func (e *EnvBinding) SetConditions(c ...condition.Condition) {
|
||||
e.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition gets condition from EnvBinding
|
||||
func (e *EnvBinding) GetCondition(conditionType condition.ConditionType) condition.Condition {
|
||||
return e.Status.GetCondition(conditionType)
|
||||
}
|
||||
50
apis/core.oam.dev/v1alpha1/register.go
Normal file
50
apis/core.oam.dev/v1alpha1/register.go
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
// Package type metadata.
|
||||
const (
|
||||
Group = "core.oam.dev"
|
||||
Version = "v1alpha1"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
|
||||
)
|
||||
|
||||
// EnvBinding type metadata.
|
||||
var (
|
||||
EnvBindingKind = reflect.TypeOf(EnvBinding{}).Name()
|
||||
EnvBindingGroupKind = schema.GroupKind{Group: Group, Kind: EnvBindingKind}.String()
|
||||
EnvBindingKindAPIVersion = EnvBindingKind + "." + SchemeGroupVersion.String()
|
||||
EnvBindingKindVersionKind = SchemeGroupVersion.WithKind(EnvBindingKind)
|
||||
)
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&EnvBinding{}, &EnvBindingList{})
|
||||
}
|
||||
298
apis/core.oam.dev/v1alpha1/zz_generated.deepcopy.go
Normal file
298
apis/core.oam.dev/v1alpha1/zz_generated.deepcopy.go
Normal file
@@ -0,0 +1,298 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by controller-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AppTemplate) DeepCopyInto(out *AppTemplate) {
|
||||
*out = *in
|
||||
in.RawExtension.DeepCopyInto(&out.RawExtension)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppTemplate.
|
||||
func (in *AppTemplate) DeepCopy() *AppTemplate {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AppTemplate)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterDecision) DeepCopyInto(out *ClusterDecision) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDecision.
|
||||
func (in *ClusterDecision) DeepCopy() *ClusterDecision {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterDecision)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ConfigMapReference) DeepCopyInto(out *ConfigMapReference) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapReference.
|
||||
func (in *ConfigMapReference) DeepCopy() *ConfigMapReference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ConfigMapReference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EnvBinding) DeepCopyInto(out *EnvBinding) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvBinding.
|
||||
func (in *EnvBinding) DeepCopy() *EnvBinding {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(EnvBinding)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *EnvBinding) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EnvBindingList) DeepCopyInto(out *EnvBindingList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]EnvBinding, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvBindingList.
|
||||
func (in *EnvBindingList) DeepCopy() *EnvBindingList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(EnvBindingList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *EnvBindingList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EnvBindingSpec) DeepCopyInto(out *EnvBindingSpec) {
|
||||
*out = *in
|
||||
in.AppTemplate.DeepCopyInto(&out.AppTemplate)
|
||||
if in.Envs != nil {
|
||||
in, out := &in.Envs, &out.Envs
|
||||
*out = make([]EnvConfig, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.OutputResourcesTo != nil {
|
||||
in, out := &in.OutputResourcesTo, &out.OutputResourcesTo
|
||||
*out = new(ConfigMapReference)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvBindingSpec.
|
||||
func (in *EnvBindingSpec) DeepCopy() *EnvBindingSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(EnvBindingSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EnvBindingStatus) DeepCopyInto(out *EnvBindingStatus) {
|
||||
*out = *in
|
||||
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
|
||||
if in.ClusterDecisions != nil {
|
||||
in, out := &in.ClusterDecisions, &out.ClusterDecisions
|
||||
*out = make([]ClusterDecision, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.ResourceTracker != nil {
|
||||
in, out := &in.ResourceTracker, &out.ResourceTracker
|
||||
*out = new(v1.ObjectReference)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvBindingStatus.
|
||||
func (in *EnvBindingStatus) DeepCopy() *EnvBindingStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(EnvBindingStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EnvConfig) DeepCopyInto(out *EnvConfig) {
|
||||
*out = *in
|
||||
in.Placement.DeepCopyInto(&out.Placement)
|
||||
if in.Selector != nil {
|
||||
in, out := &in.Selector, &out.Selector
|
||||
*out = new(EnvSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
in.Patch.DeepCopyInto(&out.Patch)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvConfig.
|
||||
func (in *EnvConfig) DeepCopy() *EnvConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(EnvConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EnvPatch) DeepCopyInto(out *EnvPatch) {
|
||||
*out = *in
|
||||
if in.Components != nil {
|
||||
in, out := &in.Components, &out.Components
|
||||
*out = make([]common.ApplicationComponent, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvPatch.
|
||||
func (in *EnvPatch) DeepCopy() *EnvPatch {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(EnvPatch)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EnvPlacement) DeepCopyInto(out *EnvPlacement) {
|
||||
*out = *in
|
||||
if in.ClusterSelector != nil {
|
||||
in, out := &in.ClusterSelector, &out.ClusterSelector
|
||||
*out = new(common.ClusterSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.NamespaceSelector != nil {
|
||||
in, out := &in.NamespaceSelector, &out.NamespaceSelector
|
||||
*out = new(NamespaceSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvPlacement.
|
||||
func (in *EnvPlacement) DeepCopy() *EnvPlacement {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(EnvPlacement)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EnvSelector) DeepCopyInto(out *EnvSelector) {
|
||||
*out = *in
|
||||
if in.Components != nil {
|
||||
in, out := &in.Components, &out.Components
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvSelector.
|
||||
func (in *EnvSelector) DeepCopy() *EnvSelector {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(EnvSelector)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NamespaceSelector) DeepCopyInto(out *NamespaceSelector) {
|
||||
*out = *in
|
||||
if in.Labels != nil {
|
||||
in, out := &in.Labels, &out.Labels
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceSelector.
|
||||
func (in *NamespaceSelector) DeepCopy() *NamespaceSelector {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NamespaceSelector)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
123
apis/core.oam.dev/v1alpha2/application_types.go
Normal file
123
apis/core.oam.dev/v1alpha2/application_types.go
Normal file
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
|
||||
)
|
||||
|
||||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
// AppStatus defines the observed state of Application
|
||||
type AppStatus struct {
|
||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
v1alpha1.RolloutStatus `json:",inline"`
|
||||
|
||||
Phase common.ApplicationPhase `json:"status,omitempty"`
|
||||
|
||||
// Components record the related Components created by Application Controller
|
||||
Components []corev1.ObjectReference `json:"components,omitempty"`
|
||||
|
||||
// Services record the status of the application services
|
||||
Services []common.ApplicationComponentStatus `json:"services,omitempty"`
|
||||
|
||||
// ResourceTracker record the status of the ResourceTracker
|
||||
ResourceTracker *corev1.ObjectReference `json:"resourceTracker,omitempty"`
|
||||
|
||||
// LatestRevision of the application configuration it generates
|
||||
// +optional
|
||||
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
|
||||
}
|
||||
|
||||
// ApplicationTrait defines the trait of application
|
||||
type ApplicationTrait struct {
|
||||
Name string `json:"name"`
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Properties *runtime.RawExtension `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// ApplicationComponent describe the component of application
|
||||
type ApplicationComponent struct {
|
||||
Name string `json:"name"`
|
||||
WorkloadType string `json:"type"`
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Settings runtime.RawExtension `json:"settings,omitempty"`
|
||||
|
||||
// Traits define the trait of one component, the type must be array to keep the order.
|
||||
Traits []ApplicationTrait `json:"traits,omitempty"`
|
||||
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
// scopes in ApplicationComponent defines the component-level scopes
|
||||
// the format is <scope-type:scope-instance-name> pairs, the key represents type of `ScopeDefinition` while the value represent the name of scope instance.
|
||||
Scopes map[string]string `json:"scopes,omitempty"`
|
||||
}
|
||||
|
||||
// ApplicationSpec is the spec of Application
|
||||
type ApplicationSpec struct {
|
||||
Components []ApplicationComponent `json:"components"`
|
||||
|
||||
// TODO(wonderflow): we should have application level scopes supported here
|
||||
|
||||
// RolloutPlan is the details on how to rollout the resources
|
||||
// The controller simply replace the old resources with the new one if there is no rollout plan involved
|
||||
// +optional
|
||||
RolloutPlan *v1alpha1.RolloutPlan `json:"rolloutPlan,omitempty"`
|
||||
}
|
||||
|
||||
// Application is the Schema for the applications API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam},shortName=app
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="COMPONENT",type=string,JSONPath=`.spec.components[*].name`
|
||||
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.spec.components[*].type`
|
||||
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.status`
|
||||
// +kubebuilder:printcolumn:name="HEALTHY",type=boolean,JSONPath=`.status.services[*].healthy`
|
||||
// +kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.services[*].message`
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
type Application struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ApplicationSpec `json:"spec,omitempty"`
|
||||
Status common.AppStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ApplicationList contains a list of Application
|
||||
type ApplicationList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Application `json:"items"`
|
||||
}
|
||||
|
||||
// GetComponent get the component from the application based on its workload type
|
||||
func (app *Application) GetComponent(workloadType string) *ApplicationComponent {
|
||||
for _, c := range app.Spec.Components {
|
||||
if c.WorkloadType == workloadType {
|
||||
return &c
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
68
apis/core.oam.dev/v1alpha2/application_types_test.go
Normal file
68
apis/core.oam.dev/v1alpha2/application_types_test.go
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestApplicationGetComponent(t *testing.T) {
|
||||
ac1 := ApplicationComponent{
|
||||
Name: "ac1",
|
||||
WorkloadType: "type1",
|
||||
}
|
||||
ac2 := ApplicationComponent{
|
||||
Name: "ac2",
|
||||
WorkloadType: "type2",
|
||||
}
|
||||
tests := map[string]struct {
|
||||
app *Application
|
||||
componentName string
|
||||
want *ApplicationComponent
|
||||
}{
|
||||
"test get one": {
|
||||
app: &Application{
|
||||
Spec: ApplicationSpec{
|
||||
Components: []ApplicationComponent{
|
||||
ac1, ac2,
|
||||
},
|
||||
},
|
||||
},
|
||||
componentName: ac1.WorkloadType,
|
||||
want: &ac1,
|
||||
},
|
||||
"test get none": {
|
||||
app: &Application{
|
||||
Spec: ApplicationSpec{
|
||||
Components: []ApplicationComponent{
|
||||
ac2,
|
||||
},
|
||||
},
|
||||
},
|
||||
componentName: ac1.WorkloadType,
|
||||
want: nil,
|
||||
},
|
||||
}
|
||||
for name, tt := range tests {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
if got := tt.app.GetComponent(tt.componentName); !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("GetComponent() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
73
apis/core.oam.dev/v1alpha2/applicationrevision_types.go
Normal file
73
apis/core.oam.dev/v1alpha2/applicationrevision_types.go
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
// ApplicationRevisionSpec is the spec of ApplicationRevision
|
||||
type ApplicationRevisionSpec struct {
|
||||
// Application records the snapshot of the created/modified Application
|
||||
Application Application `json:"application"`
|
||||
|
||||
// ComponentDefinitions records the snapshot of the componentDefinitions related with the created/modified Application
|
||||
ComponentDefinitions map[string]ComponentDefinition `json:"componentDefinitions,omitempty"`
|
||||
|
||||
// WorkloadDefinitions records the snapshot of the workloadDefinitions related with the created/modified Application
|
||||
WorkloadDefinitions map[string]WorkloadDefinition `json:"workloadDefinitions,omitempty"`
|
||||
|
||||
// TraitDefinitions records the snapshot of the traitDefinitions related with the created/modified Application
|
||||
TraitDefinitions map[string]TraitDefinition `json:"traitDefinitions,omitempty"`
|
||||
|
||||
// ScopeDefinitions records the snapshot of the scopeDefinitions related with the created/modified Application
|
||||
ScopeDefinitions map[string]ScopeDefinition `json:"scopeDefinitions,omitempty"`
|
||||
|
||||
// Components records the rendered components from Application, it will contains the whole K8s CR of workload in it.
|
||||
|
||||
Components []common.RawComponent `json:"components,omitempty"`
|
||||
|
||||
// ApplicationConfiguration records the rendered applicationConfiguration from Application,
|
||||
// it will contains the whole K8s CR of trait and the reference component in it.
|
||||
// +kubebuilder:validation:EmbeddedResource
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
ApplicationConfiguration runtime.RawExtension `json:"applicationConfiguration"`
|
||||
}
|
||||
|
||||
// ApplicationRevision is the Schema for the ApplicationRevision API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam},shortName=apprev
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
type ApplicationRevision struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ApplicationRevisionSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// ApplicationRevisionList contains a list of ApplicationRevision
|
||||
// +kubebuilder:object:root=true
|
||||
type ApplicationRevisionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ApplicationRevision `json:"items"`
|
||||
}
|
||||
86
apis/core.oam.dev/v1alpha2/approllout_types.go
Normal file
86
apis/core.oam.dev/v1alpha2/approllout_types.go
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
|
||||
)
|
||||
|
||||
// AppRolloutSpec defines how to describe an upgrade between different apps
|
||||
type AppRolloutSpec struct {
|
||||
// TargetAppRevisionName contains the name of the applicationRevision that we need to upgrade to.
|
||||
TargetAppRevisionName string `json:"targetAppRevisionName"`
|
||||
|
||||
// SourceAppRevisionName contains the name of the applicationRevision that we need to upgrade from.
|
||||
// it can be empty only when the rolling is only a scale event
|
||||
SourceAppRevisionName string `json:"sourceAppRevisionName,omitempty"`
|
||||
|
||||
// The list of component to upgrade in the application.
|
||||
// We only support single component application so far
|
||||
// TODO: (RZ) Support multiple components in an application
|
||||
// +optional
|
||||
ComponentList []string `json:"componentList,omitempty"`
|
||||
|
||||
// RolloutPlan is the details on how to rollout the resources
|
||||
RolloutPlan v1alpha1.RolloutPlan `json:"rolloutPlan"`
|
||||
|
||||
// RevertOnDelete revert the rollout when the rollout CR is deleted
|
||||
// It will remove the target app from the kubernetes if it's set to true
|
||||
// +optional
|
||||
RevertOnDelete *bool `json:"revertOnDelete,omitempty"`
|
||||
}
|
||||
|
||||
// AppRolloutStatus defines the observed state of AppRollout
|
||||
type AppRolloutStatus struct {
|
||||
v1alpha1.RolloutStatus `json:",inline"`
|
||||
|
||||
// LastUpgradedTargetAppRevision contains the name of the app that we upgraded to
|
||||
// We will restart the rollout if this is not the same as the spec
|
||||
LastUpgradedTargetAppRevision string `json:"lastTargetAppRevision"`
|
||||
|
||||
// LastSourceAppRevision contains the name of the app that we need to upgrade from.
|
||||
// We will restart the rollout if this is not the same as the spec
|
||||
LastSourceAppRevision string `json:"LastSourceAppRevision,omitempty"`
|
||||
}
|
||||
|
||||
// AppRollout is the Schema for the AppRollout API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam},shortName=approllout
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="TARGET",type=string,JSONPath=`.status.rolloutStatus.rolloutTargetSize`
|
||||
// +kubebuilder:printcolumn:name="UPGRADED",type=string,JSONPath=`.status.rolloutStatus.upgradedReplicas`
|
||||
// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.rolloutStatus.upgradedReadyReplicas`
|
||||
// +kubebuilder:printcolumn:name="BATCH-STATE",type=string,JSONPath=`.status.rolloutStatus.batchRollingState`
|
||||
// +kubebuilder:printcolumn:name="ROLLING-STATE",type=string,JSONPath=`.status.rolloutStatus.rollingState`
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
type AppRollout struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec AppRolloutSpec `json:"spec,omitempty"`
|
||||
Status AppRolloutStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// AppRolloutList contains a list of AppRollout
|
||||
// +kubebuilder:object:root=true
|
||||
type AppRolloutList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []AppRollout `json:"items"`
|
||||
}
|
||||
103
apis/core.oam.dev/v1alpha2/componentdefinition_types.go
Normal file
103
apis/core.oam.dev/v1alpha2/componentdefinition_types.go
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
|
||||
// ComponentDefinitionSpec defines the desired state of ComponentDefinition
|
||||
type ComponentDefinitionSpec struct {
|
||||
// Workload is a workload type descriptor
|
||||
Workload common.WorkloadTypeDescriptor `json:"workload"`
|
||||
|
||||
// ChildResourceKinds are the list of GVK of the child resources this workload generates
|
||||
ChildResourceKinds []common.ChildResourceKind `json:"childResourceKinds,omitempty"`
|
||||
|
||||
// RevisionLabel indicates which label for underlying resources(e.g. pods) of this workload
|
||||
// can be used by trait to create resource selectors(e.g. label selector for pods).
|
||||
// +optional
|
||||
RevisionLabel string `json:"revisionLabel,omitempty"`
|
||||
|
||||
// PodSpecPath indicates where/if this workload has K8s podSpec field
|
||||
// if one workload has podSpec, trait can do lot's of assumption such as port, env, volume fields.
|
||||
// +optional
|
||||
PodSpecPath string `json:"podSpecPath,omitempty"`
|
||||
|
||||
// Status defines the custom health policy and status message for workload
|
||||
// +optional
|
||||
Status *common.Status `json:"status,omitempty"`
|
||||
|
||||
// Schematic defines the data format and template of the encapsulation of the workload
|
||||
// +optional
|
||||
Schematic *common.Schematic `json:"schematic,omitempty"`
|
||||
|
||||
// Extension is used for extension needs by OAM platform builders
|
||||
// +optional
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Extension *runtime.RawExtension `json:"extension,omitempty"`
|
||||
}
|
||||
|
||||
// ComponentDefinitionStatus is the status of ComponentDefinition
|
||||
type ComponentDefinitionStatus struct {
|
||||
// ConditionedStatus reflects the observed status of a resource
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
|
||||
ConfigMapRef string `json:"configMapRef,omitempty"`
|
||||
// LatestRevision of the component definition
|
||||
// +optional
|
||||
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ComponentDefinition is the Schema for the componentdefinitions API
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=comp
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="WORKLOAD-KIND",type=string,JSONPath=".spec.workload.definition.kind"
|
||||
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
|
||||
type ComponentDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ComponentDefinitionSpec `json:"spec,omitempty"`
|
||||
Status ComponentDefinitionStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// SetConditions set condition for WorkloadDefinition
|
||||
func (cd *ComponentDefinition) SetConditions(c ...condition.Condition) {
|
||||
cd.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition gets condition from WorkloadDefinition
|
||||
func (cd *ComponentDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
|
||||
return cd.Status.GetCondition(conditionType)
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ComponentDefinitionList contains a list of ComponentDefinition
|
||||
type ComponentDefinitionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ComponentDefinition `json:"items"`
|
||||
}
|
||||
135
apis/core.oam.dev/v1alpha2/conversion.go
Normal file
135
apis/core.oam.dev/v1alpha2/conversion.go
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
"sigs.k8s.io/controller-runtime/pkg/conversion"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1"
|
||||
)
|
||||
|
||||
// ApplicationV1alpha2ToV1beta1 will convert v1alpha2 to v1beta1
|
||||
func ApplicationV1alpha2ToV1beta1(v1a2 *Application, v1b1 *v1beta1.Application) {
|
||||
// 1) convert metav1.TypeMeta
|
||||
// apiVersion and Kind automatically converted
|
||||
|
||||
// 2) convert metav1.ObjectMeta
|
||||
v1b1.ObjectMeta = *v1a2.ObjectMeta.DeepCopy()
|
||||
|
||||
// 3) convert Spec ApplicationSpec
|
||||
// 3.1) convert Spec.Components
|
||||
for _, comp := range v1a2.Spec.Components {
|
||||
|
||||
// convert trait, especially for `.name` -> `.type`
|
||||
var traits = make([]common.ApplicationTrait, len(comp.Traits))
|
||||
for j, trait := range comp.Traits {
|
||||
traits[j] = common.ApplicationTrait{
|
||||
Type: trait.Name,
|
||||
Properties: trait.Properties.DeepCopy(),
|
||||
}
|
||||
}
|
||||
|
||||
// deep copy scopes
|
||||
scopes := make(map[string]string)
|
||||
for k, v := range comp.Scopes {
|
||||
scopes[k] = v
|
||||
}
|
||||
// convert component
|
||||
// `.settings` -> `.properties`
|
||||
v1b1.Spec.Components = append(v1b1.Spec.Components, common.ApplicationComponent{
|
||||
Name: comp.Name,
|
||||
Type: comp.WorkloadType,
|
||||
Properties: comp.Settings.DeepCopy(),
|
||||
Traits: traits,
|
||||
Scopes: scopes,
|
||||
})
|
||||
}
|
||||
// 3.2) convert Spec.RolloutPlan
|
||||
v1b1.Spec.RolloutPlan = v1a2.Spec.RolloutPlan.DeepCopy()
|
||||
|
||||
// 4) convert Status common.AppStatus
|
||||
v1b1.Status = *v1a2.Status.DeepCopy()
|
||||
}
|
||||
|
||||
// ConvertTo converts this Application to the Hub version (v1beta1 only for now).
|
||||
func (app *Application) ConvertTo(dst conversion.Hub) error {
|
||||
switch convertedApp := dst.(type) {
|
||||
case *v1beta1.Application:
|
||||
klog.Infof("convert *v1alpha2.Application [%s] to *v1beta1.Application", app.Name)
|
||||
ApplicationV1alpha2ToV1beta1(app, convertedApp)
|
||||
return nil
|
||||
default:
|
||||
}
|
||||
return fmt.Errorf("unsupported convertTo object %v", reflect.TypeOf(dst))
|
||||
}
|
||||
|
||||
// ConvertFrom converts from the Hub version (v1beta1) to this version (v1alpha2).
|
||||
func (app *Application) ConvertFrom(src conversion.Hub) error {
|
||||
switch sourceApp := src.(type) {
|
||||
case *v1beta1.Application:
|
||||
|
||||
klog.Infof("convert *v1alpha2.Application from *v1beta1.Application [%s]", sourceApp.Name)
|
||||
|
||||
// 1) convert metav1.TypeMeta
|
||||
// apiVersion and Kind automatically converted
|
||||
|
||||
// 2) convert metav1.ObjectMeta
|
||||
app.ObjectMeta = *sourceApp.ObjectMeta.DeepCopy()
|
||||
|
||||
// 3) convert Spec ApplicationSpec
|
||||
// 3.1) convert Spec.Components
|
||||
for _, comp := range sourceApp.Spec.Components {
|
||||
|
||||
// convert trait, especially for `.type` -> `.name`
|
||||
var traits = make([]ApplicationTrait, len(comp.Traits))
|
||||
for j, trait := range comp.Traits {
|
||||
traits[j] = ApplicationTrait{
|
||||
Name: trait.Type,
|
||||
Properties: trait.Properties.DeepCopy(),
|
||||
}
|
||||
}
|
||||
|
||||
// deep copy scopes
|
||||
scopes := make(map[string]string)
|
||||
for k, v := range comp.Scopes {
|
||||
scopes[k] = v
|
||||
}
|
||||
// convert component
|
||||
// `.properties` -> `.settings`
|
||||
app.Spec.Components = append(app.Spec.Components, ApplicationComponent{
|
||||
Name: comp.Name,
|
||||
WorkloadType: comp.Type,
|
||||
Settings: *comp.Properties.DeepCopy(),
|
||||
Traits: traits,
|
||||
Scopes: scopes,
|
||||
})
|
||||
}
|
||||
// 3.2) convert Spec.RolloutPlan
|
||||
app.Spec.RolloutPlan = sourceApp.Spec.RolloutPlan.DeepCopy()
|
||||
|
||||
// 4) convert Status common.AppStatus
|
||||
app.Status = *sourceApp.Status.DeepCopy()
|
||||
return nil
|
||||
default:
|
||||
}
|
||||
return fmt.Errorf("unsupported ConvertFrom object %v", reflect.TypeOf(src))
|
||||
}
|
||||
146
apis/core.oam.dev/v1alpha2/core_scope_types.go
Normal file
146
apis/core.oam.dev/v1alpha2/core_scope_types.go
Normal file
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
|
||||
"github.com/oam-dev/kubevela/pkg/oam"
|
||||
)
|
||||
|
||||
// HealthStatus represents health status strings.
|
||||
type HealthStatus string
|
||||
|
||||
const (
|
||||
// StatusHealthy represents healthy status.
|
||||
StatusHealthy HealthStatus = "HEALTHY"
|
||||
// StatusUnhealthy represents unhealthy status.
|
||||
StatusUnhealthy = "UNHEALTHY"
|
||||
// StatusUnknown represents unknown status.
|
||||
StatusUnknown = "UNKNOWN"
|
||||
)
|
||||
|
||||
var _ oam.Scope = &HealthScope{}
|
||||
|
||||
// A HealthScopeSpec defines the desired state of a HealthScope.
|
||||
type HealthScopeSpec struct {
|
||||
// ProbeTimeout is the amount of time in seconds to wait when receiving a response before marked failure.
|
||||
ProbeTimeout *int32 `json:"probe-timeout,omitempty"`
|
||||
|
||||
// ProbeInterval is the amount of time in seconds between probing tries.
|
||||
ProbeInterval *int32 `json:"probe-interval,omitempty"`
|
||||
|
||||
// AppRefs records references of applications' components
|
||||
AppRefs []AppReference `json:"appReferences,omitempty"`
|
||||
|
||||
// WorkloadReferences to the workloads that are in this scope.
|
||||
// +deprecated
|
||||
WorkloadReferences []corev1.ObjectReference `json:"workloadRefs"`
|
||||
}
|
||||
|
||||
// AppReference records references of an application's components
|
||||
type AppReference struct {
|
||||
AppName string `json:"appName,omitempty"`
|
||||
CompReferences []CompReference `json:"compReferences,omitempty"`
|
||||
}
|
||||
|
||||
// CompReference records references of a component's resources
|
||||
type CompReference struct {
|
||||
CompName string `json:"compName,omitempty"`
|
||||
Workload corev1.ObjectReference `json:"workload,omitempty"`
|
||||
Traits []corev1.ObjectReference `json:"traits,omitempty"`
|
||||
}
|
||||
|
||||
// A HealthScopeStatus represents the observed state of a HealthScope.
|
||||
type HealthScopeStatus struct {
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
|
||||
// ScopeHealthCondition represents health condition summary of the scope
|
||||
ScopeHealthCondition ScopeHealthCondition `json:"scopeHealthCondition"`
|
||||
|
||||
// AppHealthConditions represents health condition of applications in the scope
|
||||
AppHealthConditions []*AppHealthCondition `json:"appHealthConditions,omitempty"`
|
||||
|
||||
// WorkloadHealthConditions represents health condition of workloads in the scope
|
||||
// Use AppHealthConditions to provide app level status
|
||||
// +deprecated
|
||||
WorkloadHealthConditions []*WorkloadHealthCondition `json:"healthConditions,omitempty"`
|
||||
}
|
||||
|
||||
// AppHealthCondition represents health condition of an application
|
||||
type AppHealthCondition struct {
|
||||
AppName string `json:"appName"`
|
||||
EnvName string `json:"envName,omitempty"`
|
||||
Components []*WorkloadHealthCondition `json:"components,omitempty"`
|
||||
}
|
||||
|
||||
// ScopeHealthCondition represents health condition summary of a scope.
|
||||
type ScopeHealthCondition struct {
|
||||
HealthStatus HealthStatus `json:"healthStatus"`
|
||||
Total int64 `json:"total,omitempty"`
|
||||
HealthyWorkloads int64 `json:"healthyWorkloads,omitempty"`
|
||||
UnhealthyWorkloads int64 `json:"unhealthyWorkloads,omitempty"`
|
||||
UnknownWorkloads int64 `json:"unknownWorkloads,omitempty"`
|
||||
}
|
||||
|
||||
// WorkloadHealthCondition represents informative health condition of a workload.
|
||||
type WorkloadHealthCondition struct {
|
||||
// ComponentName represents the component name if target is a workload
|
||||
ComponentName string `json:"componentName,omitempty"`
|
||||
TargetWorkload corev1.ObjectReference `json:"targetWorkload,omitempty"`
|
||||
HealthStatus HealthStatus `json:"healthStatus"`
|
||||
Diagnosis string `json:"diagnosis,omitempty"`
|
||||
// WorkloadStatus represents status of workloads whose HealthStatus is UNKNOWN.
|
||||
WorkloadStatus string `json:"workloadStatus,omitempty"`
|
||||
CustomStatusMsg string `json:"customStatusMsg,omitempty"`
|
||||
Traits []*TraitHealthCondition `json:"traits,omitempty"`
|
||||
}
|
||||
|
||||
// TraitHealthCondition represents informative health condition of a trait.
|
||||
type TraitHealthCondition struct {
|
||||
Type string `json:"type"`
|
||||
Resource string `json:"resource"`
|
||||
HealthStatus HealthStatus `json:"healthStatus"`
|
||||
Diagnosis string `json:"diagnosis,omitempty"`
|
||||
CustomStatusMsg string `json:"customStatusMsg,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// A HealthScope determines an aggregate health status based of the health of components.
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:JSONPath=".status.health",name=HEALTH,type=string
|
||||
type HealthScope struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec HealthScopeSpec `json:"spec,omitempty"`
|
||||
Status HealthScopeStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// HealthScopeList contains a list of HealthScope.
|
||||
type HealthScopeList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []HealthScope `json:"items"`
|
||||
}
|
||||
65
apis/core.oam.dev/v1alpha2/core_trait_types.go
Normal file
65
apis/core.oam.dev/v1alpha2/core_trait_types.go
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
|
||||
"github.com/oam-dev/kubevela/pkg/oam"
|
||||
)
|
||||
|
||||
var _ oam.Trait = &ManualScalerTrait{}
|
||||
|
||||
// A ManualScalerTraitSpec defines the desired state of a ManualScalerTrait.
|
||||
type ManualScalerTraitSpec struct {
|
||||
// ReplicaCount of the workload this trait applies to.
|
||||
ReplicaCount int32 `json:"replicaCount"`
|
||||
|
||||
// WorkloadReference to the workload this trait applies to.
|
||||
WorkloadReference corev1.ObjectReference `json:"workloadRef"`
|
||||
}
|
||||
|
||||
// A ManualScalerTraitStatus represents the observed state of a
|
||||
// ManualScalerTrait.
|
||||
type ManualScalerTraitStatus struct {
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// A ManualScalerTrait determines how many replicas a workload should have.
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:subresource:status
|
||||
type ManualScalerTrait struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ManualScalerTraitSpec `json:"spec,omitempty"`
|
||||
Status ManualScalerTraitStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ManualScalerTraitList contains a list of ManualScalerTrait.
|
||||
type ManualScalerTraitList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ManualScalerTrait `json:"items"`
|
||||
}
|
||||
673
apis/core.oam.dev/v1alpha2/core_types.go
Normal file
673
apis/core.oam.dev/v1alpha2/core_types.go
Normal file
@@ -0,0 +1,673 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
"github.com/oam-dev/kubevela/apis/types"
|
||||
)
|
||||
|
||||
// A WorkloadDefinitionSpec defines the desired state of a WorkloadDefinition.
|
||||
type WorkloadDefinitionSpec struct {
|
||||
// Reference to the CustomResourceDefinition that defines this workload kind.
|
||||
Reference common.DefinitionReference `json:"definitionRef"`
|
||||
|
||||
// ChildResourceKinds are the list of GVK of the child resources this workload generates
|
||||
ChildResourceKinds []common.ChildResourceKind `json:"childResourceKinds,omitempty"`
|
||||
|
||||
// RevisionLabel indicates which label for underlying resources(e.g. pods) of this workload
|
||||
// can be used by trait to create resource selectors(e.g. label selector for pods).
|
||||
// +optional
|
||||
RevisionLabel string `json:"revisionLabel,omitempty"`
|
||||
|
||||
// PodSpecPath indicates where/if this workload has K8s podSpec field
|
||||
// if one workload has podSpec, trait can do lot's of assumption such as port, env, volume fields.
|
||||
// +optional
|
||||
PodSpecPath string `json:"podSpecPath,omitempty"`
|
||||
|
||||
// Status defines the custom health policy and status message for workload
|
||||
// +optional
|
||||
Status *common.Status `json:"status,omitempty"`
|
||||
|
||||
// Schematic defines the data format and template of the encapsulation of the workload
|
||||
// +optional
|
||||
Schematic *common.Schematic `json:"schematic,omitempty"`
|
||||
|
||||
// Extension is used for extension needs by OAM platform builders
|
||||
// +optional
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Extension *runtime.RawExtension `json:"extension,omitempty"`
|
||||
}
|
||||
|
||||
// WorkloadDefinitionStatus is the status of WorkloadDefinition
|
||||
type WorkloadDefinitionStatus struct {
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// A WorkloadDefinition registers a kind of Kubernetes custom resource as a
|
||||
// valid OAM workload kind by referencing its CustomResourceDefinition. The CRD
|
||||
// is used to validate the schema of the workload when it is embedded in an OAM
|
||||
// Component.
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=workload
|
||||
// +kubebuilder:printcolumn:name="DEFINITION-NAME",type=string,JSONPath=".spec.definitionRef.name"
|
||||
type WorkloadDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec WorkloadDefinitionSpec `json:"spec,omitempty"`
|
||||
Status WorkloadDefinitionStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// SetConditions set condition for WorkloadDefinition
|
||||
func (wd *WorkloadDefinition) SetConditions(c ...condition.Condition) {
|
||||
wd.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition gets condition from WorkloadDefinition
|
||||
func (wd *WorkloadDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
|
||||
return wd.Status.GetCondition(conditionType)
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// WorkloadDefinitionList contains a list of WorkloadDefinition.
|
||||
type WorkloadDefinitionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []WorkloadDefinition `json:"items"`
|
||||
}
|
||||
|
||||
// A TraitDefinitionSpec defines the desired state of a TraitDefinition.
|
||||
type TraitDefinitionSpec struct {
|
||||
// Reference to the CustomResourceDefinition that defines this trait kind.
|
||||
Reference common.DefinitionReference `json:"definitionRef,omitempty"`
|
||||
|
||||
// Revision indicates whether a trait is aware of component revision
|
||||
// +optional
|
||||
RevisionEnabled bool `json:"revisionEnabled,omitempty"`
|
||||
|
||||
// WorkloadRefPath indicates where/if a trait accepts a workloadRef object
|
||||
// +optional
|
||||
WorkloadRefPath string `json:"workloadRefPath,omitempty"`
|
||||
|
||||
// PodDisruptive specifies whether using the trait will cause the pod to restart or not.
|
||||
// +optional
|
||||
PodDisruptive bool `json:"podDisruptive,omitempty"`
|
||||
|
||||
// AppliesToWorkloads specifies the list of workload kinds this trait
|
||||
// applies to. Workload kinds are specified in kind.group/version format,
|
||||
// e.g. server.core.oam.dev/v1alpha2. Traits that omit this field apply to
|
||||
// all workload kinds.
|
||||
// +optional
|
||||
AppliesToWorkloads []string `json:"appliesToWorkloads,omitempty"`
|
||||
|
||||
// ConflictsWith specifies the list of traits(CRD name, Definition name, CRD group)
|
||||
// which could not apply to the same workloads with this trait.
|
||||
// Traits that omit this field can work with any other traits.
|
||||
// Example rules:
|
||||
// "service" # Trait definition name
|
||||
// "services.k8s.io" # API resource/crd name
|
||||
// "*.networking.k8s.io" # API group
|
||||
// "labelSelector:foo=bar" # label selector
|
||||
// labelSelector format: https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse
|
||||
// +optional
|
||||
ConflictsWith []string `json:"conflictsWith,omitempty"`
|
||||
|
||||
// Schematic defines the data format and template of the encapsulation of the trait
|
||||
// +optional
|
||||
Schematic *common.Schematic `json:"schematic,omitempty"`
|
||||
|
||||
// Status defines the custom health policy and status message for trait
|
||||
// +optional
|
||||
Status *common.Status `json:"status,omitempty"`
|
||||
|
||||
// Extension is used for extension needs by OAM platform builders
|
||||
// +optional
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Extension *runtime.RawExtension `json:"extension,omitempty"`
|
||||
}
|
||||
|
||||
// TraitDefinitionStatus is the status of TraitDefinition
|
||||
type TraitDefinitionStatus struct {
|
||||
// ConditionedStatus reflects the observed status of a resource
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
|
||||
ConfigMapRef string `json:"configMapRef,omitempty"`
|
||||
// LatestRevision of the trait definition
|
||||
// +optional
|
||||
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// A TraitDefinition registers a kind of Kubernetes custom resource as a valid
|
||||
// OAM trait kind by referencing its CustomResourceDefinition. The CRD is used
|
||||
// to validate the schema of the trait when it is embedded in an OAM
|
||||
// ApplicationConfiguration.
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=trait
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="APPLIES-TO",type=string,JSONPath=".spec.appliesToWorkloads"
|
||||
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
|
||||
type TraitDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec TraitDefinitionSpec `json:"spec,omitempty"`
|
||||
Status TraitDefinitionStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// SetConditions set condition for TraitDefinition
|
||||
func (td *TraitDefinition) SetConditions(c ...condition.Condition) {
|
||||
td.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition gets condition from TraitDefinition
|
||||
func (td *TraitDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
|
||||
return td.Status.GetCondition(conditionType)
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// TraitDefinitionList contains a list of TraitDefinition.
|
||||
type TraitDefinitionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []TraitDefinition `json:"items"`
|
||||
}
|
||||
|
||||
// A ScopeDefinitionSpec defines the desired state of a ScopeDefinition.
|
||||
type ScopeDefinitionSpec struct {
|
||||
// Reference to the CustomResourceDefinition that defines this scope kind.
|
||||
Reference common.DefinitionReference `json:"definitionRef"`
|
||||
|
||||
// WorkloadRefsPath indicates if/where a scope accepts workloadRef objects
|
||||
WorkloadRefsPath string `json:"workloadRefsPath,omitempty"`
|
||||
|
||||
// AllowComponentOverlap specifies whether an OAM component may exist in
|
||||
// multiple instances of this kind of scope.
|
||||
AllowComponentOverlap bool `json:"allowComponentOverlap"`
|
||||
|
||||
// Extension is used for extension needs by OAM platform builders
|
||||
// +optional
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Extension *runtime.RawExtension `json:"extension,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// A ScopeDefinition registers a kind of Kubernetes custom resource as a valid
|
||||
// OAM scope kind by referencing its CustomResourceDefinition. The CRD is used
|
||||
// to validate the schema of the scope when it is embedded in an OAM
|
||||
// ApplicationConfiguration.
|
||||
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=scope
|
||||
type ScopeDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ScopeDefinitionSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ScopeDefinitionList contains a list of ScopeDefinition.
|
||||
type ScopeDefinitionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ScopeDefinition `json:"items"`
|
||||
}
|
||||
|
||||
// A ComponentParameter defines a configurable parameter of a component.
|
||||
type ComponentParameter struct {
|
||||
// Name of this parameter. OAM ApplicationConfigurations will specify
|
||||
// parameter values using this name.
|
||||
Name string `json:"name"`
|
||||
|
||||
// FieldPaths specifies an array of fields within this Component's workload
|
||||
// that will be overwritten by the value of this parameter. The type of the
|
||||
// parameter (e.g. int, string) is inferred from the type of these fields;
|
||||
// All fields must be of the same type. Fields are specified as JSON field
|
||||
// paths without a leading dot, for example 'spec.replicas'.
|
||||
FieldPaths []string `json:"fieldPaths"`
|
||||
|
||||
// +kubebuilder:default:=false
|
||||
// Required specifies whether or not a value for this parameter must be
|
||||
// supplied when authoring an ApplicationConfiguration.
|
||||
// +optional
|
||||
Required *bool `json:"required,omitempty"`
|
||||
|
||||
// Description of this parameter.
|
||||
// +optional
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// A ComponentSpec defines the desired state of a Component.
|
||||
type ComponentSpec struct {
|
||||
// A Workload that will be created for each ApplicationConfiguration that
|
||||
// includes this Component. Workload is an instance of a workloadDefinition.
|
||||
// We either use the GVK info or a special "type" field in the workload to associate
|
||||
// the content of the workload with its workloadDefinition
|
||||
// +kubebuilder:validation:EmbeddedResource
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Workload runtime.RawExtension `json:"workload"`
|
||||
|
||||
// HelmRelease records a Helm release used by a Helm module workload.
|
||||
// +optional
|
||||
Helm *common.Helm `json:"helm,omitempty"`
|
||||
|
||||
// Parameters exposed by this component. ApplicationConfigurations that
|
||||
// reference this component may specify values for these parameters, which
|
||||
// will in turn be injected into the embedded workload.
|
||||
// +optional
|
||||
Parameters []ComponentParameter `json:"parameters,omitempty"`
|
||||
}
|
||||
|
||||
// A ComponentStatus represents the observed state of a Component.
|
||||
type ComponentStatus struct {
|
||||
// The generation observed by the component controller.
|
||||
// +optional
|
||||
ObservedGeneration int64 `json:"observedGeneration"`
|
||||
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
|
||||
// LatestRevision of component
|
||||
// +optional
|
||||
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
|
||||
|
||||
// One Component should only be used by one AppConfig
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// A Component describes how an OAM workload kind may be instantiated.
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:JSONPath=".spec.workload.kind",name=WORKLOAD-KIND,type=string
|
||||
// +kubebuilder:printcolumn:name="age",type="date",JSONPath=".metadata.creationTimestamp"
|
||||
type Component struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ComponentSpec `json:"spec,omitempty"`
|
||||
Status ComponentStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ComponentList contains a list of Component.
|
||||
type ComponentList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Component `json:"items"`
|
||||
}
|
||||
|
||||
// A ComponentParameterValue specifies a value for a named parameter. The
|
||||
// associated component must publish a parameter with this name.
|
||||
type ComponentParameterValue struct {
|
||||
// Name of the component parameter to set.
|
||||
Name string `json:"name"`
|
||||
|
||||
// Value to set.
|
||||
Value intstr.IntOrString `json:"value"`
|
||||
}
|
||||
|
||||
// A ComponentTrait specifies a trait that should be applied to a component.
|
||||
type ComponentTrait struct {
|
||||
// A Trait that will be created for the component
|
||||
// +kubebuilder:validation:EmbeddedResource
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Trait runtime.RawExtension `json:"trait"`
|
||||
|
||||
// DataOutputs specify the data output sources from this trait.
|
||||
// +optional
|
||||
DataOutputs []DataOutput `json:"dataOutputs,omitempty"`
|
||||
|
||||
// DataInputs specify the data input sinks into this trait.
|
||||
// +optional
|
||||
DataInputs []DataInput `json:"dataInputs,omitempty"`
|
||||
}
|
||||
|
||||
// A ComponentScope specifies a scope in which a component should exist.
|
||||
type ComponentScope struct {
|
||||
// A ScopeReference must refer to an OAM scope resource.
|
||||
ScopeReference corev1.ObjectReference `json:"scopeRef"`
|
||||
}
|
||||
|
||||
// An ApplicationConfigurationComponent specifies a component of an
|
||||
// ApplicationConfiguration. Each component is used to instantiate a workload.
|
||||
type ApplicationConfigurationComponent struct {
|
||||
// ComponentName specifies a component whose latest revision will be bind
|
||||
// with ApplicationConfiguration. When the spec of the referenced component
|
||||
// changes, ApplicationConfiguration will automatically migrate all trait
|
||||
// affect from the prior revision to the new one. This is mutually exclusive
|
||||
// with RevisionName.
|
||||
// +optional
|
||||
ComponentName string `json:"componentName,omitempty"`
|
||||
|
||||
// RevisionName of a specific component revision to which to bind
|
||||
// ApplicationConfiguration. This is mutually exclusive with componentName.
|
||||
// +optional
|
||||
RevisionName string `json:"revisionName,omitempty"`
|
||||
|
||||
// DataOutputs specify the data output sources from this component.
|
||||
DataOutputs []DataOutput `json:"dataOutputs,omitempty"`
|
||||
|
||||
// DataInputs specify the data input sinks into this component.
|
||||
DataInputs []DataInput `json:"dataInputs,omitempty"`
|
||||
|
||||
// ParameterValues specify values for the the specified component's
|
||||
// parameters. Any parameter required by the component must be specified.
|
||||
// +optional
|
||||
ParameterValues []ComponentParameterValue `json:"parameterValues,omitempty"`
|
||||
|
||||
// Traits of the specified component.
|
||||
// +optional
|
||||
Traits []ComponentTrait `json:"traits,omitempty"`
|
||||
|
||||
// Scopes in which the specified component should exist.
|
||||
// +optional
|
||||
Scopes []ComponentScope `json:"scopes,omitempty"`
|
||||
}
|
||||
|
||||
// An ApplicationConfigurationSpec defines the desired state of a
|
||||
// ApplicationConfiguration.
|
||||
type ApplicationConfigurationSpec struct {
|
||||
// Components of which this ApplicationConfiguration consists. Each
|
||||
// component will be used to instantiate a workload.
|
||||
Components []ApplicationConfigurationComponent `json:"components"`
|
||||
}
|
||||
|
||||
// A TraitStatus represents the state of a trait.
|
||||
type TraitStatus string
|
||||
|
||||
// A WorkloadTrait represents a trait associated with a workload and its status
|
||||
type WorkloadTrait struct {
|
||||
// Status is a place holder for a customized controller to fill
|
||||
// if it needs a single place to summarize the status of the trait
|
||||
Status TraitStatus `json:"status,omitempty"`
|
||||
|
||||
// Reference to a trait created by an ApplicationConfiguration.
|
||||
Reference corev1.ObjectReference `json:"traitRef"`
|
||||
|
||||
// Message will allow controller to leave some additional information for this trait
|
||||
Message string `json:"message,omitempty"`
|
||||
|
||||
// AppliedGeneration indicates the generation observed by the appConfig controller.
|
||||
// The same field is also recorded in the annotations of traits.
|
||||
// A trait is possible to be deleted from cluster after created.
|
||||
// This field is useful to track the observed generation of traits after they are
|
||||
// deleted.
|
||||
AppliedGeneration int64 `json:"appliedGeneration,omitempty"`
|
||||
|
||||
// DependencyUnsatisfied notify does the trait has dependency unsatisfied
|
||||
DependencyUnsatisfied bool `json:"dependencyUnsatisfied,omitempty"`
|
||||
}
|
||||
|
||||
// A ScopeStatus represents the state of a scope.
|
||||
type ScopeStatus string
|
||||
|
||||
// A WorkloadScope represents a scope associated with a workload and its status
|
||||
type WorkloadScope struct {
|
||||
// Status is a place holder for a customized controller to fill
|
||||
// if it needs a single place to summarize the status of the scope
|
||||
Status ScopeStatus `json:"status,omitempty"`
|
||||
|
||||
// Reference to a scope created by an ApplicationConfiguration.
|
||||
Reference corev1.ObjectReference `json:"scopeRef"`
|
||||
}
|
||||
|
||||
// A WorkloadStatus represents the status of a workload.
|
||||
type WorkloadStatus struct {
|
||||
// Status is a place holder for a customized controller to fill
|
||||
// if it needs a single place to summarize the entire status of the workload
|
||||
Status string `json:"status,omitempty"`
|
||||
|
||||
// ComponentName that produced this workload.
|
||||
ComponentName string `json:"componentName,omitempty"`
|
||||
|
||||
// ComponentRevisionName of current component
|
||||
ComponentRevisionName string `json:"componentRevisionName,omitempty"`
|
||||
|
||||
// DependencyUnsatisfied notify does the workload has dependency unsatisfied
|
||||
DependencyUnsatisfied bool `json:"dependencyUnsatisfied,omitempty"`
|
||||
|
||||
// AppliedComponentRevision indicates the applied component revision name of this workload
|
||||
AppliedComponentRevision string `json:"appliedComponentRevision,omitempty"`
|
||||
|
||||
// Reference to a workload created by an ApplicationConfiguration.
|
||||
Reference corev1.ObjectReference `json:"workloadRef,omitempty"`
|
||||
|
||||
// Traits associated with this workload.
|
||||
Traits []WorkloadTrait `json:"traits,omitempty"`
|
||||
|
||||
// Scopes associated with this workload.
|
||||
Scopes []WorkloadScope `json:"scopes,omitempty"`
|
||||
}
|
||||
|
||||
// HistoryWorkload contain the old component revision that are still running
|
||||
type HistoryWorkload struct {
|
||||
// Revision of this workload
|
||||
Revision string `json:"revision,omitempty"`
|
||||
|
||||
// Reference to running workload.
|
||||
Reference corev1.ObjectReference `json:"workloadRef,omitempty"`
|
||||
}
|
||||
|
||||
// A ApplicationStatus represents the state of the entire application.
|
||||
type ApplicationStatus string
|
||||
|
||||
// An ApplicationConfigurationStatus represents the observed state of a
|
||||
// ApplicationConfiguration.
|
||||
type ApplicationConfigurationStatus struct {
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
|
||||
// Status is a place holder for a customized controller to fill
|
||||
// if it needs a single place to summarize the status of the entire application
|
||||
Status ApplicationStatus `json:"status,omitempty"`
|
||||
|
||||
Dependency DependencyStatus `json:"dependency,omitempty"`
|
||||
|
||||
// RollingStatus indicates what phase are we in the rollout phase
|
||||
RollingStatus types.RollingStatus `json:"rollingStatus,omitempty"`
|
||||
|
||||
// Workloads created by this ApplicationConfiguration.
|
||||
Workloads []WorkloadStatus `json:"workloads,omitempty"`
|
||||
|
||||
// The generation observed by the appConfig controller.
|
||||
// +optional
|
||||
ObservedGeneration int64 `json:"observedGeneration"`
|
||||
|
||||
// HistoryWorkloads will record history but still working revision workloads.
|
||||
HistoryWorkloads []HistoryWorkload `json:"historyWorkloads,omitempty"`
|
||||
}
|
||||
|
||||
// DependencyStatus represents the observed state of the dependency of
|
||||
// an ApplicationConfiguration.
|
||||
type DependencyStatus struct {
|
||||
Unsatisfied []UnstaifiedDependency `json:"unsatisfied,omitempty"`
|
||||
}
|
||||
|
||||
// UnstaifiedDependency describes unsatisfied dependency flow between
|
||||
// one pair of objects.
|
||||
type UnstaifiedDependency struct {
|
||||
Reason string `json:"reason"`
|
||||
From DependencyFromObject `json:"from"`
|
||||
To DependencyToObject `json:"to"`
|
||||
}
|
||||
|
||||
// DependencyFromObject represents the object that dependency data comes from.
|
||||
type DependencyFromObject struct {
|
||||
corev1.ObjectReference `json:",inline"`
|
||||
FieldPath string `json:"fieldPath,omitempty"`
|
||||
}
|
||||
|
||||
// DependencyToObject represents the object that dependency data goes to.
|
||||
type DependencyToObject struct {
|
||||
corev1.ObjectReference `json:",inline"`
|
||||
FieldPaths []string `json:"fieldPaths,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// An ApplicationConfiguration represents an OAM application.
|
||||
// +kubebuilder:resource:shortName=appconfig,categories={oam}
|
||||
// +kubebuilder:subresource:status
|
||||
type ApplicationConfiguration struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ApplicationConfigurationSpec `json:"spec,omitempty"`
|
||||
Status ApplicationConfigurationStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ApplicationConfigurationList contains a list of ApplicationConfiguration.
|
||||
type ApplicationConfigurationList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ApplicationConfiguration `json:"items"`
|
||||
}
|
||||
|
||||
// DataOutput specifies a data output source from an object.
|
||||
type DataOutput struct {
|
||||
// Name is the unique name of a DataOutput in an ApplicationConfiguration.
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// FieldPath refers to the value of an object's field.
|
||||
FieldPath string `json:"fieldPath,omitempty"`
|
||||
|
||||
// Conditions specify the conditions that should be satisfied before emitting a data output.
|
||||
// Different conditions are AND-ed together.
|
||||
// If no conditions is specified, it is by default to check output value not empty.
|
||||
// +optional
|
||||
Conditions []ConditionRequirement `json:"conditions,omitempty"`
|
||||
// OutputStore specifies the object used to store intermediate data generated by Operations
|
||||
OutputStore StoreReference `json:"outputStore,omitempty"`
|
||||
}
|
||||
|
||||
// StoreReference specifies the referenced object in DataOutput or DataInput
|
||||
type StoreReference struct {
|
||||
corev1.ObjectReference `json:",inline"`
|
||||
// Operations specify the data processing operations
|
||||
Operations []DataOperation `json:"operations,omitempty"`
|
||||
}
|
||||
|
||||
// DataOperation defines the specific operation for data
|
||||
type DataOperation struct {
|
||||
// Type specifies the type of DataOperation
|
||||
Type string `json:"type"`
|
||||
// Operator specifies the operation under this DataOperation type
|
||||
Operator DataOperator `json:"op"`
|
||||
// ToFieldPath refers to the value of an object's field
|
||||
ToFieldPath string `json:"toFieldPath"`
|
||||
// ToDataPath refers to the value of an object's specfied by ToDataPath. For example the ToDataPath "redis" specifies "redis info" in '{"redis":"redis info"}'
|
||||
ToDataPath string `json:"toDataPath,omitempty"`
|
||||
// +optional
|
||||
// Value specifies an expected value
|
||||
// This is mutually exclusive with ValueFrom
|
||||
Value string `json:"value,omitempty"`
|
||||
// +optional
|
||||
// ValueFrom specifies expected value from object such as workload and trait
|
||||
// This is mutually exclusive with Value
|
||||
ValueFrom ValueFrom `json:"valueFrom,omitempty"`
|
||||
Conditions []ConditionRequirement `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// DataOperator defines the type of Operator in DataOperation
|
||||
type DataOperator string
|
||||
|
||||
const (
|
||||
// AddOperator specifies the add operation for data passing
|
||||
AddOperator DataOperator = "add"
|
||||
// DeleteOperator specifies the delete operation for data passing
|
||||
DeleteOperator DataOperator = "delete"
|
||||
// ReplaceOperator specifies the replace operation for data passing
|
||||
ReplaceOperator DataOperator = "replace"
|
||||
)
|
||||
|
||||
// DataInput specifies a data input sink to an object.
|
||||
// If input is array, it will be appended to the target field paths.
|
||||
type DataInput struct {
|
||||
// ValueFrom specifies the value source.
|
||||
ValueFrom DataInputValueFrom `json:"valueFrom,omitempty"`
|
||||
|
||||
// ToFieldPaths specifies the field paths of an object to fill passed value.
|
||||
ToFieldPaths []string `json:"toFieldPaths,omitempty"`
|
||||
|
||||
// StrategyMergeKeys specifies the merge key if the toFieldPaths target is an array.
|
||||
// The StrategyMergeKeys is optional, by default, if the toFieldPaths target is an array, we will append.
|
||||
// If StrategyMergeKeys specified, we will check the key in the target array.
|
||||
// If any key exist, do update; if no key exist, append.
|
||||
StrategyMergeKeys []string `json:"strategyMergeKeys,omitempty"`
|
||||
|
||||
// When the Conditions is satified, ToFieldPaths will be filled with passed value
|
||||
Conditions []ConditionRequirement `json:"conditions,omitempty"`
|
||||
|
||||
// InputStore specifies the object used to read intermediate data genereted by DataOutput
|
||||
InputStore StoreReference `json:"inputStore,omitempty"`
|
||||
}
|
||||
|
||||
// DataInputValueFrom specifies the value source for a data input.
|
||||
type DataInputValueFrom struct {
|
||||
// DataOutputName matches a name of a DataOutput in the same AppConfig.
|
||||
DataOutputName string `json:"dataOutputName"`
|
||||
}
|
||||
|
||||
// ConditionRequirement specifies the requirement to match a value.
|
||||
type ConditionRequirement struct {
|
||||
Operator ConditionOperator `json:"op"`
|
||||
|
||||
// +optional
|
||||
// Value specifies an expected value
|
||||
// This is mutually exclusive with ValueFrom
|
||||
Value string `json:"value,omitempty"`
|
||||
// +optional
|
||||
// ValueFrom specifies expected value from AppConfig
|
||||
// This is mutually exclusive with Value
|
||||
ValueFrom ValueFrom `json:"valueFrom,omitempty"`
|
||||
|
||||
// +optional
|
||||
// FieldPath specifies got value from workload/trait object
|
||||
FieldPath string `json:"fieldPath,omitempty"`
|
||||
}
|
||||
|
||||
// ValueFrom gets value from AppConfig object by specifying a path
|
||||
type ValueFrom struct {
|
||||
FieldPath string `json:"fieldPath"`
|
||||
}
|
||||
|
||||
// ConditionOperator specifies the operator to match a value.
|
||||
type ConditionOperator string
|
||||
|
||||
const (
|
||||
// ConditionEqual indicates equal to given value
|
||||
ConditionEqual ConditionOperator = "eq"
|
||||
// ConditionNotEqual indicates not equal to given value
|
||||
ConditionNotEqual ConditionOperator = "notEq"
|
||||
// ConditionNotEmpty indicates given value not empty
|
||||
ConditionNotEmpty ConditionOperator = "notEmpty"
|
||||
)
|
||||
411
apis/core.oam.dev/v1alpha2/core_workload_types.go
Normal file
411
apis/core.oam.dev/v1alpha2/core_workload_types.go
Normal file
@@ -0,0 +1,411 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1alpha2
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
|
||||
"github.com/oam-dev/kubevela/pkg/oam"
|
||||
)
|
||||
|
||||
// An OperatingSystem required by a containerised workload.
|
||||
type OperatingSystem string
|
||||
|
||||
// Supported operating system types.
|
||||
const (
|
||||
OperatingSystemLinux OperatingSystem = "linux"
|
||||
OperatingSystemWindows OperatingSystem = "windows"
|
||||
)
|
||||
|
||||
// A CPUArchitecture required by a containerised workload.
|
||||
type CPUArchitecture string
|
||||
|
||||
// Supported architectures
|
||||
const (
|
||||
CPUArchitectureI386 CPUArchitecture = "i386"
|
||||
CPUArchitectureAMD64 CPUArchitecture = "amd64"
|
||||
CPUArchitectureARM CPUArchitecture = "arm"
|
||||
CPUArchitectureARM64 CPUArchitecture = "arm64"
|
||||
)
|
||||
|
||||
// A SecretKeySelector is a reference to a secret key in an arbitrary namespace.
|
||||
type SecretKeySelector struct {
|
||||
// The name of the secret.
|
||||
Name string `json:"name"`
|
||||
|
||||
// The key to select.
|
||||
Key string `json:"key"`
|
||||
}
|
||||
|
||||
// TODO(negz): The OAM spec calls for float64 quantities in some cases, but this
|
||||
// is incompatible with controller-gen and Kubernetes API conventions. We should
|
||||
// reassess whether resource.Quantity is appropriate after resolving
|
||||
// https://github.com/oam-dev/spec/issues/313
|
||||
|
||||
// CPUResources required by a container.
|
||||
type CPUResources struct {
|
||||
// Required CPU count. 1.0 represents one CPU core.
|
||||
Required resource.Quantity `json:"required"`
|
||||
}
|
||||
|
||||
// MemoryResources required by a container.
|
||||
type MemoryResources struct {
|
||||
// Required memory.
|
||||
Required resource.Quantity `json:"required"`
|
||||
}
|
||||
|
||||
// GPUResources required by a container.
|
||||
type GPUResources struct {
|
||||
// Required GPU count.
|
||||
Required resource.Quantity `json:"required"`
|
||||
}
|
||||
|
||||
// DiskResource required by a container.
|
||||
type DiskResource struct {
|
||||
// Required disk space.
|
||||
Required resource.Quantity `json:"required"`
|
||||
|
||||
// Ephemeral specifies whether an external disk needs to be mounted.
|
||||
// +optional
|
||||
Ephemeral *bool `json:"ephemeral,omitempty"`
|
||||
}
|
||||
|
||||
// A VolumeAccessMode determines how a volume may be accessed.
|
||||
type VolumeAccessMode string
|
||||
|
||||
// Volume access modes.
|
||||
const (
|
||||
VolumeAccessModeRO VolumeAccessMode = "RO"
|
||||
VolumeAccessModeRW VolumeAccessMode = "RW"
|
||||
)
|
||||
|
||||
// A VolumeSharingPolicy determines how a volume may be shared.
|
||||
type VolumeSharingPolicy string
|
||||
|
||||
// Volume sharing policies.
|
||||
const (
|
||||
VolumeSharingPolicyExclusive VolumeSharingPolicy = "Exclusive"
|
||||
VolumeSharingPolicyShared VolumeSharingPolicy = "Shared"
|
||||
)
|
||||
|
||||
// VolumeResource required by a container.
|
||||
type VolumeResource struct {
|
||||
// Name of this volume. Must be unique within its container.
|
||||
Name string `json:"name"`
|
||||
|
||||
// MountPath at which this volume will be mounted within its container.
|
||||
MountPath string `json:"mountPath"`
|
||||
|
||||
// TODO(negz): Use +kubebuilder:default marker to default AccessMode to RW
|
||||
// and SharingPolicy to Exclusive once we're generating v1 CRDs.
|
||||
|
||||
// AccessMode of this volume; RO (read only) or RW (read and write).
|
||||
// +optional
|
||||
// +kubebuilder:validation:Enum=RO;RW
|
||||
AccessMode *VolumeAccessMode `json:"accessMode,omitempty"`
|
||||
|
||||
// SharingPolicy of this volume; Exclusive or Shared.
|
||||
// +optional
|
||||
// +kubebuilder:validation:Enum=Exclusive;Shared
|
||||
SharingPolicy *VolumeSharingPolicy `json:"sharingPolicy,omitempty"`
|
||||
|
||||
// Disk requirements of this volume.
|
||||
// +optional
|
||||
Disk *DiskResource `json:"disk,omitempty"`
|
||||
}
|
||||
|
||||
// ExtendedResource required by a container.
|
||||
type ExtendedResource struct {
|
||||
// Name of the external resource. Resource names are specified in
|
||||
// kind.group/version format, e.g. motionsensor.ext.example.com/v1.
|
||||
Name string `json:"name"`
|
||||
|
||||
// Required extended resource(s), e.g. 8 or "very-cool-widget"
|
||||
Required intstr.IntOrString `json:"required"`
|
||||
}
|
||||
|
||||
// ContainerResources specifies a container's required compute resources.
|
||||
type ContainerResources struct {
|
||||
// CPU required by this container.
|
||||
CPU CPUResources `json:"cpu"`
|
||||
|
||||
// Memory required by this container.
|
||||
Memory MemoryResources `json:"memory"`
|
||||
|
||||
// GPU required by this container.
|
||||
// +optional
|
||||
GPU *GPUResources `json:"gpu,omitempty"`
|
||||
|
||||
// Volumes required by this container.
|
||||
// +optional
|
||||
Volumes []VolumeResource `json:"volumes,omitempty"`
|
||||
|
||||
// Extended resources required by this container.
|
||||
// +optional
|
||||
Extended []ExtendedResource `json:"extended,omitempty"`
|
||||
}
|
||||
|
||||
// A ContainerEnvVar specifies an environment variable that should be set within
|
||||
// a container.
|
||||
type ContainerEnvVar struct {
|
||||
// Name of the environment variable. Must be composed of valid Unicode
|
||||
// letter and number characters, as well as _ and -.
|
||||
// +kubebuilder:validation:Pattern=^[-_a-zA-Z0-9]+$
|
||||
Name string `json:"name"`
|
||||
|
||||
// Value of the environment variable.
|
||||
// +optional
|
||||
Value *string `json:"value,omitempty"`
|
||||
|
||||
// FromSecret is a secret key reference which can be used to assign a value
|
||||
// to the environment variable.
|
||||
// +optional
|
||||
FromSecret *SecretKeySelector `json:"fromSecret,omitempty"`
|
||||
}
|
||||
|
||||
// A ContainerConfigFile specifies a configuration file that should be written
|
||||
// within a container.
|
||||
type ContainerConfigFile struct {
|
||||
// Path within the container at which the configuration file should be
|
||||
// written.
|
||||
Path string `json:"path"`
|
||||
|
||||
// Value that should be written to the configuration file.
|
||||
// +optional
|
||||
Value *string `json:"value,omitempty"`
|
||||
|
||||
// FromSecret is a secret key reference which can be used to assign a value
|
||||
// to be written to the configuration file at the given path in the
|
||||
// container.
|
||||
// +optional
|
||||
FromSecret *SecretKeySelector `json:"fromSecret,omitempty"`
|
||||
}
|
||||
|
||||
// A TransportProtocol represents a transport layer protocol.
|
||||
type TransportProtocol string
|
||||
|
||||
// Transport protocols.
|
||||
const (
|
||||
TransportProtocolTCP TransportProtocol = "TCP"
|
||||
TransportProtocolUDP TransportProtocol = "UDP"
|
||||
)
|
||||
|
||||
// A ContainerPort specifies a port that is exposed by a container.
|
||||
type ContainerPort struct {
|
||||
// Name of this port. Must be unique within its container. Must be lowercase
|
||||
// alphabetical characters.
|
||||
// +kubebuilder:validation:Pattern=^[a-z]+$
|
||||
Name string `json:"name"`
|
||||
|
||||
// Port number. Must be unique within its container.
|
||||
Port int32 `json:"containerPort"`
|
||||
|
||||
// TODO(negz): Use +kubebuilder:default marker to default Protocol to TCP
|
||||
// once we're generating v1 CRDs.
|
||||
|
||||
// Protocol used by the server listening on this port.
|
||||
// +kubebuilder:validation:Enum=TCP;UDP
|
||||
// +optional
|
||||
Protocol *TransportProtocol `json:"protocol,omitempty"`
|
||||
}
|
||||
|
||||
// An ExecProbe probes a container's health by executing a command.
|
||||
type ExecProbe struct {
|
||||
// Command to be run by this probe.
|
||||
Command []string `json:"command"`
|
||||
}
|
||||
|
||||
// A HTTPHeader to be passed when probing a container.
|
||||
type HTTPHeader struct {
|
||||
// Name of this HTTP header. Must be unique per probe.
|
||||
Name string `json:"name"`
|
||||
|
||||
// Value of this HTTP header.
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
// A HTTPGetProbe probes a container's health by sending an HTTP GET request.
|
||||
type HTTPGetProbe struct {
|
||||
// Path to probe, e.g. '/healthz'.
|
||||
Path string `json:"path"`
|
||||
|
||||
// Port to probe.
|
||||
Port int32 `json:"port"`
|
||||
|
||||
// HTTPHeaders to send with the GET request.
|
||||
// +optional
|
||||
HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty"`
|
||||
}
|
||||
|
||||
// A TCPSocketProbe probes a container's health by connecting to a TCP socket.
|
||||
type TCPSocketProbe struct {
|
||||
// Port this probe should connect to.
|
||||
Port int32 `json:"port"`
|
||||
}
|
||||
|
||||
// A ContainerHealthProbe specifies how to probe the health of a container.
|
||||
// Exactly one of Exec, HTTPGet, or TCPSocket must be specified.
|
||||
type ContainerHealthProbe struct {
|
||||
// Exec probes a container's health by executing a command.
|
||||
// +optional
|
||||
Exec *ExecProbe `json:"exec,omitempty"`
|
||||
|
||||
// HTTPGet probes a container's health by sending an HTTP GET request.
|
||||
// +optional
|
||||
HTTPGet *HTTPGetProbe `json:"httpGet,omitempty"`
|
||||
|
||||
// TCPSocketProbe probes a container's health by connecting to a TCP socket.
|
||||
// +optional
|
||||
TCPSocket *TCPSocketProbe `json:"tcpSocket,omitempty"`
|
||||
|
||||
// InitialDelaySeconds after a container starts before the first probe.
|
||||
// +optional
|
||||
InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`
|
||||
|
||||
// TODO(negz): Use +kubebuilder:default marker to default PeriodSeconds,
|
||||
// TimeoutSeconds, SuccessThreshold, and FailureThreshold to 10, 1, 1, and 3
|
||||
// respectively once we're generating v1 CRDs.
|
||||
|
||||
// PeriodSeconds between probes.
|
||||
// +optional
|
||||
PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
|
||||
|
||||
// TimeoutSeconds after which the probe times out.
|
||||
// +optional
|
||||
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
|
||||
|
||||
// SuccessThreshold specifies how many consecutive probes must success in
|
||||
// order for the container to be considered healthy.
|
||||
// +optional
|
||||
SuccessThreshold *int32 `json:"successThreshold,omitempty"`
|
||||
|
||||
// FailureThreshold specifies how many consecutive probes must fail in order
|
||||
// for the container to be considered healthy.
|
||||
// +optional
|
||||
FailureThreshold *int32 `json:"failureThreshold,omitempty"`
|
||||
}
|
||||
|
||||
// A Container represents an Open Containers Initiative (OCI) container.
|
||||
type Container struct {
|
||||
// Name of this container. Must be unique within its workload.
|
||||
Name string `json:"name"`
|
||||
|
||||
// Image this container should run. Must be a path-like or URI-like
|
||||
// representation of an OCI image. May be prefixed with a registry address
|
||||
// and should be suffixed with a tag.
|
||||
Image string `json:"image"`
|
||||
|
||||
// Resources required by this container
|
||||
// +optional
|
||||
Resources *ContainerResources `json:"resources,omitempty"`
|
||||
|
||||
// Command to be run by this container.
|
||||
// +optional
|
||||
Command []string `json:"command,omitempty"`
|
||||
|
||||
// Arguments to be passed to the command run by this container.
|
||||
// +optional
|
||||
Arguments []string `json:"args,omitempty"`
|
||||
|
||||
// Environment variables that should be set within this container.
|
||||
// +optional
|
||||
Environment []ContainerEnvVar `json:"env,omitempty"`
|
||||
|
||||
// ConfigFiles that should be written within this container.
|
||||
// +optional
|
||||
ConfigFiles []ContainerConfigFile `json:"config,omitempty"`
|
||||
|
||||
// Ports exposed by this container.
|
||||
// +optional
|
||||
Ports []ContainerPort `json:"ports,omitempty"`
|
||||
|
||||
// A LivenessProbe assesses whether this container is alive. Containers that
|
||||
// fail liveness probes will be restarted.
|
||||
// +optional
|
||||
LivenessProbe *ContainerHealthProbe `json:"livenessProbe,omitempty"`
|
||||
|
||||
// A ReadinessProbe assesses whether this container is ready to serve
|
||||
// requests. Containers that fail readiness probes will be withdrawn from
|
||||
// service.
|
||||
// +optional
|
||||
ReadinessProbe *ContainerHealthProbe `json:"readinessProbe,omitempty"`
|
||||
|
||||
// TODO(negz): Ideally the key within this secret would be configurable, but
|
||||
// the current OAM spec allows only a secret name.
|
||||
|
||||
// ImagePullSecret specifies the name of a Secret from which the
|
||||
// credentials required to pull this container's image can be loaded.
|
||||
// +optional
|
||||
ImagePullSecret *string `json:"imagePullSecret,omitempty"`
|
||||
}
|
||||
|
||||
// A ContainerizedWorkloadSpec defines the desired state of a
|
||||
// ContainerizedWorkload.
|
||||
type ContainerizedWorkloadSpec struct {
|
||||
// OperatingSystem required by this workload.
|
||||
// +kubebuilder:validation:Enum=linux;windows
|
||||
// +optional
|
||||
OperatingSystem *OperatingSystem `json:"osType,omitempty"`
|
||||
|
||||
// CPUArchitecture required by this workload.
|
||||
// +kubebuilder:validation:Enum=i386;amd64;arm;arm64
|
||||
// +optional
|
||||
CPUArchitecture *CPUArchitecture `json:"arch,omitempty"`
|
||||
|
||||
// Containers of which this workload consists.
|
||||
Containers []Container `json:"containers"`
|
||||
}
|
||||
|
||||
// A ContainerizedWorkloadStatus represents the observed state of a
|
||||
// ContainerizedWorkload.
|
||||
type ContainerizedWorkloadStatus struct {
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
|
||||
// Resources managed by this containerised workload.
|
||||
Resources []corev1.ObjectReference `json:"resources,omitempty"`
|
||||
}
|
||||
|
||||
var _ oam.Workload = &ContainerizedWorkload{}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// A ContainerizedWorkload is a workload that runs OCI containers.
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:subresource:status
|
||||
type ContainerizedWorkload struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ContainerizedWorkloadSpec `json:"spec,omitempty"`
|
||||
Status ContainerizedWorkloadStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ContainerizedWorkloadList contains a list of ContainerizedWorkload.
|
||||
type ContainerizedWorkloadList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ContainerizedWorkload `json:"items"`
|
||||
}
|
||||
22
apis/core.oam.dev/v1alpha2/doc.go
Normal file
22
apis/core.oam.dev/v1alpha2/doc.go
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1alpha2 contains resources relating to the Open Application Model.
|
||||
// See https://github.com/oam-dev/spec for more details.
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=core.oam.dev
|
||||
// +versionName=v1alpha2
|
||||
package v1alpha2
|
||||
95
apis/core.oam.dev/v1alpha2/methods.go
Normal file
95
apis/core.oam.dev/v1alpha2/methods.go
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This code is manually implemented, but should be generated in the future.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
)
|
||||
|
||||
// GetCondition of this ManualScalerTrait.
|
||||
func (tr *ManualScalerTrait) GetCondition(ct condition.ConditionType) condition.Condition {
|
||||
return tr.Status.GetCondition(ct)
|
||||
}
|
||||
|
||||
// SetConditions of this ManualScalerTrait.
|
||||
func (tr *ManualScalerTrait) SetConditions(c ...condition.Condition) {
|
||||
tr.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetWorkloadReference of this ManualScalerTrait.
|
||||
func (tr *ManualScalerTrait) GetWorkloadReference() corev1.ObjectReference {
|
||||
return tr.Spec.WorkloadReference
|
||||
}
|
||||
|
||||
// SetWorkloadReference of this ManualScalerTrait.
|
||||
func (tr *ManualScalerTrait) SetWorkloadReference(r corev1.ObjectReference) {
|
||||
tr.Spec.WorkloadReference = r
|
||||
}
|
||||
|
||||
// GetCondition of this ApplicationConfiguration.
|
||||
func (ac *ApplicationConfiguration) GetCondition(ct condition.ConditionType) condition.Condition {
|
||||
return ac.Status.GetCondition(ct)
|
||||
}
|
||||
|
||||
// SetConditions of this ApplicationConfiguration.
|
||||
func (ac *ApplicationConfiguration) SetConditions(c ...condition.Condition) {
|
||||
ac.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition of this Component.
|
||||
func (cm *Component) GetCondition(ct condition.ConditionType) condition.Condition {
|
||||
return cm.Status.GetCondition(ct)
|
||||
}
|
||||
|
||||
// SetConditions of this Component.
|
||||
func (cm *Component) SetConditions(c ...condition.Condition) {
|
||||
cm.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition of this ContainerizedWorkload.
|
||||
func (wl *ContainerizedWorkload) GetCondition(ct condition.ConditionType) condition.Condition {
|
||||
return wl.Status.GetCondition(ct)
|
||||
}
|
||||
|
||||
// SetConditions of this ContainerizedWorkload.
|
||||
func (wl *ContainerizedWorkload) SetConditions(c ...condition.Condition) {
|
||||
wl.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition of this HealthScope.
|
||||
func (hs *HealthScope) GetCondition(ct condition.ConditionType) condition.Condition {
|
||||
return hs.Status.GetCondition(ct)
|
||||
}
|
||||
|
||||
// SetConditions of this HealthScope.
|
||||
func (hs *HealthScope) SetConditions(c ...condition.Condition) {
|
||||
hs.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetWorkloadReferences to get all workload references for scope.
|
||||
func (hs *HealthScope) GetWorkloadReferences() []corev1.ObjectReference {
|
||||
return hs.Spec.WorkloadReferences
|
||||
}
|
||||
|
||||
// AddWorkloadReference to add a workload reference to this scope.
|
||||
func (hs *HealthScope) AddWorkloadReference(r corev1.ObjectReference) {
|
||||
hs.Spec.WorkloadReferences = append(hs.Spec.WorkloadReferences, r)
|
||||
}
|
||||
149
apis/core.oam.dev/v1alpha2/register.go
Normal file
149
apis/core.oam.dev/v1alpha2/register.go
Normal file
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
// Package type metadata.
|
||||
const (
|
||||
Group = "core.oam.dev"
|
||||
Version = "v1alpha2"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
|
||||
)
|
||||
|
||||
// ComponentDefinition type metadata.
|
||||
var (
|
||||
ComponentDefinitionKind = reflect.TypeOf(ComponentDefinition{}).Name()
|
||||
ComponentDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: ComponentDefinitionKind}.String()
|
||||
ComponentDefinitionKindAPIVersion = ComponentDefinitionKind + "." + SchemeGroupVersion.String()
|
||||
ComponentDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(ComponentDefinitionKind)
|
||||
)
|
||||
|
||||
// WorkloadDefinition type metadata.
|
||||
var (
|
||||
WorkloadDefinitionKind = reflect.TypeOf(WorkloadDefinition{}).Name()
|
||||
WorkloadDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: WorkloadDefinitionKind}.String()
|
||||
WorkloadDefinitionKindAPIVersion = WorkloadDefinitionKind + "." + SchemeGroupVersion.String()
|
||||
WorkloadDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(WorkloadDefinitionKind)
|
||||
)
|
||||
|
||||
// TraitDefinition type metadata.
|
||||
var (
|
||||
TraitDefinitionKind = reflect.TypeOf(TraitDefinition{}).Name()
|
||||
TraitDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: TraitDefinitionKind}.String()
|
||||
TraitDefinitionKindAPIVersion = TraitDefinitionKind + "." + SchemeGroupVersion.String()
|
||||
TraitDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(TraitDefinitionKind)
|
||||
)
|
||||
|
||||
// ScopeDefinition type metadata.
|
||||
var (
|
||||
ScopeDefinitionKind = reflect.TypeOf(ScopeDefinition{}).Name()
|
||||
ScopeDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: ScopeDefinitionKind}.String()
|
||||
ScopeDefinitionKindAPIVersion = ScopeDefinitionKind + "." + SchemeGroupVersion.String()
|
||||
ScopeDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(ScopeDefinitionKind)
|
||||
)
|
||||
|
||||
// Component type metadata.
|
||||
var (
|
||||
ComponentKind = reflect.TypeOf(Component{}).Name()
|
||||
ComponentGroupKind = schema.GroupKind{Group: Group, Kind: ComponentKind}.String()
|
||||
ComponentKindAPIVersion = ComponentKind + "." + SchemeGroupVersion.String()
|
||||
ComponentGroupVersionKind = SchemeGroupVersion.WithKind(ComponentKind)
|
||||
)
|
||||
|
||||
// ApplicationConfiguration type metadata.
|
||||
var (
|
||||
ApplicationConfigurationKind = reflect.TypeOf(ApplicationConfiguration{}).Name()
|
||||
ApplicationConfigurationGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationConfigurationKind}.String()
|
||||
ApplicationConfigurationKindAPIVersion = ApplicationConfigurationKind + "." + SchemeGroupVersion.String()
|
||||
ApplicationConfigurationGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationConfigurationKind)
|
||||
)
|
||||
|
||||
// ContainerizedWorkload type metadata.
|
||||
var (
|
||||
ContainerizedWorkloadKind = reflect.TypeOf(ContainerizedWorkload{}).Name()
|
||||
ContainerizedWorkloadGroupKind = schema.GroupKind{Group: Group, Kind: ContainerizedWorkloadKind}.String()
|
||||
ContainerizedWorkloadKindAPIVersion = ContainerizedWorkloadKind + "." + SchemeGroupVersion.String()
|
||||
ContainerizedWorkloadGroupVersionKind = SchemeGroupVersion.WithKind(ContainerizedWorkloadKind)
|
||||
)
|
||||
|
||||
// ManualScalerTrait type metadata.
|
||||
var (
|
||||
ManualScalerTraitKind = reflect.TypeOf(ManualScalerTrait{}).Name()
|
||||
ManualScalerTraitGroupKind = schema.GroupKind{Group: Group, Kind: ManualScalerTraitKind}.String()
|
||||
ManualScalerTraitKindAPIVersion = ManualScalerTraitKind + "." + SchemeGroupVersion.String()
|
||||
ManualScalerTraitGroupVersionKind = SchemeGroupVersion.WithKind(ManualScalerTraitKind)
|
||||
)
|
||||
|
||||
// HealthScope type metadata.
|
||||
var (
|
||||
HealthScopeKind = reflect.TypeOf(HealthScope{}).Name()
|
||||
HealthScopeGroupKind = schema.GroupKind{Group: Group, Kind: HealthScopeKind}.String()
|
||||
HealthScopeKindAPIVersion = HealthScopeKind + "." + SchemeGroupVersion.String()
|
||||
HealthScopeGroupVersionKind = SchemeGroupVersion.WithKind(HealthScopeKind)
|
||||
)
|
||||
|
||||
// Application type metadata.
|
||||
var (
|
||||
ApplicationKind = reflect.TypeOf(Application{}).Name()
|
||||
ApplicationGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationKind}.String()
|
||||
ApplicationKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
|
||||
ApplicationKindVersionKind = SchemeGroupVersion.WithKind(ApplicationKind)
|
||||
)
|
||||
|
||||
// AppRollout type metadata.
|
||||
var (
|
||||
AppRolloutKind = reflect.TypeOf(AppRollout{}).Name()
|
||||
AppRolloutGroupKind = schema.GroupKind{Group: Group, Kind: AppRolloutKind}.String()
|
||||
AppRolloutKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
|
||||
AppRolloutKindVersionKind = SchemeGroupVersion.WithKind(AppRolloutKind)
|
||||
)
|
||||
|
||||
// ApplicationRevision type metadata
|
||||
var (
|
||||
ApplicationRevisionKind = reflect.TypeOf(ApplicationRevision{}).Name()
|
||||
ApplicationRevisionGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationRevisionKind}.String()
|
||||
ApplicationRevisionKindAPIVersion = ApplicationRevisionKind + "." + SchemeGroupVersion.String()
|
||||
ApplicationRevisionGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationRevisionKind)
|
||||
)
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&ComponentDefinition{}, &ComponentDefinitionList{})
|
||||
SchemeBuilder.Register(&WorkloadDefinition{}, &WorkloadDefinitionList{})
|
||||
SchemeBuilder.Register(&TraitDefinition{}, &TraitDefinitionList{})
|
||||
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
|
||||
SchemeBuilder.Register(&Component{}, &ComponentList{})
|
||||
SchemeBuilder.Register(&ApplicationConfiguration{}, &ApplicationConfigurationList{})
|
||||
SchemeBuilder.Register(&ContainerizedWorkload{}, &ContainerizedWorkloadList{})
|
||||
SchemeBuilder.Register(&ManualScalerTrait{}, &ManualScalerTraitList{})
|
||||
SchemeBuilder.Register(&HealthScope{}, &HealthScopeList{})
|
||||
SchemeBuilder.Register(&Application{}, &ApplicationList{})
|
||||
SchemeBuilder.Register(&AppRollout{}, &AppRolloutList{})
|
||||
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})
|
||||
}
|
||||
2383
apis/core.oam.dev/v1alpha2/zz_generated.deepcopy.go
Normal file
2383
apis/core.oam.dev/v1alpha2/zz_generated.deepcopy.go
Normal file
File diff suppressed because it is too large
Load Diff
176
apis/core.oam.dev/v1beta1/appdeployment_types.go
Normal file
176
apis/core.oam.dev/v1beta1/appdeployment_types.go
Normal file
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
)
|
||||
|
||||
// AppDeploymentPhase defines the phase that the AppDeployment is undergoing.
|
||||
type AppDeploymentPhase string
|
||||
|
||||
const (
|
||||
// PhaseRolling is the phase when the AppDeployment is rolling live instances from old revisions to new ones.
|
||||
PhaseRolling AppDeploymentPhase = "Rolling"
|
||||
|
||||
// PhaseCompleted is the phase when the AppDeployment is done with reconciliation.
|
||||
PhaseCompleted AppDeploymentPhase = "Completed"
|
||||
|
||||
// PhaseFailed is the phase when the AppDeployment has failed in reconciliation due to unexpected conditions.
|
||||
PhaseFailed AppDeploymentPhase = "Failed"
|
||||
)
|
||||
|
||||
// HTTPMatchRequest specifies a set of criterion to be met in order for the
|
||||
// rule to be applied to the HTTP request. For example, the following
|
||||
// restricts the rule to match only requests where the URL path
|
||||
// starts with /ratings/v2/ and the request contains a custom `end-user` header
|
||||
// with value `jason`.
|
||||
type HTTPMatchRequest struct {
|
||||
// URI defines how to match with an URI.
|
||||
URI *URIMatch `json:"uri,omitempty"`
|
||||
}
|
||||
|
||||
// URIMatch defines the rules to match with an URI.
|
||||
type URIMatch struct {
|
||||
Prefix string `json:"prefix,omitempty"`
|
||||
}
|
||||
|
||||
// HTTPRule defines the rules to match and split http traffic across revisions.
|
||||
type HTTPRule struct {
|
||||
|
||||
// Match defines the conditions to be satisfied for the rule to be
|
||||
// activated. All conditions inside a single match block have AND
|
||||
// semantics, while the list of match blocks have OR semantics. The rule
|
||||
// is matched if any one of the match blocks succeed.
|
||||
Match []*HTTPMatchRequest `json:"match,omitempty"`
|
||||
|
||||
// WeightedTargets defines the revision targets to select and route traffic to.
|
||||
WeightedTargets []WeightedTarget `json:"weightedTargets,omitempty"`
|
||||
}
|
||||
|
||||
// WeightedTarget defines the revision target to select and route traffic to.
|
||||
type WeightedTarget struct {
|
||||
|
||||
// RevisionName is the name of the app revision.
|
||||
RevisionName string `json:"revisionName,omitempty"`
|
||||
|
||||
// ComponentName is the name of the component.
|
||||
// Note that it is the original component name in the Application. No need to append revision.
|
||||
ComponentName string `json:"componentName,omitempty"`
|
||||
|
||||
// Port is the port to route traffic towards.
|
||||
Port int `json:"port,omitempty"`
|
||||
|
||||
// Weight defines the proportion of traffic to be forwarded to the service
|
||||
// version. (0-100). Sum of weights across destinations SHOULD BE == 100.
|
||||
// If there is only one destination in a rule, the weight value is assumed to
|
||||
// be 100.
|
||||
Weight int `json:"weight,omitempty"`
|
||||
}
|
||||
|
||||
// Traffic defines the traffic rules to apply across revisions.
|
||||
type Traffic struct {
|
||||
// Hosts are the destination hosts to which traffic is being sent. Could
|
||||
// be a DNS name with wildcard prefix or an IP address.
|
||||
Hosts []string `json:"hosts,omitempty"`
|
||||
|
||||
// Gateways specifies the names of gateways that should apply these rules.
|
||||
// Gateways in other namespaces may be referred to by
|
||||
// `<gateway namespace>/<gateway name>`; specifying a gateway with no
|
||||
// namespace qualifier is the same as specifying the AppDeployment's namespace.
|
||||
Gateways []string `json:"gateways,omitempty"`
|
||||
|
||||
// HTTP defines the rules to match and split http traffoc across revisions.
|
||||
HTTP []HTTPRule `json:"http,omitempty"`
|
||||
}
|
||||
|
||||
// AppRevision specifies an AppRevision resource to and the rules to apply to it.
|
||||
type AppRevision struct {
|
||||
// RevisionName is the name of the AppRevision.
|
||||
RevisionName string `json:"revisionName,omitempty"`
|
||||
|
||||
// Placement defines the cluster placement rules for an app revision.
|
||||
Placement []common.ClusterPlacement `json:"placement,omitempty"`
|
||||
}
|
||||
|
||||
// ClusterPlacementStatus shows the placement results of a cluster.
|
||||
type ClusterPlacementStatus struct {
|
||||
// ClusterName indicates the name of the cluster to deploy apps to.
|
||||
// If empty, it indicates the host cluster per se.
|
||||
ClusterName string `json:"clusterName,omitempty"`
|
||||
|
||||
// Replicas indicates the replica number of an app revision to deploy to a cluster.
|
||||
Replicas int `json:"replicas,omitempty"`
|
||||
}
|
||||
|
||||
// PlacementStatus shows the cluster placement results of an app revision.
|
||||
type PlacementStatus struct {
|
||||
// RevisionName is the name of the AppRevision.
|
||||
RevisionName string `json:"revisionName,omitempty"`
|
||||
|
||||
// Clusters shows cluster placement results.
|
||||
Clusters []ClusterPlacementStatus `json:"clusters,omitempty"`
|
||||
}
|
||||
|
||||
// AppDeploymentSpec defines how to describe an upgrade between different apps
|
||||
type AppDeploymentSpec struct {
|
||||
|
||||
// Traffic defines the traffic rules to apply across revisions.
|
||||
Traffic *Traffic `json:"traffic,omitempty"`
|
||||
|
||||
// AppRevision specifies AppRevision resources to and the rules to apply to them.
|
||||
AppRevisions []AppRevision `json:"appRevisions,omitempty"`
|
||||
}
|
||||
|
||||
// AppDeploymentStatus defines the observed state of AppDeployment
|
||||
type AppDeploymentStatus struct {
|
||||
// Conditions represents the latest available observations of a CloneSet's current state.
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
|
||||
// Phase shows the phase that the AppDeployment is undergoing.
|
||||
// If Phase is Rolling, no update should be made to the spec.
|
||||
Phase AppDeploymentPhase `json:"phase,omitempty"`
|
||||
|
||||
// Placement shows the cluster placement results of the app revisions.
|
||||
Placement []PlacementStatus `json:"placement,omitempty"`
|
||||
}
|
||||
|
||||
// AppDeployment is the Schema for the AppDeployment API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam},shortName=appdeploy
|
||||
// +kubebuilder:subresource:status
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type AppDeployment struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec AppDeploymentSpec `json:"spec,omitempty"`
|
||||
Status AppDeploymentStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// AppDeploymentList contains a list of AppDeployment
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type AppDeploymentList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []AppDeployment `json:"items"`
|
||||
}
|
||||
146
apis/core.oam.dev/v1beta1/application_types.go
Normal file
146
apis/core.oam.dev/v1beta1/application_types.go
Normal file
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
|
||||
)
|
||||
|
||||
const (
|
||||
// TypeHealthy application are believed to be determined as healthy by a health scope.
|
||||
TypeHealthy condition.ConditionType = "Healthy"
|
||||
)
|
||||
|
||||
// Reasons an application is or is not healthy
|
||||
const (
|
||||
ReasonHealthy condition.ConditionReason = "AllComponentsHealthy"
|
||||
ReasonUnhealthy condition.ConditionReason = "UnhealthyOrUnknownComponents"
|
||||
ReasonHealthCheckErr condition.ConditionReason = "HealthCheckeError"
|
||||
)
|
||||
|
||||
// AppPolicy defines a global policy for all components in the app.
|
||||
type AppPolicy struct {
|
||||
// Name is the unique name of the policy.
|
||||
Name string `json:"name"`
|
||||
|
||||
Type string `json:"type"`
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Properties *runtime.RawExtension `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// WorkflowStep defines how to execute a workflow step.
|
||||
type WorkflowStep struct {
|
||||
// Name is the unique name of the workflow step.
|
||||
Name string `json:"name"`
|
||||
|
||||
Type string `json:"type"`
|
||||
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Properties *runtime.RawExtension `json:"properties,omitempty"`
|
||||
|
||||
DependsOn []string `json:"dependsOn,omitempty"`
|
||||
|
||||
Inputs common.StepInputs `json:"inputs,omitempty"`
|
||||
|
||||
Outputs common.StepOutputs `json:"outputs,omitempty"`
|
||||
}
|
||||
|
||||
// Workflow defines workflow steps and other attributes
|
||||
type Workflow struct {
|
||||
Steps []WorkflowStep `json:"steps,omitempty"`
|
||||
}
|
||||
|
||||
// ApplicationSpec is the spec of Application
|
||||
type ApplicationSpec struct {
|
||||
Components []common.ApplicationComponent `json:"components"`
|
||||
|
||||
// Policies defines the global policies for all components in the app, e.g. security, metrics, gitops,
|
||||
// multi-cluster placement rules, etc.
|
||||
// Policies are applied after components are rendered and before workflow steps are executed.
|
||||
Policies []AppPolicy `json:"policies,omitempty"`
|
||||
|
||||
// Workflow defines how to customize the control logic.
|
||||
// If workflow is specified, Vela won't apply any resource, but provide rendered output in AppRevision.
|
||||
// Workflow steps are executed in array order, and each step:
|
||||
// - will have a context in annotation.
|
||||
// - should mark "finish" phase in status.conditions.
|
||||
Workflow *Workflow `json:"workflow,omitempty"`
|
||||
|
||||
// TODO(wonderflow): we should have application level scopes supported here
|
||||
|
||||
// RolloutPlan is the details on how to rollout the resources
|
||||
// The controller simply replace the old resources with the new one if there is no rollout plan involved
|
||||
// +optional
|
||||
RolloutPlan *v1alpha1.RolloutPlan `json:"rolloutPlan,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// Application is the Schema for the applications API
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:resource:categories={oam},shortName=app
|
||||
// +kubebuilder:printcolumn:name="COMPONENT",type=string,JSONPath=`.spec.components[*].name`
|
||||
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.spec.components[*].type`
|
||||
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.status`
|
||||
// +kubebuilder:printcolumn:name="HEALTHY",type=boolean,JSONPath=`.status.services[*].healthy`
|
||||
// +kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.services[*].message`
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type Application struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ApplicationSpec `json:"spec,omitempty"`
|
||||
Status common.AppStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ApplicationList contains a list of Application
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type ApplicationList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Application `json:"items"`
|
||||
}
|
||||
|
||||
// SetConditions set condition to application
|
||||
func (app *Application) SetConditions(c ...condition.Condition) {
|
||||
app.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition get condition by given condition type
|
||||
func (app *Application) GetCondition(t condition.ConditionType) condition.Condition {
|
||||
return app.Status.GetCondition(t)
|
||||
}
|
||||
|
||||
// GetComponent get the component from the application based on its workload type
|
||||
func (app *Application) GetComponent(workloadType string) *common.ApplicationComponent {
|
||||
for _, c := range app.Spec.Components {
|
||||
if c.Type == workloadType {
|
||||
return &c
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
93
apis/core.oam.dev/v1beta1/applicationrevision_types.go
Normal file
93
apis/core.oam.dev/v1beta1/applicationrevision_types.go
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
// ApplicationRevisionSpec is the spec of ApplicationRevision
|
||||
type ApplicationRevisionSpec struct {
|
||||
// Application records the snapshot of the created/modified Application
|
||||
Application Application `json:"application"`
|
||||
|
||||
// ComponentDefinitions records the snapshot of the componentDefinitions related with the created/modified Application
|
||||
ComponentDefinitions map[string]ComponentDefinition `json:"componentDefinitions,omitempty"`
|
||||
|
||||
// WorkloadDefinitions records the snapshot of the workloadDefinitions related with the created/modified Application
|
||||
WorkloadDefinitions map[string]WorkloadDefinition `json:"workloadDefinitions,omitempty"`
|
||||
|
||||
// TraitDefinitions records the snapshot of the traitDefinitions related with the created/modified Application
|
||||
TraitDefinitions map[string]TraitDefinition `json:"traitDefinitions,omitempty"`
|
||||
|
||||
// ScopeDefinitions records the snapshot of the scopeDefinitions related with the created/modified Application
|
||||
ScopeDefinitions map[string]ScopeDefinition `json:"scopeDefinitions,omitempty"`
|
||||
|
||||
// PolicyDefinitions records the snapshot of the PolicyDefinitions related with the created/modified Application
|
||||
PolicyDefinitions map[string]PolicyDefinition `json:"policyDefinitions,omitempty"`
|
||||
|
||||
// WorkflowStepDefinitions records the snapshot of the WorkflowStepDefinitions related with the created/modified Application
|
||||
WorkflowStepDefinitions map[string]WorkflowStepDefinition `json:"workflowStepDefinitions,omitempty"`
|
||||
|
||||
// ScopeGVK records the apiVersion to GVK mapping
|
||||
ScopeGVK map[string]metav1.GroupVersionKind `json:"scopeGVK,omitempty"`
|
||||
|
||||
// Components records the rendered components from Application, it will contains the whole K8s CR of workload in it.
|
||||
// +deprecated
|
||||
Components []common.RawComponent `json:"components,omitempty"`
|
||||
|
||||
// ApplicationConfiguration records the rendered applicationConfiguration from Application,
|
||||
// it will contains the whole K8s CR of trait and the reference component in it.
|
||||
// +kubebuilder:validation:EmbeddedResource
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
// +deprecated
|
||||
ApplicationConfiguration runtime.RawExtension `json:"applicationConfiguration,omitempty"`
|
||||
|
||||
// ResourcesConfigMap references the ConfigMap that's generated to contain all final rendered resources.
|
||||
ResourcesConfigMap corev1.LocalObjectReference `json:"resourcesConfigMap,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ApplicationRevision is the Schema for the ApplicationRevision API
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:resource:categories={oam},shortName=apprev
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type ApplicationRevision struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ApplicationRevisionSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ApplicationRevisionList contains a list of ApplicationRevision
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type ApplicationRevisionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ApplicationRevision `json:"items"`
|
||||
}
|
||||
81
apis/core.oam.dev/v1beta1/approllout_types.go
Normal file
81
apis/core.oam.dev/v1beta1/approllout_types.go
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
|
||||
)
|
||||
|
||||
// AppRolloutSpec defines how to describe an upgrade between different apps
|
||||
type AppRolloutSpec struct {
|
||||
// TargetAppRevisionName contains the name of the applicationConfiguration that we need to upgrade to.
|
||||
// Here we use an applicationConfiguration as a revision of an application, thus the name alone is suffice
|
||||
TargetAppRevisionName string `json:"targetAppRevisionName"`
|
||||
|
||||
// SourceAppRevisionName contains the name of the applicationConfiguration that we need to upgrade from.
|
||||
// it can be empty only when it's the first time to deploy the application
|
||||
SourceAppRevisionName string `json:"sourceAppRevisionName,omitempty"`
|
||||
|
||||
// The list of component to upgrade in the application.
|
||||
// We only support single component application so far
|
||||
// TODO: (RZ) Support multiple components in an application
|
||||
// +optional
|
||||
ComponentList []string `json:"componentList,omitempty"`
|
||||
|
||||
// RolloutPlan is the details on how to rollout the resources
|
||||
RolloutPlan v1alpha1.RolloutPlan `json:"rolloutPlan"`
|
||||
|
||||
// RevertOnDelete revert the failed rollout when the rollout CR is deleted
|
||||
// It will revert the change back to the source version at once (not in batches)
|
||||
// Default is false
|
||||
// +optional
|
||||
RevertOnDelete bool `json:"revertOnDelete,omitempty"`
|
||||
}
|
||||
|
||||
// AppRollout is the Schema for the AppRollout API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam},shortName=approllout
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:printcolumn:name="TARGET",type=string,JSONPath=`.status.rolloutTargetSize`
|
||||
// +kubebuilder:printcolumn:name="UPGRADED",type=string,JSONPath=`.status.upgradedReplicas`
|
||||
// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.upgradedReadyReplicas`
|
||||
// +kubebuilder:printcolumn:name="BATCH-STATE",type=string,JSONPath=`.status.batchRollingState`
|
||||
// +kubebuilder:printcolumn:name="ROLLING-STATE",type=string,JSONPath=`.status.rollingState`
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type AppRollout struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec AppRolloutSpec `json:"spec,omitempty"`
|
||||
Status common.AppRolloutStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// AppRolloutList contains a list of AppRollout
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type AppRolloutList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []AppRollout `json:"items"`
|
||||
}
|
||||
64
apis/core.oam.dev/v1beta1/cluster_types.go
Normal file
64
apis/core.oam.dev/v1beta1/cluster_types.go
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
// ClusterSpec defines the desired state of Cluster
|
||||
type ClusterSpec struct {
|
||||
// KubeconfigSecretRef specifies the reference to the secret
|
||||
// that contains the kubeconfig in field `config`.
|
||||
KubeconfigSecretRef LocalSecretReference `json:"kubeconfigSecretRef,omitempty"`
|
||||
}
|
||||
|
||||
// LocalSecretReference is a reference to a secret within the enclosing
|
||||
// namespace.
|
||||
type LocalSecretReference struct {
|
||||
// Name of a secret within the enclosing namespace.
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// ClusterStatus defines the observed state of Cluster
|
||||
type ClusterStatus struct {
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// Cluster is the Schema for the clusters API
|
||||
type Cluster struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ClusterSpec `json:"spec,omitempty"`
|
||||
Status ClusterStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// ClusterList contains a list of Cluster
|
||||
type ClusterList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Cluster `json:"items"`
|
||||
}
|
||||
107
apis/core.oam.dev/v1beta1/componentdefinition_types.go
Normal file
107
apis/core.oam.dev/v1beta1/componentdefinition_types.go
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
|
||||
// ComponentDefinitionSpec defines the desired state of ComponentDefinition
|
||||
type ComponentDefinitionSpec struct {
|
||||
// Workload is a workload type descriptor
|
||||
Workload common.WorkloadTypeDescriptor `json:"workload"`
|
||||
|
||||
// ChildResourceKinds are the list of GVK of the child resources this workload generates
|
||||
ChildResourceKinds []common.ChildResourceKind `json:"childResourceKinds,omitempty"`
|
||||
|
||||
// RevisionLabel indicates which label for underlying resources(e.g. pods) of this workload
|
||||
// can be used by trait to create resource selectors(e.g. label selector for pods).
|
||||
// +optional
|
||||
RevisionLabel string `json:"revisionLabel,omitempty"`
|
||||
|
||||
// PodSpecPath indicates where/if this workload has K8s podSpec field
|
||||
// if one workload has podSpec, trait can do lot's of assumption such as port, env, volume fields.
|
||||
// +optional
|
||||
PodSpecPath string `json:"podSpecPath,omitempty"`
|
||||
|
||||
// Status defines the custom health policy and status message for workload
|
||||
// +optional
|
||||
Status *common.Status `json:"status,omitempty"`
|
||||
|
||||
// Schematic defines the data format and template of the encapsulation of the workload
|
||||
// +optional
|
||||
Schematic *common.Schematic `json:"schematic,omitempty"`
|
||||
|
||||
// Extension is used for extension needs by OAM platform builders
|
||||
// +optional
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Extension *runtime.RawExtension `json:"extension,omitempty"`
|
||||
}
|
||||
|
||||
// ComponentDefinitionStatus is the status of ComponentDefinition
|
||||
type ComponentDefinitionStatus struct {
|
||||
// ConditionedStatus reflects the observed status of a resource
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
|
||||
ConfigMapRef string `json:"configMapRef,omitempty"`
|
||||
// LatestRevision of the component definition
|
||||
// +optional
|
||||
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ComponentDefinition is the Schema for the componentdefinitions API
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=comp
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="WORKLOAD-KIND",type=string,JSONPath=".spec.workload.definition.kind"
|
||||
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type ComponentDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ComponentDefinitionSpec `json:"spec,omitempty"`
|
||||
Status ComponentDefinitionStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// SetConditions set condition for ComponentDefinition
|
||||
func (cd *ComponentDefinition) SetConditions(c ...condition.Condition) {
|
||||
cd.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition gets condition from ComponentDefinition
|
||||
func (cd *ComponentDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
|
||||
return cd.Status.GetCondition(conditionType)
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// ComponentDefinitionList contains a list of ComponentDefinition
|
||||
type ComponentDefinitionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ComponentDefinition `json:"items"`
|
||||
}
|
||||
20
apis/core.oam.dev/v1beta1/conversion.go
Normal file
20
apis/core.oam.dev/v1beta1/conversion.go
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
// Hub marks this type as a conversion hub.
|
||||
func (*Application) Hub() {}
|
||||
288
apis/core.oam.dev/v1beta1/core_types.go
Normal file
288
apis/core.oam.dev/v1beta1/core_types.go
Normal file
@@ -0,0 +1,288 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
|
||||
// A WorkloadDefinitionSpec defines the desired state of a WorkloadDefinition.
|
||||
type WorkloadDefinitionSpec struct {
|
||||
// Reference to the CustomResourceDefinition that defines this workload kind.
|
||||
Reference common.DefinitionReference `json:"definitionRef"`
|
||||
|
||||
// ChildResourceKinds are the list of GVK of the child resources this workload generates
|
||||
ChildResourceKinds []common.ChildResourceKind `json:"childResourceKinds,omitempty"`
|
||||
|
||||
// RevisionLabel indicates which label for underlying resources(e.g. pods) of this workload
|
||||
// can be used by trait to create resource selectors(e.g. label selector for pods).
|
||||
// +optional
|
||||
RevisionLabel string `json:"revisionLabel,omitempty"`
|
||||
|
||||
// PodSpecPath indicates where/if this workload has K8s podSpec field
|
||||
// if one workload has podSpec, trait can do lot's of assumption such as port, env, volume fields.
|
||||
// +optional
|
||||
PodSpecPath string `json:"podSpecPath,omitempty"`
|
||||
|
||||
// Status defines the custom health policy and status message for workload
|
||||
// +optional
|
||||
Status *common.Status `json:"status,omitempty"`
|
||||
|
||||
// Schematic defines the data format and template of the encapsulation of the workload
|
||||
// +optional
|
||||
Schematic *common.Schematic `json:"schematic,omitempty"`
|
||||
|
||||
// Extension is used for extension needs by OAM platform builders
|
||||
// +optional
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Extension *runtime.RawExtension `json:"extension,omitempty"`
|
||||
}
|
||||
|
||||
// WorkloadDefinitionStatus is the status of WorkloadDefinition
|
||||
type WorkloadDefinitionStatus struct {
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// A WorkloadDefinition registers a kind of Kubernetes custom resource as a
|
||||
// valid OAM workload kind by referencing its CustomResourceDefinition. The CRD
|
||||
// is used to validate the schema of the workload when it is embedded in an OAM
|
||||
// Component.
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=workload
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:printcolumn:name="DEFINITION-NAME",type=string,JSONPath=".spec.definitionRef.name"
|
||||
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type WorkloadDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec WorkloadDefinitionSpec `json:"spec,omitempty"`
|
||||
Status WorkloadDefinitionStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// SetConditions set condition for WorkloadDefinition
|
||||
func (wd *WorkloadDefinition) SetConditions(c ...condition.Condition) {
|
||||
wd.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition gets condition from WorkloadDefinition
|
||||
func (wd *WorkloadDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
|
||||
return wd.Status.GetCondition(conditionType)
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// WorkloadDefinitionList contains a list of WorkloadDefinition.
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type WorkloadDefinitionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []WorkloadDefinition `json:"items"`
|
||||
}
|
||||
|
||||
// A TraitDefinitionSpec defines the desired state of a TraitDefinition.
|
||||
type TraitDefinitionSpec struct {
|
||||
// Reference to the CustomResourceDefinition that defines this trait kind.
|
||||
Reference common.DefinitionReference `json:"definitionRef,omitempty"`
|
||||
|
||||
// Revision indicates whether a trait is aware of component revision
|
||||
// +optional
|
||||
RevisionEnabled bool `json:"revisionEnabled,omitempty"`
|
||||
|
||||
// WorkloadRefPath indicates where/if a trait accepts a workloadRef object
|
||||
// +optional
|
||||
WorkloadRefPath string `json:"workloadRefPath,omitempty"`
|
||||
|
||||
// PodDisruptive specifies whether using the trait will cause the pod to restart or not.
|
||||
// +optional
|
||||
PodDisruptive bool `json:"podDisruptive,omitempty"`
|
||||
|
||||
// AppliesToWorkloads specifies the list of workload kinds this trait
|
||||
// applies to. Workload kinds are specified in kind.group/version format,
|
||||
// e.g. server.core.oam.dev/v1alpha2. Traits that omit this field apply to
|
||||
// all workload kinds.
|
||||
// +optional
|
||||
AppliesToWorkloads []string `json:"appliesToWorkloads,omitempty"`
|
||||
|
||||
// ConflictsWith specifies the list of traits(CRD name, Definition name, CRD group)
|
||||
// which could not apply to the same workloads with this trait.
|
||||
// Traits that omit this field can work with any other traits.
|
||||
// Example rules:
|
||||
// "service" # Trait definition name
|
||||
// "services.k8s.io" # API resource/crd name
|
||||
// "*.networking.k8s.io" # API group
|
||||
// "labelSelector:foo=bar" # label selector
|
||||
// labelSelector format: https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse
|
||||
// +optional
|
||||
ConflictsWith []string `json:"conflictsWith,omitempty"`
|
||||
|
||||
// Schematic defines the data format and template of the encapsulation of the trait
|
||||
// +optional
|
||||
Schematic *common.Schematic `json:"schematic,omitempty"`
|
||||
|
||||
// Status defines the custom health policy and status message for trait
|
||||
// +optional
|
||||
Status *common.Status `json:"status,omitempty"`
|
||||
|
||||
// Extension is used for extension needs by OAM platform builders
|
||||
// +optional
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Extension *runtime.RawExtension `json:"extension,omitempty"`
|
||||
|
||||
// ManageWorkload defines the trait would be responsible for creating the workload
|
||||
// +optional
|
||||
ManageWorkload bool `json:"manageWorkload,omitempty"`
|
||||
// SkipRevisionAffect defines the update this trait will not generate a new application Revision
|
||||
// +optional
|
||||
SkipRevisionAffect bool `json:"skipRevisionAffect,omitempty"`
|
||||
}
|
||||
|
||||
// TraitDefinitionStatus is the status of TraitDefinition
|
||||
type TraitDefinitionStatus struct {
|
||||
// ConditionedStatus reflects the observed status of a resource
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
|
||||
ConfigMapRef string `json:"configMapRef,omitempty"`
|
||||
// LatestRevision of the component definition
|
||||
// +optional
|
||||
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// A TraitDefinition registers a kind of Kubernetes custom resource as a valid
|
||||
// OAM trait kind by referencing its CustomResourceDefinition. The CRD is used
|
||||
// to validate the schema of the trait when it is embedded in an OAM
|
||||
// ApplicationConfiguration.
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=trait
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:printcolumn:name="APPLIES-TO",type=string,JSONPath=".spec.appliesToWorkloads"
|
||||
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type TraitDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec TraitDefinitionSpec `json:"spec,omitempty"`
|
||||
Status TraitDefinitionStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// SetConditions set condition for TraitDefinition
|
||||
func (td *TraitDefinition) SetConditions(c ...condition.Condition) {
|
||||
td.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition gets condition from TraitDefinition
|
||||
func (td *TraitDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
|
||||
return td.Status.GetCondition(conditionType)
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// TraitDefinitionList contains a list of TraitDefinition.
|
||||
type TraitDefinitionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []TraitDefinition `json:"items"`
|
||||
}
|
||||
|
||||
// A ScopeDefinitionSpec defines the desired state of a ScopeDefinition.
|
||||
type ScopeDefinitionSpec struct {
|
||||
// Reference to the CustomResourceDefinition that defines this scope kind.
|
||||
Reference common.DefinitionReference `json:"definitionRef"`
|
||||
|
||||
// WorkloadRefsPath indicates if/where a scope accepts workloadRef objects
|
||||
WorkloadRefsPath string `json:"workloadRefsPath,omitempty"`
|
||||
|
||||
// AllowComponentOverlap specifies whether an OAM component may exist in
|
||||
// multiple instances of this kind of scope.
|
||||
AllowComponentOverlap bool `json:"allowComponentOverlap"`
|
||||
|
||||
// Extension is used for extension needs by OAM platform builders
|
||||
// +optional
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Extension *runtime.RawExtension `json:"extension,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// A ScopeDefinition registers a kind of Kubernetes custom resource as a valid
|
||||
// OAM scope kind by referencing its CustomResourceDefinition. The CRD is used
|
||||
// to validate the schema of the scope when it is embedded in an OAM
|
||||
// ApplicationConfiguration.
|
||||
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=scope
|
||||
// +kubebuilder:storageversion
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type ScopeDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ScopeDefinitionSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// ScopeDefinitionList contains a list of ScopeDefinition.
|
||||
type ScopeDefinitionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ScopeDefinition `json:"items"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// An ResourceTracker represents a tracker for track cross namespace resources
|
||||
// +kubebuilder:resource:scope=Cluster,categories={oam},shortName=tracker
|
||||
type ResourceTracker struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Status ResourceTrackerStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceTrackerStatus define the status of resourceTracker
|
||||
type ResourceTrackerStatus struct {
|
||||
TrackedResources []corev1.ObjectReference `json:"trackedResources,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// ResourceTrackerList contains a list of ResourceTracker
|
||||
type ResourceTrackerList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ResourceTracker `json:"items"`
|
||||
}
|
||||
73
apis/core.oam.dev/v1beta1/definitionrevision_types.go
Normal file
73
apis/core.oam.dev/v1beta1/definitionrevision_types.go
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
|
||||
// DefinitionRevisionSpec is the spec of DefinitionRevision
|
||||
type DefinitionRevisionSpec struct {
|
||||
// Revision record revision number of DefinitionRevision
|
||||
Revision int64 `json:"revision"`
|
||||
|
||||
// RevisionHash record the hash value of the spec of DefinitionRevision object.
|
||||
RevisionHash string `json:"revisionHash"`
|
||||
|
||||
// DefinitionType
|
||||
DefinitionType common.DefinitionType `json:"definitionType"`
|
||||
|
||||
// ComponentDefinition records the snapshot of the created/modified ComponentDefinition
|
||||
ComponentDefinition ComponentDefinition `json:"componentDefinition,omitempty"`
|
||||
|
||||
// TraitDefinition records the snapshot of the created/modified TraitDefinition
|
||||
TraitDefinition TraitDefinition `json:"traitDefinition,omitempty"`
|
||||
|
||||
// PolicyDefinition records the snapshot of the created/modified PolicyDefinition
|
||||
PolicyDefinition PolicyDefinition `json:"policyDefinition,omitempty"`
|
||||
|
||||
// WorkflowStepDefinition records the snapshot of the created/modified WorkflowStepDefinition
|
||||
WorkflowStepDefinition WorkflowStepDefinition `json:"workflowStepDefinition,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// DefinitionRevision is the Schema for the DefinitionRevision API
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=defrev
|
||||
// +kubebuilder:printcolumn:name="REVISION",type=integer,JSONPath=".spec.revision"
|
||||
// +kubebuilder:printcolumn:name="HASH",type=string,JSONPath=".spec.revisionHash"
|
||||
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=".spec.definitionType"
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type DefinitionRevision struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec DefinitionRevisionSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// DefinitionRevisionList contains a list of DefinitionRevision
|
||||
type DefinitionRevisionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []DefinitionRevision `json:"items"`
|
||||
}
|
||||
22
apis/core.oam.dev/v1beta1/doc.go
Normal file
22
apis/core.oam.dev/v1beta1/doc.go
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1beta1 contains resources relating to the Open Application Model.
|
||||
// See https://github.com/oam-dev/spec for more details.
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=core.oam.dev
|
||||
// +versionName=v1beta1
|
||||
package v1beta1
|
||||
100
apis/core.oam.dev/v1beta1/initializer_type.go
Normal file
100
apis/core.oam.dev/v1beta1/initializer_type.go
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
)
|
||||
|
||||
// InitializerPhase is a label for the condition of a initializer at the current time
|
||||
type InitializerPhase string
|
||||
|
||||
const (
|
||||
// InitializerCheckingDependsOn means the initializer is checking the status of dependent Initializer
|
||||
InitializerCheckingDependsOn InitializerPhase = "checkingDependsOn"
|
||||
// InitializerInitializing means the initializer is initializing
|
||||
InitializerInitializing InitializerPhase = "initializing"
|
||||
// InitializerSuccess means the initializer successfully initialized the environment
|
||||
InitializerSuccess InitializerPhase = "success"
|
||||
)
|
||||
|
||||
// DependsOn refer to an object which Initializer depends on
|
||||
type DependsOn struct {
|
||||
Ref corev1.ObjectReference `json:"ref"`
|
||||
}
|
||||
|
||||
// A InitializerSpec defines the desired state of a Initializer.
|
||||
type InitializerSpec struct {
|
||||
// AppTemplate indicates the application template to render and deploy an system application.
|
||||
AppTemplate Application `json:"appTemplate"`
|
||||
|
||||
// DependsOn indicates the other initializers that this depends on.
|
||||
// It will not apply its components until all dependencies exist.
|
||||
DependsOn []DependsOn `json:"dependsOn,omitempty"`
|
||||
}
|
||||
|
||||
// InitializerStatus is the status of Initializer
|
||||
type InitializerStatus struct {
|
||||
// ConditionedStatus reflects the observed status of a resource
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
|
||||
Phase InitializerPhase `json:"status,omitempty"`
|
||||
|
||||
// The generation observed by the Initializer controller.
|
||||
// +optional
|
||||
ObservedGeneration int64 `json:"observedGeneration"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// Initializer is the Schema for the Initializer API
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=init
|
||||
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.status`
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type Initializer struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec InitializerSpec `json:"spec,omitempty"`
|
||||
Status InitializerStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// InitializerList contains a list of Initializer.
|
||||
type InitializerList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Initializer `json:"items"`
|
||||
}
|
||||
|
||||
// SetConditions set condition for Initializer
|
||||
func (i *Initializer) SetConditions(c ...condition.Condition) {
|
||||
i.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition gets condition from Initializer
|
||||
func (i *Initializer) GetCondition(conditionType condition.ConditionType) condition.Condition {
|
||||
return i.Status.GetCondition(conditionType)
|
||||
}
|
||||
85
apis/core.oam.dev/v1beta1/policy_definition.go
Normal file
85
apis/core.oam.dev/v1beta1/policy_definition.go
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
|
||||
// PolicyDefinitionSpec defines the desired state of PolicyDefinition
|
||||
type PolicyDefinitionSpec struct {
|
||||
// Reference to the CustomResourceDefinition that defines this trait kind.
|
||||
Reference common.DefinitionReference `json:"definitionRef,omitempty"`
|
||||
|
||||
// Schematic defines the data format and template of the encapsulation of the policy definition
|
||||
// +optional
|
||||
Schematic *common.Schematic `json:"schematic,omitempty"`
|
||||
|
||||
// ManageHealthCheck means the policy will handle health checking and skip application controller
|
||||
// built-in health checking.
|
||||
ManageHealthCheck bool `json:"manageHealthCheck,omitempty"`
|
||||
}
|
||||
|
||||
// PolicyDefinitionStatus is the status of PolicyDefinition
|
||||
type PolicyDefinitionStatus struct {
|
||||
// ConditionedStatus reflects the observed status of a resource
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
|
||||
// LatestRevision of the component definition
|
||||
// +optional
|
||||
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
|
||||
}
|
||||
|
||||
// SetConditions set condition for PolicyDefinition
|
||||
func (d *PolicyDefinition) SetConditions(c ...condition.Condition) {
|
||||
d.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition gets condition from PolicyDefinition
|
||||
func (d *PolicyDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
|
||||
return d.Status.GetCondition(conditionType)
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// PolicyDefinition is the Schema for the policydefinitions API
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=policy
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:subresource:status
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type PolicyDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec PolicyDefinitionSpec `json:"spec,omitempty"`
|
||||
Status PolicyDefinitionStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// PolicyDefinitionList contains a list of PolicyDefinition
|
||||
type PolicyDefinitionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []PolicyDefinition `json:"items"`
|
||||
}
|
||||
175
apis/core.oam.dev/v1beta1/register.go
Normal file
175
apis/core.oam.dev/v1beta1/register.go
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
// Package type metadata.
|
||||
const (
|
||||
Group = "core.oam.dev"
|
||||
Version = "v1beta1"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
|
||||
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// ComponentDefinition type metadata.
|
||||
var (
|
||||
ComponentDefinitionKind = reflect.TypeOf(ComponentDefinition{}).Name()
|
||||
ComponentDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: ComponentDefinitionKind}.String()
|
||||
ComponentDefinitionKindAPIVersion = ComponentDefinitionKind + "." + SchemeGroupVersion.String()
|
||||
ComponentDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(ComponentDefinitionKind)
|
||||
)
|
||||
|
||||
// WorkloadDefinition type metadata.
|
||||
var (
|
||||
WorkloadDefinitionKind = reflect.TypeOf(WorkloadDefinition{}).Name()
|
||||
WorkloadDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: WorkloadDefinitionKind}.String()
|
||||
WorkloadDefinitionKindAPIVersion = WorkloadDefinitionKind + "." + SchemeGroupVersion.String()
|
||||
WorkloadDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(WorkloadDefinitionKind)
|
||||
)
|
||||
|
||||
// TraitDefinition type metadata.
|
||||
var (
|
||||
TraitDefinitionKind = reflect.TypeOf(TraitDefinition{}).Name()
|
||||
TraitDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: TraitDefinitionKind}.String()
|
||||
TraitDefinitionKindAPIVersion = TraitDefinitionKind + "." + SchemeGroupVersion.String()
|
||||
TraitDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(TraitDefinitionKind)
|
||||
)
|
||||
|
||||
// PolicyDefinition type metadata.
|
||||
var (
|
||||
PolicyDefinitionKind = reflect.TypeOf(PolicyDefinition{}).Name()
|
||||
PolicyDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: PolicyDefinitionKind}.String()
|
||||
PolicyDefinitionKindAPIVersion = PolicyDefinitionKind + "." + SchemeGroupVersion.String()
|
||||
PolicyDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(PolicyDefinitionKind)
|
||||
)
|
||||
|
||||
// WorkflowStepDefinition type metadata.
|
||||
var (
|
||||
WorkflowStepDefinitionKind = reflect.TypeOf(WorkflowStepDefinition{}).Name()
|
||||
WorkflowStepDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: WorkflowStepDefinitionKind}.String()
|
||||
WorkflowStepDefinitionKindAPIVersion = WorkflowStepDefinitionKind + "." + SchemeGroupVersion.String()
|
||||
WorkflowStepDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(WorkflowStepDefinitionKind)
|
||||
)
|
||||
|
||||
// DefinitionRevision type metadata.
|
||||
var (
|
||||
DefinitionRevisionKind = reflect.TypeOf(DefinitionRevision{}).Name()
|
||||
DefinitionRevisionGroupKind = schema.GroupKind{Group: Group, Kind: DefinitionRevisionKind}.String()
|
||||
DefinitionRevisionKindAPIVersion = DefinitionRevisionKind + "." + SchemeGroupVersion.String()
|
||||
DefinitionRevisionGroupVersionKind = SchemeGroupVersion.WithKind(DefinitionRevisionKind)
|
||||
)
|
||||
|
||||
// Application type metadata.
|
||||
var (
|
||||
ApplicationKind = reflect.TypeOf(Application{}).Name()
|
||||
ApplicationGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationKind}.String()
|
||||
ApplicationKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
|
||||
ApplicationKindVersionKind = SchemeGroupVersion.WithKind(ApplicationKind)
|
||||
)
|
||||
|
||||
// AppRollout type metadata.
|
||||
var (
|
||||
AppRolloutKind = reflect.TypeOf(AppRollout{}).Name()
|
||||
AppRolloutGroupKind = schema.GroupKind{Group: Group, Kind: AppRolloutKind}.String()
|
||||
AppRolloutKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
|
||||
AppRolloutKindVersionKind = SchemeGroupVersion.WithKind(AppRolloutKind)
|
||||
)
|
||||
|
||||
// ApplicationRevision type metadata
|
||||
var (
|
||||
ApplicationRevisionKind = reflect.TypeOf(ApplicationRevision{}).Name()
|
||||
ApplicationRevisionGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationRevisionKind}.String()
|
||||
ApplicationRevisionKindAPIVersion = ApplicationRevisionKind + "." + SchemeGroupVersion.String()
|
||||
ApplicationRevisionGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationRevisionKind)
|
||||
)
|
||||
|
||||
// ScopeDefinition type metadata.
|
||||
var (
|
||||
ScopeDefinitionKind = reflect.TypeOf(ScopeDefinition{}).Name()
|
||||
ScopeDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: ScopeDefinitionKind}.String()
|
||||
ScopeDefinitionKindAPIVersion = ScopeDefinitionKind + "." + SchemeGroupVersion.String()
|
||||
ScopeDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(ScopeDefinitionKind)
|
||||
)
|
||||
|
||||
// ResourceTracker type metadata.
|
||||
var (
|
||||
ResourceTrackerKind = reflect.TypeOf(ResourceTracker{}).Name()
|
||||
ResourceTrackerGroupKind = schema.GroupKind{Group: Group, Kind: ResourceTrackerKind}.String()
|
||||
ResourceTrackerKindAPIVersion = ResourceTrackerKind + "." + SchemeGroupVersion.String()
|
||||
ResourceTrackerKindVersionKind = SchemeGroupVersion.WithKind(ResourceTrackerKind)
|
||||
)
|
||||
|
||||
// AppDeployment type metadata.
|
||||
var (
|
||||
AppDeploymentKind = reflect.TypeOf(AppDeployment{}).Name()
|
||||
AppDeploymentGroupKind = schema.GroupKind{Group: Group, Kind: AppDeploymentKind}.String()
|
||||
AppDeploymentKindAPIVersion = AppDeploymentKind + "." + SchemeGroupVersion.String()
|
||||
AppDeploymentKindVersionKind = SchemeGroupVersion.WithKind(AppDeploymentKind)
|
||||
)
|
||||
|
||||
// Cluster type metadata.
|
||||
var (
|
||||
ClusterKind = reflect.TypeOf(Cluster{}).Name()
|
||||
ClusterGroupKind = schema.GroupKind{Group: Group, Kind: ClusterKind}.String()
|
||||
ClusterKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
|
||||
ClusterKindVersionKind = SchemeGroupVersion.WithKind(ClusterKind)
|
||||
)
|
||||
|
||||
// Initializer type metadata.
|
||||
var (
|
||||
InitializerKind = reflect.TypeOf(Initializer{}).Name()
|
||||
InitializerGroupKind = schema.GroupKind{Group: Group, Kind: InitializerKind}.String()
|
||||
InitializerKindAPIVersion = InitializerKind + "." + SchemeGroupVersion.String()
|
||||
InitializerKindVersionKind = SchemeGroupVersion.WithKind(InitializerKind)
|
||||
)
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&ComponentDefinition{}, &ComponentDefinitionList{})
|
||||
SchemeBuilder.Register(&WorkloadDefinition{}, &WorkloadDefinitionList{})
|
||||
SchemeBuilder.Register(&TraitDefinition{}, &TraitDefinitionList{})
|
||||
SchemeBuilder.Register(&PolicyDefinition{}, &PolicyDefinitionList{})
|
||||
SchemeBuilder.Register(&WorkflowStepDefinition{}, &WorkflowStepDefinitionList{})
|
||||
SchemeBuilder.Register(&DefinitionRevision{}, &DefinitionRevisionList{})
|
||||
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
|
||||
SchemeBuilder.Register(&Application{}, &ApplicationList{})
|
||||
SchemeBuilder.Register(&AppRollout{}, &AppRolloutList{})
|
||||
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})
|
||||
SchemeBuilder.Register(&AppDeployment{}, &AppDeploymentList{})
|
||||
SchemeBuilder.Register(&Cluster{}, &ClusterList{})
|
||||
SchemeBuilder.Register(&ResourceTracker{}, &ResourceTrackerList{})
|
||||
SchemeBuilder.Register(&Initializer{}, &InitializerList{})
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
81
apis/core.oam.dev/v1beta1/workflow_step_definition.go
Normal file
81
apis/core.oam.dev/v1beta1/workflow_step_definition.go
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
Copyright 2021. The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
|
||||
// WorkflowStepDefinitionSpec defines the desired state of WorkflowStepDefinition
|
||||
type WorkflowStepDefinitionSpec struct {
|
||||
// Reference to the CustomResourceDefinition that defines this trait kind.
|
||||
Reference common.DefinitionReference `json:"definitionRef,omitempty"`
|
||||
|
||||
// Schematic defines the data format and template of the encapsulation of the workflow step definition
|
||||
// +optional
|
||||
Schematic *common.Schematic `json:"schematic,omitempty"`
|
||||
}
|
||||
|
||||
// WorkflowStepDefinitionStatus is the status of WorkflowStepDefinition
|
||||
type WorkflowStepDefinitionStatus struct {
|
||||
// ConditionedStatus reflects the observed status of a resource
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
|
||||
// LatestRevision of the component definition
|
||||
// +optional
|
||||
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
|
||||
}
|
||||
|
||||
// SetConditions set condition for WorkflowStepDefinition
|
||||
func (d *WorkflowStepDefinition) SetConditions(c ...condition.Condition) {
|
||||
d.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition gets condition from WorkflowStepDefinition
|
||||
func (d *WorkflowStepDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
|
||||
return d.Status.GetCondition(conditionType)
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// WorkflowStepDefinition is the Schema for the workflowstepdefinitions API
|
||||
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=workflowstep
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:subresource:status
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type WorkflowStepDefinition struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec WorkflowStepDefinitionSpec `json:"spec,omitempty"`
|
||||
Status WorkflowStepDefinitionStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// WorkflowStepDefinitionList contains a list of WorkflowStepDefinition
|
||||
type WorkflowStepDefinitionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []WorkflowStepDefinition `json:"items"`
|
||||
}
|
||||
1701
apis/core.oam.dev/v1beta1/zz_generated.deepcopy.go
Normal file
1701
apis/core.oam.dev/v1beta1/zz_generated.deepcopy.go
Normal file
File diff suppressed because it is too large
Load Diff
35
apis/generate.go
Normal file
35
apis/generate.go
Normal file
@@ -0,0 +1,35 @@
|
||||
// +build generate
|
||||
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// See the below link for details on what is happening here.
|
||||
// https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
|
||||
|
||||
// NOTE(@wonderflow) We don't remove existing CRDs here, because the crd folders contain not only auto generated.
|
||||
|
||||
// Generate deepcopy methodsets and CRD manifests
|
||||
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:crdVersions=v1,generateEmbeddedObjectMeta=true output:artifacts:config=../config/crd/base
|
||||
|
||||
// Generate legacy_support for K8s 1.12~1.15 versions CRD manifests
|
||||
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:generateEmbeddedObjectMeta=true output:artifacts:config=../legacy/charts/vela-core-legacy/crds
|
||||
//go:generate go run ../legacy/convert/main.go ../legacy/charts/vela-core-legacy/crds
|
||||
|
||||
package apis
|
||||
|
||||
import (
|
||||
_ "sigs.k8s.io/controller-tools/cmd/controller-gen" //nolint:typecheck
|
||||
)
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -24,9 +24,16 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
const (
|
||||
// GroupName of the CRDs
|
||||
GroupName = "standard.oam.dev"
|
||||
// Version of the group of CRDs
|
||||
Version = "v1alpha1"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: "standard.oam.dev", Version: "v1alpha1"}
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
|
||||
35
apis/standard.oam.dev/v1alpha1/register.go
Normal file
35
apis/standard.oam.dev/v1alpha1/register.go
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// Rollout type metadata
|
||||
var (
|
||||
RolloutKind = reflect.TypeOf(Rollout{}).Name()
|
||||
RolloutGroupKind = schema.GroupKind{Group: GroupName, Kind: RolloutKind}.String()
|
||||
RolloutKindAPIVersion = RolloutKind + "." + SchemeGroupVersion.String()
|
||||
RolloutKindVersionKind = SchemeGroupVersion.WithKind(RolloutKind)
|
||||
)
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&Rollout{}, &RolloutList{})
|
||||
}
|
||||
285
apis/standard.oam.dev/v1alpha1/rollout_plan_types.go
Normal file
285
apis/standard.oam.dev/v1alpha1/rollout_plan_types.go
Normal file
@@ -0,0 +1,285 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
)
|
||||
|
||||
// RolloutStrategyType defines strategies for pods rollout
|
||||
type RolloutStrategyType string
|
||||
|
||||
const (
|
||||
// IncreaseFirstRolloutStrategyType indicates that we increase the target resources first
|
||||
IncreaseFirstRolloutStrategyType RolloutStrategyType = "IncreaseFirst"
|
||||
|
||||
// DecreaseFirstRolloutStrategyType indicates that we decrease the source resources first
|
||||
DecreaseFirstRolloutStrategyType RolloutStrategyType = "DecreaseFirst"
|
||||
)
|
||||
|
||||
// HookType can be pre, post or during rollout
|
||||
type HookType string
|
||||
|
||||
const (
|
||||
// InitializeRolloutHook execute webhook during the rollout initializing phase
|
||||
InitializeRolloutHook HookType = "initialize-rollout"
|
||||
// PreBatchRolloutHook execute webhook before each batch rollout
|
||||
PreBatchRolloutHook HookType = "pre-batch-rollout"
|
||||
// PostBatchRolloutHook execute webhook after each batch rollout
|
||||
PostBatchRolloutHook HookType = "post-batch-rollout"
|
||||
// FinalizeRolloutHook execute the webhook during the rollout finalizing phase
|
||||
FinalizeRolloutHook HookType = "finalize-rollout"
|
||||
)
|
||||
|
||||
// RollingState is the overall rollout state
|
||||
type RollingState string
|
||||
|
||||
const (
|
||||
// LocatingTargetAppState indicates that the rollout is in the stage of locating target app
|
||||
// we use this state to make sure we special handle the target app successfully only once
|
||||
LocatingTargetAppState RollingState = "locatingTargetApp"
|
||||
// VerifyingSpecState indicates that the rollout is in the stage of verifying the rollout settings
|
||||
// and the controller can locate both the target and the source
|
||||
VerifyingSpecState RollingState = "verifyingSpec"
|
||||
// InitializingState indicates that the rollout is initializing all the new resources
|
||||
InitializingState RollingState = "initializing"
|
||||
// RollingInBatchesState indicates that the rollout starts rolling
|
||||
RollingInBatchesState RollingState = "rollingInBatches"
|
||||
// FinalisingState indicates that the rollout is finalizing, possibly clean up the old resources, adjust traffic
|
||||
FinalisingState RollingState = "finalising"
|
||||
// RolloutFailingState indicates that the rollout is failing
|
||||
// one needs to finalize it before mark it as failed by cleaning up the old resources, adjust traffic
|
||||
RolloutFailingState RollingState = "rolloutFailing"
|
||||
// RolloutSucceedState indicates that rollout successfully completed to match the desired target state
|
||||
RolloutSucceedState RollingState = "rolloutSucceed"
|
||||
// RolloutAbandoningState indicates that the rollout is being abandoned
|
||||
// we need to finalize it by cleaning up the old resources, adjust traffic and return control back to its owner
|
||||
RolloutAbandoningState RollingState = "rolloutAbandoning"
|
||||
// RolloutDeletingState indicates that the rollout is being deleted
|
||||
// we need to finalize it by cleaning up the old resources, adjust traffic and return control back to its owner
|
||||
RolloutDeletingState RollingState = "RolloutDeletingState"
|
||||
// RolloutFailedState indicates that rollout is failed, the target replica is not reached
|
||||
// we can not move forward anymore, we will let the client to decide when or whether to revert.
|
||||
RolloutFailedState RollingState = "rolloutFailed"
|
||||
)
|
||||
|
||||
// BatchRollingState is the sub state when the rollout is on the fly
|
||||
type BatchRollingState string
|
||||
|
||||
const (
|
||||
// BatchInitializingState still rolling the batch, the batch rolling is not completed yet
|
||||
BatchInitializingState BatchRollingState = "batchInitializing"
|
||||
// BatchInRollingState still rolling the batch, the batch rolling is not completed yet
|
||||
BatchInRollingState BatchRollingState = "batchInRolling"
|
||||
// BatchVerifyingState verifying if the application is ready to roll.
|
||||
BatchVerifyingState BatchRollingState = "batchVerifying"
|
||||
// BatchRolloutFailedState indicates that the batch didn't get the manual or automatic approval
|
||||
BatchRolloutFailedState BatchRollingState = "batchVerifyFailed"
|
||||
// BatchFinalizingState indicates that all the pods in the are available, we can move on to the next batch
|
||||
BatchFinalizingState BatchRollingState = "batchFinalizing"
|
||||
// BatchReadyState indicates that all the pods in the are upgraded and its state is ready
|
||||
BatchReadyState BatchRollingState = "batchReady"
|
||||
)
|
||||
|
||||
// RolloutPlan fines the details of the rollout plan
|
||||
type RolloutPlan struct {
|
||||
|
||||
// RolloutStrategy defines strategies for the rollout plan
|
||||
// The default is IncreaseFirstRolloutStrategyType
|
||||
// +optional
|
||||
RolloutStrategy RolloutStrategyType `json:"rolloutStrategy,omitempty"`
|
||||
|
||||
// The size of the target resource. The default is the same
|
||||
// as the size of the source resource.
|
||||
// +optional
|
||||
TargetSize *int32 `json:"targetSize,omitempty"`
|
||||
|
||||
// The number of batches, default = 1
|
||||
// +optional
|
||||
NumBatches *int32 `json:"numBatches,omitempty"`
|
||||
|
||||
// The exact distribution among batches.
|
||||
// its size has to be exactly the same as the NumBatches (if set)
|
||||
// The total number cannot exceed the targetSize or the size of the source resource
|
||||
// We will IGNORE the last batch's replica field if it's a percentage since round errors can lead to inaccurate sum
|
||||
// We highly recommend to leave the last batch's replica field empty
|
||||
// +optional
|
||||
RolloutBatches []RolloutBatch `json:"rolloutBatches,omitempty"`
|
||||
|
||||
// All pods in the batches up to the batchPartition (included) will have
|
||||
// the target resource specification while the rest still have the source resource
|
||||
// This is designed for the operators to manually rollout
|
||||
// Default is the the number of batches which will rollout all the batches
|
||||
// +optional
|
||||
BatchPartition *int32 `json:"batchPartition,omitempty"`
|
||||
|
||||
// Paused the rollout, default is false
|
||||
// +optional
|
||||
Paused bool `json:"paused,omitempty"`
|
||||
|
||||
// RolloutWebhooks provide a way for the rollout to interact with an external process
|
||||
// +optional
|
||||
RolloutWebhooks []RolloutWebhook `json:"rolloutWebhooks,omitempty"`
|
||||
|
||||
// CanaryMetric provides a way for the rollout process to automatically check certain metrics
|
||||
// before complete the process
|
||||
// +optional
|
||||
CanaryMetric []CanaryMetric `json:"canaryMetric,omitempty"`
|
||||
}
|
||||
|
||||
// RolloutBatch is used to describe how the each batch rollout should be
|
||||
type RolloutBatch struct {
|
||||
// Replicas is the number of pods to upgrade in this batch
|
||||
// it can be an absolute number (ex: 5) or a percentage of total pods
|
||||
// we will ignore the percentage of the last batch to just fill the gap
|
||||
// +optional
|
||||
// it is mutually exclusive with the PodList field
|
||||
Replicas intstr.IntOrString `json:"replicas,omitempty"`
|
||||
|
||||
// The list of Pods to get upgraded
|
||||
// +optional
|
||||
// it is mutually exclusive with the Replicas field
|
||||
PodList []string `json:"podList,omitempty"`
|
||||
|
||||
// MaxUnavailable is the max allowed number of pods that is unavailable
|
||||
// during the upgrade. We will mark the batch as ready as long as there are less
|
||||
// or equal number of pods unavailable than this number.
|
||||
// default = 0
|
||||
// +optional
|
||||
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
|
||||
|
||||
// The wait time, in seconds, between instances upgrades, default = 0
|
||||
// +optional
|
||||
InstanceInterval *int32 `json:"instanceInterval,omitempty"`
|
||||
|
||||
// RolloutWebhooks provides a way for the batch rollout to interact with an external process
|
||||
// +optional
|
||||
BatchRolloutWebhooks []RolloutWebhook `json:"batchRolloutWebhooks,omitempty"`
|
||||
|
||||
// CanaryMetric provides a way for the batch rollout process to automatically check certain metrics
|
||||
// before moving to the next batch
|
||||
// +optional
|
||||
CanaryMetric []CanaryMetric `json:"canaryMetric,omitempty"`
|
||||
}
|
||||
|
||||
// RolloutWebhook holds the reference to external checks used for canary analysis
|
||||
type RolloutWebhook struct {
|
||||
// Type of this webhook
|
||||
Type HookType `json:"type"`
|
||||
|
||||
// Name of this webhook
|
||||
Name string `json:"name"`
|
||||
|
||||
// URL address of this webhook
|
||||
URL string `json:"url"`
|
||||
|
||||
// Method the HTTP call method, default is POST
|
||||
Method string `json:"method,omitempty"`
|
||||
|
||||
// ExpectedStatus contains all the expected http status code that we will accept as success
|
||||
ExpectedStatus []int `json:"expectedStatus,omitempty"`
|
||||
|
||||
// Metadata (key-value pairs) for this webhook
|
||||
// +optional
|
||||
Metadata *map[string]string `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
// RolloutWebhookPayload holds the info and metadata sent to webhooks
|
||||
type RolloutWebhookPayload struct {
|
||||
// Name of the upgrading resource
|
||||
Name string `json:"name"`
|
||||
|
||||
// Namespace of the upgrading resource
|
||||
Namespace string `json:"namespace"`
|
||||
|
||||
// Phase of the rollout
|
||||
Phase string `json:"phase"`
|
||||
|
||||
// Metadata (key-value pairs) are the extra data send to this webhook
|
||||
Metadata map[string]string `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
// CanaryMetric holds the reference to metrics used for canary analysis
|
||||
type CanaryMetric struct {
|
||||
// Name of the metric
|
||||
Name string `json:"name"`
|
||||
|
||||
// Interval represents the windows size
|
||||
Interval string `json:"interval,omitempty"`
|
||||
|
||||
// Range value accepted for this metric
|
||||
// +optional
|
||||
MetricsRange *MetricsExpectedRange `json:"metricsRange,omitempty"`
|
||||
|
||||
// TemplateRef references a metric template object
|
||||
// +optional
|
||||
TemplateRef *corev1.ObjectReference `json:"templateRef,omitempty"`
|
||||
}
|
||||
|
||||
// MetricsExpectedRange defines the range used for metrics validation
|
||||
type MetricsExpectedRange struct {
|
||||
// Minimum value
|
||||
// +optional
|
||||
Min *intstr.IntOrString `json:"min,omitempty"`
|
||||
|
||||
// Maximum value
|
||||
// +optional
|
||||
Max *intstr.IntOrString `json:"max,omitempty"`
|
||||
}
|
||||
|
||||
// RolloutStatus defines the observed state of a rollout plan
|
||||
type RolloutStatus struct {
|
||||
// Conditions represents the latest available observations of a CloneSet's current state.
|
||||
condition.ConditionedStatus `json:",inline"`
|
||||
|
||||
// RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification
|
||||
// and does not change until the rollout is restarted
|
||||
RolloutOriginalSize int32 `json:"rolloutOriginalSize,omitempty"`
|
||||
|
||||
// RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification
|
||||
// and does not change until the rollout is restarted
|
||||
RolloutTargetSize int32 `json:"rolloutTargetSize,omitempty"`
|
||||
|
||||
// NewPodTemplateIdentifier is a string that uniquely represent the new pod template
|
||||
// each workload type could use different ways to identify that so we cannot compare between resources
|
||||
NewPodTemplateIdentifier string `json:"targetGeneration,omitempty"`
|
||||
|
||||
// lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template
|
||||
// each workload type could use different ways to identify that so we cannot compare between resources
|
||||
// We update this field only after a successful rollout
|
||||
LastAppliedPodTemplateIdentifier string `json:"lastAppliedPodTemplateIdentifier,omitempty"`
|
||||
|
||||
// RollingState is the Rollout State
|
||||
RollingState RollingState `json:"rollingState"`
|
||||
|
||||
// BatchRollingState only meaningful when the Status is rolling
|
||||
// +optional
|
||||
BatchRollingState BatchRollingState `json:"batchRollingState"`
|
||||
|
||||
// The current batch the rollout is working on/blocked
|
||||
// it starts from 0
|
||||
CurrentBatch int32 `json:"currentBatch"`
|
||||
|
||||
// UpgradedReplicas is the number of Pods upgraded by the rollout controller
|
||||
UpgradedReplicas int32 `json:"upgradedReplicas"`
|
||||
|
||||
// UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
|
||||
UpgradedReadyReplicas int32 `json:"upgradedReadyReplicas"`
|
||||
}
|
||||
430
apis/standard.oam.dev/v1alpha1/rollout_state.go
Normal file
430
apis/standard.oam.dev/v1alpha1/rollout_state.go
Normal file
@@ -0,0 +1,430 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
// RolloutEvent is used to describe the events during rollout
|
||||
type RolloutEvent string
|
||||
|
||||
const (
|
||||
// RollingFailedEvent indicates that we encountered an unexpected error during upgrading and can't be retried
|
||||
RollingFailedEvent RolloutEvent = "RollingFailedEvent"
|
||||
|
||||
// RollingRetriableFailureEvent indicates that we encountered an unexpected but retriable error
|
||||
RollingRetriableFailureEvent RolloutEvent = "RollingRetriableFailureEvent"
|
||||
|
||||
// AppLocatedEvent indicates that apps are located successfully
|
||||
AppLocatedEvent RolloutEvent = "AppLocatedEvent"
|
||||
|
||||
// RollingModifiedEvent indicates that the rolling target or source has changed
|
||||
RollingModifiedEvent RolloutEvent = "RollingModifiedEvent"
|
||||
|
||||
// RollingDeletedEvent indicates that the rolling is being deleted
|
||||
RollingDeletedEvent RolloutEvent = "RollingDeletedEvent"
|
||||
|
||||
// RollingSpecVerifiedEvent indicates that we have successfully verified that the rollout spec
|
||||
RollingSpecVerifiedEvent RolloutEvent = "RollingSpecVerifiedEvent"
|
||||
|
||||
// RollingInitializedEvent indicates that we have finished initializing all the workload resources
|
||||
RollingInitializedEvent RolloutEvent = "RollingInitializedEvent"
|
||||
|
||||
// AllBatchFinishedEvent indicates that all batches are upgraded
|
||||
AllBatchFinishedEvent RolloutEvent = "AllBatchFinishedEvent"
|
||||
|
||||
// RollingFinalizedEvent indicates that we have finalized the rollout which includes but not
|
||||
// limited to the resource garbage collection
|
||||
RollingFinalizedEvent RolloutEvent = "AllBatchFinishedEvent"
|
||||
|
||||
// InitializedOneBatchEvent indicates that we have successfully rolled out one batch
|
||||
InitializedOneBatchEvent RolloutEvent = "InitializedOneBatchEvent"
|
||||
|
||||
// FinishedOneBatchEvent indicates that we have successfully rolled out one batch
|
||||
FinishedOneBatchEvent RolloutEvent = "FinishedOneBatchEvent"
|
||||
|
||||
// RolloutOneBatchEvent indicates that we have rollout one batch
|
||||
RolloutOneBatchEvent RolloutEvent = "RolloutOneBatchEvent"
|
||||
|
||||
// OneBatchAvailableEvent indicates that the batch resource is considered available
|
||||
// this events comes after we have examine the pod readiness check and traffic shifting if needed
|
||||
OneBatchAvailableEvent RolloutEvent = "OneBatchAvailable"
|
||||
|
||||
// BatchRolloutApprovedEvent indicates that we got the approval manually
|
||||
BatchRolloutApprovedEvent RolloutEvent = "BatchRolloutApprovedEvent"
|
||||
|
||||
// BatchRolloutFailedEvent indicates that we are waiting for the approval of the
|
||||
BatchRolloutFailedEvent RolloutEvent = "BatchRolloutFailedEvent"
|
||||
)
|
||||
|
||||
// These are valid conditions of the rollout.
|
||||
const (
|
||||
// RolloutSpecVerifying indicates that the rollout just started with verification
|
||||
RolloutSpecVerifying condition.ConditionType = "RolloutSpecVerifying"
|
||||
// RolloutInitializing means we start to initialize the cluster
|
||||
RolloutInitializing condition.ConditionType = "RolloutInitializing"
|
||||
// RolloutInProgress means we are upgrading resources.
|
||||
RolloutInProgress condition.ConditionType = "RolloutInProgress"
|
||||
// RolloutFinalizing means the rollout is finalizing
|
||||
RolloutFinalizing condition.ConditionType = "RolloutFinalizing"
|
||||
// RolloutFailing means the rollout is failing
|
||||
RolloutFailing condition.ConditionType = "RolloutFailing"
|
||||
// RolloutAbandoning means that the rollout is being abandoned.
|
||||
RolloutAbandoning condition.ConditionType = "RolloutAbandoning"
|
||||
// RolloutDeleting means that the rollout is being deleted.
|
||||
RolloutDeleting condition.ConditionType = "RolloutDeleting"
|
||||
// RolloutFailed means that the rollout failed.
|
||||
RolloutFailed condition.ConditionType = "RolloutFailed"
|
||||
// RolloutSucceed means that the rollout is done.
|
||||
RolloutSucceed condition.ConditionType = "RolloutSucceed"
|
||||
// BatchInitializing
|
||||
BatchInitializing condition.ConditionType = "BatchInitializing"
|
||||
// BatchPaused
|
||||
BatchPaused condition.ConditionType = "BatchPaused"
|
||||
// BatchVerifying
|
||||
BatchVerifying condition.ConditionType = "BatchVerifying"
|
||||
// BatchRolloutFailed
|
||||
BatchRolloutFailed condition.ConditionType = "BatchRolloutFailed"
|
||||
// BatchFinalizing
|
||||
BatchFinalizing condition.ConditionType = "BatchFinalizing"
|
||||
// BatchReady
|
||||
BatchReady condition.ConditionType = "BatchReady"
|
||||
)
|
||||
|
||||
// NewPositiveCondition creates a positive condition type
|
||||
func NewPositiveCondition(condType condition.ConditionType) condition.Condition {
|
||||
return condition.Condition{
|
||||
Type: condType,
|
||||
Status: v1.ConditionTrue,
|
||||
LastTransitionTime: metav1.NewTime(time.Now()),
|
||||
}
|
||||
}
|
||||
|
||||
// NewNegativeCondition creates a false condition type
|
||||
func NewNegativeCondition(condType condition.ConditionType, message string) condition.Condition {
|
||||
return condition.Condition{
|
||||
Type: condType,
|
||||
Status: v1.ConditionFalse,
|
||||
LastTransitionTime: metav1.NewTime(time.Now()),
|
||||
Message: message,
|
||||
}
|
||||
}
|
||||
|
||||
const invalidRollingStateTransition = "the rollout state transition from `%s` state with `%s` is invalid"
|
||||
|
||||
const invalidBatchRollingStateTransition = "the batch rolling state transition from `%s` state with `%s` is invalid"
|
||||
|
||||
func (r *RolloutStatus) getRolloutConditionType() condition.ConditionType {
|
||||
// figure out which condition type should we put in the condition depends on its state
|
||||
switch r.RollingState {
|
||||
case VerifyingSpecState:
|
||||
return RolloutSpecVerifying
|
||||
|
||||
case InitializingState:
|
||||
return RolloutInitializing
|
||||
|
||||
case RollingInBatchesState:
|
||||
switch r.BatchRollingState {
|
||||
case BatchInitializingState:
|
||||
return BatchInitializing
|
||||
|
||||
case BatchVerifyingState:
|
||||
return BatchVerifying
|
||||
|
||||
case BatchFinalizingState:
|
||||
return BatchFinalizing
|
||||
|
||||
case BatchRolloutFailedState:
|
||||
return BatchRolloutFailed
|
||||
|
||||
case BatchReadyState:
|
||||
return BatchReady
|
||||
|
||||
default:
|
||||
return RolloutInProgress
|
||||
}
|
||||
|
||||
case FinalisingState:
|
||||
return RolloutFinalizing
|
||||
|
||||
case RolloutFailingState:
|
||||
return RolloutFailing
|
||||
|
||||
case RolloutAbandoningState:
|
||||
return RolloutAbandoning
|
||||
|
||||
case RolloutDeletingState:
|
||||
return RolloutDeleting
|
||||
|
||||
case RolloutSucceedState:
|
||||
return RolloutSucceed
|
||||
|
||||
default:
|
||||
return RolloutFailed
|
||||
}
|
||||
}
|
||||
|
||||
// RolloutRetry is a special state transition since we need an error message
|
||||
func (r *RolloutStatus) RolloutRetry(reason string) {
|
||||
// we can still retry, no change on the state
|
||||
r.SetConditions(NewNegativeCondition(r.getRolloutConditionType(), reason))
|
||||
}
|
||||
|
||||
// RolloutFailed is a special state transition since we need an error message
|
||||
func (r *RolloutStatus) RolloutFailed(reason string) {
|
||||
// set the condition first which depends on the state
|
||||
r.SetConditions(NewNegativeCondition(r.getRolloutConditionType(), reason))
|
||||
r.RollingState = RolloutFailedState
|
||||
}
|
||||
|
||||
// RolloutFailing is a special state transition that always moves the rollout state to the failing state
|
||||
func (r *RolloutStatus) RolloutFailing(reason string) {
|
||||
// set the condition first which depends on the state
|
||||
r.SetConditions(NewNegativeCondition(r.getRolloutConditionType(), reason))
|
||||
r.RollingState = RolloutFailingState
|
||||
r.BatchRollingState = BatchInitializingState
|
||||
}
|
||||
|
||||
// ResetStatus resets the status of the rollout to start from beginning
|
||||
func (r *RolloutStatus) ResetStatus() {
|
||||
r.NewPodTemplateIdentifier = ""
|
||||
r.RolloutTargetSize = -1
|
||||
r.LastAppliedPodTemplateIdentifier = ""
|
||||
r.RollingState = LocatingTargetAppState
|
||||
r.BatchRollingState = BatchInitializingState
|
||||
r.CurrentBatch = 0
|
||||
r.UpgradedReplicas = 0
|
||||
r.UpgradedReadyReplicas = 0
|
||||
}
|
||||
|
||||
// SetRolloutCondition sets the supplied condition, replacing any existing condition
|
||||
// of the same type unless they are identical.
|
||||
func (r *RolloutStatus) SetRolloutCondition(new condition.Condition) {
|
||||
exists := false
|
||||
for i, existing := range r.Conditions {
|
||||
if existing.Type != new.Type {
|
||||
continue
|
||||
}
|
||||
// we want to update the condition when the LTT changes
|
||||
if existing.Type == new.Type &&
|
||||
existing.Status == new.Status &&
|
||||
existing.Reason == new.Reason &&
|
||||
existing.Message == new.Message &&
|
||||
existing.LastTransitionTime == new.LastTransitionTime {
|
||||
exists = true
|
||||
continue
|
||||
}
|
||||
|
||||
r.Conditions[i] = new
|
||||
exists = true
|
||||
}
|
||||
if !exists {
|
||||
r.Conditions = append(r.Conditions, new)
|
||||
}
|
||||
}
|
||||
|
||||
// we can't panic since it will crash the other controllers
|
||||
func (r *RolloutStatus) illegalStateTransition(err error) {
|
||||
r.RolloutFailed(err.Error())
|
||||
}
|
||||
|
||||
// StateTransition is the center place to do rollout state transition
|
||||
// it returns an error if the transition is invalid
|
||||
// it changes the coming rollout state if it's valid
|
||||
func (r *RolloutStatus) StateTransition(event RolloutEvent) {
|
||||
rollingState := r.RollingState
|
||||
batchRollingState := r.BatchRollingState
|
||||
defer func() {
|
||||
klog.InfoS("try to execute a rollout state transition",
|
||||
"pre rolling state", rollingState,
|
||||
"pre batch rolling state", batchRollingState,
|
||||
"post rolling state", r.RollingState,
|
||||
"post batch rolling state", r.BatchRollingState)
|
||||
}()
|
||||
|
||||
// we have special transition for these types of event since they require additional info
|
||||
if event == RollingFailedEvent || event == RollingRetriableFailureEvent {
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
return
|
||||
}
|
||||
// special handle modified event here
|
||||
if event == RollingModifiedEvent {
|
||||
if r.RollingState == RolloutDeletingState {
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
return
|
||||
}
|
||||
if r.RollingState == RolloutFailedState || r.RollingState == RolloutSucceedState {
|
||||
r.ResetStatus()
|
||||
} else {
|
||||
r.SetRolloutCondition(NewNegativeCondition(r.getRolloutConditionType(), "Rollout Spec is modified"))
|
||||
r.RollingState = RolloutAbandoningState
|
||||
r.BatchRollingState = BatchInitializingState
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// special handle deleted event here, it can happen at many states
|
||||
if event == RollingDeletedEvent {
|
||||
if r.RollingState == RolloutFailedState || r.RollingState == RolloutSucceedState {
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
return
|
||||
}
|
||||
r.SetRolloutCondition(NewNegativeCondition(r.getRolloutConditionType(), "Rollout is being deleted"))
|
||||
r.RollingState = RolloutDeletingState
|
||||
r.BatchRollingState = BatchInitializingState
|
||||
return
|
||||
}
|
||||
|
||||
// special handle appLocatedEvent event here, it only applies to one state but it's legal to happen at other states
|
||||
if event == AppLocatedEvent {
|
||||
if r.RollingState == LocatingTargetAppState {
|
||||
r.RollingState = VerifyingSpecState
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
switch rollingState {
|
||||
case VerifyingSpecState:
|
||||
if event == RollingSpecVerifiedEvent {
|
||||
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
|
||||
r.RollingState = InitializingState
|
||||
return
|
||||
}
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
case InitializingState:
|
||||
if event == RollingInitializedEvent {
|
||||
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
|
||||
r.RollingState = RollingInBatchesState
|
||||
r.BatchRollingState = BatchInitializingState
|
||||
return
|
||||
}
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
case RollingInBatchesState:
|
||||
r.batchStateTransition(event)
|
||||
return
|
||||
|
||||
case RolloutAbandoningState:
|
||||
if event == RollingFinalizedEvent {
|
||||
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
|
||||
r.ResetStatus()
|
||||
return
|
||||
}
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
case RolloutDeletingState:
|
||||
if event == RollingFinalizedEvent {
|
||||
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
|
||||
r.RollingState = RolloutFailedState
|
||||
return
|
||||
}
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
case FinalisingState:
|
||||
if event == RollingFinalizedEvent {
|
||||
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
|
||||
r.RollingState = RolloutSucceedState
|
||||
return
|
||||
}
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
case RolloutFailingState:
|
||||
if event == RollingFinalizedEvent {
|
||||
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
|
||||
r.RollingState = RolloutFailedState
|
||||
return
|
||||
}
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
case RolloutSucceedState, RolloutFailedState:
|
||||
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
|
||||
|
||||
default:
|
||||
r.illegalStateTransition(fmt.Errorf("invalid rolling state %s before transition", rollingState))
|
||||
}
|
||||
}
|
||||
|
||||
// batchStateTransition handles the state transition when the rollout is in action
|
||||
func (r *RolloutStatus) batchStateTransition(event RolloutEvent) {
|
||||
batchRollingState := r.BatchRollingState
|
||||
if event == BatchRolloutFailedEvent {
|
||||
r.BatchRollingState = BatchRolloutFailedState
|
||||
r.RollingState = RolloutFailedState
|
||||
r.SetConditions(NewNegativeCondition(r.getRolloutConditionType(), "failed"))
|
||||
return
|
||||
}
|
||||
switch batchRollingState {
|
||||
case BatchInitializingState:
|
||||
if event == InitializedOneBatchEvent {
|
||||
r.BatchRollingState = BatchInRollingState
|
||||
return
|
||||
}
|
||||
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
|
||||
case BatchInRollingState:
|
||||
if event == RolloutOneBatchEvent {
|
||||
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
|
||||
r.BatchRollingState = BatchVerifyingState
|
||||
return
|
||||
}
|
||||
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
|
||||
case BatchVerifyingState:
|
||||
if event == OneBatchAvailableEvent {
|
||||
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
|
||||
r.BatchRollingState = BatchFinalizingState
|
||||
return
|
||||
}
|
||||
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
|
||||
case BatchFinalizingState:
|
||||
if event == FinishedOneBatchEvent {
|
||||
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
|
||||
r.BatchRollingState = BatchReadyState
|
||||
return
|
||||
}
|
||||
if event == AllBatchFinishedEvent {
|
||||
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
|
||||
// transition out of the batch loop
|
||||
r.BatchRollingState = BatchReadyState
|
||||
r.RollingState = FinalisingState
|
||||
return
|
||||
}
|
||||
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
|
||||
case BatchReadyState:
|
||||
if event == BatchRolloutApprovedEvent {
|
||||
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
|
||||
r.BatchRollingState = BatchInitializingState
|
||||
r.CurrentBatch++
|
||||
return
|
||||
}
|
||||
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
|
||||
|
||||
default:
|
||||
r.illegalStateTransition(fmt.Errorf("invalid batch rolling state %s", batchRollingState))
|
||||
}
|
||||
}
|
||||
77
apis/standard.oam.dev/v1alpha1/rollout_type.go
Normal file
77
apis/standard.oam.dev/v1alpha1/rollout_type.go
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// Rollout is the Schema for the Rollout API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam},shortName=rollout
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:printcolumn:name="TARGET",type=string,JSONPath=`.status.rolloutTargetSize`
|
||||
// +kubebuilder:printcolumn:name="UPGRADED",type=string,JSONPath=`.status.upgradedReplicas`
|
||||
// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.upgradedReadyReplicas`
|
||||
// +kubebuilder:printcolumn:name="BATCH-STATE",type=string,JSONPath=`.status.batchRollingState`
|
||||
// +kubebuilder:printcolumn:name="ROLLING-STATE",type=string,JSONPath=`.status.rollingState`
|
||||
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
|
||||
type Rollout struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec RolloutSpec `json:"spec,omitempty"`
|
||||
Status CompRolloutStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// RolloutSpec defines how to describe an update between different compRevision
|
||||
type RolloutSpec struct {
|
||||
// TargetRevisionName contains the name of the componentRevisionName that we need to upgrade to.
|
||||
TargetRevisionName string `json:"targetRevisionName"`
|
||||
|
||||
// SourceRevisionName contains the name of the componentRevisionName that we need to upgrade from.
|
||||
// it can be empty only when it's the first time to deploy the application
|
||||
SourceRevisionName string `json:"sourceRevisionName,omitempty"`
|
||||
|
||||
// ComponentName specify the component name
|
||||
ComponentName string `json:"componentName"`
|
||||
|
||||
// RolloutPlan is the details on how to rollout the resources
|
||||
RolloutPlan RolloutPlan `json:"rolloutPlan"`
|
||||
}
|
||||
|
||||
// CompRolloutStatus defines the observed state of rollout
|
||||
type CompRolloutStatus struct {
|
||||
RolloutStatus `json:",inline"`
|
||||
|
||||
// LastUpgradedTargetRevision contains the name of the componentRevisionName that we upgraded to
|
||||
// We will restart the rollout if this is not the same as the spec
|
||||
LastUpgradedTargetRevision string `json:"lastTargetRevision"`
|
||||
|
||||
// LastSourceRevision contains the name of the componentRevisionName that we need to upgrade from.
|
||||
// We will restart the rollout if this is not the same as the spec
|
||||
LastSourceRevision string `json:"LastSourceRevision,omitempty"`
|
||||
}
|
||||
|
||||
// RolloutList contains a list of Rollout
|
||||
// +kubebuilder:object:root=true
|
||||
type RolloutList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Rollout `json:"items"`
|
||||
}
|
||||
333
apis/standard.oam.dev/v1alpha1/zz_generated.deepcopy.go
Normal file
333
apis/standard.oam.dev/v1alpha1/zz_generated.deepcopy.go
Normal file
@@ -0,0 +1,333 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by controller-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CanaryMetric) DeepCopyInto(out *CanaryMetric) {
|
||||
*out = *in
|
||||
if in.MetricsRange != nil {
|
||||
in, out := &in.MetricsRange, &out.MetricsRange
|
||||
*out = new(MetricsExpectedRange)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.TemplateRef != nil {
|
||||
in, out := &in.TemplateRef, &out.TemplateRef
|
||||
*out = new(v1.ObjectReference)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CanaryMetric.
|
||||
func (in *CanaryMetric) DeepCopy() *CanaryMetric {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CanaryMetric)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CompRolloutStatus) DeepCopyInto(out *CompRolloutStatus) {
|
||||
*out = *in
|
||||
in.RolloutStatus.DeepCopyInto(&out.RolloutStatus)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompRolloutStatus.
|
||||
func (in *CompRolloutStatus) DeepCopy() *CompRolloutStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CompRolloutStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MetricsExpectedRange) DeepCopyInto(out *MetricsExpectedRange) {
|
||||
*out = *in
|
||||
if in.Min != nil {
|
||||
in, out := &in.Min, &out.Min
|
||||
*out = new(intstr.IntOrString)
|
||||
**out = **in
|
||||
}
|
||||
if in.Max != nil {
|
||||
in, out := &in.Max, &out.Max
|
||||
*out = new(intstr.IntOrString)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsExpectedRange.
|
||||
func (in *MetricsExpectedRange) DeepCopy() *MetricsExpectedRange {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(MetricsExpectedRange)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Rollout) DeepCopyInto(out *Rollout) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rollout.
|
||||
func (in *Rollout) DeepCopy() *Rollout {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Rollout)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Rollout) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RolloutBatch) DeepCopyInto(out *RolloutBatch) {
|
||||
*out = *in
|
||||
out.Replicas = in.Replicas
|
||||
if in.PodList != nil {
|
||||
in, out := &in.PodList, &out.PodList
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.MaxUnavailable != nil {
|
||||
in, out := &in.MaxUnavailable, &out.MaxUnavailable
|
||||
*out = new(intstr.IntOrString)
|
||||
**out = **in
|
||||
}
|
||||
if in.InstanceInterval != nil {
|
||||
in, out := &in.InstanceInterval, &out.InstanceInterval
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
if in.BatchRolloutWebhooks != nil {
|
||||
in, out := &in.BatchRolloutWebhooks, &out.BatchRolloutWebhooks
|
||||
*out = make([]RolloutWebhook, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.CanaryMetric != nil {
|
||||
in, out := &in.CanaryMetric, &out.CanaryMetric
|
||||
*out = make([]CanaryMetric, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutBatch.
|
||||
func (in *RolloutBatch) DeepCopy() *RolloutBatch {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RolloutBatch)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RolloutList) DeepCopyInto(out *RolloutList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Rollout, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutList.
|
||||
func (in *RolloutList) DeepCopy() *RolloutList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RolloutList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RolloutList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RolloutPlan) DeepCopyInto(out *RolloutPlan) {
|
||||
*out = *in
|
||||
if in.TargetSize != nil {
|
||||
in, out := &in.TargetSize, &out.TargetSize
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
if in.NumBatches != nil {
|
||||
in, out := &in.NumBatches, &out.NumBatches
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
if in.RolloutBatches != nil {
|
||||
in, out := &in.RolloutBatches, &out.RolloutBatches
|
||||
*out = make([]RolloutBatch, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.BatchPartition != nil {
|
||||
in, out := &in.BatchPartition, &out.BatchPartition
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
if in.RolloutWebhooks != nil {
|
||||
in, out := &in.RolloutWebhooks, &out.RolloutWebhooks
|
||||
*out = make([]RolloutWebhook, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.CanaryMetric != nil {
|
||||
in, out := &in.CanaryMetric, &out.CanaryMetric
|
||||
*out = make([]CanaryMetric, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutPlan.
|
||||
func (in *RolloutPlan) DeepCopy() *RolloutPlan {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RolloutPlan)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RolloutSpec) DeepCopyInto(out *RolloutSpec) {
|
||||
*out = *in
|
||||
in.RolloutPlan.DeepCopyInto(&out.RolloutPlan)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutSpec.
|
||||
func (in *RolloutSpec) DeepCopy() *RolloutSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RolloutSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RolloutStatus) DeepCopyInto(out *RolloutStatus) {
|
||||
*out = *in
|
||||
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutStatus.
|
||||
func (in *RolloutStatus) DeepCopy() *RolloutStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RolloutStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RolloutWebhook) DeepCopyInto(out *RolloutWebhook) {
|
||||
*out = *in
|
||||
if in.ExpectedStatus != nil {
|
||||
in, out := &in.ExpectedStatus, &out.ExpectedStatus
|
||||
*out = make([]int, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Metadata != nil {
|
||||
in, out := &in.Metadata, &out.Metadata
|
||||
*out = new(map[string]string)
|
||||
if **in != nil {
|
||||
in, out := *in, *out
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutWebhook.
|
||||
func (in *RolloutWebhook) DeepCopy() *RolloutWebhook {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RolloutWebhook)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RolloutWebhookPayload) DeepCopyInto(out *RolloutWebhookPayload) {
|
||||
*out = *in
|
||||
if in.Metadata != nil {
|
||||
in, out := &in.Metadata, &out.Metadata
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutWebhookPayload.
|
||||
func (in *RolloutWebhookPayload) DeepCopy() *RolloutWebhookPayload {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RolloutWebhookPayload)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
185
apis/types/capability.go
Normal file
185
apis/types/capability.go
Normal file
@@ -0,0 +1,185 @@
|
||||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
|
||||
"cuelang.org/go/cue"
|
||||
"github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
// Source record the source of Capability
|
||||
type Source struct {
|
||||
RepoName string `json:"repoName"`
|
||||
ChartName string `json:"chartName,omitempty"`
|
||||
}
|
||||
|
||||
// CRDInfo record the CRD info of the Capability
|
||||
type CRDInfo struct {
|
||||
APIVersion string `json:"apiVersion"`
|
||||
Kind string `json:"kind"`
|
||||
}
|
||||
|
||||
// Chart defines all necessary information to install a whole chart
|
||||
type Chart struct {
|
||||
Repo string `json:"repo"`
|
||||
URL string `json:"url"`
|
||||
Name string `json:"name"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
Version string `json:"version"`
|
||||
Values map[string]interface{} `json:"values"`
|
||||
}
|
||||
|
||||
// Installation defines the installation method for this Capability, currently only helm is supported
|
||||
type Installation struct {
|
||||
Helm Chart `json:"helm"`
|
||||
// TODO(wonderflow) add raw yaml file support for install capability
|
||||
}
|
||||
|
||||
// CapType defines the type of capability
|
||||
type CapType string
|
||||
|
||||
const (
|
||||
// TypeComponentDefinition represents OAM ComponentDefinition
|
||||
TypeComponentDefinition CapType = "componentDefinition"
|
||||
// TypeWorkload represents OAM Workload
|
||||
TypeWorkload CapType = "workload"
|
||||
// TypeTrait represents OAM Trait
|
||||
TypeTrait CapType = "trait"
|
||||
// TypeScope represent OAM Scope
|
||||
TypeScope CapType = "scope"
|
||||
// TypeWorkflowStep represent OAM Workflow
|
||||
TypeWorkflowStep CapType = "workflowstep"
|
||||
// TypePolicy represent OAM Policy
|
||||
TypePolicy CapType = "policy"
|
||||
)
|
||||
|
||||
// CapabilityConfigMapNamePrefix is the prefix for capability ConfigMap name
|
||||
const CapabilityConfigMapNamePrefix = "schema-"
|
||||
|
||||
const (
|
||||
// OpenapiV3JSONSchema is the key to store OpenAPI v3 JSON schema in ConfigMap
|
||||
OpenapiV3JSONSchema string = "openapi-v3-json-schema"
|
||||
)
|
||||
|
||||
// CapabilityCategory defines the category of a capability
|
||||
type CapabilityCategory string
|
||||
|
||||
// categories of capability schematic
|
||||
const (
|
||||
TerraformCategory CapabilityCategory = "terraform"
|
||||
|
||||
HelmCategory CapabilityCategory = "helm"
|
||||
|
||||
KubeCategory CapabilityCategory = "kube"
|
||||
|
||||
CUECategory CapabilityCategory = "cue"
|
||||
)
|
||||
|
||||
// Parameter defines a parameter for cli from capability template
|
||||
type Parameter struct {
|
||||
Name string `json:"name"`
|
||||
Short string `json:"short,omitempty"`
|
||||
Required bool `json:"required,omitempty"`
|
||||
Default interface{} `json:"default,omitempty"`
|
||||
Usage string `json:"usage,omitempty"`
|
||||
Ignore bool `json:"ignore,omitempty"`
|
||||
Type cue.Kind `json:"type,omitempty"`
|
||||
Alias string `json:"alias,omitempty"`
|
||||
JSONType string `json:"jsonType,omitempty"`
|
||||
}
|
||||
|
||||
// SetFlagBy set cli flag from Parameter
|
||||
func SetFlagBy(flags *pflag.FlagSet, v Parameter) {
|
||||
name := v.Name
|
||||
if v.Alias != "" {
|
||||
name = v.Alias
|
||||
}
|
||||
// nolint:exhaustive
|
||||
switch v.Type {
|
||||
case cue.IntKind:
|
||||
var vv int64
|
||||
switch val := v.Default.(type) {
|
||||
case int64:
|
||||
vv = val
|
||||
case json.Number:
|
||||
vv, _ = val.Int64()
|
||||
case int:
|
||||
vv = int64(val)
|
||||
case float64:
|
||||
vv = int64(val)
|
||||
}
|
||||
flags.Int64P(name, v.Short, vv, v.Usage)
|
||||
case cue.StringKind:
|
||||
flags.StringP(name, v.Short, v.Default.(string), v.Usage)
|
||||
case cue.BoolKind:
|
||||
flags.BoolP(name, v.Short, v.Default.(bool), v.Usage)
|
||||
case cue.NumberKind, cue.FloatKind:
|
||||
var vv float64
|
||||
switch val := v.Default.(type) {
|
||||
case int64:
|
||||
vv = float64(val)
|
||||
case json.Number:
|
||||
vv, _ = val.Float64()
|
||||
case int:
|
||||
vv = float64(val)
|
||||
case float64:
|
||||
vv = val
|
||||
}
|
||||
flags.Float64P(name, v.Short, vv, v.Usage)
|
||||
default:
|
||||
// other types not supported yet
|
||||
}
|
||||
}
|
||||
|
||||
// Capability defines the content of a capability
|
||||
type Capability struct {
|
||||
Name string `json:"name"`
|
||||
Type CapType `json:"type"`
|
||||
CueTemplate string `json:"template,omitempty"`
|
||||
CueTemplateURI string `json:"templateURI,omitempty"`
|
||||
Parameters []Parameter `json:"parameters,omitempty"`
|
||||
CrdName string `json:"crdName,omitempty"`
|
||||
Center string `json:"center,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Category CapabilityCategory `json:"category,omitempty"`
|
||||
|
||||
// trait only
|
||||
AppliesTo []string `json:"appliesTo,omitempty"`
|
||||
|
||||
// Namespace represents it's a system-level or user-level capability.
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
|
||||
// Plugin Source
|
||||
Source *Source `json:"source,omitempty"`
|
||||
Install *Installation `json:"install,omitempty"`
|
||||
CrdInfo *CRDInfo `json:"crdInfo,omitempty"`
|
||||
|
||||
// Terraform
|
||||
TerraformConfiguration string `json:"terraformConfiguration,omitempty"`
|
||||
|
||||
// KubeTemplate
|
||||
KubeTemplate runtime.RawExtension `json:"kubetemplate,omitempty"`
|
||||
KubeParameter []common.KubeParameter `json:"kubeparameter,omitempty"`
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user