mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 18:10:21 +00:00
Compare commits
400 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c2df10299 | ||
|
|
918ed9727b | ||
|
|
fa78cb7632 | ||
|
|
f3cdbcf203 | ||
|
|
7bd2cf4dbc | ||
|
|
969babdd9e | ||
|
|
94c46a179b | ||
|
|
bec288c6b4 | ||
|
|
9a44be9788 | ||
|
|
9c7f4b7e03 | ||
|
|
539f1ed02b | ||
|
|
9e95122387 | ||
|
|
f49f11dd72 | ||
|
|
191d9038f1 | ||
|
|
e10e43b6c8 | ||
|
|
b9cc523267 | ||
|
|
7f1743ef58 | ||
|
|
dd39c38cf1 | ||
|
|
0851454c6f | ||
|
|
cd3577db53 | ||
|
|
d578adfe6e | ||
|
|
4b88cd201e | ||
|
|
492e7d7f0d | ||
|
|
0742ca9ee5 | ||
|
|
1cf4ae3fc3 | ||
|
|
444d315143 | ||
|
|
2e3a89f6b1 | ||
|
|
d94293ac59 | ||
|
|
cc604cfadb | ||
|
|
8ef2513b2e | ||
|
|
657e3b1bde | ||
|
|
004e2a814d | ||
|
|
6dcba5ef11 | ||
|
|
fd39804dc9 | ||
|
|
ce57fbb752 | ||
|
|
80b2b2c2d3 | ||
|
|
49d97e5c2b | ||
|
|
1ee5915546 | ||
|
|
3f6b38cc7f | ||
|
|
c2c7ab91f9 | ||
|
|
866ffb9689 | ||
|
|
61afb366ee | ||
|
|
a2a8d73a58 | ||
|
|
fc3b428788 | ||
|
|
500dc52b34 | ||
|
|
789aa38476 | ||
|
|
17adf35717 | ||
|
|
586f266798 | ||
|
|
b8dcbe4964 | ||
|
|
778579c79b | ||
|
|
69293f4094 | ||
|
|
3a917cb6af | ||
|
|
1c43c6d1c5 | ||
|
|
9bbf7bf01b | ||
|
|
5a845104fb | ||
|
|
693eb3cb1d | ||
|
|
78f5827fa6 | ||
|
|
af8a7eb695 | ||
|
|
97ce8ba500 | ||
|
|
03d892bcf1 | ||
|
|
360c9e24b2 | ||
|
|
ba0a726cfc | ||
|
|
b2f4e237c2 | ||
|
|
5f71d05db1 | ||
|
|
340059989b | ||
|
|
5b636e451a | ||
|
|
ecc77f8cae | ||
|
|
8a5239575a | ||
|
|
6461625832 | ||
|
|
28f6f42ed4 | ||
|
|
7bc2f4e8d1 | ||
|
|
d588def0af | ||
|
|
6c12b968a7 | ||
|
|
18f778a871 | ||
|
|
0f6c244d81 | ||
|
|
2fb0633354 | ||
|
|
38aa522016 | ||
|
|
7cc7ea2fa0 | ||
|
|
88f4c33d72 | ||
|
|
a11f2cdae5 | ||
|
|
f0902e91d1 | ||
|
|
8988d9a224 | ||
|
|
cadaa996da | ||
|
|
25b9350fd4 | ||
|
|
a9bc43a9dd | ||
|
|
4ad8a13b5e | ||
|
|
c7c6009e1c | ||
|
|
a5a1a2ed15 | ||
|
|
8798371454 | ||
|
|
9151b3d51f | ||
|
|
8ef512d9f6 | ||
|
|
c98d0d5bd1 | ||
|
|
4e611fe736 | ||
|
|
3f600b2e28 | ||
|
|
0b21c54236 | ||
|
|
2899fa6f8f | ||
|
|
9bd443cded | ||
|
|
1f7b9cebcc | ||
|
|
863b36226d | ||
|
|
1ebb64d4d4 | ||
|
|
e6fe7eb7d3 | ||
|
|
dcb5378ff9 | ||
|
|
c94fa21c28 | ||
|
|
2b3da03da8 | ||
|
|
66fbd104e9 | ||
|
|
ac9cf58afa | ||
|
|
b6f4328167 | ||
|
|
e63aa444e5 | ||
|
|
54285e6c64 | ||
|
|
48bf5cb644 | ||
|
|
336408f3d0 | ||
|
|
b9e7c710d8 | ||
|
|
c8b24ab363 | ||
|
|
62b4d9144f | ||
|
|
6627dc33a9 | ||
|
|
49335fdcdb | ||
|
|
b8c08c3574 | ||
|
|
32354d7fb1 | ||
|
|
11c6b2bc98 | ||
|
|
ec07e641ee | ||
|
|
3b8cd84f82 | ||
|
|
88545e5aa8 | ||
|
|
bc041cf940 | ||
|
|
9aa2ec3ccd | ||
|
|
1dd08f35ef | ||
|
|
a205fff1a7 | ||
|
|
191dbcc58d | ||
|
|
cd565f362f | ||
|
|
e5d8fcf2f8 | ||
|
|
fdc4622208 | ||
|
|
734025f03f | ||
|
|
277d94f447 | ||
|
|
e05f34392d | ||
|
|
8516ede345 | ||
|
|
6363967895 | ||
|
|
655697f2fd | ||
|
|
8252b1eada | ||
|
|
139009546c | ||
|
|
1530f6c24f | ||
|
|
eddd131dcd | ||
|
|
78f4e00dac | ||
|
|
66bffabc1b | ||
|
|
c89f268af1 | ||
|
|
ee28112015 | ||
|
|
a5c7804185 | ||
|
|
85d5eec8b4 | ||
|
|
3bd38584d7 | ||
|
|
2c7f294279 | ||
|
|
380d0ff9a1 | ||
|
|
2bbf957c29 | ||
|
|
467e7c992b | ||
|
|
e706b5d4a3 | ||
|
|
84feb2beb4 | ||
|
|
46c8f104c3 | ||
|
|
23c959fb71 | ||
|
|
a74fb181b3 | ||
|
|
b8535d2c5e | ||
|
|
986a3a1f2a | ||
|
|
522efff188 | ||
|
|
afd363b896 | ||
|
|
a944f47313 | ||
|
|
755005bb56 | ||
|
|
5ad47a1947 | ||
|
|
7c0918375e | ||
|
|
d6466368c1 | ||
|
|
5d0b64773e | ||
|
|
e79e12fbe6 | ||
|
|
853df82f4a | ||
|
|
0e849d142c | ||
|
|
7e012f5ca0 | ||
|
|
ef897db10b | ||
|
|
85489c63b4 | ||
|
|
7f1a9010dc | ||
|
|
6b79104923 | ||
|
|
0c3db0b0e6 | ||
|
|
89237d2681 | ||
|
|
0a53eb2973 | ||
|
|
195d35dcc6 | ||
|
|
19fbe2faa8 | ||
|
|
4b9e071558 | ||
|
|
fa44776702 | ||
|
|
23cbc9c91f | ||
|
|
8f4ce76543 | ||
|
|
2dfe233ebe | ||
|
|
73bed17869 | ||
|
|
21bf141019 | ||
|
|
c990bcdf66 | ||
|
|
14ac74f76d | ||
|
|
63c7285b8b | ||
|
|
560dad3873 | ||
|
|
b97c3af09f | ||
|
|
de9fa2f821 | ||
|
|
63c9896d82 | ||
|
|
cad525ff16 | ||
|
|
01c759dcd1 | ||
|
|
ea12c0f11e | ||
|
|
bd5864f40a | ||
|
|
b7a763c074 | ||
|
|
c4a0c1480d | ||
|
|
2324357907 | ||
|
|
1e3759bb25 | ||
|
|
56f200fb59 | ||
|
|
210db6de95 | ||
|
|
2255b0a6c7 | ||
|
|
5c1bf0ad70 | ||
|
|
accc7f9a83 | ||
|
|
b41391a4fa | ||
|
|
70c036a4be | ||
|
|
70f0500825 | ||
|
|
7855b0024d | ||
|
|
44b4afbcdf | ||
|
|
416f68860e | ||
|
|
95b3b31b11 | ||
|
|
7fc3d7c23b | ||
|
|
072ef8f724 | ||
|
|
ab4348ed67 | ||
|
|
2175bb519e | ||
|
|
f1107c5018 | ||
|
|
c0e1a1a323 | ||
|
|
9e00d48206 | ||
|
|
0fb55d9f8d | ||
|
|
dc7d791127 | ||
|
|
51c803cc12 | ||
|
|
ccf7bdd2d6 | ||
|
|
49ed837f97 | ||
|
|
5a4bdd4f6e | ||
|
|
0a9be7c164 | ||
|
|
4fba13c813 | ||
|
|
913c740a87 | ||
|
|
2c4febb9cf | ||
|
|
a03751e0ae | ||
|
|
2d5871cfeb | ||
|
|
bbdce2f6ee | ||
|
|
fb45a94bb8 | ||
|
|
15c0e4122e | ||
|
|
556535be84 | ||
|
|
17afabc1ff | ||
|
|
9c5b7a526d | ||
|
|
4d1c8e886d | ||
|
|
ba3c0305c4 | ||
|
|
3299184d3b | ||
|
|
4c56fac228 | ||
|
|
fd11f90d96 | ||
|
|
0aaab7fa30 | ||
|
|
37384fc200 | ||
|
|
0f67440b26 | ||
|
|
91e470acfc | ||
|
|
09e628025a | ||
|
|
bd728cbdbc | ||
|
|
b79dc3bccf | ||
|
|
72827b29f2 | ||
|
|
feca6ccb84 | ||
|
|
cfcf24b657 | ||
|
|
b5f0363a3d | ||
|
|
aed06c3021 | ||
|
|
b8c2b7aa96 | ||
|
|
7fa40dbe77 | ||
|
|
0fceb5ee59 | ||
|
|
070d612a3d | ||
|
|
668a637f86 | ||
|
|
9b6ec588f5 | ||
|
|
e6507cd6cd | ||
|
|
6287a9caeb | ||
|
|
6e986d8db1 | ||
|
|
e99e1a650f | ||
|
|
9da8cb619d | ||
|
|
cb61b30e43 | ||
|
|
b9058ca360 | ||
|
|
db3249a0b5 | ||
|
|
3fc268d13d | ||
|
|
c780a1b2c2 | ||
|
|
d98016aa3d | ||
|
|
99d25a3657 | ||
|
|
d38b20de64 | ||
|
|
cdbf14c328 | ||
|
|
dd22f27e39 | ||
|
|
e2cc8b466b | ||
|
|
e1cfd483cd | ||
|
|
7a7ce85acb | ||
|
|
cd9ac72531 | ||
|
|
b898cecf2f | ||
|
|
67f1901015 | ||
|
|
43131d88f5 | ||
|
|
682c76b8c0 | ||
|
|
ac52f4aba8 | ||
|
|
1adc6d8803 | ||
|
|
86f32574cb | ||
|
|
62710f4b01 | ||
|
|
3a2809f658 | ||
|
|
dd13caf3c5 | ||
|
|
c2d6dfe920 | ||
|
|
cea9ef5c97 | ||
|
|
15004d9ad8 | ||
|
|
01bf4c5ac4 | ||
|
|
fbf25c6ba2 | ||
|
|
d7f57ed122 | ||
|
|
19b672846f | ||
|
|
3b3e7ebb9d | ||
|
|
b9cb8fa591 | ||
|
|
8df436aa3b | ||
|
|
239c5474dd | ||
|
|
a3e1c4d5ce | ||
|
|
6d77b9c651 | ||
|
|
d1159170d0 | ||
|
|
d595a0592f | ||
|
|
e3c1e391f9 | ||
|
|
b462edeae6 | ||
|
|
bab9534ed8 | ||
|
|
a393fb03d1 | ||
|
|
5116ef3398 | ||
|
|
4e08ece053 | ||
|
|
3531249e1b | ||
|
|
a4ad1ad40f | ||
|
|
20bd1eeec5 | ||
|
|
514ef4cc42 | ||
|
|
68c1da847d | ||
|
|
ea20b6c47d | ||
|
|
1e87f455e8 | ||
|
|
5a241078b7 | ||
|
|
36ee590071 | ||
|
|
afb0466bcc | ||
|
|
309eb2e702 | ||
|
|
924d55381e | ||
|
|
bcb3550025 | ||
|
|
8c6d97809b | ||
|
|
b9ab50ea93 | ||
|
|
2e18eaa3b2 | ||
|
|
72591788a6 | ||
|
|
ad6f07297c | ||
|
|
c0249c5cc3 | ||
|
|
be0914f839 | ||
|
|
14d3b676ec | ||
|
|
d7919110cd | ||
|
|
e63377092a | ||
|
|
436ff916b6 | ||
|
|
beabd4faf8 | ||
|
|
f23e2a8442 | ||
|
|
aa1f090fb6 | ||
|
|
4d3ef75601 | ||
|
|
c3ca308489 | ||
|
|
22553d73e5 | ||
|
|
148feeb4fd | ||
|
|
a2acd06ab1 | ||
|
|
ad879dadfb | ||
|
|
0b03f99765 | ||
|
|
db26a037f3 | ||
|
|
2d8cb1278c | ||
|
|
fcafbef8c5 | ||
|
|
6fbbdc97ca | ||
|
|
9fae4df34e | ||
|
|
afc1d425d7 | ||
|
|
fce66879e7 | ||
|
|
bb67ecaecf | ||
|
|
ccb122d4a7 | ||
|
|
7964ec90e4 | ||
|
|
5e7135f00d | ||
|
|
258d816184 | ||
|
|
53e5a3ff2d | ||
|
|
233fe5e7a7 | ||
|
|
b4c65441c9 | ||
|
|
73f983e61e | ||
|
|
c8a16adfe8 | ||
|
|
d300d1b2d7 | ||
|
|
1053501df1 | ||
|
|
aaf3f14fee | ||
|
|
8dfc8e35a6 | ||
|
|
976d683185 | ||
|
|
b05d3bb066 | ||
|
|
f7d3fbaeca | ||
|
|
f1790e5e6b | ||
|
|
4334c4c195 | ||
|
|
c6ae772cc1 | ||
|
|
c372578e59 | ||
|
|
8a82ac6277 | ||
|
|
7cdaa09660 | ||
|
|
20877f7946 | ||
|
|
b95980a92b | ||
|
|
4283a0caef | ||
|
|
1fcb6395db | ||
|
|
edc6d9c551 | ||
|
|
feede077f6 | ||
|
|
cfda756e0f | ||
|
|
932553ac83 | ||
|
|
24c6514874 | ||
|
|
70eb639ba7 | ||
|
|
c2a4169e6d | ||
|
|
8fd47ef5b9 | ||
|
|
e595879da9 | ||
|
|
c68061bca7 | ||
|
|
bb8f4e426a | ||
|
|
89037b2123 | ||
|
|
4814bce594 | ||
|
|
26234f5ebf | ||
|
|
6a9064b823 | ||
|
|
572fba3539 | ||
|
|
73627b8d54 | ||
|
|
e2031c1a7f | ||
|
|
cae4aa4a76 | ||
|
|
3e57246740 | ||
|
|
573f60170c |
35
.github/CODEOWNERS
vendored
35
.github/CODEOWNERS
vendored
@@ -1,7 +1,13 @@
|
||||
# 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
|
||||
|
||||
* @barnettZQG @wonderflow @leejanee @Somefive
|
||||
design/ @barnettZQG @leejanee @wonderflow @Somefive
|
||||
* @barnettZQG @wonderflow @leejanee @Somefive @jefree-cat @FogDong
|
||||
design/ @barnettZQG @leejanee @wonderflow @Somefive @jefree-cat @FogDong
|
||||
|
||||
# Owner of Core Controllers
|
||||
pkg/controller/core.oam.dev @Somefive @FogDong @barnettZQG @wonderflow
|
||||
|
||||
# Owner of Standard Controllers
|
||||
pkg/controller/standard.oam.dev @wangyikewxgm @barnettZQG @wonderflow
|
||||
|
||||
# Owner of CUE
|
||||
pkg/cue @leejanee @FogDong @Somefive
|
||||
@@ -11,26 +17,21 @@ pkg/stdlib @leejanee @FogDong @Somefive
|
||||
pkg/workflow @leejanee @FogDong @Somefive
|
||||
|
||||
# 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 @FogDong
|
||||
pkg/controller/core.oam.dev/v1alpha2/core/policies/policydefinition @yangsoon @Somefive @FogDong
|
||||
pkg/controller/core.oam.dev/v1alpha2/core/components/componentdefinition @yangsoon @zzxwill @Somefive
|
||||
pkg/controller/core.oam.dev/v1alpha2/core/traits/traitdefinition @yangsoon @zzxwill @Somefive
|
||||
|
||||
# Owner of health scope controller
|
||||
pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope @captainroy-hy @zzxwill @yangsoon
|
||||
pkg/controller/common/rollout/ @wangyikewxgm @wonderflow
|
||||
runtime/rollout @wangyikewxgm @wonderflow
|
||||
|
||||
# Owner of vela templates
|
||||
vela-templates/ @Somefive @barnettZQG @wonderflow
|
||||
vela-templates/ @Somefive @barnettZQG @wonderflow @FogDong
|
||||
|
||||
# Owner of vela CLI
|
||||
references/cli/ @Somefive @zzxwill @StevenLeiZhang
|
||||
references/cli/ @Somefive @zzxwill @StevenLeiZhang @charlie0129 @chivalryq
|
||||
|
||||
# Owner of vela APIServer
|
||||
pkg/apiserver/ @barnettZQG @yangsoon @FogDong
|
||||
|
||||
# Owner of vela addon framework
|
||||
pkg/addon/ @wangyikewxgm @wonderflow @charlie0129
|
||||
|
||||
# Owner of resource keeper and tracker
|
||||
pkg/resourcekeeper @Somefive @FogDong
|
||||
pkg/resourcetracker @Somefive @FogDong
|
||||
|
||||
2
.github/bot.md
vendored
2
.github/bot.md
vendored
@@ -1,6 +1,6 @@
|
||||
### GitHub & kubevela automation
|
||||
|
||||
The bot is configured via [issue-commands.json](https://github.com/kubevela/kubevela/blob/master/.github/workflows/issue-commands.json)
|
||||
The bot is configured via [issue-commands.json](https://github.com/kubevela/kubevela/blob/master/.github/issue-commands.json)
|
||||
and some other GitHub [workflows](https://github.com/kubevela/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/kubevela/kubevela/blob/master/.github/comment.userlist)
|
||||
|
||||
@@ -17,11 +17,10 @@ on:
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.17'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
KIND_VERSION: 'v0.14.0'
|
||||
KIND_IMAGE_VERSION: '[\"v1.20.15\"]'
|
||||
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.15\",\"v1.22.9\"]'
|
||||
GO_VERSION: '1.19'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -32,26 +31,12 @@ jobs:
|
||||
steps:
|
||||
- name: Detect No-op Changes
|
||||
id: noop
|
||||
uses: fkirc/skip-duplicate-actions@v4.0.0
|
||||
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
|
||||
concurrent_skipping: false
|
||||
|
||||
set-k8s-matrix:
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
matrix: ${{ steps.set-k8s-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- id: set-k8s-matrix
|
||||
run: |
|
||||
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
|
||||
echo "pushing tag: ${{ github.ref_name }}"
|
||||
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
|
||||
else
|
||||
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
|
||||
fi
|
||||
continue-on-error: true
|
||||
|
||||
apiserver-unit-tests:
|
||||
runs-on: ubuntu-20.04
|
||||
@@ -60,18 +45,18 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Cache Go Dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
|
||||
with:
|
||||
path: .work/pkg
|
||||
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
|
||||
@@ -79,15 +64,18 @@ jobs:
|
||||
|
||||
- name: Install ginkgo
|
||||
run: |
|
||||
sudo sed -i 's/azure\.//' /etc/apt/sources.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y golang-ginkgo-dev
|
||||
|
||||
- name: Start MongoDB
|
||||
uses: supercharge/mongodb-github-action@1.7.0
|
||||
uses: supercharge/mongodb-github-action@538a4d2a1041920c47630172445cb688592d6e51 # 1.8.0
|
||||
with:
|
||||
mongodb-version: '5.0'
|
||||
|
||||
# TODO need update action version to resolve node 12 deprecated.
|
||||
- name: install Kubebuilder
|
||||
uses: RyanSiu1995/kubebuilder-action@v1.2
|
||||
uses: RyanSiu1995/kubebuilder-action@ff52bff1bae252239223476e5ab0d71d6ba02343
|
||||
with:
|
||||
version: 3.1.0
|
||||
kubebuilderOnly: false
|
||||
@@ -97,7 +85,7 @@ jobs:
|
||||
run: make unit-test-apiserver
|
||||
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@v1
|
||||
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
file: ./coverage.txt
|
||||
@@ -106,21 +94,24 @@ jobs:
|
||||
|
||||
apiserver-e2e-tests:
|
||||
runs-on: aliyun
|
||||
needs: [ detect-noop,set-k8s-matrix ]
|
||||
needs: [ detect-noop ]
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
strategy:
|
||||
matrix:
|
||||
k8s-version: ${{ fromJson(needs.set-k8s-matrix.outputs.matrix) }}
|
||||
k8s-version: ["v1.20","v1.24"]
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
|
||||
cancel-in-progress: true
|
||||
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
@@ -128,41 +119,58 @@ jobs:
|
||||
run: |
|
||||
go get -v -t -d ./...
|
||||
|
||||
- name: Setup Kind
|
||||
uses: engineerd/setup-kind@v0.5.0
|
||||
- name: Tear down K3d if exist
|
||||
run: |
|
||||
k3d cluster delete || true
|
||||
k3d cluster delete worker || true
|
||||
|
||||
- name: Calculate K3d args
|
||||
run: |
|
||||
EGRESS_ARG=""
|
||||
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
|
||||
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
|
||||
fi
|
||||
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup K3d (Hub)
|
||||
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
|
||||
with:
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
skipClusterCreation: true
|
||||
version: ${{ matrix.k8s-version }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
k3d-args: ${{ env.EGRESS_ARG }}
|
||||
|
||||
- name: Setup Kind Cluster (Worker)
|
||||
|
||||
- name: Setup K3d (Worker)
|
||||
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
|
||||
with:
|
||||
version: ${{ matrix.k8s-version }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
k3d-name: worker
|
||||
k3d-args: --kubeconfig-update-default=false --network=k3d-k3s-default ${{ env.EGRESS_ARG }}
|
||||
|
||||
|
||||
- name: Kind Cluster (Worker)
|
||||
run: |
|
||||
kind delete cluster --name worker
|
||||
kind create cluster --image kindest/node:${{ matrix.k8s-version }} --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
|
||||
internal_ip=$(docker network inspect k3d-k3s-default|jq ".[0].Containers"| jq -r '.[]| select(.Name=="k3d-worker-server-0")|.IPv4Address' | cut -d/ -f1)
|
||||
k3d kubeconfig get worker > /tmp/worker.client.kubeconfig
|
||||
cp /tmp/worker.client.kubeconfig /tmp/worker.kubeconfig
|
||||
sed -i "s/0.0.0.0:[0-9]\+/$internal_ip:6443/" /tmp/worker.kubeconfig
|
||||
|
||||
- name: Setup Kind Cluster (Hub)
|
||||
run: |
|
||||
kind delete cluster
|
||||
kind create cluster --image kindest/node:${{ matrix.k8s-version }}
|
||||
kubectl version
|
||||
kubectl cluster-info
|
||||
|
||||
- name: Load Image to kind cluster
|
||||
run: make kind-load
|
||||
- name: Load image to k3d cluster
|
||||
run: make image-load
|
||||
|
||||
- name: Cleanup for e2e tests
|
||||
run: |
|
||||
make e2e-cleanup
|
||||
make vela-cli
|
||||
make e2e-cleanup
|
||||
make e2e-setup-core
|
||||
bin/vela addon enable fluxcd
|
||||
bin/vela addon enable vela-workflow --override-definitions
|
||||
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
|
||||
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-workflow -n vela-system --timeout=600s
|
||||
|
||||
- name: Run api server e2e test
|
||||
run: |
|
||||
@@ -175,10 +183,10 @@ jobs:
|
||||
run: make end-e2e-core
|
||||
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@v1
|
||||
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: /tmp/e2e_apiserver_test.out
|
||||
files: /tmp/e2e-profile.out, /tmp/e2e_apiserver_test.out
|
||||
flags: apiserver-e2etests
|
||||
name: codecov-umbrella
|
||||
|
||||
@@ -187,4 +195,4 @@ jobs:
|
||||
|
||||
- name: Cleanup image
|
||||
if: ${{ always() }}
|
||||
run: make image-cleanup
|
||||
run: make image-cleanup
|
||||
@@ -4,19 +4,25 @@ on:
|
||||
types:
|
||||
- closed
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
# align with crossplane's choice https://github.com/crossplane/crossplane/blob/master/.github/workflows/backport.yml
|
||||
open-pr:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event.pull_request.merged
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Open Backport PR
|
||||
uses: zeebe-io/backport-action@v0.0.6
|
||||
uses: zeebe-io/backport-action@2ee900dc92632adf994f8e437b6d16840fd61f58
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github_workspace: ${{ github.workspace }}
|
||||
@@ -6,6 +6,9 @@ on:
|
||||
- "v*"
|
||||
workflow_dispatch: { }
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
BUCKET: ${{ secrets.OSS_BUCKET }}
|
||||
ENDPOINT: ${{ secrets.OSS_ENDPOINT }}
|
||||
@@ -21,21 +24,25 @@ jobs:
|
||||
MINIMAL_HELM_CHART: charts/vela-minimal
|
||||
LEGACY_HELM_CHART: legacy/charts/vela-core-legacy
|
||||
VELA_ROLLOUT_HELM_CHART: runtime/rollout/charts
|
||||
LOCAL_OSS_DIRECTORY: .oss/
|
||||
LOCAL_OSS_DIRECTORY: .oss
|
||||
HELM_CHART_NAME: vela-core
|
||||
MINIMAL_HELM_CHART_NAME: vela-minimal
|
||||
LEGACY_HELM_CHART_NAME: vela-core-legacy
|
||||
VELA_ROLLOUT_HELM_CHART_NAME: vela-rollout
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
- name: Get git revision
|
||||
id: vars
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=git_revision::$(git rev-parse --short HEAD)"
|
||||
echo "git_revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||
- name: Install Helm
|
||||
uses: azure/setup-helm@v1
|
||||
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78
|
||||
with:
|
||||
version: v3.4.0
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
|
||||
with:
|
||||
node-version: '14'
|
||||
- name: Generate helm doc
|
||||
@@ -52,7 +59,7 @@ jobs:
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=${GITHUB_REF#refs/tags/}
|
||||
echo ::set-output name=VERSION::${VERSION}
|
||||
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
||||
- name: Tag helm chart image
|
||||
run: |
|
||||
image_tag=${{ steps.get_version.outputs.VERSION }}
|
||||
@@ -86,4 +93,11 @@ jobs:
|
||||
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
|
||||
run: |
|
||||
image_tag=${{ steps.get_version.outputs.VERSION }}
|
||||
chart_semver=${image_tag#"v"}
|
||||
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/index.yaml oss://$BUCKET/core/index.yaml
|
||||
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/$HELM_CHART_NAME-${chart_semver}.tgz oss://$BUCKET/core/$HELM_CHART_NAME-${chart_semver}.tgz
|
||||
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/$MINIMAL_HELM_CHART_NAME-${chart_semver}.tgz oss://$BUCKET/core/$MINIMAL_HELM_CHART_NAME-${chart_semver}.tgz
|
||||
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/$LEGACY_HELM_CHART_NAME-${chart_semver}.tgz oss://$BUCKET/core/$LEGACY_HELM_CHART_NAME-${chart_semver}.tgz
|
||||
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/$VELA_ROLLOUT_HELM_CHART_NAME-${chart_semver}.tgz oss://$BUCKET/core/$VELA_ROLLOUT_HELM_CHART_NAME-${chart_semver}.tgz
|
||||
27
.github/workflows/codeql-analysis.yml
vendored
27
.github/workflows/codeql-analysis.yml
vendored
@@ -4,27 +4,34 @@ on:
|
||||
push:
|
||||
branches: [ master, release-* ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
actions: read # for github/codeql-action/init to get workflow details
|
||||
security-events: write # for github/codeql-action/autobuild to send a status report
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'go' ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
|
||||
|
||||
5
.github/workflows/commit-lint.yml
vendored
5
.github/workflows/commit-lint.yml
vendored
@@ -8,11 +8,14 @@ on:
|
||||
- labeled
|
||||
- unlabeled
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: thehanimo/pr-title-checker@v1.3.1
|
||||
- uses: thehanimo/pr-title-checker@v1.3.5
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
pass_on_octokit_error: true
|
||||
|
||||
40
.github/workflows/core-api-test.yml
vendored
Normal file
40
.github/workflows/core-api-test.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: core-api-test
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'apis/**'
|
||||
- 'pkg/oam/**'
|
||||
- "hack/apis/**"
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
core-api-test:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Set up Go 1.19
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
env:
|
||||
GO_VERSION: '1.19'
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Test build kubevela-core-api
|
||||
env:
|
||||
VERSION: ${{ steps.get_version.outputs.VERSION }}
|
||||
COMMIT_ID: ${{ github.sha }}
|
||||
run: |
|
||||
bash ./hack/apis/clientgen.sh
|
||||
bash ./hack/apis/sync.sh test
|
||||
47
.github/workflows/definition-lint.yml
vendored
Normal file
47
.github/workflows/definition-lint.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
name: Definition-Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
workflow_dispatch: {}
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.19'
|
||||
|
||||
jobs:
|
||||
definition-doc:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Setup K3d
|
||||
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
|
||||
with:
|
||||
version: v1.20
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Definition Doc generate check
|
||||
run: |
|
||||
go build -o docgen hack/docgen/def/gen.go
|
||||
./docgen --type=comp --force-example-doc --path=./comp-def-check.md
|
||||
./docgen --type=trait --force-example-doc --path=./trait-def-check.md
|
||||
./docgen --type=wf --force-example-doc --path=./wf-def-check.md
|
||||
./docgen --type=policy --force-example-doc --path=./policy-def-check.md
|
||||
99
.github/workflows/e2e-multicluster-test.yml
vendored
99
.github/workflows/e2e-multicluster-test.yml
vendored
@@ -13,60 +13,49 @@ on:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.17'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
KIND_VERSION: 'v0.14.0'
|
||||
KIND_IMAGE_VERSION: '[\"v1.20.15\"]'
|
||||
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.15\",\"v1.22.9\"]'
|
||||
GO_VERSION: '1.19'
|
||||
|
||||
jobs:
|
||||
|
||||
detect-noop:
|
||||
permissions:
|
||||
actions: write
|
||||
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@v4.0.0
|
||||
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
|
||||
concurrent_skipping: false
|
||||
|
||||
set-k8s-matrix:
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
matrix: ${{ steps.set-k8s-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- id: set-k8s-matrix
|
||||
run: |
|
||||
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
|
||||
echo "pushing tag: ${{ github.ref_name }}"
|
||||
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
|
||||
else
|
||||
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
|
||||
fi
|
||||
|
||||
continue-on-error: true
|
||||
|
||||
e2e-multi-cluster-tests:
|
||||
runs-on: aliyun
|
||||
needs: [ detect-noop,set-k8s-matrix ]
|
||||
needs: [ detect-noop ]
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
strategy:
|
||||
matrix:
|
||||
k8s-version: ${{ fromJson(needs.set-k8s-matrix.outputs.matrix) }}
|
||||
k8s-version: ["v1.20","v1.24"]
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
|
||||
cancel-in-progress: true
|
||||
|
||||
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
@@ -74,37 +63,49 @@ jobs:
|
||||
run: |
|
||||
go get -v -t -d ./...
|
||||
|
||||
- name: Setup Kind
|
||||
uses: engineerd/setup-kind@v0.5.0
|
||||
- name: Tear down K3d if exist
|
||||
run: |
|
||||
k3d cluster delete || true
|
||||
k3d cluster delete worker || true
|
||||
|
||||
- name: Calculate K3d args
|
||||
run: |
|
||||
EGRESS_ARG=""
|
||||
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
|
||||
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
|
||||
fi
|
||||
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup K3d (Hub)
|
||||
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
|
||||
with:
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
skipClusterCreation: true
|
||||
version: ${{ matrix.k8s-version }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
k3d-args: ${{ env.EGRESS_ARG }}
|
||||
|
||||
- name: Setup Kind Cluster (Worker)
|
||||
- name: Setup K3d (Worker)
|
||||
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
|
||||
with:
|
||||
version: ${{ matrix.k8s-version }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
k3d-name: worker
|
||||
k3d-args: --kubeconfig-update-default=false --network=k3d-k3s-default ${{ env.EGRESS_ARG }}
|
||||
|
||||
- name: Generating internal worker kubeconfig
|
||||
run: |
|
||||
kind delete cluster --name worker
|
||||
kind create cluster --image kindest/node:${{ matrix.k8s-version }} --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
|
||||
internal_ip=$(docker network inspect k3d-k3s-default|jq ".[0].Containers"| jq -r '.[]| select(.Name=="k3d-worker-server-0")|.IPv4Address' | cut -d/ -f1)
|
||||
k3d kubeconfig get worker > /tmp/worker.client.kubeconfig
|
||||
cp /tmp/worker.client.kubeconfig /tmp/worker.kubeconfig
|
||||
sed -i "s/0.0.0.0:[0-9]\+/$internal_ip:6443/" /tmp/worker.kubeconfig
|
||||
|
||||
- name: Setup Kind Cluster (Hub)
|
||||
run: |
|
||||
kind delete cluster
|
||||
kind create cluster --image kindest/node:${{ matrix.k8s-version }}
|
||||
kubectl version
|
||||
kubectl cluster-info
|
||||
|
||||
- name: Load Image to kind cluster (Hub)
|
||||
run: make kind-load
|
||||
- name: Load image to k3d cluster (hub and worker)
|
||||
run: make image-load image-load-runtime-cluster
|
||||
|
||||
- name: Cleanup for e2e tests
|
||||
run: |
|
||||
make e2e-cleanup
|
||||
make vela-cli
|
||||
make e2e-cleanup
|
||||
make e2e-setup-core-auth
|
||||
make
|
||||
make setup-runtime-e2e-cluster
|
||||
|
||||
- name: Run e2e multicluster tests
|
||||
@@ -116,7 +117,7 @@ jobs:
|
||||
run: make end-e2e-core
|
||||
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@v1
|
||||
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: /tmp/e2e-profile.out,/tmp/e2e_multicluster_test.out
|
||||
|
||||
83
.github/workflows/e2e-rollout-test.yml
vendored
83
.github/workflows/e2e-rollout-test.yml
vendored
@@ -13,58 +13,49 @@ on:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.17'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
KIND_VERSION: 'v0.14.0'
|
||||
KIND_IMAGE_VERSION: '[\"v1.20.15\"]'
|
||||
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.15\",\"v1.22.9\"]'
|
||||
GO_VERSION: '1.19'
|
||||
|
||||
jobs:
|
||||
|
||||
detect-noop:
|
||||
permissions:
|
||||
actions: write
|
||||
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@v4.0.0
|
||||
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
|
||||
concurrent_skipping: false
|
||||
|
||||
set-k8s-matrix:
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
matrix: ${{ steps.set-k8s-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- id: set-k8s-matrix
|
||||
run: |
|
||||
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
|
||||
echo "pushing tag: ${{ github.ref_name }}"
|
||||
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
|
||||
else
|
||||
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
|
||||
fi
|
||||
continue-on-error: true
|
||||
|
||||
e2e-rollout-tests:
|
||||
runs-on: aliyun
|
||||
needs: [ detect-noop,set-k8s-matrix ]
|
||||
needs: [ detect-noop ]
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
strategy:
|
||||
matrix:
|
||||
k8s-version: ${{ fromJson(needs.set-k8s-matrix.outputs.matrix) }}
|
||||
k8s-version: ["v1.20","v1.24"]
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
|
||||
cancel-in-progress: true
|
||||
|
||||
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
@@ -72,33 +63,35 @@ jobs:
|
||||
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
|
||||
- name: Tear down K3d if exist
|
||||
run: |
|
||||
kind delete cluster
|
||||
kind create cluster --image kindest/node:${{ matrix.k8s-version }}
|
||||
kubectl version
|
||||
kubectl cluster-info
|
||||
k3d cluster delete || true
|
||||
k3d cluster delete worker || true
|
||||
|
||||
- name: Load Image to kind cluster
|
||||
run: make kind-load
|
||||
- name: Calculate K3d args
|
||||
run: |
|
||||
EGRESS_ARG=""
|
||||
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
|
||||
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
|
||||
fi
|
||||
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
|
||||
|
||||
- name: Run Make
|
||||
run: make
|
||||
- name: Setup K3d
|
||||
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
|
||||
with:
|
||||
version: ${{ matrix.k8s-version }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
k3d-args: ${{ env.EGRESS_ARG }}
|
||||
|
||||
- name: Run Make Manager
|
||||
run: make manager
|
||||
- name: Load image to k3d cluster
|
||||
run: make image-load image-load-runtime-cluster
|
||||
|
||||
- name: Prepare for e2e tests
|
||||
run: |
|
||||
make vela-cli
|
||||
make e2e-cleanup
|
||||
make e2e-setup
|
||||
helm lint ./charts/vela-core
|
||||
make e2e-setup-core
|
||||
make setup-runtime-e2e-cluster
|
||||
helm test -n vela-system kubevela --timeout 5m
|
||||
|
||||
- name: Run e2e tests
|
||||
@@ -108,7 +101,7 @@ jobs:
|
||||
run: make end-e2e
|
||||
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@v1
|
||||
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: /tmp/e2e-profile.out
|
||||
|
||||
82
.github/workflows/e2e-test.yml
vendored
82
.github/workflows/e2e-test.yml
vendored
@@ -13,58 +13,49 @@ on:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.17'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
KIND_VERSION: 'v0.14.0'
|
||||
KIND_IMAGE_VERSION: '[\"v1.20.15\"]'
|
||||
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.15\",\"v1.22.9\"]'
|
||||
GO_VERSION: '1.19'
|
||||
|
||||
jobs:
|
||||
|
||||
detect-noop:
|
||||
permissions:
|
||||
actions: write
|
||||
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@v4.0.0
|
||||
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
|
||||
concurrent_skipping: false
|
||||
|
||||
set-k8s-matrix:
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
matrix: ${{ steps.set-k8s-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- id: set-k8s-matrix
|
||||
run: |
|
||||
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
|
||||
echo "pushing tag: ${{ github.ref_name }}"
|
||||
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
|
||||
else
|
||||
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
|
||||
fi
|
||||
continue-on-error: true
|
||||
|
||||
e2e-tests:
|
||||
runs-on: aliyun
|
||||
needs: [ detect-noop,set-k8s-matrix ]
|
||||
needs: [ detect-noop ]
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
strategy:
|
||||
matrix:
|
||||
k8s-version: ${{ fromJson(needs.set-k8s-matrix.outputs.matrix) }}
|
||||
k8s-version: ["v1.20","v1.24"]
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
|
||||
cancel-in-progress: true
|
||||
|
||||
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
@@ -72,33 +63,36 @@ jobs:
|
||||
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
|
||||
- name: Tear down K3d if exist
|
||||
run: |
|
||||
kind delete cluster
|
||||
kind create cluster --image kindest/node:${{ matrix.k8s-version }}
|
||||
kubectl version
|
||||
kubectl cluster-info
|
||||
k3d cluster delete || true
|
||||
k3d cluster delete worker || true
|
||||
|
||||
- name: Load Image to kind cluster
|
||||
run: make kind-load
|
||||
- name: Calculate K3d args
|
||||
run: |
|
||||
EGRESS_ARG=""
|
||||
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
|
||||
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
|
||||
fi
|
||||
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup K3d
|
||||
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
|
||||
with:
|
||||
version: ${{ matrix.k8s-version }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
k3d-args: ${{ env.EGRESS_ARG }}
|
||||
|
||||
- name: Load image to k3d cluster
|
||||
run: make image-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
|
||||
make e2e-setup-core
|
||||
helm test -n vela-system kubevela --timeout 5m
|
||||
|
||||
- name: Run api e2e tests
|
||||
@@ -114,7 +108,7 @@ jobs:
|
||||
run: make end-e2e
|
||||
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@v1
|
||||
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: /tmp/e2e-profile.out
|
||||
|
||||
152
.github/workflows/go.yml
vendored
152
.github/workflows/go.yml
vendored
@@ -11,11 +11,13 @@ on:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions: # added using https://github.com/step-security/secure-workflows
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.17'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
KIND_VERSION: 'v0.14.0'
|
||||
GO_VERSION: '1.19'
|
||||
GOLANGCI_VERSION: 'v1.49'
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -23,15 +25,17 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
permissions:
|
||||
actions: write
|
||||
steps:
|
||||
- name: Detect No-op Changes
|
||||
id: noop
|
||||
uses: fkirc/skip-duplicate-actions@v4.0.0
|
||||
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
|
||||
concurrent_skipping: false
|
||||
continue-on-error: true
|
||||
|
||||
staticcheck:
|
||||
runs-on: ubuntu-20.04
|
||||
@@ -40,27 +44,17 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
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=on go get honnef.co/go/tools/cmd/staticcheck@v0.3.0
|
||||
|
||||
- name: Static Check
|
||||
run: staticcheck ./...
|
||||
run: make staticcheck
|
||||
|
||||
- name: License Header Check
|
||||
run: make check-license-header
|
||||
@@ -69,31 +63,27 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
permissions:
|
||||
contents: read # for actions/checkout to fetch code
|
||||
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
|
||||
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
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@v3
|
||||
uses: golangci/golangci-lint-action@07db5389c99593f11ad7b44463c2d4233066a9b1 # v3.3.0
|
||||
with:
|
||||
version: ${{ env.GOLANGCI_VERSION }}
|
||||
|
||||
@@ -104,35 +94,125 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
|
||||
with:
|
||||
node-version: '14'
|
||||
|
||||
- name: Cache Go Dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
|
||||
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
|
||||
run: |
|
||||
export PATH=$(pwd)/bin/:$PATH
|
||||
make check-diff
|
||||
|
||||
- name: Cleanup binary
|
||||
run: make build-cleanup
|
||||
|
||||
check-windows:
|
||||
runs-on: windows-latest
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Cache Go Dependencies
|
||||
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
|
||||
with:
|
||||
path: .work/pkg
|
||||
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: ${{ runner.os }}-pkg-
|
||||
|
||||
- name: Run Build CLI
|
||||
run: make vela-cli
|
||||
|
||||
- name: Run CLI for version
|
||||
shell: cmd
|
||||
run: |
|
||||
move .\bin\vela .\bin\vela.exe
|
||||
.\bin\vela.exe version
|
||||
|
||||
check-core-image-build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
submodules: true
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
|
||||
- name: Build Test for vela core
|
||||
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
check-apiserver-image-build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
submodules: true
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
|
||||
- name: Build Test for apiserver
|
||||
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apiserver
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
check-cli-image-build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
submodules: true
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
|
||||
- name: Build Test for CLI
|
||||
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.cli
|
||||
|
||||
20
.github/workflows/issue-commands.yml
vendored
20
.github/workflows/issue-commands.yml
vendored
@@ -5,18 +5,21 @@ on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
bot:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
repository: "oam-dev/kubevela-github-actions"
|
||||
path: ./actions
|
||||
ref: v0.4.2
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
|
||||
with:
|
||||
node-version: '14'
|
||||
cache: 'npm'
|
||||
@@ -30,12 +33,15 @@ jobs:
|
||||
configPath: issue-commands
|
||||
|
||||
backport:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
if: github.event.issue.pull_request && contains(github.event.comment.body, '/backport')
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Extract Command
|
||||
id: command
|
||||
uses: xt0rted/slash-command-action@v1
|
||||
uses: xt0rted/slash-command-action@bf51f8f5f4ea3d58abc7eca58f77104182b23e88
|
||||
with:
|
||||
repo-token: ${{ secrets.VELA_BOT_TOKEN }}
|
||||
command: backport
|
||||
@@ -44,7 +50,7 @@ jobs:
|
||||
allow-edits: "false"
|
||||
permission-level: read
|
||||
- name: Handle Command
|
||||
uses: actions/github-script@v4
|
||||
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0
|
||||
env:
|
||||
VERSION: ${{ steps.command.outputs.command-arguments }}
|
||||
with:
|
||||
@@ -65,11 +71,11 @@ jobs:
|
||||
})
|
||||
console.log("Added '" + label + "' label.")
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Open Backport PR
|
||||
uses: zeebe-io/backport-action@v0.0.6
|
||||
uses: zeebe-io/backport-action@2ee900dc92632adf994f8e437b6d16840fd61f58
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github_workspace: ${{ github.workspace }}
|
||||
|
||||
5
.github/workflows/license.yml
vendored
5
.github/workflows/license.yml
vendored
@@ -9,13 +9,16 @@ on:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
-
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
license_check:
|
||||
runs-on: ubuntu-latest
|
||||
name: Check for unapproved licenses
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
|
||||
70
.github/workflows/registry.yml
vendored
70
.github/workflows/registry.yml
vendored
@@ -11,11 +11,16 @@ env:
|
||||
ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
|
||||
ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
publish-core-images:
|
||||
permissions:
|
||||
packages: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: |
|
||||
@@ -23,36 +28,36 @@ jobs:
|
||||
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
|
||||
VERSION=latest
|
||||
fi
|
||||
echo ::set-output name=VERSION::${VERSION}
|
||||
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
||||
- name: Get git revision
|
||||
id: vars
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=git_revision::$(git rev-parse --short HEAD)"
|
||||
echo "git_revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||
- name: Login ghcr.io
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Login docker.io
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
|
||||
with:
|
||||
registry: docker.io
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: Login Alibaba Cloud ACR
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
|
||||
with:
|
||||
registry: ${{ secrets.ACR_DOMAIN }}
|
||||
username: ${{ secrets.ACR_USERNAME }}
|
||||
password: ${{ secrets.ACR_PASSWORD }}
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
|
||||
- uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
|
||||
with:
|
||||
driver-opts: image=moby/buildkit:master
|
||||
|
||||
- uses: docker/build-push-action@v2
|
||||
- uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
|
||||
name: Build & Pushing vela-core for Dockerhub, GHCR and ACR
|
||||
with:
|
||||
context: .
|
||||
@@ -71,7 +76,7 @@ jobs:
|
||||
ghcr.io/${{ github.repository_owner }}/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
|
||||
${{ secrets.ACR_DOMAIN }}/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
|
||||
|
||||
- uses: docker/build-push-action@v2
|
||||
- uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
|
||||
name: Build & Pushing CLI for Dockerhub, GHCR and ACR
|
||||
with:
|
||||
context: .
|
||||
@@ -91,9 +96,11 @@ jobs:
|
||||
${{ secrets.ACR_DOMAIN }}/oamdev/vela-cli:${{ steps.get_version.outputs.VERSION }}
|
||||
|
||||
publish-addon-images:
|
||||
permissions:
|
||||
packages: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: |
|
||||
@@ -101,36 +108,36 @@ jobs:
|
||||
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
|
||||
VERSION=latest
|
||||
fi
|
||||
echo ::set-output name=VERSION::${VERSION}
|
||||
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
||||
- name: Get git revision
|
||||
id: vars
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=git_revision::$(git rev-parse --short HEAD)"
|
||||
echo "git_revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||
- name: Login ghcr.io
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Login docker.io
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
|
||||
with:
|
||||
registry: docker.io
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: Login Alibaba Cloud ACR
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
|
||||
with:
|
||||
registry: ${{ secrets.ACR_DOMAIN }}
|
||||
username: ${{ secrets.ACR_USERNAME }}
|
||||
password: ${{ secrets.ACR_PASSWORD }}
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
|
||||
- uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
|
||||
with:
|
||||
driver-opts: image=moby/buildkit:master
|
||||
|
||||
- uses: docker/build-push-action@v2
|
||||
- uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
|
||||
name: Build & Pushing vela-apiserver for Dockerhub, GHCR and ACR
|
||||
with:
|
||||
context: .
|
||||
@@ -149,7 +156,7 @@ jobs:
|
||||
ghcr.io/${{ github.repository_owner }}/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }}
|
||||
${{ secrets.ACR_DOMAIN }}/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }}
|
||||
|
||||
- uses: docker/build-push-action@v2
|
||||
- uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
|
||||
name: Build & Pushing runtime rollout Dockerhub, GHCR and ACR
|
||||
with:
|
||||
context: .
|
||||
@@ -167,25 +174,6 @@ jobs:
|
||||
docker.io/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
|
||||
ghcr.io/${{ github.repository_owner }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
|
||||
${{ secrets.ACR_DOMAIN }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
|
||||
|
||||
- uses: docker/build-push-action@v2
|
||||
name: Build & Pushing CloudShell for Dockerhub, GHCR and ACR
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.cloudshell
|
||||
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 }}
|
||||
GOPROXY=https://proxy.golang.org
|
||||
tags: |-
|
||||
docker.io/oamdev/cloudshell:${{ steps.get_version.outputs.VERSION }}
|
||||
ghcr.io/${{ github.repository_owner }}/oamdev/cloudshell:${{ steps.get_version.outputs.VERSION }}
|
||||
${{ secrets.ACR_DOMAIN }}/oamdev/cloudshell:${{ steps.get_version.outputs.VERSION }}
|
||||
|
||||
publish-capabilities:
|
||||
env:
|
||||
@@ -194,7 +182,7 @@ jobs:
|
||||
CAPABILITY_ENDPOINT: oss-cn-beijing.aliyuncs.com
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
- 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
|
||||
@@ -204,4 +192,4 @@ jobs:
|
||||
- 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
|
||||
run: ./ossutil --config-file .ossutilconfig sync $CAPABILITY_DIR oss://$CAPABILITY_BUCKET -f
|
||||
|
||||
171
.github/workflows/release.yml
vendored
171
.github/workflows/release.yml
vendored
@@ -7,119 +7,56 @@ on:
|
||||
workflow_dispatch: { }
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BUCKET: ${{ secrets.CLI_OSS_BUCKET }}
|
||||
ENDPOINT: ${{ secrets.CLI_OSS_ENDPOINT }}
|
||||
ACCESS_KEY: ${{ secrets.CLI_OSS_ACCESS_KEY }}
|
||||
ACCESS_KEY_SECRET: ${{ secrets.CLI_OSS_ACCESS_KEY_SECRET }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
permissions:
|
||||
contents: write
|
||||
actions: read
|
||||
checks: write
|
||||
issues: read
|
||||
packages: write
|
||||
pull-requests: read
|
||||
repository-projects: read
|
||||
statuses: read
|
||||
runs-on: ubuntu-latest
|
||||
name: build
|
||||
strategy:
|
||||
matrix:
|
||||
TARGETS: [ linux/amd64, darwin/amd64, windows/amd64, linux/arm64, darwin/arm64 ]
|
||||
env:
|
||||
VELA_VERSION_KEY: github.com/oam-dev/kubevela/version.VelaVersion
|
||||
VELA_GITVERSION_KEY: github.com/oam-dev/kubevela/version.GitRevision
|
||||
GO_BUILD_ENV: GO111MODULE=on CGO_ENABLED=0
|
||||
DIST_DIRS: find * -type d -exec
|
||||
name: goreleaser
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
go-version: 1.17
|
||||
- name: Get release
|
||||
id: get_release
|
||||
uses: bruceadams/get-release@v1.2.2
|
||||
fetch-depth: 0
|
||||
- run: git fetch --force --tags
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
with:
|
||||
go-version: 1.19
|
||||
cache: true
|
||||
- uses: goreleaser/goreleaser-action@9754a253a8673b0ea869c2e863b4e975497efd0c # v4.1.1
|
||||
with:
|
||||
distribution: goreleaser
|
||||
version: 1.14.1
|
||||
args: release --rm-dist --timeout 60m
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Since goreleaser haven't supported aliyun OSS, we need to upload the release manually
|
||||
- name: Get version
|
||||
run: echo "VELA_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||
- name: Get matrix
|
||||
id: get_matrix
|
||||
run: |
|
||||
TARGETS=${{matrix.TARGETS}}
|
||||
echo ::set-output name=OS::${TARGETS%/*}
|
||||
echo ::set-output name=ARCH::${TARGETS#*/}
|
||||
- name: Get ldflags
|
||||
id: get_ldflags
|
||||
run: |
|
||||
LDFLAGS="-s -w -X ${{ env.VELA_VERSION_KEY }}=${{ env.VELA_VERSION }} -X ${{ env.VELA_GITVERSION_KEY }}=git-$(git rev-parse --short HEAD)"
|
||||
echo "LDFLAGS=${LDFLAGS}" >> $GITHUB_ENV
|
||||
- name: Build
|
||||
run: |
|
||||
${{ env.GO_BUILD_ENV }} GOOS=${{ steps.get_matrix.outputs.OS }} GOARCH=${{ steps.get_matrix.outputs.ARCH }} \
|
||||
go build -ldflags "${{ env.LDFLAGS }}" \
|
||||
-o _bin/vela/${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}/vela -v \
|
||||
./references/cmd/cli/main.go
|
||||
${{ env.GO_BUILD_ENV }} GOOS=${{ steps.get_matrix.outputs.OS }} GOARCH=${{ steps.get_matrix.outputs.ARCH }} \
|
||||
go build -ldflags "${{ env.LDFLAGS }}" \
|
||||
-o _bin/kubectl-vela/${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}/kubectl-vela -v \
|
||||
./cmd/plugin/main.go
|
||||
- name: Compress
|
||||
run: |
|
||||
echo "\n## Release Info\nVERSION: ${{ env.VELA_VERSION }}" >> README.md && \
|
||||
echo "GIT_COMMIT: ${GITHUB_SHA}\n" >> README.md && \
|
||||
cd _bin/vela && \
|
||||
${{ env.DIST_DIRS }} cp ../../LICENSE {} \; && \
|
||||
${{ env.DIST_DIRS }} cp ../../README.md {} \; && \
|
||||
${{ env.DIST_DIRS }} tar -zcf vela-{}.tar.gz {} \; && \
|
||||
${{ env.DIST_DIRS }} zip -r vela-{}.zip {} \; && \
|
||||
cd ../kubectl-vela && \
|
||||
${{ env.DIST_DIRS }} cp ../../LICENSE {} \; && \
|
||||
${{ env.DIST_DIRS }} cp ../../README.md {} \; && \
|
||||
${{ env.DIST_DIRS }} tar -zcf kubectl-vela-{}.tar.gz {} \; && \
|
||||
${{ env.DIST_DIRS }} zip -r kubectl-vela-{}.zip {} \; && \
|
||||
cd .. && \
|
||||
sha256sum vela/vela-* kubectl-vela/kubectl-vela-* >> sha256-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.txt \
|
||||
- name: Upload Vela tar.gz
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela/vela-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.tar.gz
|
||||
asset_name: vela-${{ env.VELA_VERSION }}-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Vela zip
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: ./_bin/vela/vela-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.zip
|
||||
asset_name: vela-${{ env.VELA_VERSION }}-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela 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-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.tar.gz
|
||||
asset_name: kubectl-vela-${{ env.VELA_VERSION }}-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.tar.gz
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Upload Kubectl-Vela 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-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.zip
|
||||
asset_name: kubectl-vela-${{ env.VELA_VERSION }}-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.zip
|
||||
asset_content_type: binary/octet-stream
|
||||
- name: Post sha256
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: sha256sums
|
||||
path: ./_bin/sha256-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.txt
|
||||
retention-days: 1
|
||||
- name: clear the asset
|
||||
run: |
|
||||
rm -rf ./_bin/vela/${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}
|
||||
mv ./_bin/vela/vela-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.tar.gz ./_bin/vela/vela-${{ env.VELA_VERSION }}-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.tar.gz
|
||||
mv ./_bin/vela/vela-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.zip ./_bin/vela/vela-${{ env.VELA_VERSION }}-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.zip
|
||||
- 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
|
||||
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT}
|
||||
- name: split files to be upload
|
||||
run: mkdir -p ./dist/files_upload && mv ./dist/*.tar.gz ./dist/files_upload && mv ./dist/*.zip ./dist/files_upload
|
||||
- name: sync local to cloud
|
||||
run: ./ossutil --config-file .ossutilconfig sync ./_bin/vela oss://$BUCKET/binary/vela/${{ env.VELA_VERSION }}
|
||||
|
||||
run: ./ossutil --config-file .ossutilconfig sync ./dist/files_upload oss://$BUCKET/binary/vela/${{ env.VELA_VERSION }}
|
||||
- name: sync the latest version file
|
||||
if: ${{ !contains(env.VELA_VERSION,'alpha') && !contains(env.VELA_VERSION,'beta') }}
|
||||
run: |
|
||||
@@ -130,44 +67,26 @@ jobs:
|
||||
verlte ${{ env.VELA_VERSION }} $LATEST_VERSION && echo "${{ env.VELA_VERSION }} <= $LATEST_VERSION, skip update" && exit 0
|
||||
echo ${{ env.VELA_VERSION }} > ./latest_version
|
||||
./ossutil --config-file .ossutilconfig cp -u ./latest_version oss://$BUCKET/binary/vela/latest_version
|
||||
|
||||
|
||||
upload-plugin-homebrew:
|
||||
permissions:
|
||||
contents: write
|
||||
actions: read
|
||||
checks: write
|
||||
issues: read
|
||||
packages: write
|
||||
pull-requests: read
|
||||
repository-projects: read
|
||||
statuses: read
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
name: upload-sha256sums
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Get release
|
||||
id: get_release
|
||||
uses: bruceadams/get-release@v1.2.2
|
||||
- name: Download sha256sums
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: sha256sums
|
||||
path: cli-artifacts
|
||||
- name: Display structure of downloaded files
|
||||
run: ls -R
|
||||
working-directory: cli-artifacts
|
||||
- shell: bash
|
||||
working-directory: cli-artifacts
|
||||
run: |
|
||||
for file in *
|
||||
do
|
||||
cat ${file} >> sha256sums.txt
|
||||
done
|
||||
- name: Upload Checksums
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
with:
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_path: cli-artifacts/sha256sums.txt
|
||||
asset_name: sha256sums.txt
|
||||
asset_content_type: text/plain
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
- name: Update kubectl plugin version in krew-index
|
||||
uses: rajatjindal/krew-release-bot@v0.0.38
|
||||
uses: rajatjindal/krew-release-bot@3320c0b546b5d2320613c46762bd3f73e2801bdc # v0.0.38
|
||||
- name: Update Homebrew formula
|
||||
uses: dawidd6/action-homebrew-bump-formula@v3
|
||||
uses: dawidd6/action-homebrew-bump-formula@02e79d9da43d79efa846d73695b6052cbbdbf48a # v3.8.3
|
||||
with:
|
||||
token: ${{ secrets.HOMEBREW_TOKEN }}
|
||||
formula: kubevela
|
||||
|
||||
60
.github/workflows/scorecards.yml
vendored
Normal file
60
.github/workflows/scorecards.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Scorecards supply-chain security
|
||||
on:
|
||||
schedule:
|
||||
# Weekly on Saturdays.
|
||||
- cron: '30 1 * * 6'
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
# Declare default permissions as read only.
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
analysis:
|
||||
name: Scorecards analysis
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# Needed to upload the results to code-scanning dashboard.
|
||||
security-events: write
|
||||
# Used to receive a badge. (Upcoming feature)
|
||||
id-token: write
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@937ffa90d79c7d720498178154ad4c7ba1e4ad8c # tag=v2.1.0
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
|
||||
# - you want to enable the Branch-Protection check on a *public* repository, or
|
||||
# - you are installing Scorecards on a *private* repository
|
||||
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
|
||||
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
|
||||
|
||||
# Publish the results for public repositories to enable scorecard badges. For more details, see
|
||||
# https://github.com/ossf/scorecard-action#publishing-results.
|
||||
# For private repositories, `publish_results` will automatically be set to `false`, regardless
|
||||
# of the value entered here.
|
||||
publish_results: true
|
||||
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
retention-days: 5
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
20
.github/workflows/sync-api.yml
vendored
20
.github/workflows/sync-api.yml
vendored
@@ -7,25 +7,27 @@ on:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
GO_VERSION: '1.19'
|
||||
|
||||
jobs:
|
||||
sync-core-api:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Set up Go 1.17
|
||||
uses: actions/setup-go@v1
|
||||
env:
|
||||
GO_VERSION: '1.17'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
|
||||
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Sync to kubevela-core-api Repo
|
||||
env:
|
||||
@@ -34,4 +36,4 @@ jobs:
|
||||
COMMIT_ID: ${{ github.sha }}
|
||||
run: |
|
||||
bash ./hack/apis/clientgen.sh
|
||||
bash ./hack/apis/sync.sh
|
||||
bash ./hack/apis/sync.sh sync
|
||||
|
||||
4
.github/workflows/timed-task.yml
vendored
4
.github/workflows/timed-task.yml
vendored
@@ -2,6 +2,10 @@ name: Timed Task
|
||||
on:
|
||||
schedule:
|
||||
- cron: '* * * * *'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
clean-image:
|
||||
runs-on: aliyun
|
||||
|
||||
7
.github/workflows/trivy-scan.yml
vendored
7
.github/workflows/trivy-scan.yml
vendored
@@ -4,13 +4,16 @@ on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
images:
|
||||
name: Image Scan
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
|
||||
- name: Build Vela Core image from Dockerfile
|
||||
run: |
|
||||
@@ -24,7 +27,7 @@ jobs:
|
||||
output: 'trivy-results.sarif'
|
||||
|
||||
- name: Upload Trivy scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
uses: github/codeql-action/upload-sarif@v2
|
||||
if: always()
|
||||
with:
|
||||
sarif_file: 'trivy-results.sarif'
|
||||
36
.github/workflows/unit-test.yml
vendored
36
.github/workflows/unit-test.yml
vendored
@@ -5,33 +5,36 @@ on:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
workflow_dispatch: {}
|
||||
workflow_dispatch: { }
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.17'
|
||||
GOLANGCI_VERSION: 'v1.38'
|
||||
KIND_VERSION: 'v0.14.0'
|
||||
GO_VERSION: '1.19'
|
||||
|
||||
jobs:
|
||||
|
||||
detect-noop:
|
||||
permissions:
|
||||
actions: write # for fkirc/skip-duplicate-actions to skip or stop workflow runs
|
||||
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@v4.0.0
|
||||
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
|
||||
concurrent_skipping: false
|
||||
continue-on-error: true
|
||||
|
||||
unit-tests:
|
||||
runs-on: ubuntu-20.04
|
||||
@@ -40,18 +43,17 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Cache Go Dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
|
||||
with:
|
||||
path: .work/pkg
|
||||
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
|
||||
@@ -59,15 +61,19 @@ jobs:
|
||||
|
||||
- name: Install ginkgo
|
||||
run: |
|
||||
sudo sed -i 's/azure\.//' /etc/apt/sources.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y golang-ginkgo-dev
|
||||
|
||||
- name: Setup Kind Cluster
|
||||
uses: engineerd/setup-kind@v0.5.0
|
||||
- name: Setup K3d
|
||||
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
|
||||
with:
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
version: v1.20
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# TODO need update action version to resolve node 12 deprecated.
|
||||
- name: install Kubebuilder
|
||||
uses: RyanSiu1995/kubebuilder-action@v1.2
|
||||
uses: RyanSiu1995/kubebuilder-action@ff52bff1bae252239223476e5ab0d71d6ba02343
|
||||
with:
|
||||
version: 3.1.0
|
||||
kubebuilderOnly: false
|
||||
@@ -77,7 +83,7 @@ jobs:
|
||||
run: make test
|
||||
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@v1
|
||||
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
file: ./coverage.txt
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
# Binaries for programs and plugins
|
||||
# Binaries for programs and docgen
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
@@ -33,6 +33,7 @@ vendor/
|
||||
|
||||
# Vscode files
|
||||
.vscode
|
||||
.history
|
||||
|
||||
pkg/test/vela
|
||||
config/crd/bases
|
||||
@@ -52,3 +53,5 @@ git-page/
|
||||
# e2e rollout runtime image build
|
||||
runtime/rollout/e2e/tmp
|
||||
vela.json
|
||||
|
||||
dist/
|
||||
|
||||
@@ -38,7 +38,7 @@ linters-settings:
|
||||
# report about shadowed variables
|
||||
check-shadowing: false
|
||||
|
||||
golint:
|
||||
revive:
|
||||
# minimal confidence for issues, default is 0.8
|
||||
min-confidence: 0.8
|
||||
|
||||
@@ -116,11 +116,20 @@ linters:
|
||||
- goconst
|
||||
- goimports
|
||||
- gofmt # We enable this as well as goimports for its simplify mode.
|
||||
- golint
|
||||
- revive
|
||||
- unconvert
|
||||
- misspell
|
||||
- nakedret
|
||||
|
||||
- exportloopref
|
||||
disable:
|
||||
- deadcode
|
||||
- scopelint
|
||||
- structcheck
|
||||
- varcheck
|
||||
- rowserrcheck
|
||||
- sqlclosecheck
|
||||
- errchkjson
|
||||
- contextcheck
|
||||
presets:
|
||||
- bugs
|
||||
- unused
|
||||
@@ -137,7 +146,7 @@ issues:
|
||||
- errcheck
|
||||
- dupl
|
||||
- gosec
|
||||
- scopelint
|
||||
- exportloopref
|
||||
- unparam
|
||||
|
||||
# Ease some gocritic warnings on test files.
|
||||
@@ -186,7 +195,15 @@ issues:
|
||||
|
||||
- text: "don't use an underscore"
|
||||
linters:
|
||||
- golint
|
||||
- revive
|
||||
|
||||
- text: "package-comments: should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
|
||||
- text: "error-strings: error strings should not be capitalized or end with punctuation or a newline"
|
||||
linters:
|
||||
- revive
|
||||
|
||||
# Independently from option `exclude` we use default exclude patterns,
|
||||
# it can be disabled by this option. To list all
|
||||
|
||||
76
.goreleaser.yaml
Normal file
76
.goreleaser.yaml
Normal file
@@ -0,0 +1,76 @@
|
||||
# This is an example .goreleaser.yml file with some sensible defaults.
|
||||
# Make sure to check the documentation at https://goreleaser.com
|
||||
builds:
|
||||
- id: vela-cli
|
||||
binary: vela
|
||||
goos:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
main: ./references/cmd/cli/main.go
|
||||
ldflags:
|
||||
- -s -w -X github.com/oam-dev/kubevela/version.VelaVersion={{ .Version }} -X github.com/oam-dev/kubevela/version.GitRevision=git-{{.ShortCommit}}
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
|
||||
- id: kubectl-vela
|
||||
binary: kubectl-vela
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
main: ./cmd/plugin/main.go
|
||||
ldflags:
|
||||
- -s -w -X github.com/oam-dev/kubevela/version.VelaVersion={{ .Version }} -X github.com/oam-dev/kubevela/version.GitRevision=git-{{.ShortCommit}}
|
||||
|
||||
archives:
|
||||
- format: tar.gz
|
||||
id: vela-cli-tgz
|
||||
wrap_in_directory: '{{ .Os }}-{{ .Arch }}'
|
||||
builds:
|
||||
- vela-cli
|
||||
name_template: '{{ trimsuffix .ArtifactName ".exe" }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}'
|
||||
files: [ LICENSE, README.md ]
|
||||
- format: zip
|
||||
id: vela-cli-zip
|
||||
builds:
|
||||
- vela-cli
|
||||
wrap_in_directory: '{{ .Os }}-{{ .Arch }}'
|
||||
name_template: '{{ trimsuffix .ArtifactName ".exe" }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}'
|
||||
files: [ LICENSE, README.md ]
|
||||
- format: tar.gz
|
||||
id: plugin-tgz
|
||||
builds:
|
||||
- kubectl-vela
|
||||
wrap_in_directory: '{{ .Os }}-{{ .Arch }}'
|
||||
name_template: '{{ trimsuffix .ArtifactName ".exe" }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}'
|
||||
files: [ LICENSE, README.md ]
|
||||
- format: zip
|
||||
id: plugin-zip
|
||||
builds:
|
||||
- kubectl-vela
|
||||
wrap_in_directory: '{{ .Os }}-{{ .Arch }}'
|
||||
name_template: '{{ trimsuffix .ArtifactName ".exe" }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}'
|
||||
files: [ LICENSE, README.md ]
|
||||
|
||||
checksum:
|
||||
name_template: 'sha256sums.txt'
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- '^docs:'
|
||||
- '^test:'
|
||||
|
||||
# The lines beneath this are called `modelines`. See `:help modeline`
|
||||
# Feel free to remove those if you don't want/use them.
|
||||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
|
||||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
|
||||
@@ -33,8 +33,8 @@ spec:
|
||||
arch: amd64
|
||||
{{addURIAndSha "https://github.com/oam-dev/kubevela/releases/download/{{ .TagName }}/kubectl-vela-{{ .TagName }}-windows-amd64.zip" .TagName }}
|
||||
files:
|
||||
- from: "*/kubectl-vela"
|
||||
to: "kubectl-vela.exe"
|
||||
- from: "*/kubectl-vela.exe"
|
||||
to: "."
|
||||
- from: "*/LICENSE"
|
||||
to: "."
|
||||
bin: "kubectl-vela.exe"
|
||||
|
||||
11
Dockerfile
11
Dockerfile
@@ -1,6 +1,6 @@
|
||||
ARG BASE_IMAGE
|
||||
# Build the manager binary
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine@sha256:a9b24b67dc83b3383d22a14941c2b2b2ca6a103d805cac6820fd1355943beaf1 as builder
|
||||
|
||||
WORKDIR /workspace
|
||||
# Copy the Go Modules manifests
|
||||
@@ -15,9 +15,8 @@ ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
|
||||
# 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/apiserver/main.go cmd/apiserver/main.go
|
||||
# Copy the go source for building core
|
||||
COPY cmd/core/ cmd/core/
|
||||
COPY apis/ apis/
|
||||
COPY pkg/ pkg/
|
||||
COPY version/ version/
|
||||
@@ -29,13 +28,13 @@ 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
|
||||
-o manager-${TARGETARCH} cmd/core/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`
|
||||
FROM ${BASE_IMAGE:-alpine:3.15}
|
||||
FROM ${BASE_IMAGE:-alpine:3.15@sha256:cf34c62ee8eb3fe8aa24c1fab45d7e9d12768d945c3f5a6fd6a63d901e898479}
|
||||
# This is required by daemon connecting with cri
|
||||
RUN apk add --no-cache ca-certificates bash expat
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
ARG BASE_IMAGE
|
||||
# Build the manager binary
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine@sha256:a9b24b67dc83b3383d22a14941c2b2b2ca6a103d805cac6820fd1355943beaf1 as builder
|
||||
ARG GOPROXY
|
||||
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
|
||||
WORKDIR /workspace
|
||||
@@ -11,9 +11,8 @@ COPY go.sum go.sum
|
||||
# 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/apiserver/main.go cmd/apiserver/main.go
|
||||
# Copy the go source for building apiserver
|
||||
COPY cmd/apiserver/ cmd/apiserver/
|
||||
COPY apis/ apis/
|
||||
COPY pkg/ pkg/
|
||||
COPY version/ version/
|
||||
@@ -33,7 +32,7 @@ RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
|
||||
# Refer to https://github.com/GoogleContainerTools/distroless for more details
|
||||
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
|
||||
|
||||
FROM ${BASE_IMAGE:-alpine:3.15}
|
||||
FROM ${BASE_IMAGE:-alpine:3.15@sha256:cf34c62ee8eb3fe8aa24c1fab45d7e9d12768d945c3f5a6fd6a63d901e898479}
|
||||
# This is required by daemon connecting with cri
|
||||
RUN apk add --no-cache ca-certificates bash expat
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
ARG BASE_IMAGE
|
||||
# Build the cli binary
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine@sha256:a9b24b67dc83b3383d22a14941c2b2b2ca6a103d805cac6820fd1355943beaf1 as builder
|
||||
ARG GOPROXY
|
||||
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
|
||||
WORKDIR /workspace
|
||||
@@ -32,12 +32,12 @@ RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH:-amd64} \
|
||||
# Refer to https://github.com/GoogleContainerTools/distroless for more details
|
||||
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
|
||||
|
||||
FROM ${BASE_IMAGE:-alpine:3.15}
|
||||
FROM ${BASE_IMAGE:-alpine:3.15@sha256:cf34c62ee8eb3fe8aa24c1fab45d7e9d12768d945c3f5a6fd6a63d901e898479}
|
||||
# This is required by daemon connecting with cri
|
||||
RUN apk add --no-cache ca-certificates bash expat
|
||||
|
||||
WORKDIR /
|
||||
|
||||
ARG TARGETARCH
|
||||
COPY --from=builder /workspace/vela-${TARGETARCH} /vela
|
||||
ENTRYPOINT ["/vela"]
|
||||
COPY --from=builder /workspace/vela-${TARGETARCH} /bin/vela
|
||||
ENTRYPOINT ["/bin/vela"]
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
ARG BASE_IMAGE
|
||||
# Build the cli binary
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
|
||||
ARG GOPROXY
|
||||
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
|
||||
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 apis/ apis/
|
||||
COPY pkg/ pkg/
|
||||
COPY version/ version/
|
||||
COPY references/ references/
|
||||
|
||||
# Build
|
||||
ARG VERSION
|
||||
ARG GITVERSION
|
||||
|
||||
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
||||
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 vela ./references/cmd/cli/main.go
|
||||
|
||||
FROM ghcr.io/cloudtty/cloudshell:v0.2.0
|
||||
RUN apt-get install -y vim
|
||||
ENV API_TOKEN_PATH=/usr/local/kubeconfig/token
|
||||
COPY --from=builder /workspace/vela /usr/local/bin/vela
|
||||
@@ -1,6 +1,6 @@
|
||||
ARG BASE_IMAGE
|
||||
# Build the manager binary
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine@sha256:a9b24b67dc83b3383d22a14941c2b2b2ca6a103d805cac6820fd1355943beaf1 as builder
|
||||
|
||||
WORKDIR /workspace
|
||||
# Copy the Go Modules manifests
|
||||
@@ -38,7 +38,7 @@ RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
|
||||
# Refer to https://github.com/GoogleContainerTools/distroless for more details
|
||||
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
|
||||
|
||||
FROM ${BASE_IMAGE:-alpine:3.15}
|
||||
FROM ${BASE_IMAGE:-alpine:3.15@sha256:cf34c62ee8eb3fe8aa24c1fab45d7e9d12768d945c3f5a6fd6a63d901e898479}
|
||||
# This is required by daemon connecting with cri
|
||||
RUN apk add --no-cache ca-certificates bash expat
|
||||
|
||||
|
||||
@@ -1,16 +1 @@
|
||||
# Governance
|
||||
|
||||
[Project maintainers](https://github.com/kubevela/community/blob/main/OWNERS.md#maintainers) are responsible for activities around maintaining and updating KubeVela.
|
||||
Final decisions on the project reside with the project maintainers.
|
||||
|
||||
Maintainers **MUST** remain active. If they are unresponsive for >6 months,
|
||||
they will be automatically removed unless a [super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) of the other project maintainers agrees to extend the period to be greater than 6 months.
|
||||
|
||||
New maintainers can be added to the project by a [super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) vote of the existing maintainers.
|
||||
A potential maintainer may be nominated by an existing maintainer.
|
||||
A vote is conducted in private between the current maintainers over the course of a one week voting period.
|
||||
At the end of the week, votes are counted and a pull request is made on the repo adding the new maintainer to the [CODEOWNERS](https://github.com/kubevela/kubevela/blob/master/.github/CODEOWNERS) file.
|
||||
|
||||
A maintainer may step down by submitting an [issue](https://github.com/kubevela/kubevela/issues/new/choose) stating their intent.
|
||||
|
||||
Changes to this governance document require a pull request with approval from a [super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) of the current maintainers.
|
||||
Refer to https://github.com/kubevela/community/blob/main/GOVERNANCE.md
|
||||
22
Makefile
22
Makefile
@@ -9,7 +9,7 @@ include makefiles/e2e.mk
|
||||
all: build
|
||||
|
||||
# Run tests
|
||||
test: vet lint staticcheck unit-test-core test-cli-gen
|
||||
test: unit-test-core test-cli-gen
|
||||
@$(OK) unit-tests pass
|
||||
|
||||
test-cli-gen:
|
||||
@@ -22,7 +22,7 @@ unit-test-apiserver:
|
||||
go test -gcflags=all=-l -coverprofile=coverage.txt $(shell go list ./pkg/... ./cmd/... | grep -E 'apiserver|velaql')
|
||||
|
||||
# Build vela cli binary
|
||||
build: fmt vet lint staticcheck vela-cli kubectl-vela
|
||||
build: vela-cli kubectl-vela
|
||||
@$(OK) build succeed
|
||||
|
||||
build-cleanup:
|
||||
@@ -82,28 +82,28 @@ endif
|
||||
|
||||
|
||||
|
||||
# load docker image to the kind cluster
|
||||
kind-load: kind-load-runtime-cluster
|
||||
# load docker image to the k3d cluster
|
||||
image-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; }
|
||||
k3d image import $(VELA_CORE_TEST_IMAGE) || { echo >&2 "kind not installed or error loading image: $(VELA_CORE_TEST_IMAGE)"; exit 1; }
|
||||
|
||||
kind-load-runtime-cluster:
|
||||
image-load-runtime-cluster:
|
||||
/bin/sh hack/e2e/build_runtime_rollout.sh
|
||||
docker build -t $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE) -f runtime/rollout/e2e/Dockerfile.e2e runtime/rollout/e2e/
|
||||
rm -rf runtime/rollout/e2e/tmp
|
||||
kind load docker-image $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE) || { echo >&2 "kind not installed or error loading image: $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE)"; exit 1; }
|
||||
kind load docker-image $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE) --name=$(RUNTIME_CLUSTER_NAME) || { echo >&2 "kind not installed or error loading image: $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE)"; exit 1; }
|
||||
k3d image import $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE) || { echo >&2 "kind not installed or error loading image: $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE)"; exit 1; }
|
||||
k3d cluster get $(RUNTIME_CLUSTER_NAME) && k3d image import $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE) --cluster=$(RUNTIME_CLUSTER_NAME) || echo "no worker cluster"
|
||||
|
||||
# Run tests
|
||||
core-test: fmt vet manifests
|
||||
core-test:
|
||||
go test ./pkg/... -coverprofile cover.out
|
||||
|
||||
# Build vela core manager and apiserver binary
|
||||
manager: fmt vet lint manifests
|
||||
manager:
|
||||
$(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
|
||||
vela-runtime-rollout-manager:
|
||||
$(GOBUILD_ENV) go build -o ./runtime/rollout/bin/manager -a -ldflags $(LDFLAGS) ./runtime/rollout/cmd/main.go
|
||||
|
||||
# Generate manifests e.g. CRD, RBAC etc.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||

|
||||

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

|
||||
[](https://codecov.io/gh/kubevela/kubevela)
|
||||
@@ -16,6 +16,8 @@
|
||||
[](https://twitter.com/oam_dev)
|
||||
[](https://artifacthub.io/packages/search?repo=kubevela)
|
||||
[](https://bestpractices.coreinfrastructure.org/projects/4602)
|
||||

|
||||
[](https://api.securityscorecards.dev/projects/github.com/kubevela/kubevela)
|
||||
|
||||
## Introduction
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
|
||||
"github.com/oam-dev/kubevela/pkg/oam"
|
||||
@@ -135,6 +137,9 @@ type Terraform struct {
|
||||
|
||||
// Region is cloud provider's region. It will override the region in the region field of ProviderReference
|
||||
Region string `json:"customRegion,omitempty"`
|
||||
|
||||
// GitCredentialsSecretReference specifies the reference to the secret containing the git credentials
|
||||
GitCredentialsSecretReference *corev1.SecretReference `json:"gitCredentialsSecretReference,omitempty"`
|
||||
}
|
||||
|
||||
// A WorkloadTypeDescriptor refer to a Workload Type
|
||||
@@ -187,8 +192,6 @@ type Status struct {
|
||||
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
|
||||
@@ -201,8 +204,8 @@ const (
|
||||
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"
|
||||
// ApplicationWorkflowFailed means the app's workflow is failed
|
||||
ApplicationWorkflowFailed ApplicationPhase = "workflowFailed"
|
||||
// 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
|
||||
@@ -245,6 +248,12 @@ type ApplicationComponentStatus struct {
|
||||
Scopes []corev1.ObjectReference `json:"scopes,omitempty"`
|
||||
}
|
||||
|
||||
// Equal check if two ApplicationComponentStatus are equal
|
||||
func (in ApplicationComponentStatus) Equal(r ApplicationComponentStatus) bool {
|
||||
return in.Name == r.Name && in.Namespace == r.Namespace &&
|
||||
in.Cluster == r.Cluster && in.Env == r.Env
|
||||
}
|
||||
|
||||
// ApplicationTraitStatus records the trait health status
|
||||
type ApplicationTraitStatus struct {
|
||||
Type string `json:"type"`
|
||||
@@ -268,33 +277,6 @@ type RawComponent struct {
|
||||
Raw runtime.RawExtension `json:"raw"`
|
||||
}
|
||||
|
||||
// StepStatus record the base status of workflow step, which could be workflow step or subStep
|
||||
type StepStatus 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"`
|
||||
// FirstExecuteTime is the first time this step execution.
|
||||
FirstExecuteTime metav1.Time `json:"firstExecuteTime,omitempty"`
|
||||
// LastExecuteTime is the last time this step execution.
|
||||
LastExecuteTime metav1.Time `json:"lastExecuteTime,omitempty"`
|
||||
}
|
||||
|
||||
// WorkflowStepStatus record the status of a workflow step, include step status and subStep status
|
||||
type WorkflowStepStatus struct {
|
||||
StepStatus `json:",inline"`
|
||||
SubStepsStatus []WorkflowSubStepStatus `json:"subSteps,omitempty"`
|
||||
}
|
||||
|
||||
// WorkflowSubStepStatus record the status of a workflow subStep
|
||||
type WorkflowSubStepStatus struct {
|
||||
StepStatus `json:",inline"`
|
||||
}
|
||||
|
||||
// AppStatus defines the observed state of Application
|
||||
type AppStatus struct {
|
||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
@@ -324,10 +306,12 @@ type AppStatus struct {
|
||||
AppliedResources []ClusterObjectReference `json:"appliedResources,omitempty"`
|
||||
|
||||
// PolicyStatus records the status of policy
|
||||
// Deprecated This field is only used by EnvBinding Policy which is deprecated.
|
||||
PolicyStatus []PolicyStatus `json:"policy,omitempty"`
|
||||
}
|
||||
|
||||
// PolicyStatus records the status of policy
|
||||
// Deprecated
|
||||
type PolicyStatus struct {
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
@@ -335,95 +319,27 @@ type PolicyStatus struct {
|
||||
Status *runtime.RawExtension `json:"status,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"`
|
||||
|
||||
Meta *WorkflowStepMeta `json:"meta,omitempty"`
|
||||
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Properties *runtime.RawExtension `json:"properties,omitempty"`
|
||||
|
||||
SubSteps []WorkflowSubStep `json:"subSteps,omitempty"`
|
||||
|
||||
If string `json:"if,omitempty"`
|
||||
|
||||
Timeout string `json:"timeout,omitempty"`
|
||||
|
||||
DependsOn []string `json:"dependsOn,omitempty"`
|
||||
|
||||
Inputs StepInputs `json:"inputs,omitempty"`
|
||||
|
||||
Outputs StepOutputs `json:"outputs,omitempty"`
|
||||
}
|
||||
|
||||
// WorkflowStepMeta contains the meta data of a workflow step
|
||||
type WorkflowStepMeta struct {
|
||||
Alias string `json:"alias,omitempty"`
|
||||
}
|
||||
|
||||
// WorkflowSubStep defines how to execute a workflow subStep.
|
||||
type WorkflowSubStep struct {
|
||||
// Name is the unique name of the workflow step.
|
||||
Name string `json:"name"`
|
||||
|
||||
Type string `json:"type"`
|
||||
|
||||
Meta *WorkflowStepMeta `json:"meta,omitempty"`
|
||||
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Properties *runtime.RawExtension `json:"properties,omitempty"`
|
||||
|
||||
If string `json:"if,omitempty"`
|
||||
|
||||
Timeout string `json:"timeout,omitempty"`
|
||||
|
||||
DependsOn []string `json:"dependsOn,omitempty"`
|
||||
|
||||
Inputs StepInputs `json:"inputs,omitempty"`
|
||||
|
||||
Outputs StepOutputs `json:"outputs,omitempty"`
|
||||
}
|
||||
|
||||
// WorkflowStatus record the status of workflow
|
||||
type WorkflowStatus struct {
|
||||
AppRevision string `json:"appRevision,omitempty"`
|
||||
Mode WorkflowMode `json:"mode"`
|
||||
Message string `json:"message,omitempty"`
|
||||
AppRevision string `json:"appRevision,omitempty"`
|
||||
Mode string `json:"mode"`
|
||||
Phase workflowv1alpha1.WorkflowRunPhase `json:"status,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
|
||||
Suspend bool `json:"suspend"`
|
||||
SuspendState string `json:"suspendState,omitempty"`
|
||||
|
||||
Suspend bool `json:"suspend"`
|
||||
Terminated bool `json:"terminated"`
|
||||
Finished bool `json:"finished"`
|
||||
|
||||
ContextBackend *corev1.ObjectReference `json:"contextBackend,omitempty"`
|
||||
Steps []WorkflowStepStatus `json:"steps,omitempty"`
|
||||
ContextBackend *corev1.ObjectReference `json:"contextBackend,omitempty"`
|
||||
Steps []workflowv1alpha1.WorkflowStepStatus `json:"steps,omitempty"`
|
||||
|
||||
StartTime metav1.Time `json:"startTime,omitempty"`
|
||||
// +nullable
|
||||
EndTime metav1.Time `json:"endTime,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 report error in `message`.
|
||||
WorkflowStepPhaseFailed WorkflowStepPhase = "failed"
|
||||
// WorkflowStepPhaseSkipped will make the controller skip the step.
|
||||
WorkflowStepPhaseSkipped WorkflowStepPhase = "skipped"
|
||||
// WorkflowStepPhaseStopped will make the controller stop the workflow.
|
||||
WorkflowStepPhaseStopped WorkflowStepPhase = "stopped"
|
||||
// WorkflowStepPhaseRunning will make the controller continue the workflow.
|
||||
WorkflowStepPhaseRunning WorkflowStepPhase = "running"
|
||||
// WorkflowStepPhasePending will make the controller wait for the step to run.
|
||||
WorkflowStepPhasePending WorkflowStepPhase = "pending"
|
||||
)
|
||||
|
||||
// DefinitionType describes the type of DefinitionRevision.
|
||||
// +kubebuilder:validation:Enum=Component;Trait;Policy;WorkflowStep
|
||||
type DefinitionType string
|
||||
@@ -442,16 +358,6 @@ const (
|
||||
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"`
|
||||
@@ -481,9 +387,9 @@ type ApplicationComponent struct {
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Properties *runtime.RawExtension `json:"properties,omitempty"`
|
||||
|
||||
DependsOn []string `json:"dependsOn,omitempty"`
|
||||
Inputs StepInputs `json:"inputs,omitempty"`
|
||||
Outputs StepOutputs `json:"outputs,omitempty"`
|
||||
DependsOn []string `json:"dependsOn,omitempty"`
|
||||
Inputs workflowv1alpha1.StepInputs `json:"inputs,omitempty"`
|
||||
Outputs workflowv1alpha1.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"`
|
||||
@@ -492,22 +398,10 @@ type ApplicationComponent struct {
|
||||
// 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"`
|
||||
// ReplicaKey is not empty means the component is replicated. This field is designed so that it can't be specified in application directly.
|
||||
// So we set the json tag as "-". Instead, this will be filled when using replication policy.
|
||||
ReplicaKey string `json:"-"`
|
||||
}
|
||||
|
||||
// ClusterSelector defines the rules to select a Cluster resource.
|
||||
@@ -536,16 +430,13 @@ type ClusterPlacement struct {
|
||||
Distribution Distribution `json:"distribution,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceCreatorRole defines the resource creator.
|
||||
type ResourceCreatorRole string
|
||||
|
||||
const (
|
||||
// PolicyResourceCreator create the policy resource.
|
||||
PolicyResourceCreator ResourceCreatorRole = "policy"
|
||||
PolicyResourceCreator string = "policy"
|
||||
// WorkflowResourceCreator create the resource in workflow.
|
||||
WorkflowResourceCreator ResourceCreatorRole = "workflow"
|
||||
WorkflowResourceCreator string = "workflow"
|
||||
// DebugResourceCreator create the debug resource.
|
||||
DebugResourceCreator ResourceCreatorRole = "debug"
|
||||
DebugResourceCreator string = "debug"
|
||||
)
|
||||
|
||||
// OAMObjectReference defines the object reference for an oam resource
|
||||
@@ -592,8 +483,8 @@ func NewOAMObjectReferenceFromObject(obj client.Object) OAMObjectReference {
|
||||
|
||||
// ClusterObjectReference defines the object reference with cluster.
|
||||
type ClusterObjectReference struct {
|
||||
Cluster string `json:"cluster,omitempty"`
|
||||
Creator ResourceCreatorRole `json:"creator,omitempty"`
|
||||
Cluster string `json:"cluster,omitempty"`
|
||||
Creator string `json:"creator,omitempty"`
|
||||
corev1.ObjectReference `json:",inline"`
|
||||
}
|
||||
|
||||
@@ -686,3 +577,29 @@ type ReferredObjectList struct {
|
||||
// +optional
|
||||
Objects []ReferredObject `json:"objects,omitempty"`
|
||||
}
|
||||
|
||||
// ContainerState defines the state of a container
|
||||
type ContainerState string
|
||||
|
||||
const (
|
||||
// ContainerRunning indicates the container is running
|
||||
ContainerRunning ContainerState = "Running"
|
||||
// ContainerWaiting indicates the container is waiting
|
||||
ContainerWaiting ContainerState = "Waiting"
|
||||
// ContainerTerminated indicates the container is terminated
|
||||
ContainerTerminated ContainerState = "Terminated"
|
||||
)
|
||||
|
||||
// ContainerStateToString convert the container state to string
|
||||
func ContainerStateToString(state corev1.ContainerState) string {
|
||||
switch {
|
||||
case state.Running != nil:
|
||||
return "Running"
|
||||
case state.Waiting != nil:
|
||||
return "Waiting"
|
||||
case state.Terminated != nil:
|
||||
return "Terminated"
|
||||
default:
|
||||
return "Unknown"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,3 +58,17 @@ func TestClusterObjectReference(t *testing.T) {
|
||||
o2.Cluster = "c"
|
||||
r.False(o2.Equal(o1))
|
||||
}
|
||||
|
||||
func TestContainerStateToString(t *testing.T) {
|
||||
r := require.New(t)
|
||||
r.Equal("Waiting", ContainerStateToString(v1.ContainerState{
|
||||
Waiting: &v1.ContainerStateWaiting{},
|
||||
}))
|
||||
r.Equal("Running", ContainerStateToString(v1.ContainerState{
|
||||
Running: &v1.ContainerStateRunning{},
|
||||
}))
|
||||
r.Equal("Terminated", ContainerStateToString(v1.ContainerState{
|
||||
Terminated: &v1.ContainerStateTerminated{},
|
||||
}))
|
||||
r.Equal("Unknown", ContainerStateToString(v1.ContainerState{}))
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ limitations under the License.
|
||||
package common
|
||||
|
||||
import (
|
||||
"github.com/kubevela/workflow/api/v1alpha1"
|
||||
crossplane_runtime "github.com/oam-dev/terraform-controller/api/types/crossplane-runtime"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -108,12 +109,12 @@ func (in *ApplicationComponent) DeepCopyInto(out *ApplicationComponent) {
|
||||
}
|
||||
if in.Inputs != nil {
|
||||
in, out := &in.Inputs, &out.Inputs
|
||||
*out = make(StepInputs, len(*in))
|
||||
*out = make(v1alpha1.StepInputs, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Outputs != nil {
|
||||
in, out := &in.Outputs, &out.Outputs
|
||||
*out = make(StepOutputs, len(*in))
|
||||
*out = make(v1alpha1.StepOutputs, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Traits != nil {
|
||||
@@ -573,61 +574,6 @@ func (in *Status) DeepCopy() *Status {
|
||||
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 *StepStatus) DeepCopyInto(out *StepStatus) {
|
||||
*out = *in
|
||||
in.FirstExecuteTime.DeepCopyInto(&out.FirstExecuteTime)
|
||||
in.LastExecuteTime.DeepCopyInto(&out.LastExecuteTime)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepStatus.
|
||||
func (in *StepStatus) DeepCopy() *StepStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(StepStatus)
|
||||
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
|
||||
@@ -641,6 +587,11 @@ func (in *Terraform) DeepCopyInto(out *Terraform) {
|
||||
*out = new(crossplane_runtime.Reference)
|
||||
**out = **in
|
||||
}
|
||||
if in.GitCredentialsSecretReference != nil {
|
||||
in, out := &in.GitCredentialsSecretReference, &out.GitCredentialsSecretReference
|
||||
*out = new(v1.SecretReference)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Terraform.
|
||||
@@ -663,12 +614,13 @@ func (in *WorkflowStatus) DeepCopyInto(out *WorkflowStatus) {
|
||||
}
|
||||
if in.Steps != nil {
|
||||
in, out := &in.Steps, &out.Steps
|
||||
*out = make([]WorkflowStepStatus, len(*in))
|
||||
*out = make([]v1alpha1.WorkflowStepStatus, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
in.StartTime.DeepCopyInto(&out.StartTime)
|
||||
in.EndTime.DeepCopyInto(&out.EndTime)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStatus.
|
||||
@@ -681,147 +633,6 @@ func (in *WorkflowStatus) DeepCopy() *WorkflowStatus {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkflowStep) DeepCopyInto(out *WorkflowStep) {
|
||||
*out = *in
|
||||
if in.Meta != nil {
|
||||
in, out := &in.Meta, &out.Meta
|
||||
*out = new(WorkflowStepMeta)
|
||||
**out = **in
|
||||
}
|
||||
if in.Properties != nil {
|
||||
in, out := &in.Properties, &out.Properties
|
||||
*out = new(runtime.RawExtension)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.SubSteps != nil {
|
||||
in, out := &in.SubSteps, &out.SubSteps
|
||||
*out = make([]WorkflowSubStep, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStep.
|
||||
func (in *WorkflowStep) DeepCopy() *WorkflowStep {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkflowStep)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkflowStepMeta) DeepCopyInto(out *WorkflowStepMeta) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStepMeta.
|
||||
func (in *WorkflowStepMeta) DeepCopy() *WorkflowStepMeta {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkflowStepMeta)
|
||||
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
|
||||
in.StepStatus.DeepCopyInto(&out.StepStatus)
|
||||
if in.SubStepsStatus != nil {
|
||||
in, out := &in.SubStepsStatus, &out.SubStepsStatus
|
||||
*out = make([]WorkflowSubStepStatus, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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 *WorkflowSubStep) DeepCopyInto(out *WorkflowSubStep) {
|
||||
*out = *in
|
||||
if in.Meta != nil {
|
||||
in, out := &in.Meta, &out.Meta
|
||||
*out = new(WorkflowStepMeta)
|
||||
**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)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowSubStep.
|
||||
func (in *WorkflowSubStep) DeepCopy() *WorkflowSubStep {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkflowSubStep)
|
||||
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
|
||||
in.StepStatus.DeepCopyInto(&out.StepStatus)
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
@@ -31,7 +31,7 @@ import (
|
||||
)
|
||||
|
||||
// A ConditionType represents a condition a resource could be in.
|
||||
// nolint:golint
|
||||
// nolint
|
||||
type ConditionType string
|
||||
|
||||
// Condition types.
|
||||
@@ -45,7 +45,7 @@ const (
|
||||
)
|
||||
|
||||
// A ConditionReason represents the reason a resource is in a condition.
|
||||
// nolint:golint
|
||||
// nolint
|
||||
type ConditionReason string
|
||||
|
||||
// Reasons a resource is or is not ready.
|
||||
|
||||
@@ -23,8 +23,17 @@ import (
|
||||
const (
|
||||
// ApplyOncePolicyType refers to the type of configuration drift policy
|
||||
ApplyOncePolicyType = "apply-once"
|
||||
// ApplyOnceStrategyOnAppUpdate policy takes effect on application updating
|
||||
ApplyOnceStrategyOnAppUpdate ApplyOnceAffectStrategy = "onUpdate"
|
||||
// ApplyOnceStrategyOnAppStateKeep policy takes effect on application state keep
|
||||
ApplyOnceStrategyOnAppStateKeep ApplyOnceAffectStrategy = "onStateKeep"
|
||||
// ApplyOnceStrategyAlways policy takes effect always
|
||||
ApplyOnceStrategyAlways ApplyOnceAffectStrategy = "always"
|
||||
)
|
||||
|
||||
// ApplyOnceAffectStrategy is a string that mark the policy effective stage
|
||||
type ApplyOnceAffectStrategy string
|
||||
|
||||
// ApplyOncePolicySpec defines the spec of preventing configuration drift
|
||||
type ApplyOncePolicySpec struct {
|
||||
Enable bool `json:"enable"`
|
||||
@@ -45,23 +54,23 @@ type ApplyOnceStrategy struct {
|
||||
// Path the specified path that allow configuration drift
|
||||
// like 'spec.template.spec.containers[0].resources' and '*' means the whole target allow configuration drift
|
||||
Path []string `json:"path"`
|
||||
// ApplyOnceAffectStrategy Decide when the strategy will take effect
|
||||
// like affect:onUpdate/onStateKeep/always
|
||||
ApplyOnceAffectStrategy ApplyOnceAffectStrategy `json:"affect"`
|
||||
}
|
||||
|
||||
// Type the type name of the policy
|
||||
func (in *ApplyOncePolicySpec) Type() string {
|
||||
return ApplyOncePolicyType
|
||||
}
|
||||
|
||||
// FindStrategy find apply-once strategy for target resource
|
||||
func (in ApplyOncePolicySpec) FindStrategy(manifest *unstructured.Unstructured) *ApplyOnceStrategy {
|
||||
func (in *ApplyOncePolicySpec) FindStrategy(manifest *unstructured.Unstructured) *ApplyOnceStrategy {
|
||||
if !in.Enable {
|
||||
return nil
|
||||
}
|
||||
for _, rule := range in.Rules {
|
||||
match := func(src []string, val string) (found bool) {
|
||||
for _, _val := range src {
|
||||
found = found || _val == val
|
||||
}
|
||||
return val != "" && found
|
||||
}
|
||||
if (match(rule.Selector.CompNames, manifest.GetName()) && match(rule.Selector.ResourceTypes, manifest.GetKind())) ||
|
||||
(rule.Selector.CompNames == nil && match(rule.Selector.ResourceTypes, manifest.GetKind()) ||
|
||||
(rule.Selector.ResourceTypes == nil && match(rule.Selector.CompNames, manifest.GetName()))) {
|
||||
if rule.Selector.Match(manifest) {
|
||||
return rule.Strategy
|
||||
}
|
||||
}
|
||||
@@ -97,6 +97,7 @@ type EnvSelector struct {
|
||||
}
|
||||
|
||||
// EnvConfig is the configuration for different environments.
|
||||
// Deprecated
|
||||
type EnvConfig struct {
|
||||
Name string `json:"name"`
|
||||
Placement EnvPlacement `json:"placement,omitempty"`
|
||||
@@ -105,6 +106,7 @@ type EnvConfig struct {
|
||||
}
|
||||
|
||||
// EnvBindingSpec defines a list of envs
|
||||
// Deprecated This spec is deprecated and replaced by Topology/Override Policy
|
||||
type EnvBindingSpec struct {
|
||||
Envs []EnvConfig `json:"envs"`
|
||||
}
|
||||
@@ -124,18 +126,21 @@ func (in PlacementDecision) String() string {
|
||||
}
|
||||
|
||||
// EnvStatus records the status of one env
|
||||
// Deprecated
|
||||
type EnvStatus struct {
|
||||
Env string `json:"env"`
|
||||
Placements []PlacementDecision `json:"placements"`
|
||||
}
|
||||
|
||||
// ClusterConnection records the connection with clusters and the last active app revision when they are active (still be used)
|
||||
// Deprecated
|
||||
type ClusterConnection struct {
|
||||
ClusterName string `json:"clusterName"`
|
||||
LastActiveRevision string `json:"lastActiveRevision"`
|
||||
}
|
||||
|
||||
// EnvBindingStatus records the status of all env
|
||||
// Deprecated
|
||||
type EnvBindingStatus struct {
|
||||
Envs []EnvStatus `json:"envs"`
|
||||
ClusterConnections []ClusterConnection `json:"clusterConnections"`
|
||||
|
||||
@@ -19,8 +19,6 @@ package v1alpha1
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
@@ -49,27 +47,3 @@ type PolicyList struct {
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Policy `json:"items"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// Workflow is the Schema for the policy API
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type Workflow struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Steps []common.WorkflowStep `json:"steps,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// WorkflowList contains a list of Workflow
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type WorkflowList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Workflow `json:"items"`
|
||||
}
|
||||
|
||||
@@ -18,9 +18,6 @@ package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/utils/strings/slices"
|
||||
|
||||
"github.com/oam-dev/kubevela/pkg/oam"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -56,42 +53,6 @@ type GarbageCollectPolicyRule struct {
|
||||
Strategy GarbageCollectStrategy `json:"strategy"`
|
||||
}
|
||||
|
||||
// ResourcePolicyRuleSelector select the targets of the rule
|
||||
// 1) for GarbageCollectPolicyRule
|
||||
// if both traitTypes, oamTypes and componentTypes are specified, combination logic is OR
|
||||
// if one resource is specified with conflict strategies, strategy as component go first.
|
||||
// 2) for ApplyOncePolicyRule only CompNames and ResourceTypes are used
|
||||
type ResourcePolicyRuleSelector struct {
|
||||
CompNames []string `json:"componentNames"`
|
||||
CompTypes []string `json:"componentTypes"`
|
||||
OAMResourceTypes []string `json:"oamTypes"`
|
||||
TraitTypes []string `json:"traitTypes"`
|
||||
ResourceTypes []string `json:"resourceTypes"`
|
||||
ResourceNames []string `json:"resourceNames"`
|
||||
}
|
||||
|
||||
// Match check if current rule selector match the target resource
|
||||
func (in *ResourcePolicyRuleSelector) Match(manifest *unstructured.Unstructured) bool {
|
||||
var compName, compType, oamType, traitType, resourceType, resourceName string
|
||||
if labels := manifest.GetLabels(); labels != nil {
|
||||
compName = labels[oam.LabelAppComponent]
|
||||
compType = labels[oam.WorkloadTypeLabel]
|
||||
oamType = labels[oam.LabelOAMResourceType]
|
||||
traitType = labels[oam.TraitTypeLabel]
|
||||
}
|
||||
resourceType = manifest.GetKind()
|
||||
resourceName = manifest.GetName()
|
||||
match := func(src []string, val string) (found bool) {
|
||||
return val != "" && slices.Contains(src, val)
|
||||
}
|
||||
return match(in.CompNames, compName) ||
|
||||
match(in.CompTypes, compType) ||
|
||||
match(in.OAMResourceTypes, oamType) ||
|
||||
match(in.TraitTypes, traitType) ||
|
||||
match(in.ResourceTypes, resourceType) ||
|
||||
match(in.ResourceNames, resourceName)
|
||||
}
|
||||
|
||||
// GarbageCollectStrategy the strategy for target resource to recycle
|
||||
type GarbageCollectStrategy string
|
||||
|
||||
@@ -105,8 +66,13 @@ const (
|
||||
GarbageCollectStrategyOnAppUpdate GarbageCollectStrategy = "onAppUpdate"
|
||||
)
|
||||
|
||||
// Type the type name of the policy
|
||||
func (in *GarbageCollectPolicySpec) Type() string {
|
||||
return GarbageCollectPolicyType
|
||||
}
|
||||
|
||||
// FindStrategy find gc strategy for target resource
|
||||
func (in GarbageCollectPolicySpec) FindStrategy(manifest *unstructured.Unstructured) *GarbageCollectStrategy {
|
||||
func (in *GarbageCollectPolicySpec) FindStrategy(manifest *unstructured.Unstructured) *GarbageCollectStrategy {
|
||||
for _, rule := range in.Rules {
|
||||
if rule.Selector.Match(manifest) {
|
||||
return &rule.Strategy
|
||||
@@ -16,8 +16,6 @@ limitations under the License.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
||||
const (
|
||||
// TopologyPolicyType refers to the type of topology policy
|
||||
TopologyPolicyType = "topology"
|
||||
@@ -25,8 +23,8 @@ const (
|
||||
OverridePolicyType = "override"
|
||||
// DebugPolicyType refers to the type of debug policy
|
||||
DebugPolicyType = "debug"
|
||||
// SharedResourcePolicyType refers to the type of shared resource policy
|
||||
SharedResourcePolicyType = "shared-resource"
|
||||
// ReplicationPolicyType refers to the type of replication policy
|
||||
ReplicationPolicyType = "replication"
|
||||
)
|
||||
|
||||
// TopologyPolicySpec defines the spec of topology policy
|
||||
@@ -47,6 +45,10 @@ type Placement struct {
|
||||
// Exclusive to "clusters"
|
||||
ClusterLabelSelector map[string]string `json:"clusterLabelSelector,omitempty"`
|
||||
|
||||
// AllowEmpty ignore empty cluster error when no cluster returned for label
|
||||
// selector
|
||||
AllowEmpty bool `json:"allowEmpty,omitempty"`
|
||||
|
||||
// DeprecatedClusterSelector is a depreciated alias for ClusterLabelSelector.
|
||||
// Deprecated: Use clusterLabelSelector instead.
|
||||
DeprecatedClusterSelector map[string]string `json:"clusterSelector,omitempty"`
|
||||
@@ -58,22 +60,10 @@ type OverridePolicySpec struct {
|
||||
Selector []string `json:"selector,omitempty"`
|
||||
}
|
||||
|
||||
// SharedResourcePolicySpec defines the spec of shared-resource policy
|
||||
type SharedResourcePolicySpec struct {
|
||||
Rules []SharedResourcePolicyRule `json:"rules"`
|
||||
}
|
||||
|
||||
// SharedResourcePolicyRule defines the rule for sharing resources
|
||||
type SharedResourcePolicyRule struct {
|
||||
Selector ResourcePolicyRuleSelector `json:"selector"`
|
||||
}
|
||||
|
||||
// FindStrategy return if the target resource should be shared
|
||||
func (in SharedResourcePolicySpec) FindStrategy(manifest *unstructured.Unstructured) bool {
|
||||
for _, rule := range in.Rules {
|
||||
if rule.Selector.Match(manifest) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
// ReplicationPolicySpec defines the spec of replication policy
|
||||
// Override policy should be used together with replication policy to select the deployment target components
|
||||
type ReplicationPolicySpec struct {
|
||||
Keys []string `json:"keys,omitempty"`
|
||||
// Selector is the subset of selected components which will be replicated.
|
||||
Selector []string `json:"selector,omitempty"`
|
||||
}
|
||||
|
||||
49
apis/core.oam.dev/v1alpha1/readonly_policy_types.go
Normal file
49
apis/core.oam.dev/v1alpha1/readonly_policy_types.go
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
Copyright 2022 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 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
||||
const (
|
||||
// ReadOnlyPolicyType refers to the type of read-only policy
|
||||
ReadOnlyPolicyType = "read-only"
|
||||
)
|
||||
|
||||
// ReadOnlyPolicySpec defines the spec of read-only policy
|
||||
type ReadOnlyPolicySpec struct {
|
||||
Rules []ReadOnlyPolicyRule `json:"rules"`
|
||||
}
|
||||
|
||||
// Type the type name of the policy
|
||||
func (in *ReadOnlyPolicySpec) Type() string {
|
||||
return ReadOnlyPolicyType
|
||||
}
|
||||
|
||||
// ReadOnlyPolicyRule defines the rule for read-only resources
|
||||
type ReadOnlyPolicyRule struct {
|
||||
Selector ResourcePolicyRuleSelector `json:"selector"`
|
||||
}
|
||||
|
||||
// FindStrategy return if the target resource is read-only
|
||||
func (in *ReadOnlyPolicySpec) FindStrategy(manifest *unstructured.Unstructured) bool {
|
||||
for _, rule := range in.Rules {
|
||||
if rule.Selector.Match(manifest) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -18,8 +18,11 @@ package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
k8sscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
|
||||
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
|
||||
@@ -54,5 +57,6 @@ var (
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&Policy{}, &PolicyList{})
|
||||
SchemeBuilder.Register(&Workflow{}, &WorkflowList{})
|
||||
SchemeBuilder.Register(&workflowv1alpha1.Workflow{}, &workflowv1alpha1.WorkflowList{})
|
||||
_ = SchemeBuilder.AddToScheme(k8sscheme.Scheme)
|
||||
}
|
||||
|
||||
78
apis/core.oam.dev/v1alpha1/resource_policy_types.go
Normal file
78
apis/core.oam.dev/v1alpha1/resource_policy_types.go
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
Copyright 2022 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 (
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/utils/pointer"
|
||||
stringslices "k8s.io/utils/strings/slices"
|
||||
|
||||
"github.com/oam-dev/kubevela/pkg/oam"
|
||||
)
|
||||
|
||||
// ResourcePolicyRuleSelector select the targets of the rule
|
||||
// if multiple conditions are specified, combination logic is AND
|
||||
type ResourcePolicyRuleSelector struct {
|
||||
CompNames []string `json:"componentNames,omitempty"`
|
||||
CompTypes []string `json:"componentTypes,omitempty"`
|
||||
OAMResourceTypes []string `json:"oamTypes,omitempty"`
|
||||
TraitTypes []string `json:"traitTypes,omitempty"`
|
||||
ResourceTypes []string `json:"resourceTypes,omitempty"`
|
||||
ResourceNames []string `json:"resourceNames,omitempty"`
|
||||
}
|
||||
|
||||
// Match check if current rule selector match the target resource
|
||||
// If at least one condition is matched and no other condition failed (could be empty), return true
|
||||
// Otherwise, return false
|
||||
func (in *ResourcePolicyRuleSelector) Match(manifest *unstructured.Unstructured) bool {
|
||||
var compName, compType, oamType, traitType, resourceType, resourceName string
|
||||
if labels := manifest.GetLabels(); labels != nil {
|
||||
compName = labels[oam.LabelAppComponent]
|
||||
compType = labels[oam.WorkloadTypeLabel]
|
||||
oamType = labels[oam.LabelOAMResourceType]
|
||||
traitType = labels[oam.TraitTypeLabel]
|
||||
}
|
||||
resourceType = manifest.GetKind()
|
||||
resourceName = manifest.GetName()
|
||||
match := func(src []string, val string) (found *bool) {
|
||||
if len(src) == 0 {
|
||||
return nil
|
||||
}
|
||||
return pointer.Bool(val != "" && stringslices.Contains(src, val))
|
||||
}
|
||||
conditions := []*bool{
|
||||
match(in.CompNames, compName),
|
||||
match(in.CompTypes, compType),
|
||||
match(in.OAMResourceTypes, oamType),
|
||||
match(in.TraitTypes, traitType),
|
||||
match(in.ResourceTypes, resourceType),
|
||||
match(in.ResourceNames, resourceName),
|
||||
}
|
||||
hasMatched := false
|
||||
for _, cond := range conditions {
|
||||
// if any non-empty condition failed, return false
|
||||
if cond != nil && !*cond {
|
||||
return false
|
||||
}
|
||||
// if condition succeed, record it
|
||||
if cond != nil && *cond {
|
||||
hasMatched = true
|
||||
}
|
||||
}
|
||||
// if at least one condition is met, return true
|
||||
return hasMatched
|
||||
}
|
||||
49
apis/core.oam.dev/v1alpha1/sharedresource_policy_types.go
Normal file
49
apis/core.oam.dev/v1alpha1/sharedresource_policy_types.go
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
Copyright 2022 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 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
||||
const (
|
||||
// SharedResourcePolicyType refers to the type of shared resource policy
|
||||
SharedResourcePolicyType = "shared-resource"
|
||||
)
|
||||
|
||||
// SharedResourcePolicySpec defines the spec of shared-resource policy
|
||||
type SharedResourcePolicySpec struct {
|
||||
Rules []SharedResourcePolicyRule `json:"rules"`
|
||||
}
|
||||
|
||||
// Type the type name of the policy
|
||||
func (in *SharedResourcePolicySpec) Type() string {
|
||||
return SharedResourcePolicyType
|
||||
}
|
||||
|
||||
// SharedResourcePolicyRule defines the rule for sharing resources
|
||||
type SharedResourcePolicyRule struct {
|
||||
Selector ResourcePolicyRuleSelector `json:"selector"`
|
||||
}
|
||||
|
||||
// FindStrategy return if the target resource should be shared
|
||||
func (in *SharedResourcePolicySpec) FindStrategy(manifest *unstructured.Unstructured) bool {
|
||||
for _, rule := range in.Rules {
|
||||
if rule.Selector.Match(manifest) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
49
apis/core.oam.dev/v1alpha1/takeover_policy_types.go
Normal file
49
apis/core.oam.dev/v1alpha1/takeover_policy_types.go
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
Copyright 2022 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 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
||||
const (
|
||||
// TakeOverPolicyType refers to the type of take-over policy
|
||||
TakeOverPolicyType = "take-over"
|
||||
)
|
||||
|
||||
// TakeOverPolicySpec defines the spec of take-over policy
|
||||
type TakeOverPolicySpec struct {
|
||||
Rules []TakeOverPolicyRule `json:"rules"`
|
||||
}
|
||||
|
||||
// Type the type name of the policy
|
||||
func (in *TakeOverPolicySpec) Type() string {
|
||||
return TakeOverPolicyType
|
||||
}
|
||||
|
||||
// TakeOverPolicyRule defines the rule for taking over resources
|
||||
type TakeOverPolicyRule struct {
|
||||
Selector ResourcePolicyRuleSelector `json:"selector"`
|
||||
}
|
||||
|
||||
// FindStrategy return if the target resource should be taken over
|
||||
func (in *TakeOverPolicySpec) FindStrategy(manifest *unstructured.Unstructured) bool {
|
||||
for _, rule := range in.Rules {
|
||||
if rule.Selector.Match(manifest) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -585,6 +585,44 @@ func (in *PolicyList) DeepCopyObject() runtime.Object {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ReadOnlyPolicyRule) DeepCopyInto(out *ReadOnlyPolicyRule) {
|
||||
*out = *in
|
||||
in.Selector.DeepCopyInto(&out.Selector)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadOnlyPolicyRule.
|
||||
func (in *ReadOnlyPolicyRule) DeepCopy() *ReadOnlyPolicyRule {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ReadOnlyPolicyRule)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ReadOnlyPolicySpec) DeepCopyInto(out *ReadOnlyPolicySpec) {
|
||||
*out = *in
|
||||
if in.Rules != nil {
|
||||
in, out := &in.Rules, &out.Rules
|
||||
*out = make([]ReadOnlyPolicyRule, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadOnlyPolicySpec.
|
||||
func (in *ReadOnlyPolicySpec) DeepCopy() *ReadOnlyPolicySpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ReadOnlyPolicySpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RefObjectsComponentSpec) DeepCopyInto(out *RefObjectsComponentSpec) {
|
||||
*out = *in
|
||||
@@ -612,6 +650,31 @@ func (in *RefObjectsComponentSpec) DeepCopy() *RefObjectsComponentSpec {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ReplicationPolicySpec) DeepCopyInto(out *ReplicationPolicySpec) {
|
||||
*out = *in
|
||||
if in.Keys != nil {
|
||||
in, out := &in.Keys, &out.Keys
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Selector != nil {
|
||||
in, out := &in.Selector, &out.Selector
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicationPolicySpec.
|
||||
func (in *ReplicationPolicySpec) DeepCopy() *ReplicationPolicySpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ReplicationPolicySpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResourcePolicyRuleSelector) DeepCopyInto(out *ResourcePolicyRuleSelector) {
|
||||
*out = *in
|
||||
@@ -695,6 +758,44 @@ func (in *SharedResourcePolicySpec) DeepCopy() *SharedResourcePolicySpec {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TakeOverPolicyRule) DeepCopyInto(out *TakeOverPolicyRule) {
|
||||
*out = *in
|
||||
in.Selector.DeepCopyInto(&out.Selector)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TakeOverPolicyRule.
|
||||
func (in *TakeOverPolicyRule) DeepCopy() *TakeOverPolicyRule {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TakeOverPolicyRule)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TakeOverPolicySpec) DeepCopyInto(out *TakeOverPolicySpec) {
|
||||
*out = *in
|
||||
if in.Rules != nil {
|
||||
in, out := &in.Rules, &out.Rules
|
||||
*out = make([]TakeOverPolicyRule, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TakeOverPolicySpec.
|
||||
func (in *TakeOverPolicySpec) DeepCopy() *TakeOverPolicySpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TakeOverPolicySpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TopologyPolicySpec) DeepCopyInto(out *TopologyPolicySpec) {
|
||||
*out = *in
|
||||
@@ -710,67 +811,3 @@ func (in *TopologyPolicySpec) DeepCopy() *TopologyPolicySpec {
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Workflow) DeepCopyInto(out *Workflow) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
if in.Steps != nil {
|
||||
in, out := &in.Steps, &out.Steps
|
||||
*out = make([]common.WorkflowStep, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workflow.
|
||||
func (in *Workflow) DeepCopy() *Workflow {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Workflow)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Workflow) 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 *WorkflowList) DeepCopyInto(out *WorkflowList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Workflow, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowList.
|
||||
func (in *WorkflowList) DeepCopy() *WorkflowList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkflowList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *WorkflowList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
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"`
|
||||
}
|
||||
@@ -24,26 +24,6 @@ import (
|
||||
"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)
|
||||
|
||||
@@ -87,14 +87,6 @@ var (
|
||||
ApplicationConfigurationGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationConfigurationKind)
|
||||
)
|
||||
|
||||
// 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()
|
||||
@@ -126,7 +118,6 @@ func init() {
|
||||
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
|
||||
SchemeBuilder.Register(&Component{}, &ComponentList{})
|
||||
SchemeBuilder.Register(&ApplicationConfiguration{}, &ApplicationConfigurationList{})
|
||||
SchemeBuilder.Register(&ManualScalerTrait{}, &ManualScalerTraitList{})
|
||||
SchemeBuilder.Register(&HealthScope{}, &HealthScopeList{})
|
||||
SchemeBuilder.Register(&Application{}, &ApplicationList{})
|
||||
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})
|
||||
|
||||
@@ -1520,97 +1520,6 @@ func (in *HistoryWorkload) DeepCopy() *HistoryWorkload {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ManualScalerTrait) DeepCopyInto(out *ManualScalerTrait) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Spec = in.Spec
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManualScalerTrait.
|
||||
func (in *ManualScalerTrait) DeepCopy() *ManualScalerTrait {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ManualScalerTrait)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ManualScalerTrait) 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 *ManualScalerTraitList) DeepCopyInto(out *ManualScalerTraitList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ManualScalerTrait, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManualScalerTraitList.
|
||||
func (in *ManualScalerTraitList) DeepCopy() *ManualScalerTraitList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ManualScalerTraitList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ManualScalerTraitList) 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 *ManualScalerTraitSpec) DeepCopyInto(out *ManualScalerTraitSpec) {
|
||||
*out = *in
|
||||
out.WorkloadReference = in.WorkloadReference
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManualScalerTraitSpec.
|
||||
func (in *ManualScalerTraitSpec) DeepCopy() *ManualScalerTraitSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ManualScalerTraitSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ManualScalerTraitStatus) DeepCopyInto(out *ManualScalerTraitStatus) {
|
||||
*out = *in
|
||||
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManualScalerTraitStatus.
|
||||
func (in *ManualScalerTraitStatus) DeepCopy() *ManualScalerTraitStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ManualScalerTraitStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MemoryResources) DeepCopyInto(out *MemoryResources) {
|
||||
*out = *in
|
||||
|
||||
@@ -23,6 +23,8 @@ import (
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
|
||||
)
|
||||
@@ -49,20 +51,11 @@ type AppPolicy struct {
|
||||
Properties *runtime.RawExtension `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// WorkflowStep defines how to execute a workflow step.
|
||||
type WorkflowStep common.WorkflowStep
|
||||
|
||||
// Workflow defines workflow steps and other attributes
|
||||
type Workflow struct {
|
||||
Ref string `json:"ref,omitempty"`
|
||||
Mode *WorkflowExecuteMode `json:"mode,omitempty"`
|
||||
Steps []WorkflowStep `json:"steps,omitempty"`
|
||||
}
|
||||
|
||||
// WorkflowExecuteMode defines the mode of workflow execution
|
||||
type WorkflowExecuteMode struct {
|
||||
Steps common.WorkflowMode `json:"steps,omitempty"`
|
||||
SubSteps common.WorkflowMode `json:"subSteps,omitempty"`
|
||||
Ref string `json:"ref,omitempty"`
|
||||
Mode *workflowv1alpha1.WorkflowExecuteMode `json:"mode,omitempty"`
|
||||
Steps []workflowv1alpha1.WorkflowStep `json:"steps,omitempty"`
|
||||
}
|
||||
|
||||
// ApplicationSpec is the spec of Application
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/kubevela/pkg/util/compression"
|
||||
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
@@ -27,6 +31,16 @@ import (
|
||||
|
||||
// ApplicationRevisionSpec is the spec of ApplicationRevision
|
||||
type ApplicationRevisionSpec struct {
|
||||
// ApplicationRevisionCompressibleFields represents all the fields that can be compressed.
|
||||
ApplicationRevisionCompressibleFields `json:",inline"`
|
||||
|
||||
// Compression represents the compressed components in apprev in base64 (if compression is enabled).
|
||||
Compression ApplicationRevisionCompression `json:"compression,omitempty"`
|
||||
}
|
||||
|
||||
// ApplicationRevisionCompressibleFields represents all the fields that can be compressed.
|
||||
// So we can better organize them and compress only the compressible fields.
|
||||
type ApplicationRevisionCompressibleFields struct {
|
||||
// Application records the snapshot of the created/modified Application
|
||||
Application Application `json:"application"`
|
||||
|
||||
@@ -55,19 +69,74 @@ type ApplicationRevisionSpec struct {
|
||||
Policies map[string]v1alpha1.Policy `json:"policies,omitempty"`
|
||||
|
||||
// Workflow records the external workflow
|
||||
Workflow *v1alpha1.Workflow `json:"workflow,omitempty"`
|
||||
Workflow *workflowv1alpha1.Workflow `json:"workflow,omitempty"`
|
||||
|
||||
// ReferredObjects records the referred objects used in the ref-object typed components
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
ReferredObjects []common.ReferredObject `json:"referredObjects,omitempty"`
|
||||
}
|
||||
|
||||
// ApplicationRevisionCompression represents the compressed components in apprev in base64.
|
||||
type ApplicationRevisionCompression struct {
|
||||
compression.CompressedText `json:",inline"`
|
||||
}
|
||||
|
||||
// MarshalJSON serves the same purpose as the one in ResourceTrackerSpec.
|
||||
func (apprev *ApplicationRevisionSpec) MarshalJSON() ([]byte, error) {
|
||||
type Alias ApplicationRevisionSpec
|
||||
tmp := &struct {
|
||||
*Alias
|
||||
}{}
|
||||
|
||||
if apprev.Compression.Type == compression.Uncompressed {
|
||||
tmp.Alias = (*Alias)(apprev)
|
||||
} else {
|
||||
cpy := apprev.DeepCopy()
|
||||
err := cpy.Compression.EncodeFrom(cpy.ApplicationRevisionCompressibleFields)
|
||||
cpy.ApplicationRevisionCompressibleFields = ApplicationRevisionCompressibleFields{
|
||||
// Application needs to have components.
|
||||
Application: Application{Spec: ApplicationSpec{Components: []common.ApplicationComponent{}}},
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tmp.Alias = (*Alias)(cpy)
|
||||
}
|
||||
|
||||
return json.Marshal(tmp.Alias)
|
||||
}
|
||||
|
||||
// UnmarshalJSON serves the same purpose as the one in ResourceTrackerSpec.
|
||||
func (apprev *ApplicationRevisionSpec) UnmarshalJSON(data []byte) error {
|
||||
type Alias ApplicationRevisionSpec
|
||||
tmp := &struct {
|
||||
*Alias
|
||||
}{}
|
||||
|
||||
if err := json.Unmarshal(data, tmp); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if tmp.Compression.Type != compression.Uncompressed {
|
||||
err := tmp.Compression.DecodeTo(&tmp.ApplicationRevisionCompressibleFields)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tmp.Compression.Clean()
|
||||
}
|
||||
|
||||
(*ApplicationRevisionSpec)(tmp.Alias).DeepCopyInto(apprev)
|
||||
return nil
|
||||
}
|
||||
|
||||
// ApplicationRevisionStatus is the status of ApplicationRevision
|
||||
type ApplicationRevisionStatus struct {
|
||||
// Succeeded records if the workflow finished running with success
|
||||
Succeeded bool `json:"succeeded"`
|
||||
// Workflow the running status of the workflow
|
||||
Workflow *common.WorkflowStatus `json:"workflow,omitempty"`
|
||||
// Record the context values to the revision.
|
||||
WorkflowContext map[string]string `json:"workflowContext,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
86
apis/core.oam.dev/v1beta1/applicationrevision_types_test.go
Normal file
86
apis/core.oam.dev/v1beta1/applicationrevision_types_test.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 v1beta1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/kubevela/pkg/util/compression"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
)
|
||||
|
||||
func TestApplicationRevisionCompression(t *testing.T) {
|
||||
// Fill data
|
||||
spec := &ApplicationRevisionSpec{}
|
||||
spec.Application = Application{Spec: ApplicationSpec{Components: []common.ApplicationComponent{{Name: "test-name"}}}}
|
||||
spec.ComponentDefinitions = make(map[string]ComponentDefinition)
|
||||
spec.ComponentDefinitions["def"] = ComponentDefinition{Spec: ComponentDefinitionSpec{PodSpecPath: "path"}}
|
||||
spec.WorkloadDefinitions = make(map[string]WorkloadDefinition)
|
||||
spec.WorkloadDefinitions["def"] = WorkloadDefinition{Spec: WorkloadDefinitionSpec{Reference: common.DefinitionReference{Name: "testdef"}}}
|
||||
spec.TraitDefinitions = make(map[string]TraitDefinition)
|
||||
spec.TraitDefinitions["def"] = TraitDefinition{Spec: TraitDefinitionSpec{ControlPlaneOnly: true}}
|
||||
spec.ScopeDefinitions = make(map[string]ScopeDefinition)
|
||||
spec.ScopeDefinitions["def"] = ScopeDefinition{Spec: ScopeDefinitionSpec{AllowComponentOverlap: true}}
|
||||
spec.PolicyDefinitions = make(map[string]PolicyDefinition)
|
||||
spec.PolicyDefinitions["def"] = PolicyDefinition{Spec: PolicyDefinitionSpec{ManageHealthCheck: true}}
|
||||
spec.WorkflowStepDefinitions = make(map[string]WorkflowStepDefinition)
|
||||
spec.WorkflowStepDefinitions["def"] = WorkflowStepDefinition{Spec: WorkflowStepDefinitionSpec{Reference: common.DefinitionReference{Name: "testname"}}}
|
||||
spec.ReferredObjects = []common.ReferredObject{{RawExtension: runtime.RawExtension{Raw: []byte("123")}}}
|
||||
|
||||
testAppRev := &ApplicationRevision{Spec: *spec}
|
||||
|
||||
marshalAndUnmarshal := func(in *ApplicationRevision) (*ApplicationRevision, int) {
|
||||
out := &ApplicationRevision{}
|
||||
b, err := json.Marshal(in)
|
||||
assert.NoError(t, err)
|
||||
if in.Spec.Compression.Type != compression.Uncompressed {
|
||||
assert.Contains(t, string(b), fmt.Sprintf("\"type\":\"%s\",\"data\":\"", in.Spec.Compression.Type))
|
||||
}
|
||||
err = json.Unmarshal(b, out)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, out.Spec.Compression.Type, in.Spec.Compression.Type)
|
||||
assert.Equal(t, out.Spec.Compression.Data, "")
|
||||
return out, len(b)
|
||||
}
|
||||
|
||||
// uncompressed
|
||||
testAppRev.Spec.Compression.SetType(compression.Uncompressed)
|
||||
uncomp, uncompsize := marshalAndUnmarshal(testAppRev)
|
||||
|
||||
// zstd compressed
|
||||
testAppRev.Spec.Compression.SetType(compression.Zstd)
|
||||
zstdcomp, zstdsize := marshalAndUnmarshal(testAppRev)
|
||||
// We will compare content later. Clear compression methods since it will interfere
|
||||
// comparison and is verified earlier.
|
||||
zstdcomp.Spec.Compression.SetType(compression.Uncompressed)
|
||||
|
||||
// gzip compressed
|
||||
testAppRev.Spec.Compression.SetType(compression.Gzip)
|
||||
gzipcomp, gzipsize := marshalAndUnmarshal(testAppRev)
|
||||
gzipcomp.Spec.Compression.SetType(compression.Uncompressed)
|
||||
|
||||
assert.Equal(t, uncomp, zstdcomp)
|
||||
assert.Equal(t, zstdcomp, gzipcomp)
|
||||
|
||||
assert.Less(t, zstdsize, uncompsize)
|
||||
assert.Less(t, gzipsize, uncompsize)
|
||||
}
|
||||
@@ -120,7 +120,7 @@ type TraitDefinitionSpec struct {
|
||||
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,
|
||||
// applies to. Workload kinds are specified in resource.group/version format,
|
||||
// e.g. server.core.oam.dev/v1alpha2. Traits that omit this field apply to
|
||||
// all workload kinds.
|
||||
// +optional
|
||||
@@ -138,7 +138,8 @@ type TraitDefinitionSpec struct {
|
||||
// +optional
|
||||
ConflictsWith []string `json:"conflictsWith,omitempty"`
|
||||
|
||||
// Schematic defines the data format and template of the encapsulation of the trait
|
||||
// Schematic defines the data format and template of the encapsulation of the trait.
|
||||
// Only CUE and Kube schematic are supported for now.
|
||||
// +optional
|
||||
Schematic *common.Schematic `json:"schematic,omitempty"`
|
||||
|
||||
@@ -154,14 +155,32 @@ type TraitDefinitionSpec struct {
|
||||
// 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"`
|
||||
// ControlPlaneOnly defines which cluster is dispatched to
|
||||
// +optional
|
||||
ControlPlaneOnly bool `json:"controlPlaneOnly,omitempty"`
|
||||
|
||||
// Stage defines the stage information to which this trait resource processing belongs.
|
||||
// Currently, PreDispatch and PostDispatch are provided, which are used to control resource
|
||||
// pre-process and post-process respectively.
|
||||
// +optional
|
||||
Stage StageType `json:"stage,omitempty"`
|
||||
}
|
||||
|
||||
// StageType describes how the manifests should be dispatched.
|
||||
// Only one of the following stage types may be specified.
|
||||
// If none of the following types is specified, the default one
|
||||
// is DefaultDispatch.
|
||||
type StageType string
|
||||
|
||||
const (
|
||||
// PreDispatch means that pre dispatch for manifests
|
||||
PreDispatch StageType = "PreDispatch"
|
||||
// DefaultDispatch means that default dispatch for manifests
|
||||
DefaultDispatch StageType = "DefaultDispatch"
|
||||
// PostDispatch means that post dispatch for manifests
|
||||
PostDispatch StageType = "PostDispatch"
|
||||
)
|
||||
|
||||
// TraitDefinitionStatus is the status of TraitDefinition
|
||||
type TraitDefinitionStatus struct {
|
||||
// ConditionedStatus reflects the observed status of a resource
|
||||
|
||||
@@ -29,7 +29,8 @@ 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
|
||||
// Schematic defines the data format and template of the encapsulation of the policy definition.
|
||||
// Only CUE schematic is supported for now.
|
||||
// +optional
|
||||
Schematic *common.Schematic `json:"schematic,omitempty"`
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
"reflect"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
k8sscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
@@ -133,6 +134,7 @@ func init() {
|
||||
SchemeBuilder.Register(&Application{}, &ApplicationList{})
|
||||
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})
|
||||
SchemeBuilder.Register(&ResourceTracker{}, &ResourceTrackerList{})
|
||||
_ = SchemeBuilder.AddToScheme(k8sscheme.Scheme)
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
|
||||
@@ -21,19 +21,21 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
errors2 "github.com/pkg/errors"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"github.com/pkg/errors"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
"github.com/kubevela/pkg/util/compression"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
|
||||
"github.com/oam-dev/kubevela/apis/interfaces"
|
||||
velatypes "github.com/oam-dev/kubevela/apis/types"
|
||||
"github.com/oam-dev/kubevela/pkg/oam"
|
||||
"github.com/oam-dev/kubevela/pkg/utils/errors"
|
||||
velaerr "github.com/oam-dev/kubevela/pkg/utils/errors"
|
||||
)
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
@@ -69,9 +71,60 @@ const (
|
||||
|
||||
// ResourceTrackerSpec define the spec of resourceTracker
|
||||
type ResourceTrackerSpec struct {
|
||||
Type ResourceTrackerType `json:"type,omitempty"`
|
||||
ApplicationGeneration int64 `json:"applicationGeneration"`
|
||||
ManagedResources []ManagedResource `json:"managedResources,omitempty"`
|
||||
Type ResourceTrackerType `json:"type,omitempty"`
|
||||
ApplicationGeneration int64 `json:"applicationGeneration"`
|
||||
ManagedResources []ManagedResource `json:"managedResources,omitempty"`
|
||||
Compression ResourceTrackerCompression `json:"compression,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceTrackerCompression represents the compressed components in ResourceTracker.
|
||||
type ResourceTrackerCompression struct {
|
||||
compression.CompressedText `json:",inline"`
|
||||
}
|
||||
|
||||
// MarshalJSON will encode ResourceTrackerSpec according to the compression type. If type specified,
|
||||
// it will encode data to compression data.
|
||||
// Note: this is not the standard json Marshal process but re-use the framework function.
|
||||
func (in *ResourceTrackerSpec) MarshalJSON() ([]byte, error) {
|
||||
type Alias ResourceTrackerSpec
|
||||
tmp := &struct{ *Alias }{}
|
||||
|
||||
if in.Compression.Type == compression.Uncompressed {
|
||||
tmp.Alias = (*Alias)(in)
|
||||
} else {
|
||||
cpy := in.DeepCopy()
|
||||
cpy.ManagedResources = nil
|
||||
err := cpy.Compression.EncodeFrom(in.ManagedResources)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tmp.Alias = (*Alias)(cpy)
|
||||
}
|
||||
|
||||
return json.Marshal(tmp.Alias)
|
||||
}
|
||||
|
||||
// UnmarshalJSON will decode ResourceTrackerSpec according to the compression type. If type specified,
|
||||
// it will decode data from compression data.
|
||||
// Note: this is not the standard json Unmarshal process but re-use the framework function.
|
||||
func (in *ResourceTrackerSpec) UnmarshalJSON(src []byte) error {
|
||||
type Alias ResourceTrackerSpec
|
||||
tmp := &struct{ *Alias }{}
|
||||
if err := json.Unmarshal(src, tmp); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if tmp.Compression.Type != compression.Uncompressed {
|
||||
tmp.ManagedResources = []ManagedResource{}
|
||||
err := tmp.Compression.DecodeTo(&tmp.ManagedResources)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tmp.Compression.Clean()
|
||||
}
|
||||
|
||||
(*ResourceTrackerSpec)(tmp.Alias).DeepCopyInto(in)
|
||||
return nil
|
||||
}
|
||||
|
||||
// ManagedResource define the resource to be managed by ResourceTracker
|
||||
@@ -82,6 +135,8 @@ type ManagedResource struct {
|
||||
Data *runtime.RawExtension `json:"raw,omitempty"`
|
||||
// Deleted marks the resource to be deleted
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
// SkipGC marks the resource to skip gc
|
||||
SkipGC bool `json:"skipGC,omitempty"`
|
||||
}
|
||||
|
||||
// Equal check if two managed resource equals
|
||||
@@ -121,12 +176,13 @@ func (in ManagedResource) NamespacedName() types.NamespacedName {
|
||||
|
||||
// ResourceKey computes the key for managed resource, resources with the same key points to the same resource
|
||||
func (in ManagedResource) ResourceKey() string {
|
||||
gv, kind := in.GroupVersionKind().ToAPIVersionAndKind()
|
||||
group := in.GroupVersionKind().Group
|
||||
kind := in.GroupVersionKind().Kind
|
||||
cluster := in.Cluster
|
||||
if cluster == "" {
|
||||
cluster = velatypes.ClusterLocalName
|
||||
}
|
||||
return strings.Join([]string{gv, kind, cluster, in.Namespace, in.Name}, "/")
|
||||
return strings.Join([]string{group, kind, cluster, in.Namespace, in.Name}, "/")
|
||||
}
|
||||
|
||||
// ComponentKey computes the key for the component which managed resource belongs to
|
||||
@@ -137,7 +193,7 @@ func (in ManagedResource) ComponentKey() string {
|
||||
// UnmarshalTo unmarshal ManagedResource into target object
|
||||
func (in ManagedResource) UnmarshalTo(obj interface{}) error {
|
||||
if in.Data == nil || in.Data.Raw == nil {
|
||||
return errors.ManagedResourceHasNoDataError{}
|
||||
return velaerr.ManagedResourceHasNoDataError{}
|
||||
}
|
||||
return json.Unmarshal(in.Data.Raw, obj)
|
||||
}
|
||||
@@ -158,7 +214,7 @@ func (in ManagedResource) ToUnstructured() *unstructured.Unstructured {
|
||||
func (in ManagedResource) ToUnstructuredWithData() (*unstructured.Unstructured, error) {
|
||||
obj := in.ToUnstructured()
|
||||
if err := in.UnmarshalTo(obj); err != nil {
|
||||
if errors2.Is(err, errors.ManagedResourceHasNoDataError{}) {
|
||||
if errors.Is(err, velaerr.ManagedResourceHasNoDataError{}) {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
@@ -195,7 +251,7 @@ func newManagedResourceFromResource(rsc client.Object) ManagedResource {
|
||||
gvk := rsc.GetObjectKind().GroupVersionKind()
|
||||
return ManagedResource{
|
||||
ClusterObjectReference: common.ClusterObjectReference{
|
||||
ObjectReference: v1.ObjectReference{
|
||||
ObjectReference: corev1.ObjectReference{
|
||||
APIVersion: gvk.GroupVersion().String(),
|
||||
Kind: gvk.Kind,
|
||||
Name: rsc.GetName(),
|
||||
@@ -215,8 +271,9 @@ func (in *ResourceTracker) ContainsManagedResource(rsc client.Object) bool {
|
||||
}
|
||||
|
||||
// AddManagedResource add object to managed resources, if exists, update
|
||||
func (in *ResourceTracker) AddManagedResource(rsc client.Object, metaOnly bool, creator common.ResourceCreatorRole) (updated bool) {
|
||||
func (in *ResourceTracker) AddManagedResource(rsc client.Object, metaOnly bool, skipGC bool, creator string) (updated bool) {
|
||||
mr := newManagedResourceFromResource(rsc)
|
||||
mr.SkipGC = skipGC
|
||||
if !metaOnly {
|
||||
mr.Data = &runtime.RawExtension{Object: rsc}
|
||||
}
|
||||
@@ -242,7 +299,7 @@ func (in *ResourceTracker) DeleteManagedResource(rsc client.Object, remove bool)
|
||||
gvk := rsc.GetObjectKind().GroupVersionKind()
|
||||
mr := ManagedResource{
|
||||
ClusterObjectReference: common.ClusterObjectReference{
|
||||
ObjectReference: v1.ObjectReference{
|
||||
ObjectReference: corev1.ObjectReference{
|
||||
APIVersion: gvk.GroupVersion().String(),
|
||||
Kind: gvk.Kind,
|
||||
Name: rsc.GetName(),
|
||||
@@ -285,7 +342,7 @@ func (in *ResourceTracker) addClusterObjectReference(ref common.ClusterObjectRef
|
||||
// Deprecated
|
||||
func (in *ResourceTracker) AddTrackedResource(rsc interfaces.TrackableResource) bool {
|
||||
return in.addClusterObjectReference(common.ClusterObjectReference{
|
||||
ObjectReference: v1.ObjectReference{
|
||||
ObjectReference: corev1.ObjectReference{
|
||||
APIVersion: rsc.GetAPIVersion(),
|
||||
Kind: rsc.GetKind(),
|
||||
Name: rsc.GetName(),
|
||||
|
||||
@@ -18,12 +18,17 @@ package v1beta1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/kubevela/pkg/util/compression"
|
||||
"github.com/stretchr/testify/require"
|
||||
v12 "k8s.io/api/apps/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
v13 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/utils/pointer"
|
||||
@@ -111,10 +116,10 @@ func TestManagedResourceKeys(t *testing.T) {
|
||||
input := ManagedResource{
|
||||
ClusterObjectReference: common.ClusterObjectReference{
|
||||
Cluster: "cluster",
|
||||
ObjectReference: v1.ObjectReference{
|
||||
ObjectReference: corev1.ObjectReference{
|
||||
Namespace: "namespace",
|
||||
Name: "name",
|
||||
APIVersion: v12.SchemeGroupVersion.String(),
|
||||
APIVersion: appsv1.SchemeGroupVersion.String(),
|
||||
Kind: "Deployment",
|
||||
},
|
||||
},
|
||||
@@ -125,10 +130,10 @@ func TestManagedResourceKeys(t *testing.T) {
|
||||
},
|
||||
}
|
||||
r.Equal("namespace/name", input.NamespacedName().String())
|
||||
r.Equal("apps/v1/Deployment/cluster/namespace/name", input.ResourceKey())
|
||||
r.Equal("apps/Deployment/cluster/namespace/name", input.ResourceKey())
|
||||
r.Equal("env/component", input.ComponentKey())
|
||||
r.Equal("Deployment name (Cluster: cluster, Namespace: namespace)", input.DisplayName())
|
||||
var deploy1, deploy2 v12.Deployment
|
||||
var deploy1, deploy2 appsv1.Deployment
|
||||
deploy1.Spec.Replicas = pointer.Int32(5)
|
||||
bs, err := json.Marshal(deploy1)
|
||||
r.NoError(err)
|
||||
@@ -155,17 +160,17 @@ func TestManagedResourceKeys(t *testing.T) {
|
||||
func TestResourceTracker_ManagedResource(t *testing.T) {
|
||||
r := require.New(t)
|
||||
input := &ResourceTracker{}
|
||||
deploy1 := v12.Deployment{ObjectMeta: v13.ObjectMeta{Name: "deploy1"}}
|
||||
input.AddManagedResource(&deploy1, true, "")
|
||||
deploy1 := appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{Name: "deploy1"}}
|
||||
input.AddManagedResource(&deploy1, true, false, "")
|
||||
r.Equal(1, len(input.Spec.ManagedResources))
|
||||
cm2 := v1.ConfigMap{ObjectMeta: v13.ObjectMeta{Name: "cm2"}}
|
||||
input.AddManagedResource(&cm2, false, "")
|
||||
cm2 := corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: "cm2"}}
|
||||
input.AddManagedResource(&cm2, false, false, "")
|
||||
r.Equal(2, len(input.Spec.ManagedResources))
|
||||
pod3 := v1.Pod{ObjectMeta: v13.ObjectMeta{Name: "pod3"}}
|
||||
input.AddManagedResource(&pod3, false, "")
|
||||
pod3 := corev1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod3"}}
|
||||
input.AddManagedResource(&pod3, false, false, "")
|
||||
r.Equal(3, len(input.Spec.ManagedResources))
|
||||
deploy1.Spec.Replicas = pointer.Int32(5)
|
||||
input.AddManagedResource(&deploy1, false, "")
|
||||
input.AddManagedResource(&deploy1, false, false, "")
|
||||
r.Equal(3, len(input.Spec.ManagedResources))
|
||||
input.DeleteManagedResource(&cm2, false)
|
||||
r.Equal(3, len(input.Spec.ManagedResources))
|
||||
@@ -176,9 +181,170 @@ func TestResourceTracker_ManagedResource(t *testing.T) {
|
||||
r.Equal(1, len(input.Spec.ManagedResources))
|
||||
input.DeleteManagedResource(&pod3, true)
|
||||
r.Equal(0, len(input.Spec.ManagedResources))
|
||||
secret4 := v1.Secret{ObjectMeta: v13.ObjectMeta{Name: "secret4"}}
|
||||
secret4 := corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "secret4"}}
|
||||
input.DeleteManagedResource(&secret4, true)
|
||||
r.Equal(0, len(input.Spec.ManagedResources))
|
||||
input.DeleteManagedResource(&secret4, false)
|
||||
r.Equal(1, len(input.Spec.ManagedResources))
|
||||
}
|
||||
|
||||
func TestResourceTrackerCompression(t *testing.T) {
|
||||
count := 20
|
||||
r := require.New(t)
|
||||
|
||||
// Load some real CRDs, and other test data to simulate real use-cases.
|
||||
// The user must have some large resourcetrackers if they use compression,
|
||||
// so we load some large CRDs.
|
||||
var data []string
|
||||
paths := []string{
|
||||
"../../../charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml",
|
||||
"../../../charts/vela-core/crds/core.oam.dev_applications.yaml",
|
||||
"../../../charts/vela-core/crds/core.oam.dev_definitionrevisions.yaml",
|
||||
"../../../charts/vela-core/crds/core.oam.dev_healthscopes.yaml",
|
||||
"../../../charts/vela-core/crds/core.oam.dev_traitdefinitions.yaml",
|
||||
"../../../charts/vela-core/crds/core.oam.dev_componentdefinitions.yaml",
|
||||
"../../../charts/vela-core/crds/core.oam.dev_workloaddefinitions.yaml",
|
||||
"../../../charts/vela-core/crds/standard.oam.dev_rollouts.yaml",
|
||||
"../../../charts/vela-core/templates/kubevela-controller.yaml",
|
||||
"../../../charts/vela-core/README.md",
|
||||
"../../../pkg/velaql/providers/query/testdata/machinelearning.seldon.io_seldondeployments.yaml",
|
||||
"../../../legacy/charts/vela-core-legacy/crds/standard.oam.dev_podspecworkloads.yaml",
|
||||
}
|
||||
for _, p := range paths {
|
||||
b, err := os.ReadFile(p)
|
||||
r.NoError(err)
|
||||
data = append(data, string(b))
|
||||
}
|
||||
size := len(data)
|
||||
|
||||
// Gzip
|
||||
var (
|
||||
gzipCompressTime int64
|
||||
gzipSize int
|
||||
gzipBs []byte
|
||||
)
|
||||
for c := 0; c < count; c++ {
|
||||
var err error
|
||||
rtGzip := &ResourceTracker{}
|
||||
for i := 0; i < size; i++ {
|
||||
rtGzip.AddManagedResource(&corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("cm%d", i)}, Data: map[string]string{"1": data[i]}}, false, false, "")
|
||||
rtGzip.AddManagedResource(&corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("secret%d", i)}}, true, false, "")
|
||||
}
|
||||
rtGzip.Spec.Compression.Type = compression.Gzip
|
||||
// Compress
|
||||
t0 := time.Now()
|
||||
gzipBs, err = json.Marshal(rtGzip)
|
||||
elapsed := time.Since(t0).Nanoseconds()
|
||||
if gzipCompressTime == 0 {
|
||||
gzipCompressTime = elapsed
|
||||
} else {
|
||||
gzipCompressTime = (elapsed + gzipCompressTime) / 2
|
||||
}
|
||||
if gzipSize == 0 {
|
||||
gzipSize = len(gzipBs)
|
||||
} else {
|
||||
gzipSize = (len(gzipBs) + gzipSize) / 2
|
||||
}
|
||||
r.NoError(err)
|
||||
r.Contains(string(gzipBs), `"type":"gzip","data":`)
|
||||
}
|
||||
|
||||
// Zstd
|
||||
var (
|
||||
zstdCompressTime int64
|
||||
zstdSize int
|
||||
zstdBs []byte
|
||||
)
|
||||
for c := 0; c < count; c++ {
|
||||
var err error
|
||||
rtZstd := &ResourceTracker{}
|
||||
for i := 0; i < size; i++ {
|
||||
rtZstd.AddManagedResource(&corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("cm%d", i)}, Data: map[string]string{"1": data[i]}}, false, false, "")
|
||||
rtZstd.AddManagedResource(&corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("secret%d", i)}}, true, false, "")
|
||||
}
|
||||
rtZstd.Spec.Compression.Type = compression.Zstd
|
||||
t0 := time.Now()
|
||||
zstdBs, err = json.Marshal(rtZstd)
|
||||
elapsed := time.Since(t0).Nanoseconds()
|
||||
if zstdCompressTime == 0 {
|
||||
zstdCompressTime = elapsed
|
||||
} else {
|
||||
zstdCompressTime = (elapsed + zstdCompressTime) / 2
|
||||
}
|
||||
if zstdSize == 0 {
|
||||
zstdSize = len(zstdBs)
|
||||
} else {
|
||||
zstdSize = (len(zstdBs) + zstdSize) / 2
|
||||
}
|
||||
r.NoError(err)
|
||||
r.Contains(string(zstdBs), `"type":"zstd","data":`)
|
||||
}
|
||||
|
||||
rtUncmp := &ResourceTracker{}
|
||||
r.NoError(json.Unmarshal(gzipBs, rtUncmp))
|
||||
r.Equal(size*2, len(rtUncmp.Spec.ManagedResources))
|
||||
for i, rsc := range rtUncmp.Spec.ManagedResources {
|
||||
r.Equal(i%2 == 1, rsc.Data == nil)
|
||||
}
|
||||
r.NoError(json.Unmarshal(zstdBs, rtUncmp))
|
||||
r.Equal(size*2, len(rtUncmp.Spec.ManagedResources))
|
||||
for i, rsc := range rtUncmp.Spec.ManagedResources {
|
||||
r.Equal(i%2 == 1, rsc.Data == nil)
|
||||
}
|
||||
// No compression
|
||||
var (
|
||||
uncmpTime int64
|
||||
uncmpSize int
|
||||
)
|
||||
rtUncmp.Spec.Compression.Type = compression.Uncompressed
|
||||
for c := 0; c < count; c++ {
|
||||
t0 := time.Now()
|
||||
_bs, err := json.Marshal(rtUncmp)
|
||||
if uncmpTime == 0 {
|
||||
uncmpTime = time.Since(t0).Nanoseconds()
|
||||
} else {
|
||||
uncmpTime = (time.Since(t0).Nanoseconds() + uncmpTime) / 2
|
||||
}
|
||||
if uncmpSize == 0 {
|
||||
uncmpSize = len(_bs)
|
||||
} else {
|
||||
uncmpSize = (len(_bs) + uncmpSize) / 2
|
||||
}
|
||||
r.NoError(err)
|
||||
before, after := len(_bs), len(zstdBs)
|
||||
r.Less(after, before)
|
||||
before, after = len(_bs), len(gzipBs)
|
||||
r.Less(after, before)
|
||||
}
|
||||
|
||||
fmt.Printf(`Compressed Size:
|
||||
uncompressed: %d bytes 100.00%%
|
||||
gzip: %d bytes %.2f%%
|
||||
zstd: %d bytes %.2f%%
|
||||
`,
|
||||
uncmpSize,
|
||||
gzipSize, float64(gzipSize)*100.0/float64(uncmpSize),
|
||||
zstdSize, float64(zstdSize)*100.0/float64(uncmpSize))
|
||||
|
||||
fmt.Printf(`Marshal Time:
|
||||
no compression: %d ns 1.00x
|
||||
gzip: %d ns %.2fx
|
||||
zstd: %d ns %.2fx
|
||||
`,
|
||||
uncmpTime,
|
||||
gzipCompressTime, float64(gzipCompressTime)/float64(uncmpTime),
|
||||
zstdCompressTime, float64(zstdCompressTime)/float64(uncmpTime),
|
||||
)
|
||||
}
|
||||
|
||||
func TestResourceTrackerInvalidMarshal(t *testing.T) {
|
||||
r := require.New(t)
|
||||
rt := &ResourceTracker{}
|
||||
rt.Spec.Compression.Type = "invalid"
|
||||
_, err := json.Marshal(rt)
|
||||
r.ErrorIs(err, compression.NewUnsupportedCompressionTypeError("invalid"))
|
||||
r.True(strings.Contains(err.Error(), "invalid"))
|
||||
r.ErrorIs(json.Unmarshal([]byte(`{"spec":{"compression":{"type":"invalid"}}}`), rt), compression.NewUnsupportedCompressionTypeError("invalid"))
|
||||
r.NotNil(json.Unmarshal([]byte(`{"spec":{"compression":{"type":"gzip","data":"xxx"}}}`), rt))
|
||||
r.NotNil(json.Unmarshal([]byte(`{"spec":["invalid"]}`), rt))
|
||||
}
|
||||
|
||||
@@ -29,7 +29,8 @@ 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
|
||||
// Schematic defines the data format and template of the encapsulation of the workflow step definition.
|
||||
// Only CUE schematic is supported for now.
|
||||
// +optional
|
||||
Schematic *common.Schematic `json:"schematic,omitempty"`
|
||||
}
|
||||
|
||||
@@ -22,11 +22,12 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"github.com/kubevela/workflow/api/v1alpha1"
|
||||
v1 "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/v1alpha1"
|
||||
core_oam_devv1alpha1 "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha1"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
@@ -136,39 +137,7 @@ func (in *ApplicationRevision) DeepCopyObject() runtime.Object {
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ApplicationRevisionList) DeepCopyInto(out *ApplicationRevisionList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ApplicationRevision, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevisionList.
|
||||
func (in *ApplicationRevisionList) DeepCopy() *ApplicationRevisionList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ApplicationRevisionList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ApplicationRevisionList) 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 *ApplicationRevisionSpec) DeepCopyInto(out *ApplicationRevisionSpec) {
|
||||
func (in *ApplicationRevisionCompressibleFields) DeepCopyInto(out *ApplicationRevisionCompressibleFields) {
|
||||
*out = *in
|
||||
in.Application.DeepCopyInto(&out.Application)
|
||||
if in.ComponentDefinitions != nil {
|
||||
@@ -222,7 +191,7 @@ func (in *ApplicationRevisionSpec) DeepCopyInto(out *ApplicationRevisionSpec) {
|
||||
}
|
||||
if in.Policies != nil {
|
||||
in, out := &in.Policies, &out.Policies
|
||||
*out = make(map[string]v1alpha1.Policy, len(*in))
|
||||
*out = make(map[string]core_oam_devv1alpha1.Policy, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = *val.DeepCopy()
|
||||
}
|
||||
@@ -241,6 +210,71 @@ func (in *ApplicationRevisionSpec) DeepCopyInto(out *ApplicationRevisionSpec) {
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevisionCompressibleFields.
|
||||
func (in *ApplicationRevisionCompressibleFields) DeepCopy() *ApplicationRevisionCompressibleFields {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ApplicationRevisionCompressibleFields)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ApplicationRevisionCompression) DeepCopyInto(out *ApplicationRevisionCompression) {
|
||||
*out = *in
|
||||
out.CompressedText = in.CompressedText
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevisionCompression.
|
||||
func (in *ApplicationRevisionCompression) DeepCopy() *ApplicationRevisionCompression {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ApplicationRevisionCompression)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ApplicationRevisionList) DeepCopyInto(out *ApplicationRevisionList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ApplicationRevision, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevisionList.
|
||||
func (in *ApplicationRevisionList) DeepCopy() *ApplicationRevisionList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ApplicationRevisionList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ApplicationRevisionList) 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 *ApplicationRevisionSpec) DeepCopyInto(out *ApplicationRevisionSpec) {
|
||||
*out = *in
|
||||
in.ApplicationRevisionCompressibleFields.DeepCopyInto(&out.ApplicationRevisionCompressibleFields)
|
||||
out.Compression = in.Compression
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevisionSpec.
|
||||
func (in *ApplicationRevisionSpec) DeepCopy() *ApplicationRevisionSpec {
|
||||
if in == nil {
|
||||
@@ -259,6 +293,13 @@ func (in *ApplicationRevisionStatus) DeepCopyInto(out *ApplicationRevisionStatus
|
||||
*out = new(common.WorkflowStatus)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.WorkflowContext != nil {
|
||||
in, out := &in.WorkflowContext, &out.WorkflowContext
|
||||
*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 ApplicationRevisionStatus.
|
||||
@@ -650,6 +691,22 @@ func (in *ResourceTracker) DeepCopyObject() runtime.Object {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResourceTrackerCompression) DeepCopyInto(out *ResourceTrackerCompression) {
|
||||
*out = *in
|
||||
out.CompressedText = in.CompressedText
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceTrackerCompression.
|
||||
func (in *ResourceTrackerCompression) DeepCopy() *ResourceTrackerCompression {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResourceTrackerCompression)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResourceTrackerList) DeepCopyInto(out *ResourceTrackerList) {
|
||||
*out = *in
|
||||
@@ -692,6 +749,7 @@ func (in *ResourceTrackerSpec) DeepCopyInto(out *ResourceTrackerSpec) {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
out.Compression = in.Compression
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceTrackerSpec.
|
||||
@@ -929,12 +987,12 @@ func (in *Workflow) DeepCopyInto(out *Workflow) {
|
||||
*out = *in
|
||||
if in.Mode != nil {
|
||||
in, out := &in.Mode, &out.Mode
|
||||
*out = new(WorkflowExecuteMode)
|
||||
*out = new(v1alpha1.WorkflowExecuteMode)
|
||||
**out = **in
|
||||
}
|
||||
if in.Steps != nil {
|
||||
in, out := &in.Steps, &out.Steps
|
||||
*out = make([]WorkflowStep, len(*in))
|
||||
*out = make([]v1alpha1.WorkflowStep, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
@@ -951,68 +1009,6 @@ func (in *Workflow) DeepCopy() *Workflow {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkflowExecuteMode) DeepCopyInto(out *WorkflowExecuteMode) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowExecuteMode.
|
||||
func (in *WorkflowExecuteMode) DeepCopy() *WorkflowExecuteMode {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkflowExecuteMode)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkflowStep) DeepCopyInto(out *WorkflowStep) {
|
||||
*out = *in
|
||||
if in.Meta != nil {
|
||||
in, out := &in.Meta, &out.Meta
|
||||
*out = new(common.WorkflowStepMeta)
|
||||
**out = **in
|
||||
}
|
||||
if in.Properties != nil {
|
||||
in, out := &in.Properties, &out.Properties
|
||||
*out = new(runtime.RawExtension)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.SubSteps != nil {
|
||||
in, out := &in.SubSteps, &out.SubSteps
|
||||
*out = make([]common.WorkflowSubStep, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
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(common.StepInputs, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Outputs != nil {
|
||||
in, out := &in.Outputs, &out.Outputs
|
||||
*out = make(common.StepOutputs, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStep.
|
||||
func (in *WorkflowStep) DeepCopy() *WorkflowStep {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkflowStep)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkflowStepDefinition) DeepCopyInto(out *WorkflowStepDefinition) {
|
||||
*out = *in
|
||||
|
||||
@@ -28,9 +28,11 @@ type ComponentManifest struct {
|
||||
RevisionName string
|
||||
RevisionHash string
|
||||
ExternalRevision string
|
||||
// StandardWorkload contains K8s resource generated from "output" block of ComponentDefinition
|
||||
StandardWorkload *unstructured.Unstructured
|
||||
Traits []*unstructured.Unstructured
|
||||
Scopes []*corev1.ObjectReference
|
||||
// Traits contains both resources generated from "outputs" block of ComponentDefinition and resources generated from TraitDefinition
|
||||
Traits []*unstructured.Unstructured
|
||||
Scopes []*corev1.ObjectReference
|
||||
|
||||
// PackagedWorkloadResources contain all the workload related resources. It could be a Helm
|
||||
// Release, Git Repo or anything that can package and run a workload.
|
||||
|
||||
@@ -39,4 +39,18 @@ const (
|
||||
var (
|
||||
// AnnotationClusterAlias the annotation key for cluster alias
|
||||
AnnotationClusterAlias = config.MetaApiGroupName + "/cluster-alias"
|
||||
|
||||
// AnnotationClusterVersion the annotation key for cluster version
|
||||
AnnotationClusterVersion = config.MetaApiGroupName + "/cluster-version"
|
||||
)
|
||||
|
||||
// ClusterVersion defines the Version info of managed clusters.
|
||||
type ClusterVersion struct {
|
||||
Major string `json:"major"`
|
||||
Minor string `json:"minor"`
|
||||
GitVersion string `json:"gitVersion,omitempty"`
|
||||
Platform string `json:"platform,omitempty"`
|
||||
}
|
||||
|
||||
// ControlPlaneClusterVersion will be the default value of cluster info if managed cluster version get error, it will have value when vela-core started.
|
||||
var ControlPlaneClusterVersion ClusterVersion
|
||||
|
||||
@@ -64,6 +64,8 @@ const (
|
||||
LabelDefinitionDeprecated = "custom.definition.oam.dev/deprecated"
|
||||
// LabelDefinitionHidden is the label which describe whether the capability is hidden by UI
|
||||
LabelDefinitionHidden = "custom.definition.oam.dev/ui-hidden"
|
||||
// LabelDefinitionScope is the label which describe whether the capability's scope
|
||||
LabelDefinitionScope = "custom.definition.oam.dev/scope"
|
||||
// LabelNodeRoleGateway gateway role of node
|
||||
LabelNodeRoleGateway = "node-role.kubernetes.io/gateway"
|
||||
// LabelNodeRoleWorker worker role of node
|
||||
@@ -74,9 +76,9 @@ const (
|
||||
AnnoIngressControllerHTTPPort = "ingress.controller/http-port"
|
||||
// AnnoIngressControllerHost define ingress controller externally host
|
||||
AnnoIngressControllerHost = "ingress.controller/host"
|
||||
// LabelConfigType is the label for config type
|
||||
// LabelConfigType is the label marked as the template that generated the config.
|
||||
LabelConfigType = "config.oam.dev/type"
|
||||
// LabelConfigCatalog is the label for config catalog
|
||||
// LabelConfigCatalog is the label marked as the secret generated from the config.
|
||||
LabelConfigCatalog = "config.oam.dev/catalog"
|
||||
// LabelConfigSubType is the sub-type for a config type
|
||||
LabelConfigSubType = "config.oam.dev/sub-type"
|
||||
@@ -86,10 +88,18 @@ const (
|
||||
LabelConfigSyncToMultiCluster = "config.oam.dev/multi-cluster"
|
||||
// LabelConfigIdentifier is the label for config identifier
|
||||
LabelConfigIdentifier = "config.oam.dev/identifier"
|
||||
// LabelConfigScope is the label for config scope
|
||||
LabelConfigScope = "config.oam.dev/scope"
|
||||
// AnnotationConfigSensitive is the annotation for the sensitization
|
||||
AnnotationConfigSensitive = "config.oam.dev/sensitive"
|
||||
// AnnotationConfigTemplateNamespace is the annotation for the template namespace
|
||||
AnnotationConfigTemplateNamespace = "config.oam.dev/template-namespace"
|
||||
// AnnotationConfigDescription is the annotation for config description
|
||||
AnnotationConfigDescription = "config.oam.dev/description"
|
||||
// AnnotationConfigAlias is the annotation for config alias
|
||||
AnnotationConfigAlias = "config.oam.dev/alias"
|
||||
// AnnotationConfigDistributionSpec is the annotation key of the application that distributes the configs
|
||||
AnnotationConfigDistributionSpec = "config.oam.dev/distribution-spec"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -106,6 +116,7 @@ type Config map[string]string
|
||||
type EnvMeta struct {
|
||||
Name string `json:"name"`
|
||||
Namespace string `json:"namespace"`
|
||||
Labels string `json:"labels"`
|
||||
Current string `json:"current"`
|
||||
}
|
||||
|
||||
@@ -155,11 +166,13 @@ const (
|
||||
// TerraformProvider is the config type for terraform provider
|
||||
TerraformProvider = "terraform-provider"
|
||||
// DexConnector is the config type for dex connector
|
||||
DexConnector = "config-dex-connector"
|
||||
DexConnector = "dex-connector"
|
||||
// ImageRegistry is the config type for image registry
|
||||
ImageRegistry = "config-image-registry"
|
||||
ImageRegistry = "image-registry"
|
||||
// HelmRepository is the config type for Helm chart repository
|
||||
HelmRepository = "config-helm-repository"
|
||||
HelmRepository = "helm-repository"
|
||||
// CatalogConfigDistribution is the catalog type
|
||||
CatalogConfigDistribution = "config-distribution"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -41,13 +41,12 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wai
|
||||
| Name | Description | Value |
|
||||
| ----------------------------- | --------------------------------------------------------------------------------------------- | --------- |
|
||||
| `systemDefinitionNamespace` | System definition namespace, if unspecified, will use built-in variable `.Release.Namespace`. | `nil` |
|
||||
| `applicationRevisionLimit` | Application revision limit | `10` |
|
||||
| `definitionRevisionLimit` | Definition revision limit | `20` |
|
||||
| `applicationRevisionLimit` | Application revision limit | `2` |
|
||||
| `definitionRevisionLimit` | Definition revision limit | `2` |
|
||||
| `concurrentReconciles` | concurrentReconciles is the concurrent reconcile number of the controller | `4` |
|
||||
| `controllerArgs.reSyncPeriod` | The period for resync the applications | `5m` |
|
||||
| `OAMSpecVer` | OAMSpecVer is the oam spec version controller want to setup | `v0.3` |
|
||||
| `disableCaps` | Disable capability | `rollout` |
|
||||
| `enableFluxcdAddon` | Whether to enable fluxcd addon | `false` |
|
||||
| `dependCheckWait` | dependCheckWait is the time to wait for ApplicationConfiguration's dependent-resource ready | `30s` |
|
||||
|
||||
|
||||
@@ -81,19 +80,26 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wai
|
||||
|
||||
### KubeVela controller optimization parameters
|
||||
|
||||
| Name | Description | Value |
|
||||
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||
| `optimize.cachedGvks` | Optimize types of resources to be cached. | `""` |
|
||||
| `optimize.resourceTrackerListOp` | Optimize ResourceTracker List Op by adding index. | `true` |
|
||||
| `optimize.controllerReconcileLoopReduction` | Optimize ApplicationController reconcile by reducing the number of loops to reconcile application. | `false` |
|
||||
| `optimize.markWithProb` | Optimize ResourceTracker GC by only run mark with probability. Side effect: outdated ResourceTracker might not be able to be removed immediately. | `0.1` |
|
||||
| `optimize.disableComponentRevision` | Optimize componentRevision by disabling the creation and gc | `false` |
|
||||
| `optimize.disableApplicationRevision` | Optimize ApplicationRevision by disabling the creation and gc. | `false` |
|
||||
| `optimize.disableWorkflowRecorder` | Optimize workflow recorder by disabling the creation and gc. | `false` |
|
||||
| `optimize.enableInMemoryWorkflowContext` | Optimize workflow by use in-memory context. | `false` |
|
||||
| `optimize.disableResourceApplyDoubleCheck` | Optimize workflow by ignoring resource double check after apply. | `false` |
|
||||
| `optimize.enableResourceTrackerDeleteOnlyTrigger` | Optimize resourcetracker by only trigger reconcile when resourcetracker is deleted. | `true` |
|
||||
| `featureGates.enableLegacyComponentRevision` | if disabled, only component with rollout trait will create component revisions | `false` |
|
||||
| Name | Description | Value |
|
||||
| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||
| `optimize.cachedGvks` | Optimize types of resources to be cached. | `""` |
|
||||
| `optimize.resourceTrackerListOp` | Optimize ResourceTracker List Op by adding index. | `true` |
|
||||
| `optimize.controllerReconcileLoopReduction` | Optimize ApplicationController reconcile by reducing the number of loops to reconcile application. | `false` |
|
||||
| `optimize.markWithProb` | Optimize ResourceTracker GC by only run mark with probability. Side effect: outdated ResourceTracker might not be able to be removed immediately. | `0.1` |
|
||||
| `optimize.disableComponentRevision` | Optimize componentRevision by disabling the creation and gc | `true` |
|
||||
| `optimize.disableApplicationRevision` | Optimize ApplicationRevision by disabling the creation and gc. | `false` |
|
||||
| `optimize.disableWorkflowRecorder` | Optimize workflow recorder by disabling the creation and gc. | `false` |
|
||||
| `optimize.enableInMemoryWorkflowContext` | Optimize workflow by use in-memory context. | `false` |
|
||||
| `optimize.disableResourceApplyDoubleCheck` | Optimize workflow by ignoring resource double check after apply. | `false` |
|
||||
| `optimize.enableResourceTrackerDeleteOnlyTrigger` | Optimize resourcetracker by only trigger reconcile when resourcetracker is deleted. | `true` |
|
||||
| `featureGates.enableLegacyComponentRevision` | if disabled, only component with rollout trait will create component revisions | `false` |
|
||||
| `featureGates.gzipResourceTracker` | compress ResourceTracker using gzip (good) before being stored. This is reduces network throughput when dealing with huge ResourceTrackers. | `false` |
|
||||
| `featureGates.zstdResourceTracker` | compress ResourceTracker using zstd (fast and good) before being stored. This is reduces network throughput when dealing with huge ResourceTrackers. Note that zstd will be prioritized if you enable other compression options. | `true` |
|
||||
| `featureGates.applyOnce` | if enabled, the apply-once feature will be applied to all applications, no state-keep and no resource data storage in ResourceTracker | `false` |
|
||||
| `featureGates.multiStageComponentApply` | if enabled, the multiStageComponentApply feature will be combined with the stage field in TraitDefinition to complete the multi-stage apply. | `false` |
|
||||
| `featureGates.gzipApplicationRevision` | compress apprev using gzip (good) before being stored. This is reduces network throughput when dealing with huge apprevs. | `false` |
|
||||
| `featureGates.zstdApplicationRevision` | compress apprev using zstd (fast and good) before being stored. This is reduces network throughput when dealing with huge apprevs. Note that zstd will be prioritized if you enable other compression options. | `true` |
|
||||
| `featureGates.preDispatchDryRun` | enable dryrun before dispatching resources. Enable this flag can help prevent unsuccessful dispatch resources entering resourcetracker and improve the user experiences of gc but at the cost of increasing network requests. | `true` |
|
||||
|
||||
|
||||
### MultiCluster parameters
|
||||
@@ -105,7 +111,7 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wai
|
||||
| `multicluster.clusterGateway.replicaCount` | ClusterGateway replica count | `1` |
|
||||
| `multicluster.clusterGateway.port` | ClusterGateway port | `9443` |
|
||||
| `multicluster.clusterGateway.image.repository` | ClusterGateway image repository | `oamdev/cluster-gateway` |
|
||||
| `multicluster.clusterGateway.image.tag` | ClusterGateway image tag | `v1.4.0` |
|
||||
| `multicluster.clusterGateway.image.tag` | ClusterGateway image tag | `v1.7.0` |
|
||||
| `multicluster.clusterGateway.image.pullPolicy` | ClusterGateway image pull policy | `IfNotPresent` |
|
||||
| `multicluster.clusterGateway.resources.limits.cpu` | ClusterGateway cpu limit | `100m` |
|
||||
| `multicluster.clusterGateway.resources.limits.memory` | ClusterGateway memory limit | `200Mi` |
|
||||
@@ -141,10 +147,10 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wai
|
||||
| `logDebug` | Enable debug logs for development purpose | `false` |
|
||||
| `logFilePath` | If non-empty, write log files in this path | `""` |
|
||||
| `logFileMaxSize` | Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. | `1024` |
|
||||
| `kubeClient.qps` | The qps for reconcile clients, default is 50 | `50` |
|
||||
| `kubeClient.burst` | The burst for reconcile clients, default is 100 | `100` |
|
||||
| `kubeClient.qps` | The qps for reconcile clients, default is 100 | `100` |
|
||||
| `kubeClient.burst` | The burst for reconcile clients, default is 200 | `200` |
|
||||
| `authentication.enabled` | Enable authentication for application | `false` |
|
||||
| `authentication.withUser` | Application authentication will impersonate as the request User | `false` |
|
||||
| `authentication.withUser` | Application authentication will impersonate as the request User | `true` |
|
||||
| `authentication.defaultUser` | Application authentication will impersonate as the User if no user provided in Application | `kubevela:vela-core` |
|
||||
| `authentication.groupPattern` | Application authentication will impersonate as the request Group that matches the pattern | `kubevela:*` |
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
cert-manager.io/inject-ca-from: vela-system/kubevela-vela-core-root-cert
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
name: applications.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
@@ -178,6 +178,7 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
@@ -312,6 +313,7 @@ spec:
|
||||
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
@@ -414,7 +416,6 @@ spec:
|
||||
cluster:
|
||||
type: string
|
||||
creator:
|
||||
description: ResourceCreatorRole defines the resource creator.
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object instead of
|
||||
@@ -446,36 +447,37 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: array
|
||||
components:
|
||||
description: Components record the related Components created by Application
|
||||
Controller
|
||||
items:
|
||||
description: 'ObjectReference contains enough information to let
|
||||
description: "ObjectReference contains enough information to let
|
||||
you inspect or modify the referred object. --- New uses of this
|
||||
type are discouraged because of difficulty describing its usage
|
||||
when embedded in APIs. 1. Ignored fields. It includes many fields
|
||||
when embedded in APIs. 1. Ignored fields. It includes many fields
|
||||
which are not generally honored. For instance, ResourceVersion
|
||||
and FieldPath are both very rarely valid in actual usage. 2.
|
||||
Invalid usage help. It is impossible to add specific help for
|
||||
individual usage. In most embedded usages, there are particular restrictions
|
||||
like, "must refer only to types A and B" or "UID not honored"
|
||||
or "name must be restricted". Those cannot be well described
|
||||
when embedded. 3. Inconsistent validation. Because the usages
|
||||
and FieldPath are both very rarely valid in actual usage. 2. Invalid
|
||||
usage help. It is impossible to add specific help for individual
|
||||
usage. In most embedded usages, there are particular restrictions
|
||||
like, \"must refer only to types A and B\" or \"UID not honored\"
|
||||
or \"name must be restricted\". Those cannot be well described
|
||||
when embedded. 3. Inconsistent validation. Because the usages
|
||||
are different, the validation rules are different by usage, which
|
||||
makes it hard for users to predict what will happen. 4. The fields
|
||||
makes it hard for users to predict what will happen. 4. The fields
|
||||
are both imprecise and overly precise. Kind is not a precise
|
||||
mapping to a URL. This can produce ambiguity during interpretation
|
||||
mapping to a URL. This can produce ambiguity during interpretation
|
||||
and require a REST mapping. In most cases, the dependency is
|
||||
on the group,resource tuple and the version of the actual
|
||||
struct is irrelevant. 5. We cannot easily change it. Because
|
||||
this type is embedded in many locations, updates to this type will
|
||||
affect numerous schemas. Don''t make new APIs embed an underspecified
|
||||
API type they do not control. Instead of using this type, create
|
||||
on the group,resource tuple and the version of the actual struct
|
||||
is irrelevant. 5. We cannot easily change it. Because this type
|
||||
is embedded in many locations, updates to this type will affect
|
||||
numerous schemas. Don't make new APIs embed an underspecified
|
||||
API type they do not control. \n Instead of using this type, create
|
||||
a locally provided and used type that is well-focused on your
|
||||
reference. For example, ServiceReferences for admission registration:
|
||||
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
."
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
@@ -510,6 +512,7 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: array
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
@@ -565,9 +568,10 @@ spec:
|
||||
format: int64
|
||||
type: integer
|
||||
policy:
|
||||
description: PolicyStatus records the status of policy
|
||||
description: PolicyStatus records the status of policy Deprecated
|
||||
This field is only used by EnvBinding Policy which is deprecated.
|
||||
items:
|
||||
description: PolicyStatus records the status of policy
|
||||
description: PolicyStatus records the status of policy Deprecated
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
@@ -601,33 +605,33 @@ spec:
|
||||
type: string
|
||||
scopes:
|
||||
items:
|
||||
description: 'ObjectReference contains enough information
|
||||
description: "ObjectReference contains enough information
|
||||
to let you inspect or modify the referred object. --- New
|
||||
uses of this type are discouraged because of difficulty
|
||||
describing its usage when embedded in APIs. 1. Ignored
|
||||
fields. It includes many fields which are not generally
|
||||
honored. For instance, ResourceVersion and FieldPath are
|
||||
both very rarely valid in actual usage. 2. Invalid usage
|
||||
help. It is impossible to add specific help for individual
|
||||
usage. In most embedded usages, there are particular restrictions
|
||||
like, "must refer only to types A and B" or "UID not honored"
|
||||
or "name must be restricted". Those cannot be well described
|
||||
when embedded. 3. Inconsistent validation. Because the
|
||||
usages are different, the validation rules are different
|
||||
by usage, which makes it hard for users to predict what
|
||||
will happen. 4. The fields are both imprecise and overly
|
||||
precise. Kind is not a precise mapping to a URL. This can
|
||||
produce ambiguity during interpretation and require
|
||||
a REST mapping. In most cases, the dependency is on the
|
||||
group,resource tuple and the version of the actual struct
|
||||
is irrelevant. 5. We cannot easily change it. Because
|
||||
describing its usage when embedded in APIs. 1. Ignored fields.
|
||||
\ It includes many fields which are not generally honored.
|
||||
\ For instance, ResourceVersion and FieldPath are both very
|
||||
rarely valid in actual usage. 2. Invalid usage help. It
|
||||
is impossible to add specific help for individual usage.
|
||||
\ In most embedded usages, there are particular restrictions
|
||||
like, \"must refer only to types A and B\" or \"UID not
|
||||
honored\" or \"name must be restricted\". Those cannot be
|
||||
well described when embedded. 3. Inconsistent validation.
|
||||
\ Because the usages are different, the validation rules
|
||||
are different by usage, which makes it hard for users to
|
||||
predict what will happen. 4. The fields are both imprecise
|
||||
and overly precise. Kind is not a precise mapping to a
|
||||
URL. This can produce ambiguity during interpretation and
|
||||
require a REST mapping. In most cases, the dependency is
|
||||
on the group,resource tuple and the version of the actual
|
||||
struct is irrelevant. 5. We cannot easily change it. Because
|
||||
this type is embedded in many locations, updates to this
|
||||
type will affect numerous schemas. Don''t make new
|
||||
APIs embed an underspecified API type they do not control.
|
||||
type will affect numerous schemas. Don't make new APIs
|
||||
embed an underspecified API type they do not control. \n
|
||||
Instead of using this type, create a locally provided and
|
||||
used type that is well-focused on your reference. For example,
|
||||
ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
."
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
@@ -663,6 +667,7 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: array
|
||||
traits:
|
||||
items:
|
||||
@@ -707,31 +712,31 @@ spec:
|
||||
appRevision:
|
||||
type: string
|
||||
contextBackend:
|
||||
description: 'ObjectReference contains enough information to let
|
||||
description: "ObjectReference contains enough information to let
|
||||
you inspect or modify the referred object. --- New uses of this
|
||||
type are discouraged because of difficulty describing its usage
|
||||
when embedded in APIs. 1. Ignored fields. It includes many
|
||||
when embedded in APIs. 1. Ignored fields. It includes many
|
||||
fields which are not generally honored. For instance, ResourceVersion
|
||||
and FieldPath are both very rarely valid in actual usage. 2.
|
||||
and FieldPath are both very rarely valid in actual usage. 2.
|
||||
Invalid usage help. It is impossible to add specific help for
|
||||
individual usage. In most embedded usages, there are particular restrictions
|
||||
like, "must refer only to types A and B" or "UID not honored"
|
||||
or "name must be restricted". Those cannot be well described
|
||||
when embedded. 3. Inconsistent validation. Because the usages
|
||||
are different, the validation rules are different by usage,
|
||||
which makes it hard for users to predict what will happen. 4.
|
||||
The fields are both imprecise and overly precise. Kind is not
|
||||
a precise mapping to a URL. This can produce ambiguity during
|
||||
interpretation and require a REST mapping. In most cases, the
|
||||
dependency is on the group,resource tuple and the version
|
||||
of the actual struct is irrelevant. 5. We cannot easily change
|
||||
individual usage. In most embedded usages, there are particular
|
||||
restrictions like, \"must refer only to types A and B\" or \"UID
|
||||
not honored\" or \"name must be restricted\". Those cannot be
|
||||
well described when embedded. 3. Inconsistent validation. Because
|
||||
the usages are different, the validation rules are different
|
||||
by usage, which makes it hard for users to predict what will
|
||||
happen. 4. The fields are both imprecise and overly precise.
|
||||
\ Kind is not a precise mapping to a URL. This can produce ambiguity
|
||||
during interpretation and require a REST mapping. In most cases,
|
||||
the dependency is on the group,resource tuple and the version
|
||||
of the actual struct is irrelevant. 5. We cannot easily change
|
||||
it. Because this type is embedded in many locations, updates
|
||||
to this type will affect numerous schemas. Don''t make
|
||||
new APIs embed an underspecified API type they do not control.
|
||||
Instead of using this type, create a locally provided and used
|
||||
type that is well-focused on your reference. For example, ServiceReferences
|
||||
to this type will affect numerous schemas. Don't make new APIs
|
||||
embed an underspecified API type they do not control. \n Instead
|
||||
of using this type, create a locally provided and used type
|
||||
that is well-focused on your reference. For example, ServiceReferences
|
||||
for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
."
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
@@ -766,16 +771,24 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
endTime:
|
||||
format: date-time
|
||||
nullable: true
|
||||
type: string
|
||||
finished:
|
||||
type: boolean
|
||||
message:
|
||||
type: string
|
||||
mode:
|
||||
description: WorkflowMode describes the mode of workflow
|
||||
type: string
|
||||
startTime:
|
||||
format: date-time
|
||||
type: string
|
||||
status:
|
||||
description: WorkflowRunPhase is a label for the condition of
|
||||
a WorkflowRun at the current time
|
||||
type: string
|
||||
steps:
|
||||
items:
|
||||
description: WorkflowStepStatus record the status of a workflow
|
||||
@@ -809,8 +822,8 @@ spec:
|
||||
type: string
|
||||
subSteps:
|
||||
items:
|
||||
description: WorkflowSubStepStatus record the status of
|
||||
a workflow subStep
|
||||
description: StepStatus record the base status of workflow
|
||||
step, which could be workflow step or subStep
|
||||
properties:
|
||||
firstExecuteTime:
|
||||
description: FirstExecuteTime is the first time this
|
||||
@@ -928,7 +941,6 @@ spec:
|
||||
type: string
|
||||
required:
|
||||
- from
|
||||
- parameterKey
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
@@ -1014,10 +1026,10 @@ spec:
|
||||
execution
|
||||
properties:
|
||||
steps:
|
||||
description: WorkflowMode describes the mode of workflow
|
||||
description: Steps is the mode of workflow steps execution
|
||||
type: string
|
||||
subSteps:
|
||||
description: WorkflowMode describes the mode of workflow
|
||||
description: SubSteps is the mode of workflow sub steps execution
|
||||
type: string
|
||||
type: object
|
||||
ref:
|
||||
@@ -1028,13 +1040,15 @@ spec:
|
||||
step.
|
||||
properties:
|
||||
dependsOn:
|
||||
description: DependsOn is the dependency of the step
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
if:
|
||||
description: If is the if condition of the step
|
||||
type: string
|
||||
inputs:
|
||||
description: StepInputs defines variable input of WorkflowStep
|
||||
description: Inputs is the inputs of the step
|
||||
items:
|
||||
properties:
|
||||
from:
|
||||
@@ -1043,12 +1057,10 @@ spec:
|
||||
type: string
|
||||
required:
|
||||
- from
|
||||
- parameterKey
|
||||
type: object
|
||||
type: array
|
||||
meta:
|
||||
description: WorkflowStepMeta contains the meta data of
|
||||
a workflow step
|
||||
description: Meta is the meta data of the workflow step.
|
||||
properties:
|
||||
alias:
|
||||
type: string
|
||||
@@ -1057,7 +1069,7 @@ spec:
|
||||
description: Name is the unique name of the workflow step.
|
||||
type: string
|
||||
outputs:
|
||||
description: StepOutputs defines output variable of WorkflowStep
|
||||
description: Outputs is the outputs of the step
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
@@ -1070,22 +1082,24 @@ spec:
|
||||
type: object
|
||||
type: array
|
||||
properties:
|
||||
description: Properties is the properties of the step
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
subSteps:
|
||||
items:
|
||||
description: WorkflowSubStep defines how to execute a
|
||||
workflow subStep.
|
||||
description: WorkflowStepBase defines the workflow step
|
||||
base
|
||||
properties:
|
||||
dependsOn:
|
||||
description: DependsOn is the dependency of the step
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
if:
|
||||
description: If is the if condition of the step
|
||||
type: string
|
||||
inputs:
|
||||
description: StepInputs defines variable input of
|
||||
WorkflowStep
|
||||
description: Inputs is the inputs of the step
|
||||
items:
|
||||
properties:
|
||||
from:
|
||||
@@ -1094,12 +1108,11 @@ spec:
|
||||
type: string
|
||||
required:
|
||||
- from
|
||||
- parameterKey
|
||||
type: object
|
||||
type: array
|
||||
meta:
|
||||
description: WorkflowStepMeta contains the meta data
|
||||
of a workflow step
|
||||
description: Meta is the meta data of the workflow
|
||||
step.
|
||||
properties:
|
||||
alias:
|
||||
type: string
|
||||
@@ -1109,8 +1122,7 @@ spec:
|
||||
step.
|
||||
type: string
|
||||
outputs:
|
||||
description: StepOutputs defines output variable of
|
||||
WorkflowStep
|
||||
description: Outputs is the outputs of the step
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
@@ -1123,23 +1135,26 @@ spec:
|
||||
type: object
|
||||
type: array
|
||||
properties:
|
||||
description: Properties is the properties of the step
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
timeout:
|
||||
description: Timeout is the timeout of the step
|
||||
type: string
|
||||
type:
|
||||
description: Type is the type of the workflow step.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
timeout:
|
||||
description: Timeout is the timeout of the step
|
||||
type: string
|
||||
type:
|
||||
description: Type is the type of the workflow step.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
@@ -1163,7 +1178,6 @@ spec:
|
||||
cluster:
|
||||
type: string
|
||||
creator:
|
||||
description: ResourceCreatorRole defines the resource creator.
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object instead of
|
||||
@@ -1195,36 +1209,37 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: array
|
||||
components:
|
||||
description: Components record the related Components created by Application
|
||||
Controller
|
||||
items:
|
||||
description: 'ObjectReference contains enough information to let
|
||||
description: "ObjectReference contains enough information to let
|
||||
you inspect or modify the referred object. --- New uses of this
|
||||
type are discouraged because of difficulty describing its usage
|
||||
when embedded in APIs. 1. Ignored fields. It includes many fields
|
||||
when embedded in APIs. 1. Ignored fields. It includes many fields
|
||||
which are not generally honored. For instance, ResourceVersion
|
||||
and FieldPath are both very rarely valid in actual usage. 2.
|
||||
Invalid usage help. It is impossible to add specific help for
|
||||
individual usage. In most embedded usages, there are particular restrictions
|
||||
like, "must refer only to types A and B" or "UID not honored"
|
||||
or "name must be restricted". Those cannot be well described
|
||||
when embedded. 3. Inconsistent validation. Because the usages
|
||||
and FieldPath are both very rarely valid in actual usage. 2. Invalid
|
||||
usage help. It is impossible to add specific help for individual
|
||||
usage. In most embedded usages, there are particular restrictions
|
||||
like, \"must refer only to types A and B\" or \"UID not honored\"
|
||||
or \"name must be restricted\". Those cannot be well described
|
||||
when embedded. 3. Inconsistent validation. Because the usages
|
||||
are different, the validation rules are different by usage, which
|
||||
makes it hard for users to predict what will happen. 4. The fields
|
||||
makes it hard for users to predict what will happen. 4. The fields
|
||||
are both imprecise and overly precise. Kind is not a precise
|
||||
mapping to a URL. This can produce ambiguity during interpretation
|
||||
mapping to a URL. This can produce ambiguity during interpretation
|
||||
and require a REST mapping. In most cases, the dependency is
|
||||
on the group,resource tuple and the version of the actual
|
||||
struct is irrelevant. 5. We cannot easily change it. Because
|
||||
this type is embedded in many locations, updates to this type will
|
||||
affect numerous schemas. Don''t make new APIs embed an underspecified
|
||||
API type they do not control. Instead of using this type, create
|
||||
on the group,resource tuple and the version of the actual struct
|
||||
is irrelevant. 5. We cannot easily change it. Because this type
|
||||
is embedded in many locations, updates to this type will affect
|
||||
numerous schemas. Don't make new APIs embed an underspecified
|
||||
API type they do not control. \n Instead of using this type, create
|
||||
a locally provided and used type that is well-focused on your
|
||||
reference. For example, ServiceReferences for admission registration:
|
||||
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
."
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
@@ -1259,6 +1274,7 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: array
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
@@ -1314,9 +1330,10 @@ spec:
|
||||
format: int64
|
||||
type: integer
|
||||
policy:
|
||||
description: PolicyStatus records the status of policy
|
||||
description: PolicyStatus records the status of policy Deprecated
|
||||
This field is only used by EnvBinding Policy which is deprecated.
|
||||
items:
|
||||
description: PolicyStatus records the status of policy
|
||||
description: PolicyStatus records the status of policy Deprecated
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
@@ -1350,33 +1367,33 @@ spec:
|
||||
type: string
|
||||
scopes:
|
||||
items:
|
||||
description: 'ObjectReference contains enough information
|
||||
description: "ObjectReference contains enough information
|
||||
to let you inspect or modify the referred object. --- New
|
||||
uses of this type are discouraged because of difficulty
|
||||
describing its usage when embedded in APIs. 1. Ignored
|
||||
fields. It includes many fields which are not generally
|
||||
honored. For instance, ResourceVersion and FieldPath are
|
||||
both very rarely valid in actual usage. 2. Invalid usage
|
||||
help. It is impossible to add specific help for individual
|
||||
usage. In most embedded usages, there are particular restrictions
|
||||
like, "must refer only to types A and B" or "UID not honored"
|
||||
or "name must be restricted". Those cannot be well described
|
||||
when embedded. 3. Inconsistent validation. Because the
|
||||
usages are different, the validation rules are different
|
||||
by usage, which makes it hard for users to predict what
|
||||
will happen. 4. The fields are both imprecise and overly
|
||||
precise. Kind is not a precise mapping to a URL. This can
|
||||
produce ambiguity during interpretation and require
|
||||
a REST mapping. In most cases, the dependency is on the
|
||||
group,resource tuple and the version of the actual struct
|
||||
is irrelevant. 5. We cannot easily change it. Because
|
||||
describing its usage when embedded in APIs. 1. Ignored fields.
|
||||
\ It includes many fields which are not generally honored.
|
||||
\ For instance, ResourceVersion and FieldPath are both very
|
||||
rarely valid in actual usage. 2. Invalid usage help. It
|
||||
is impossible to add specific help for individual usage.
|
||||
\ In most embedded usages, there are particular restrictions
|
||||
like, \"must refer only to types A and B\" or \"UID not
|
||||
honored\" or \"name must be restricted\". Those cannot be
|
||||
well described when embedded. 3. Inconsistent validation.
|
||||
\ Because the usages are different, the validation rules
|
||||
are different by usage, which makes it hard for users to
|
||||
predict what will happen. 4. The fields are both imprecise
|
||||
and overly precise. Kind is not a precise mapping to a
|
||||
URL. This can produce ambiguity during interpretation and
|
||||
require a REST mapping. In most cases, the dependency is
|
||||
on the group,resource tuple and the version of the actual
|
||||
struct is irrelevant. 5. We cannot easily change it. Because
|
||||
this type is embedded in many locations, updates to this
|
||||
type will affect numerous schemas. Don''t make new
|
||||
APIs embed an underspecified API type they do not control.
|
||||
type will affect numerous schemas. Don't make new APIs
|
||||
embed an underspecified API type they do not control. \n
|
||||
Instead of using this type, create a locally provided and
|
||||
used type that is well-focused on your reference. For example,
|
||||
ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
."
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
@@ -1412,6 +1429,7 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: array
|
||||
traits:
|
||||
items:
|
||||
@@ -1456,31 +1474,31 @@ spec:
|
||||
appRevision:
|
||||
type: string
|
||||
contextBackend:
|
||||
description: 'ObjectReference contains enough information to let
|
||||
description: "ObjectReference contains enough information to let
|
||||
you inspect or modify the referred object. --- New uses of this
|
||||
type are discouraged because of difficulty describing its usage
|
||||
when embedded in APIs. 1. Ignored fields. It includes many
|
||||
when embedded in APIs. 1. Ignored fields. It includes many
|
||||
fields which are not generally honored. For instance, ResourceVersion
|
||||
and FieldPath are both very rarely valid in actual usage. 2.
|
||||
and FieldPath are both very rarely valid in actual usage. 2.
|
||||
Invalid usage help. It is impossible to add specific help for
|
||||
individual usage. In most embedded usages, there are particular restrictions
|
||||
like, "must refer only to types A and B" or "UID not honored"
|
||||
or "name must be restricted". Those cannot be well described
|
||||
when embedded. 3. Inconsistent validation. Because the usages
|
||||
are different, the validation rules are different by usage,
|
||||
which makes it hard for users to predict what will happen. 4.
|
||||
The fields are both imprecise and overly precise. Kind is not
|
||||
a precise mapping to a URL. This can produce ambiguity during
|
||||
interpretation and require a REST mapping. In most cases, the
|
||||
dependency is on the group,resource tuple and the version
|
||||
of the actual struct is irrelevant. 5. We cannot easily change
|
||||
individual usage. In most embedded usages, there are particular
|
||||
restrictions like, \"must refer only to types A and B\" or \"UID
|
||||
not honored\" or \"name must be restricted\". Those cannot be
|
||||
well described when embedded. 3. Inconsistent validation. Because
|
||||
the usages are different, the validation rules are different
|
||||
by usage, which makes it hard for users to predict what will
|
||||
happen. 4. The fields are both imprecise and overly precise.
|
||||
\ Kind is not a precise mapping to a URL. This can produce ambiguity
|
||||
during interpretation and require a REST mapping. In most cases,
|
||||
the dependency is on the group,resource tuple and the version
|
||||
of the actual struct is irrelevant. 5. We cannot easily change
|
||||
it. Because this type is embedded in many locations, updates
|
||||
to this type will affect numerous schemas. Don''t make
|
||||
new APIs embed an underspecified API type they do not control.
|
||||
Instead of using this type, create a locally provided and used
|
||||
type that is well-focused on your reference. For example, ServiceReferences
|
||||
to this type will affect numerous schemas. Don't make new APIs
|
||||
embed an underspecified API type they do not control. \n Instead
|
||||
of using this type, create a locally provided and used type
|
||||
that is well-focused on your reference. For example, ServiceReferences
|
||||
for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
."
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
@@ -1515,16 +1533,24 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
endTime:
|
||||
format: date-time
|
||||
nullable: true
|
||||
type: string
|
||||
finished:
|
||||
type: boolean
|
||||
message:
|
||||
type: string
|
||||
mode:
|
||||
description: WorkflowMode describes the mode of workflow
|
||||
type: string
|
||||
startTime:
|
||||
format: date-time
|
||||
type: string
|
||||
status:
|
||||
description: WorkflowRunPhase is a label for the condition of
|
||||
a WorkflowRun at the current time
|
||||
type: string
|
||||
steps:
|
||||
items:
|
||||
description: WorkflowStepStatus record the status of a workflow
|
||||
@@ -1558,8 +1584,8 @@ spec:
|
||||
type: string
|
||||
subSteps:
|
||||
items:
|
||||
description: WorkflowSubStepStatus record the status of
|
||||
a workflow subStep
|
||||
description: StepStatus record the base status of workflow
|
||||
step, which could be workflow step or subStep
|
||||
properties:
|
||||
firstExecuteTime:
|
||||
description: FirstExecuteTime is the first time this
|
||||
@@ -1617,9 +1643,3 @@ spec:
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
name: componentdefinitions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
@@ -188,6 +187,20 @@ spec:
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
gitCredentialsSecretReference:
|
||||
description: GitCredentialsSecretReference specifies the reference
|
||||
to the secret containing the git credentials
|
||||
properties:
|
||||
name:
|
||||
description: name is unique within a namespace to reference
|
||||
a secret resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: namespace defines the space within which
|
||||
the secret name must be unique.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
@@ -501,6 +514,20 @@ spec:
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
gitCredentialsSecretReference:
|
||||
description: GitCredentialsSecretReference specifies the reference
|
||||
to the secret containing the git credentials
|
||||
properties:
|
||||
name:
|
||||
description: name is unique within a namespace to reference
|
||||
a secret resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: namespace defines the space within which
|
||||
the secret name must be unique.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
@@ -645,9 +672,3 @@ spec:
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
name: definitionrevisions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
@@ -233,6 +232,20 @@ spec:
|
||||
provisioned cloud resources will be deleted when
|
||||
CR is deleted
|
||||
type: boolean
|
||||
gitCredentialsSecretReference:
|
||||
description: GitCredentialsSecretReference specifies
|
||||
the reference to the secret containing the git credentials
|
||||
properties:
|
||||
name:
|
||||
description: name is unique within a namespace
|
||||
to reference a secret resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: namespace defines the space within
|
||||
which the secret name must be unique.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
path:
|
||||
description: Path is the sub-directory of remote git
|
||||
repository. It's valid when remote is set
|
||||
@@ -445,7 +458,8 @@ spec:
|
||||
type: boolean
|
||||
schematic:
|
||||
description: Schematic defines the data format and template
|
||||
of the encapsulation of the policy definition
|
||||
of the encapsulation of the policy definition. Only CUE
|
||||
schematic is supported for now.
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
@@ -549,6 +563,20 @@ spec:
|
||||
provisioned cloud resources will be deleted when
|
||||
CR is deleted
|
||||
type: boolean
|
||||
gitCredentialsSecretReference:
|
||||
description: GitCredentialsSecretReference specifies
|
||||
the reference to the secret containing the git credentials
|
||||
properties:
|
||||
name:
|
||||
description: name is unique within a namespace
|
||||
to reference a secret resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: namespace defines the space within
|
||||
which the secret name must be unique.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
path:
|
||||
description: Path is the sub-directory of remote git
|
||||
repository. It's valid when remote is set
|
||||
@@ -708,7 +736,7 @@ spec:
|
||||
appliesToWorkloads:
|
||||
description: 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.
|
||||
in resource.group/version format, e.g. server.core.oam.dev/v1alpha2.
|
||||
Traits that omit this field apply to all workload kinds.
|
||||
items:
|
||||
type: string
|
||||
@@ -762,7 +790,8 @@ spec:
|
||||
type: boolean
|
||||
schematic:
|
||||
description: Schematic defines the data format and template
|
||||
of the encapsulation of the trait
|
||||
of the encapsulation of the trait. Only CUE and Kube schematic
|
||||
are supported for now.
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
@@ -866,6 +895,20 @@ spec:
|
||||
provisioned cloud resources will be deleted when
|
||||
CR is deleted
|
||||
type: boolean
|
||||
gitCredentialsSecretReference:
|
||||
description: GitCredentialsSecretReference specifies
|
||||
the reference to the secret containing the git credentials
|
||||
properties:
|
||||
name:
|
||||
description: name is unique within a namespace
|
||||
to reference a secret resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: namespace defines the space within
|
||||
which the secret name must be unique.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
path:
|
||||
description: Path is the sub-directory of remote git
|
||||
repository. It's valid when remote is set
|
||||
@@ -914,10 +957,12 @@ spec:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
skipRevisionAffect:
|
||||
description: SkipRevisionAffect defines the update this trait
|
||||
will not generate a new application Revision
|
||||
type: boolean
|
||||
stage:
|
||||
description: Stage defines the stage information to which
|
||||
this trait resource processing belongs. Currently, PreDispatch
|
||||
and PostDispatch are provided, which are used to control
|
||||
resource pre-process and post-process respectively.
|
||||
type: string
|
||||
status:
|
||||
description: Status defines the custom health policy and status
|
||||
message for trait
|
||||
@@ -1052,7 +1097,8 @@ spec:
|
||||
type: object
|
||||
schematic:
|
||||
description: Schematic defines the data format and template
|
||||
of the encapsulation of the workflow step definition
|
||||
of the encapsulation of the workflow step definition. Only
|
||||
CUE schematic is supported for now.
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
@@ -1156,6 +1202,20 @@ spec:
|
||||
provisioned cloud resources will be deleted when
|
||||
CR is deleted
|
||||
type: boolean
|
||||
gitCredentialsSecretReference:
|
||||
description: GitCredentialsSecretReference specifies
|
||||
the reference to the secret containing the git credentials
|
||||
properties:
|
||||
name:
|
||||
description: name is unique within a namespace
|
||||
to reference a secret resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: namespace defines the space within
|
||||
which the secret name must be unique.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
path:
|
||||
description: Path is the sub-directory of remote git
|
||||
repository. It's valid when remote is set
|
||||
@@ -1274,9 +1334,3 @@ spec:
|
||||
served: true
|
||||
storage: true
|
||||
subresources: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
name: healthscopes.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
@@ -59,36 +58,36 @@ spec:
|
||||
type: string
|
||||
traits:
|
||||
items:
|
||||
description: 'ObjectReference contains enough information
|
||||
description: "ObjectReference contains enough information
|
||||
to let you inspect or modify the referred object.
|
||||
--- New uses of this type are discouraged because
|
||||
of difficulty describing its usage when embedded in
|
||||
APIs. 1. Ignored fields. It includes many fields
|
||||
APIs. 1. Ignored fields. It includes many fields
|
||||
which are not generally honored. For instance, ResourceVersion
|
||||
and FieldPath are both very rarely valid in actual
|
||||
usage. 2. Invalid usage help. It is impossible to
|
||||
usage. 2. Invalid usage help. It is impossible to
|
||||
add specific help for individual usage. In most embedded
|
||||
usages, there are particular restrictions like,
|
||||
"must refer only to types A and B" or "UID not honored"
|
||||
or "name must be restricted". Those cannot be
|
||||
well described when embedded. 3. Inconsistent validation. Because
|
||||
the usages are different, the validation rules are
|
||||
different by usage, which makes it hard for users
|
||||
to predict what will happen. 4. The fields are both
|
||||
imprecise and overly precise. Kind is not a precise
|
||||
mapping to a URL. This can produce ambiguity during
|
||||
interpretation and require a REST mapping. In most
|
||||
cases, the dependency is on the group,resource tuple and
|
||||
the version of the actual struct is irrelevant. 5.
|
||||
We cannot easily change it. Because this type is
|
||||
embedded in many locations, updates to this type will
|
||||
affect numerous schemas. Don''t make new APIs embed
|
||||
an underspecified API type they do not control. Instead
|
||||
of using this type, create a locally provided and
|
||||
used type that is well-focused on your reference.
|
||||
usages, there are particular restrictions like, \"must
|
||||
refer only to types A and B\" or \"UID not honored\"
|
||||
or \"name must be restricted\". Those cannot be well
|
||||
described when embedded. 3. Inconsistent validation.
|
||||
\ Because the usages are different, the validation
|
||||
rules are different by usage, which makes it hard
|
||||
for users to predict what will happen. 4. The fields
|
||||
are both imprecise and overly precise. Kind is not
|
||||
a precise mapping to a URL. This can produce ambiguity
|
||||
during interpretation and require a REST mapping.
|
||||
\ In most cases, the dependency is on the group,resource
|
||||
tuple and the version of the actual struct is irrelevant.
|
||||
5. We cannot easily change it. Because this type
|
||||
is embedded in many locations, updates to this type
|
||||
will affect numerous schemas. Don't make new APIs
|
||||
embed an underspecified API type they do not control.
|
||||
\n Instead of using this type, create a locally provided
|
||||
and used type that is well-focused on your reference.
|
||||
For example, ServiceReferences for admission registration:
|
||||
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
."
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
@@ -127,37 +126,37 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: array
|
||||
workload:
|
||||
description: 'ObjectReference contains enough information
|
||||
description: "ObjectReference contains enough information
|
||||
to let you inspect or modify the referred object. ---
|
||||
New uses of this type are discouraged because of difficulty
|
||||
describing its usage when embedded in APIs. 1. Ignored
|
||||
describing its usage when embedded in APIs. 1. Ignored
|
||||
fields. It includes many fields which are not generally
|
||||
honored. For instance, ResourceVersion and FieldPath
|
||||
are both very rarely valid in actual usage. 2. Invalid
|
||||
are both very rarely valid in actual usage. 2. Invalid
|
||||
usage help. It is impossible to add specific help for
|
||||
individual usage. In most embedded usages, there are
|
||||
particular restrictions like, "must refer only to
|
||||
types A and B" or "UID not honored" or "name must be
|
||||
restricted". Those cannot be well described when
|
||||
embedded. 3. Inconsistent validation. Because the
|
||||
usages are different, the validation rules are different
|
||||
by usage, which makes it hard for users to predict what
|
||||
will happen. 4. The fields are both imprecise and overly
|
||||
precise. Kind is not a precise mapping to a URL. This
|
||||
can produce ambiguity during interpretation and
|
||||
require a REST mapping. In most cases, the dependency
|
||||
is on the group,resource tuple and the version of
|
||||
the actual struct is irrelevant. 5. We cannot easily
|
||||
change it. Because this type is embedded in many locations,
|
||||
updates to this type will affect numerous schemas. Don''t
|
||||
make new APIs embed an underspecified API type they
|
||||
do not control. Instead of using this type, create a
|
||||
locally provided and used type that is well-focused
|
||||
on your reference. For example, ServiceReferences for
|
||||
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
particular restrictions like, \"must refer only to types
|
||||
A and B\" or \"UID not honored\" or \"name must be restricted\".
|
||||
Those cannot be well described when embedded. 3. Inconsistent
|
||||
validation. Because the usages are different, the validation
|
||||
rules are different by usage, which makes it hard for
|
||||
users to predict what will happen. 4. The fields are
|
||||
both imprecise and overly precise. Kind is not a precise
|
||||
mapping to a URL. This can produce ambiguity during
|
||||
interpretation and require a REST mapping. In most
|
||||
cases, the dependency is on the group,resource tuple
|
||||
and the version of the actual struct is irrelevant.
|
||||
5. We cannot easily change it. Because this type is
|
||||
embedded in many locations, updates to this type will
|
||||
affect numerous schemas. Don't make new APIs embed
|
||||
an underspecified API type they do not control. \n Instead
|
||||
of using this type, create a locally provided and used
|
||||
type that is well-focused on your reference. For example,
|
||||
ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
."
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
@@ -195,6 +194,7 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
@@ -213,31 +213,31 @@ spec:
|
||||
description: WorkloadReferences to the workloads that are in this
|
||||
scope.
|
||||
items:
|
||||
description: 'ObjectReference contains enough information to let
|
||||
description: "ObjectReference contains enough information to let
|
||||
you inspect or modify the referred object. --- New uses of this
|
||||
type are discouraged because of difficulty describing its usage
|
||||
when embedded in APIs. 1. Ignored fields. It includes many fields
|
||||
when embedded in APIs. 1. Ignored fields. It includes many fields
|
||||
which are not generally honored. For instance, ResourceVersion
|
||||
and FieldPath are both very rarely valid in actual usage. 2.
|
||||
Invalid usage help. It is impossible to add specific help for
|
||||
individual usage. In most embedded usages, there are particular restrictions
|
||||
like, "must refer only to types A and B" or "UID not honored"
|
||||
or "name must be restricted". Those cannot be well described
|
||||
when embedded. 3. Inconsistent validation. Because the usages
|
||||
and FieldPath are both very rarely valid in actual usage. 2. Invalid
|
||||
usage help. It is impossible to add specific help for individual
|
||||
usage. In most embedded usages, there are particular restrictions
|
||||
like, \"must refer only to types A and B\" or \"UID not honored\"
|
||||
or \"name must be restricted\". Those cannot be well described
|
||||
when embedded. 3. Inconsistent validation. Because the usages
|
||||
are different, the validation rules are different by usage, which
|
||||
makes it hard for users to predict what will happen. 4. The fields
|
||||
makes it hard for users to predict what will happen. 4. The fields
|
||||
are both imprecise and overly precise. Kind is not a precise
|
||||
mapping to a URL. This can produce ambiguity during interpretation
|
||||
mapping to a URL. This can produce ambiguity during interpretation
|
||||
and require a REST mapping. In most cases, the dependency is
|
||||
on the group,resource tuple and the version of the actual
|
||||
struct is irrelevant. 5. We cannot easily change it. Because
|
||||
this type is embedded in many locations, updates to this type will
|
||||
affect numerous schemas. Don''t make new APIs embed an underspecified
|
||||
API type they do not control. Instead of using this type, create
|
||||
on the group,resource tuple and the version of the actual struct
|
||||
is irrelevant. 5. We cannot easily change it. Because this type
|
||||
is embedded in many locations, updates to this type will affect
|
||||
numerous schemas. Don't make new APIs embed an underspecified
|
||||
API type they do not control. \n Instead of using this type, create
|
||||
a locally provided and used type that is well-focused on your
|
||||
reference. For example, ServiceReferences for admission registration:
|
||||
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
."
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
@@ -272,6 +272,7 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: array
|
||||
required:
|
||||
- workloadRefs
|
||||
@@ -305,35 +306,34 @@ spec:
|
||||
description: HealthStatus represents health status strings.
|
||||
type: string
|
||||
targetWorkload:
|
||||
description: 'ObjectReference contains enough information
|
||||
description: "ObjectReference contains enough information
|
||||
to let you inspect or modify the referred object. ---
|
||||
New uses of this type are discouraged because of difficulty
|
||||
describing its usage when embedded in APIs. 1. Ignored
|
||||
describing its usage when embedded in APIs. 1. Ignored
|
||||
fields. It includes many fields which are not generally
|
||||
honored. For instance, ResourceVersion and FieldPath
|
||||
are both very rarely valid in actual usage. 2. Invalid
|
||||
are both very rarely valid in actual usage. 2. Invalid
|
||||
usage help. It is impossible to add specific help for
|
||||
individual usage. In most embedded usages, there are
|
||||
particular restrictions like, "must refer only to
|
||||
types A and B" or "UID not honored" or "name must be
|
||||
restricted". Those cannot be well described when
|
||||
embedded. 3. Inconsistent validation. Because the
|
||||
usages are different, the validation rules are different
|
||||
by usage, which makes it hard for users to predict what
|
||||
will happen. 4. The fields are both imprecise and overly
|
||||
precise. Kind is not a precise mapping to a URL. This
|
||||
can produce ambiguity during interpretation and
|
||||
require a REST mapping. In most cases, the dependency
|
||||
is on the group,resource tuple and the version of
|
||||
the actual struct is irrelevant. 5. We cannot easily
|
||||
change it. Because this type is embedded in many locations,
|
||||
updates to this type will affect numerous schemas. Don''t
|
||||
make new APIs embed an underspecified API type they
|
||||
do not control. Instead of using this type, create a
|
||||
locally provided and used type that is well-focused
|
||||
on your reference. For example, ServiceReferences for
|
||||
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
particular restrictions like, \"must refer only to types
|
||||
A and B\" or \"UID not honored\" or \"name must be restricted\".
|
||||
Those cannot be well described when embedded. 3. Inconsistent
|
||||
validation. Because the usages are different, the validation
|
||||
rules are different by usage, which makes it hard for
|
||||
users to predict what will happen. 4. The fields are
|
||||
both imprecise and overly precise. Kind is not a precise
|
||||
mapping to a URL. This can produce ambiguity during
|
||||
interpretation and require a REST mapping. In most
|
||||
cases, the dependency is on the group,resource tuple
|
||||
and the version of the actual struct is irrelevant.
|
||||
5. We cannot easily change it. Because this type is
|
||||
embedded in many locations, updates to this type will
|
||||
affect numerous schemas. Don't make new APIs embed
|
||||
an underspecified API type they do not control. \n Instead
|
||||
of using this type, create a locally provided and used
|
||||
type that is well-focused on your reference. For example,
|
||||
ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
."
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
@@ -371,6 +371,7 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
traits:
|
||||
items:
|
||||
description: TraitHealthCondition represents informative
|
||||
@@ -461,32 +462,32 @@ spec:
|
||||
description: HealthStatus represents health status strings.
|
||||
type: string
|
||||
targetWorkload:
|
||||
description: 'ObjectReference contains enough information to
|
||||
description: "ObjectReference contains enough information to
|
||||
let you inspect or modify the referred object. --- New uses
|
||||
of this type are discouraged because of difficulty describing
|
||||
its usage when embedded in APIs. 1. Ignored fields. It includes
|
||||
its usage when embedded in APIs. 1. Ignored fields. It includes
|
||||
many fields which are not generally honored. For instance,
|
||||
ResourceVersion and FieldPath are both very rarely valid in
|
||||
actual usage. 2. Invalid usage help. It is impossible to
|
||||
actual usage. 2. Invalid usage help. It is impossible to
|
||||
add specific help for individual usage. In most embedded
|
||||
usages, there are particular restrictions like, "must
|
||||
refer only to types A and B" or "UID not honored" or "name
|
||||
must be restricted". Those cannot be well described when
|
||||
embedded. 3. Inconsistent validation. Because the usages
|
||||
are different, the validation rules are different by usage,
|
||||
which makes it hard for users to predict what will happen. 4.
|
||||
The fields are both imprecise and overly precise. Kind is
|
||||
not a precise mapping to a URL. This can produce ambiguity during
|
||||
interpretation and require a REST mapping. In most cases,
|
||||
the dependency is on the group,resource tuple and the
|
||||
version of the actual struct is irrelevant. 5. We cannot
|
||||
easily change it. Because this type is embedded in many locations,
|
||||
updates to this type will affect numerous schemas. Don''t
|
||||
make new APIs embed an underspecified API type they do not
|
||||
control. Instead of using this type, create a locally provided
|
||||
and used type that is well-focused on your reference. For
|
||||
example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
.'
|
||||
usages, there are particular restrictions like, \"must refer
|
||||
only to types A and B\" or \"UID not honored\" or \"name must
|
||||
be restricted\". Those cannot be well described when embedded.
|
||||
3. Inconsistent validation. Because the usages are different,
|
||||
the validation rules are different by usage, which makes it
|
||||
hard for users to predict what will happen. 4. The fields
|
||||
are both imprecise and overly precise. Kind is not a precise
|
||||
mapping to a URL. This can produce ambiguity during interpretation
|
||||
and require a REST mapping. In most cases, the dependency
|
||||
is on the group,resource tuple and the version of the actual
|
||||
struct is irrelevant. 5. We cannot easily change it. Because
|
||||
this type is embedded in many locations, updates to this type
|
||||
will affect numerous schemas. Don't make new APIs embed an
|
||||
underspecified API type they do not control. \n Instead of
|
||||
using this type, create a locally provided and used type that
|
||||
is well-focused on your reference. For example, ServiceReferences
|
||||
for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
|
||||
."
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
@@ -522,6 +523,7 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
traits:
|
||||
items:
|
||||
description: TraitHealthCondition represents informative health
|
||||
@@ -582,9 +584,3 @@ spec:
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
name: manualscalertraits.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
names:
|
||||
categories:
|
||||
- oam
|
||||
kind: ManualScalerTrait
|
||||
listKind: ManualScalerTraitList
|
||||
plural: manualscalertraits
|
||||
singular: manualscalertrait
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha2
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: A ManualScalerTrait determines how many replicas a workload should
|
||||
have.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: A ManualScalerTraitSpec defines the desired state of a ManualScalerTrait.
|
||||
properties:
|
||||
replicaCount:
|
||||
description: ReplicaCount of the workload this trait applies to.
|
||||
format: int32
|
||||
type: integer
|
||||
workloadRef:
|
||||
description: WorkloadReference to the workload this trait applies
|
||||
to.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: API version of the referent.
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object instead of
|
||||
an entire object, this string should contain a valid JSON/Go
|
||||
field access statement, such as desiredState.manifest.containers[2].
|
||||
For example, if the object reference is to a container within
|
||||
a pod, this would take on a value like: "spec.containers{name}"
|
||||
(where "name" refers to the name of the container that triggered
|
||||
the event) or if no container name is specified "spec.containers[2]"
|
||||
(container with index 2 in this pod). This syntax is chosen
|
||||
only to have some well-defined way of referencing a part of
|
||||
an object. TODO: this design is not final and this field is
|
||||
subject to change in the future.'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
|
||||
type: string
|
||||
namespace:
|
||||
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
|
||||
type: string
|
||||
resourceVersion:
|
||||
description: 'Specific resourceVersion to which this reference
|
||||
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
|
||||
type: string
|
||||
uid:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
required:
|
||||
- replicaCount
|
||||
- workloadRef
|
||||
type: object
|
||||
status:
|
||||
description: A ManualScalerTraitStatus represents the observed state of
|
||||
a ManualScalerTrait.
|
||||
properties:
|
||||
conditions:
|
||||
description: Conditions of the resource.
|
||||
items:
|
||||
description: A Condition that may apply to a resource.
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: LastTransitionTime is the last time this condition
|
||||
transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: A Message containing details about this condition's
|
||||
last transition from one status to another, if any.
|
||||
type: string
|
||||
reason:
|
||||
description: A Reason for this condition's last transition from
|
||||
one status to another.
|
||||
type: string
|
||||
status:
|
||||
description: Status of this condition; is it currently True,
|
||||
False, or Unknown?
|
||||
type: string
|
||||
type:
|
||||
description: Type of this condition. At most one of each condition
|
||||
type may apply to a resource at any point in time.
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
name: policies.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
@@ -49,9 +48,3 @@ spec:
|
||||
served: true
|
||||
storage: true
|
||||
subresources: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
name: policydefinitions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
@@ -60,7 +59,8 @@ spec:
|
||||
type: boolean
|
||||
schematic:
|
||||
description: Schematic defines the data format and template of the
|
||||
encapsulation of the policy definition
|
||||
encapsulation of the policy definition. Only CUE schematic is supported
|
||||
for now.
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
@@ -160,6 +160,20 @@ spec:
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
gitCredentialsSecretReference:
|
||||
description: GitCredentialsSecretReference specifies the reference
|
||||
to the secret containing the git credentials
|
||||
properties:
|
||||
name:
|
||||
description: name is unique within a namespace to reference
|
||||
a secret resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: namespace defines the space within which
|
||||
the secret name must be unique.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
@@ -270,9 +284,3 @@ spec:
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
name: resourcetrackers.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
@@ -56,6 +55,16 @@ spec:
|
||||
applicationGeneration:
|
||||
format: int64
|
||||
type: integer
|
||||
compression:
|
||||
description: ResourceTrackerCompression represents the compressed
|
||||
components in ResourceTracker.
|
||||
properties:
|
||||
data:
|
||||
type: string
|
||||
type:
|
||||
description: Type the compression type
|
||||
type: string
|
||||
type: object
|
||||
managedResources:
|
||||
items:
|
||||
description: ManagedResource define the resource to be managed by
|
||||
@@ -69,7 +78,6 @@ spec:
|
||||
component:
|
||||
type: string
|
||||
creator:
|
||||
description: ResourceCreatorRole defines the resource creator.
|
||||
type: string
|
||||
deleted:
|
||||
description: Deleted marks the resource to be deleted
|
||||
@@ -105,12 +113,16 @@ spec:
|
||||
description: 'Specific resourceVersion to which this reference
|
||||
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
|
||||
type: string
|
||||
skipGC:
|
||||
description: SkipGC marks the resource to skip gc
|
||||
type: boolean
|
||||
trait:
|
||||
type: string
|
||||
uid:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: array
|
||||
type:
|
||||
description: ResourceTrackerType defines the type of resourceTracker
|
||||
@@ -134,7 +146,6 @@ spec:
|
||||
cluster:
|
||||
type: string
|
||||
creator:
|
||||
description: ResourceCreatorRole defines the resource creator.
|
||||
type: string
|
||||
fieldPath:
|
||||
description: 'If referring to a piece of an object instead of
|
||||
@@ -166,6 +177,7 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: array
|
||||
type: object
|
||||
type: object
|
||||
@@ -173,9 +185,3 @@ spec:
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
name: scopedefinitions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
@@ -145,9 +144,3 @@ spec:
|
||||
served: true
|
||||
storage: true
|
||||
subresources: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
name: traitdefinitions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
@@ -197,6 +196,20 @@ spec:
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
gitCredentialsSecretReference:
|
||||
description: GitCredentialsSecretReference specifies the reference
|
||||
to the secret containing the git credentials
|
||||
properties:
|
||||
name:
|
||||
description: name is unique within a namespace to reference
|
||||
a secret resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: namespace defines the space within which
|
||||
the secret name must be unique.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
@@ -356,7 +369,7 @@ spec:
|
||||
properties:
|
||||
appliesToWorkloads:
|
||||
description: AppliesToWorkloads specifies the list of workload kinds
|
||||
this trait applies to. Workload kinds are specified in kind.group/version
|
||||
this trait applies to. Workload kinds are specified in resource.group/version
|
||||
format, e.g. server.core.oam.dev/v1alpha2. Traits that omit this
|
||||
field apply to all workload kinds.
|
||||
items:
|
||||
@@ -410,7 +423,8 @@ spec:
|
||||
type: boolean
|
||||
schematic:
|
||||
description: Schematic defines the data format and template of the
|
||||
encapsulation of the trait
|
||||
encapsulation of the trait. Only CUE and Kube schematic are supported
|
||||
for now.
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
@@ -510,6 +524,20 @@ spec:
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
gitCredentialsSecretReference:
|
||||
description: GitCredentialsSecretReference specifies the reference
|
||||
to the secret containing the git credentials
|
||||
properties:
|
||||
name:
|
||||
description: name is unique within a namespace to reference
|
||||
a secret resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: namespace defines the space within which
|
||||
the secret name must be unique.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
@@ -557,10 +585,12 @@ spec:
|
||||
- configuration
|
||||
type: object
|
||||
type: object
|
||||
skipRevisionAffect:
|
||||
description: SkipRevisionAffect defines the update this trait will
|
||||
not generate a new application Revision
|
||||
type: boolean
|
||||
stage:
|
||||
description: Stage defines the stage information to which this trait
|
||||
resource processing belongs. Currently, PreDispatch and PostDispatch
|
||||
are provided, which are used to control resource pre-process and
|
||||
post-process respectively.
|
||||
type: string
|
||||
status:
|
||||
description: Status defines the custom health policy and status message
|
||||
for trait
|
||||
@@ -641,9 +671,3 @@ spec:
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
controller-gen.kubebuilder.io/version: v0.9.0
|
||||
creationTimestamp: null
|
||||
name: workflows.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
@@ -20,7 +20,7 @@ spec:
|
||||
- name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: Workflow is the Schema for the policy API
|
||||
description: Workflow is the Schema for the workflow API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
@@ -34,18 +34,30 @@ spec:
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
mode:
|
||||
description: WorkflowExecuteMode defines the mode of workflow execution
|
||||
properties:
|
||||
steps:
|
||||
description: Steps is the mode of workflow steps execution
|
||||
type: string
|
||||
subSteps:
|
||||
description: SubSteps is the mode of workflow sub steps execution
|
||||
type: string
|
||||
type: object
|
||||
steps:
|
||||
items:
|
||||
description: WorkflowStep defines how to execute a workflow step.
|
||||
properties:
|
||||
dependsOn:
|
||||
description: DependsOn is the dependency of the step
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
if:
|
||||
description: If is the if condition of the step
|
||||
type: string
|
||||
inputs:
|
||||
description: StepInputs defines variable input of WorkflowStep
|
||||
description: Inputs is the inputs of the step
|
||||
items:
|
||||
properties:
|
||||
from:
|
||||
@@ -58,8 +70,7 @@ spec:
|
||||
type: object
|
||||
type: array
|
||||
meta:
|
||||
description: WorkflowStepMeta contains the meta data of a workflow
|
||||
step
|
||||
description: Meta is the meta data of the workflow step.
|
||||
properties:
|
||||
alias:
|
||||
type: string
|
||||
@@ -68,7 +79,7 @@ spec:
|
||||
description: Name is the unique name of the workflow step.
|
||||
type: string
|
||||
outputs:
|
||||
description: StepOutputs defines output variable of WorkflowStep
|
||||
description: Outputs is the outputs of the step
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
@@ -81,21 +92,23 @@ spec:
|
||||
type: object
|
||||
type: array
|
||||
properties:
|
||||
description: Properties is the properties of the step
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
subSteps:
|
||||
items:
|
||||
description: WorkflowSubStep defines how to execute a workflow
|
||||
subStep.
|
||||
description: WorkflowStepBase defines the workflow step base
|
||||
properties:
|
||||
dependsOn:
|
||||
description: DependsOn is the dependency of the step
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
if:
|
||||
description: If is the if condition of the step
|
||||
type: string
|
||||
inputs:
|
||||
description: StepInputs defines variable input of WorkflowStep
|
||||
description: Inputs is the inputs of the step
|
||||
items:
|
||||
properties:
|
||||
from:
|
||||
@@ -108,8 +121,7 @@ spec:
|
||||
type: object
|
||||
type: array
|
||||
meta:
|
||||
description: WorkflowStepMeta contains the meta data of a
|
||||
workflow step
|
||||
description: Meta is the meta data of the workflow step.
|
||||
properties:
|
||||
alias:
|
||||
type: string
|
||||
@@ -118,7 +130,7 @@ spec:
|
||||
description: Name is the unique name of the workflow step.
|
||||
type: string
|
||||
outputs:
|
||||
description: StepOutputs defines output variable of WorkflowStep
|
||||
description: Outputs is the outputs of the step
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
@@ -131,11 +143,14 @@ spec:
|
||||
type: object
|
||||
type: array
|
||||
properties:
|
||||
description: Properties is the properties of the step
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
timeout:
|
||||
description: Timeout is the timeout of the step
|
||||
type: string
|
||||
type:
|
||||
description: Type is the type of the workflow step.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
@@ -143,8 +158,10 @@ spec:
|
||||
type: object
|
||||
type: array
|
||||
timeout:
|
||||
description: Timeout is the timeout of the step
|
||||
type: string
|
||||
type:
|
||||
description: Type is the type of the workflow step.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
@@ -154,146 +171,3 @@ spec:
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
- name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: Workflow defines workflow steps and other attributes
|
||||
properties:
|
||||
mode:
|
||||
description: WorkflowExecuteMode defines the mode of workflow execution
|
||||
properties:
|
||||
steps:
|
||||
description: WorkflowMode describes the mode of workflow
|
||||
type: string
|
||||
subSteps:
|
||||
description: WorkflowMode describes the mode of workflow
|
||||
type: string
|
||||
type: object
|
||||
ref:
|
||||
type: string
|
||||
steps:
|
||||
items:
|
||||
description: WorkflowStep defines how to execute a workflow step.
|
||||
properties:
|
||||
dependsOn:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
if:
|
||||
type: string
|
||||
inputs:
|
||||
description: StepInputs defines variable input of WorkflowStep
|
||||
items:
|
||||
properties:
|
||||
from:
|
||||
type: string
|
||||
parameterKey:
|
||||
type: string
|
||||
required:
|
||||
- from
|
||||
- parameterKey
|
||||
type: object
|
||||
type: array
|
||||
meta:
|
||||
description: WorkflowStepMeta contains the meta data of a workflow
|
||||
step
|
||||
properties:
|
||||
alias:
|
||||
type: string
|
||||
type: object
|
||||
name:
|
||||
description: Name is the unique name of the workflow step.
|
||||
type: string
|
||||
outputs:
|
||||
description: StepOutputs defines output variable of WorkflowStep
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
valueFrom:
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- valueFrom
|
||||
type: object
|
||||
type: array
|
||||
properties:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
subSteps:
|
||||
items:
|
||||
description: WorkflowSubStep defines how to execute a workflow
|
||||
subStep.
|
||||
properties:
|
||||
dependsOn:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
if:
|
||||
type: string
|
||||
inputs:
|
||||
description: StepInputs defines variable input of WorkflowStep
|
||||
items:
|
||||
properties:
|
||||
from:
|
||||
type: string
|
||||
parameterKey:
|
||||
type: string
|
||||
required:
|
||||
- from
|
||||
- parameterKey
|
||||
type: object
|
||||
type: array
|
||||
meta:
|
||||
description: WorkflowStepMeta contains the meta data of a
|
||||
workflow step
|
||||
properties:
|
||||
alias:
|
||||
type: string
|
||||
type: object
|
||||
name:
|
||||
description: Name is the unique name of the workflow step.
|
||||
type: string
|
||||
outputs:
|
||||
description: StepOutputs defines output variable of WorkflowStep
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
valueFrom:
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- valueFrom
|
||||
type: object
|
||||
type: array
|
||||
properties:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
timeout:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
timeout:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
served: true
|
||||
storage: false
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
name: workflowstepdefinitions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
@@ -57,7 +56,8 @@ spec:
|
||||
type: object
|
||||
schematic:
|
||||
description: Schematic defines the data format and template of the
|
||||
encapsulation of the workflow step definition
|
||||
encapsulation of the workflow step definition. Only CUE schematic
|
||||
is supported for now.
|
||||
properties:
|
||||
cue:
|
||||
description: CUE defines the encapsulation in CUE format
|
||||
@@ -157,6 +157,20 @@ spec:
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
gitCredentialsSecretReference:
|
||||
description: GitCredentialsSecretReference specifies the reference
|
||||
to the secret containing the git credentials
|
||||
properties:
|
||||
name:
|
||||
description: name is unique within a namespace to reference
|
||||
a secret resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: namespace defines the space within which
|
||||
the secret name must be unique.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
@@ -267,9 +281,3 @@ spec:
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
name: workloaddefinitions.core.oam.dev
|
||||
spec:
|
||||
group: core.oam.dev
|
||||
@@ -202,6 +201,20 @@ spec:
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
gitCredentialsSecretReference:
|
||||
description: GitCredentialsSecretReference specifies the reference
|
||||
to the secret containing the git credentials
|
||||
properties:
|
||||
name:
|
||||
description: name is unique within a namespace to reference
|
||||
a secret resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: namespace defines the space within which
|
||||
the secret name must be unique.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
@@ -492,6 +505,20 @@ spec:
|
||||
description: DeleteResource will determine whether provisioned
|
||||
cloud resources will be deleted when CR is deleted
|
||||
type: boolean
|
||||
gitCredentialsSecretReference:
|
||||
description: GitCredentialsSecretReference specifies the reference
|
||||
to the secret containing the git credentials
|
||||
properties:
|
||||
name:
|
||||
description: name is unique within a namespace to reference
|
||||
a secret resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: namespace defines the space within which
|
||||
the secret name must be unique.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
path:
|
||||
description: Path is the sub-directory of remote git repository.
|
||||
It's valid when remote is set
|
||||
@@ -596,9 +623,3 @@ spec:
|
||||
served: true
|
||||
storage: true
|
||||
subresources: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.6.2
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
name: rollouts.standard.oam.dev
|
||||
spec:
|
||||
group: standard.oam.dev
|
||||
@@ -140,6 +139,7 @@ spec:
|
||||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
@@ -274,6 +274,7 @@ spec:
|
||||
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
@@ -474,9 +475,3 @@ spec:
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
|
||||
@@ -1,270 +0,0 @@
|
||||
{{- if .Values.enableFluxcdAddon -}}
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
labels:
|
||||
addons.oam.dev/name: fluxcd-def
|
||||
name: addon-fluxcd-def
|
||||
namespace: {{ .Release.Namespace }}
|
||||
annotations:
|
||||
"helm.sh/resource-policy": keep
|
||||
spec:
|
||||
components:
|
||||
- name: fluxc-def-resources
|
||||
properties:
|
||||
objects:
|
||||
- apiVersion: core.oam.dev/v1beta1
|
||||
kind: ComponentDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: helm release is a group of K8s resources
|
||||
from either git repository or helm repo
|
||||
name: helm
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: "output: {\n\tapiVersion: \"source.toolkit.fluxcd.io/v1beta1\"\n\tmetadata:
|
||||
{\n\t\tname: context.name\n\t}\n\tif parameter.repoType == \"git\"
|
||||
{\n\t\tkind: \"GitRepository\"\n\t\tspec: {\n\t\t\turl: parameter.url\n\t\t\tif
|
||||
parameter.git.branch != _|_ {\n\t\t\t\tref: branch: parameter.git.branch\n\t\t\t}\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n\tif
|
||||
parameter.repoType == \"oss\" {\n\t\tkind: \"Bucket\"\n\t\tspec: {\n\t\t\tendpoint:
|
||||
\ parameter.url\n\t\t\tbucketName: parameter.oss.bucketName\n\t\t\tprovider:
|
||||
\ parameter.oss.provider\n\t\t\tif parameter.oss.region != _|_ {\n\t\t\t\tregion:
|
||||
parameter.oss.region\n\t\t\t}\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n\tif
|
||||
parameter.repoType == \"helm\" {\n\t\tkind: \"HelmRepository\"\n\t\tspec:
|
||||
{\n\t\t\turl: parameter.url\n\t\t\t_secret\n\t\t\t_sourceCommonArgs\n\t\t}\n\t}\n}\n\noutputs:
|
||||
release: {\n\tapiVersion: \"helm.toolkit.fluxcd.io/v2beta1\"\n\tkind:
|
||||
\ \"HelmRelease\"\n\tmetadata: {\n\t\tname: context.name\n\t}\n\tspec:
|
||||
{\n\t\ttimeout: parameter.installTimeout\n\t\tinterval: parameter.interval\n\t\tchart:
|
||||
{\n\t\t\tspec: {\n\t\t\t\tchart: parameter.chart\n\t\t\t\tversion:
|
||||
parameter.version\n\t\t\t\tsourceRef: {\n\t\t\t\t\tif parameter.repoType
|
||||
== \"git\" {\n\t\t\t\t\t\tkind: \"GitRepository\"\n\t\t\t\t\t}\n\t\t\t\t\tif
|
||||
parameter.repoType == \"helm\" {\n\t\t\t\t\t\tkind: \"HelmRepository\"\n\t\t\t\t\t}\n\t\t\t\t\tif
|
||||
parameter.repoType == \"oss\" {\n\t\t\t\t\t\tkind: \"Bucket\"\n\t\t\t\t\t}\n\t\t\t\t\tname:
|
||||
\ context.name\n\t\t\t\t}\n\t\t\t\tinterval: parameter.interval\n\t\t\t}\n\t\t}\n\t\tif
|
||||
parameter.targetNamespace != _|_ {\n\t\t\ttargetNamespace: parameter.targetNamespace\n\t\t}\n\t\tif
|
||||
parameter.releaseName != _|_ {\n\t\t\treleaseName: parameter.releaseName\n\t\t}\n\t\tif
|
||||
parameter.values != _|_ {\n\t\t\tvalues: parameter.values\n\t\t}\n\t}\n}\n\n_secret:
|
||||
{\n\tif parameter.secretRef != _|_ {\n\t\tsecretRef: {\n\t\t\tname:
|
||||
parameter.secretRef\n\t\t}\n\t}\n}\n\n_sourceCommonArgs: {\n\tinterval:
|
||||
parameter.pullInterval\n\tif parameter.timeout != _|_ {\n\t\ttimeout:
|
||||
parameter.timeout\n\t}\n}\n\nparameter: {\n\trepoType: *\"helm\" |
|
||||
\"git\" | \"oss\"\n\t// +usage=The interval at which to check for
|
||||
repository/bucket and relese updates, default to 5m\n\tpullInterval:
|
||||
*\"5m\" | string\n // +usage=The Interval at which to reconcile
|
||||
the Helm release, default to 30s\n interval: *\"30s\" | string\n\t//
|
||||
+usage=The Git or Helm repository URL, OSS endpoint, accept HTTP/S
|
||||
or SSH address as git url,\n\turl: string\n\t// +usage=The name of
|
||||
the secret containing authentication credentials\n\tsecretRef?: string\n\t//
|
||||
+usage=The timeout for operations like download index/clone repository,
|
||||
optional\n\ttimeout?: string\n\t// +usage=The timeout for operation
|
||||
`helm install`, optional\n\tinstallTimeout: *\"10m\" | string\n\n\tgit?:
|
||||
{\n\t\t// +usage=The Git reference to checkout and monitor for changes,
|
||||
defaults to master branch\n\t\tbranch: string\n\t}\n\toss?: {\n\t\t//
|
||||
+usage=The bucket's name, required if repoType is oss\n\t\tbucketName:
|
||||
string\n\t\t// +usage=\"generic\" for Minio, Amazon S3, Google Cloud
|
||||
Storage, Alibaba Cloud OSS, \"aws\" for retrieve credentials from
|
||||
the EC2 service when credentials not specified, default \"generic\"\n\t\tprovider:
|
||||
*\"generic\" | \"aws\"\n\t\t// +usage=The bucket region, optional\n\t\tregion?:
|
||||
string\n\t}\n\n\t// +usage=1.The relative path to helm chart for git/oss
|
||||
source. 2. chart name for helm resource 3. relative path for chart
|
||||
package(e.g. ./charts/podinfo-1.2.3.tgz)\n\tchart: string\n\t// +usage=Chart
|
||||
version\n\tversion: *\"*\" | string\n\t// +usage=The namespace for
|
||||
helm chart, optional\n\ttargetNamespace?: string\n\t// +usage=The
|
||||
release name\n\treleaseName?: string\n\t// +usage=Chart values\n\tvalues?:
|
||||
#nestedmap\n}\n\n#nestedmap: {\n\t...\n}\n"
|
||||
status:
|
||||
customStatus: "repoMessage: string\nreleaseMessage: string\nif context.output.status
|
||||
== _|_ {\n\trepoMessage: \"Fetching repository\"\n\treleaseMessage:
|
||||
\"Wating repository ready\"\n}\nif context.output.status != _|_ {\n\trepoStatus:
|
||||
context.output.status\n\tif repoStatus.conditions[0][\"type\"] != \"Ready\"
|
||||
{\n\t\trepoMessage: \"Fetch repository fail\"\n\t}\n\tif repoStatus.conditions[0][\"type\"]
|
||||
== \"Ready\" {\n\t\trepoMessage: \"Fetch repository successfully\"\n\t}\n\n\tif
|
||||
context.outputs.release.status == _|_ {\n\t\treleaseMessage: \"Creating
|
||||
helm release\"\n\t}\n\tif context.outputs.release.status != _|_ {\n\t\tif
|
||||
context.outputs.release.status.conditions[0][\"message\"] == \"Release
|
||||
reconciliation succeeded\" {\n\t\t\treleaseMessage: \"Create helm release
|
||||
successfully\"\n\t\t}\n\t\tif context.outputs.release.status.conditions[0][\"message\"]
|
||||
!= \"Release reconciliation succeeded\" {\n\t\t\treleaseBasicMessage:
|
||||
\"Delivery helm release in progress, message: \" + context.outputs.release.status.conditions[0][\"message\"]\n\t\t\tif
|
||||
len(context.outputs.release.status.conditions) == 1 {\n\t\t\t\treleaseMessage:
|
||||
releaseBasicMessage\n\t\t\t}\n\t\t\tif len(context.outputs.release.status.conditions)
|
||||
> 1 {\n\t\t\t\treleaseMessage: releaseBasicMessage + \", \" + context.outputs.release.status.conditions[1][\"message\"]\n\t\t\t}\n\t\t}\n\t}\n\n}\nmessage:
|
||||
repoMessage + \", \" + releaseMessage"
|
||||
healthPolicy: 'isHealth: len(context.outputs.release.status.conditions)
|
||||
!= 0 && context.outputs.release.status.conditions[0]["status"]=="True"'
|
||||
workload:
|
||||
type: autodetects.core.oam.dev
|
||||
- apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: A list of JSON6902 patch to selected target
|
||||
name: kustomize-json-patch
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: "patch: {\n\tspec: {\n\t\tpatchesJson6902: parameter.patchesJson\n\t}\n}\n\nparameter:
|
||||
{\n\t// +usage=A list of JSON6902 patch.\n\tpatchesJson: [...#jsonPatchItem]\n}\n\n//
|
||||
+usage=Contains a JSON6902 patch\n#jsonPatchItem: {\n\ttarget: #selector\n\tpatch:
|
||||
[...{\n\t\t// +usage=operation to perform\n\t\top: string | \"add\"
|
||||
| \"remove\" | \"replace\" | \"move\" | \"copy\" | \"test\"\n\t\t//
|
||||
+usage=operate path e.g. /foo/bar\n\t\tpath: string\n\t\t// +usage=specify
|
||||
source path when op is copy/move\n\t\tfrom?: string\n\t\t// +usage=specify
|
||||
opraation value when op is test/add/replace\n\t\tvalue?: string\n\t}]\n}\n\n//
|
||||
+usage=Selector specifies a set of resources\n#selector: {\n\tgroup?:
|
||||
\ string\n\tversion?: string\n\tkind?: string\n\tnamespace?:
|
||||
\ string\n\tname?: string\n\tannotationSelector?:
|
||||
string\n\tlabelSelector?: string\n}\n"
|
||||
- apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: A list of StrategicMerge or JSON6902 patch
|
||||
to selected target
|
||||
name: kustomize-patch
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: "patch: {\n\tspec: {\n\t\tpatches: parameter.patches\n\t}\n}\nparameter:
|
||||
{\n\t// +usage=a list of StrategicMerge or JSON6902 patch to selected
|
||||
target\n\tpatches: [...#patchItem]\n}\n\n// +usage=Contains a strategicMerge
|
||||
or JSON6902 patch\n#patchItem: {\n\t// +usage=Inline patch string,
|
||||
in yaml style\n\tpatch: string\n\t// +usage=Specify the target the
|
||||
patch should be applied to\n\ttarget: #selector\n}\n\n// +usage=Selector
|
||||
specifies a set of resources\n#selector: {\n\tgroup?: string\n\tversion?:
|
||||
\ string\n\tkind?: string\n\tnamespace?: string\n\tname?:
|
||||
\ string\n\tannotationSelector?: string\n\tlabelSelector?:
|
||||
\ string\n}\n"
|
||||
- apiVersion: core.oam.dev/v1beta1
|
||||
kind: ComponentDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: kustomize can fetching, building, updating
|
||||
and applying Kustomize manifests from git repo.
|
||||
name: kustomize
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: "output: {\n\tapiVersion: \"kustomize.toolkit.fluxcd.io/v1beta1\"\n\tkind:
|
||||
\ \"Kustomization\"\n\tmetadata: {\n\t\tname: context.name\n
|
||||
\ namespace: context.namespace\n\t}\n\tspec: {\n\t\tinterval: parameter.pullInterval\n\t\tsourceRef:
|
||||
{\n\t\t\tif parameter.repoType == \"git\" {\n\t\t\t\tkind: \"GitRepository\"\n\t\t\t}\n\t\t\tif
|
||||
parameter.repoType == \"oss\" {\n\t\t\t\tkind: \"Bucket\"\n\t\t\t}\n\t\t\tname:
|
||||
\ context.name\n\t\t\tnamespace: context.namespace\n\t\t}\n\t\tpath:
|
||||
\ parameter.path\n\t\tprune: true\n\t\tvalidation: \"client\"\n\t}\n}\n\noutputs:
|
||||
{\n repo: {\n\t apiVersion: \"source.toolkit.fluxcd.io/v1beta1\"\n\t
|
||||
\ metadata: {\n\t\t name: context.name\n namespace: context.namespace\n\t
|
||||
\ }\n\t if parameter.repoType == \"git\" {\n\t\t kind: \"GitRepository\"\n\t\t
|
||||
\ spec: {\n\t\t\t url: parameter.url\n\t\t\t if parameter.git.branch
|
||||
!= _|_ {\n\t\t\t\t ref: branch: parameter.git.branch\n\t\t\t }\n
|
||||
\ if parameter.git.provider != _|_ {\n if parameter.git.provider
|
||||
== \"GitHub\" {\n gitImplementation: \"go-git\"\n }\n
|
||||
\ if parameter.git.provider == \"AzureDevOps\" {\n gitImplementation:
|
||||
\"libgit2\"\n }\n }\n\t\t\t _secret\n\t\t\t _sourceCommonArgs\n\t\t
|
||||
\ }\n\t }\n\t if parameter.repoType == \"oss\" {\n\t\t kind: \"Bucket\"\n\t\t
|
||||
\ spec: {\n\t\t\t endpoint: parameter.url\n\t\t\t bucketName:
|
||||
parameter.oss.bucketName\n\t\t\t provider: parameter.oss.provider\n\t\t\t
|
||||
\ if parameter.oss.region != _|_ {\n\t\t\t\t region: parameter.oss.region\n\t\t\t
|
||||
\ }\n\t\t\t _secret\n\t\t\t _sourceCommonArgs\n\t\t }\n\t }\n
|
||||
\ }\n\n if parameter.imageRepository != _|_ {\n imageRepo: {\n
|
||||
\ apiVersion: \"image.toolkit.fluxcd.io/v1beta1\"\n kind:
|
||||
\"ImageRepository\"\n\t metadata: {\n\t\t name: context.name\n
|
||||
\ namespace: context.namespace\n\t }\n spec: {\n image:
|
||||
parameter.imageRepository.image\n interval: parameter.pullInterval\n
|
||||
\ if parameter.imageRepository.secretRef != _|_ {\n secretRef:
|
||||
name: parameter.imageRepository.secretRef\n }\n }\n }\n\n
|
||||
\ imagePolicy: {\n apiVersion: \"image.toolkit.fluxcd.io/v1beta1\"\n
|
||||
\ kind: \"ImagePolicy\"\n\t metadata: {\n\t\t name: context.name\n
|
||||
\ namespace: context.namespace\n\t }\n spec: {\n imageRepositoryRef:
|
||||
name: context.name\n policy: parameter.imageRepository.policy\n
|
||||
\ if parameter.imageRepository.filterTags != _|_ {\n filterTags:
|
||||
parameter.imageRepository.filterTags\n }\n }\n }\n\n
|
||||
\ imageUpdate: {\n apiVersion: \"image.toolkit.fluxcd.io/v1beta1\"\n
|
||||
\ kind: \"ImageUpdateAutomation\"\n\t metadata: {\n\t\t name:
|
||||
context.name\n namespace: context.namespace\n\t }\n spec:
|
||||
{\n interval: parameter.pullInterval\n sourceRef: {\n
|
||||
\ kind: \"GitRepository\"\n name: context.name\n
|
||||
\ }\n git: {\n checkout: ref: branch: parameter.git.branch\n
|
||||
\ commit: {\n author: {\n email: \"kubevelabot@users.noreply.github.com\"\n
|
||||
\ name: \"kubevelabot\"\n }\n if
|
||||
parameter.imageRepository.commitMessage != _|_ {\n messageTemplate:
|
||||
\"Update image automatically.\\n\" + parameter.imageRepository.commitMessage\n
|
||||
\ }\n if parameter.imageRepository.commitMessage
|
||||
== _|_ {\n messageTemplate: \"Update image automatically.\"\n
|
||||
\ }\n }\n push: branch: parameter.git.branch\n
|
||||
\ }\n update: {\n path:\tparameter.path\n strategy:
|
||||
\"Setters\"\n }\n }\n }\n }\n}\n\n_secret: {\n\tif
|
||||
parameter.secretRef != _|_ {\n\t\tsecretRef: {\n\t\t\tname: parameter.secretRef\n\t\t}\n\t}\n}\n\n_sourceCommonArgs:
|
||||
{\n\tinterval: parameter.pullInterval\n\tif parameter.timeout != _|_
|
||||
{\n\t\ttimeout: parameter.timeout\n\t}\n}\n\nparameter: {\n\trepoType:
|
||||
*\"git\" | \"oss\"\n // +usage=The image repository for automatically
|
||||
update image to git\n imageRepository?: {\n // +usage=The image
|
||||
url\n image: string\n // +usage=The name of the secret containing
|
||||
authentication credentials\n secretRef?: string\n // +usage=Policy
|
||||
gives the particulars of the policy to be followed in selecting the
|
||||
most recent image.\n policy: {\n // +usage=Alphabetical set
|
||||
of rules to use for alphabetical ordering of the tags.\n alphabetical?:
|
||||
{\n // +usage=Order specifies the sorting order of the tags.\n
|
||||
\ // +usage=Given the letters of the alphabet as tags, ascending
|
||||
order would select Z, and descending order would select A.\n order?:
|
||||
\"asc\" | \"desc\"\n }\n // +usage=Numerical set of rules
|
||||
to use for numerical ordering of the tags.\n numerical?: {\n
|
||||
\ // +usage=Order specifies the sorting order of the tags.\n
|
||||
\ // +usage=Given the integer values from 0 to 9 as tags, ascending
|
||||
order would select 9, and descending order would select 0.\n order:
|
||||
\"asc\" | \"desc\"\n }\n // +usage=SemVer gives a semantic
|
||||
version range to check against the tags available.\n semver?:
|
||||
{\n // +usage=Range gives a semver range for the image tag;
|
||||
the highest version within the range that's a tag yields the latest
|
||||
image.\n range: string\n }\n }\n // +usage=FilterTags
|
||||
enables filtering for only a subset of tags based on a set of rules.
|
||||
If no rules are provided, all the tags from the repository will be
|
||||
ordered and compared.\n filterTags?: {\n // +usage=Extract
|
||||
allows a capture group to be extracted from the specified regular
|
||||
expression pattern, useful before tag evaluation.\n extract?:
|
||||
string\n // +usage=Pattern specifies a regular expression pattern
|
||||
used to filter for image tags.\n pattern?: string\n }\n //
|
||||
+usage=The image url\n commitMessage?: string\n }\n\t// +usage=The
|
||||
interval at which to check for repository/bucket and release updates,
|
||||
default to 5m\n\tpullInterval: *\"5m\" | string\n\t// +usage=The Git
|
||||
or Helm repository URL, OSS endpoint, accept HTTP/S or SSH address
|
||||
as git url,\n\turl: string\n\t// +usage=The name of the secret containing
|
||||
authentication credentials\n\tsecretRef?: string\n\t// +usage=The
|
||||
timeout for operations like download index/clone repository, optional\n\ttimeout?:
|
||||
string\n\tgit?: {\n\t\t// +usage=The Git reference to checkout and
|
||||
monitor for changes, defaults to master branch\n\t\tbranch: string\n
|
||||
\ // +usage=Determines which git client library to use. Defaults
|
||||
to GitHub, it will pick go-git. AzureDevOps will pick libgit2.\n provider?:
|
||||
*\"GitHub\" | \"AzureDevOps\"\n\t}\n\toss?: {\n\t\t// +usage=The bucket's
|
||||
name, required if repoType is oss\n\t\tbucketName: string\n\t\t//
|
||||
+usage=\"generic\" for Minio, Amazon S3, Google Cloud Storage, Alibaba
|
||||
Cloud OSS, \"aws\" for retrieve credentials from the EC2 service when
|
||||
credentials not specified, default \"generic\"\n\t\tprovider: *\"generic\"
|
||||
| \"aws\"\n\t\t// +usage=The bucket region, optional\n\t\tregion?:
|
||||
string\n\t}\n\t//+usage=Path to the directory containing the kustomization.yaml
|
||||
file, or the set of plain YAMLs a kustomization.yaml should be generated
|
||||
for.\n\tpath: string\n}"
|
||||
workload:
|
||||
type: autodetects.core.oam.dev
|
||||
- apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: A list of strategic merge to kustomize
|
||||
config
|
||||
name: kustomize-strategy-merge
|
||||
namespace: {{.Values.systemDefinitionNamespace}}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: "patch: {\n\tspec: {\n\t\tpatchesStrategicMerge: parameter.patchesStrategicMerge\n\t}\n}\n\nparameter:
|
||||
{\n\t// +usage=a list of strategicmerge, defined as inline yaml objects.\n\tpatchesStrategicMerge:
|
||||
[...#nestedmap]\n}\n\n#nestedmap: {\n\t...\n}\n"
|
||||
type: k8s-objects
|
||||
|
||||
{{- end }}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -32,6 +32,7 @@ spec:
|
||||
- "--secure-port={{ .Values.multicluster.clusterGateway.port }}"
|
||||
- "--secret-namespace={{ .Release.Namespace }}"
|
||||
- "--feature-gates=APIPriorityAndFairness=false,ClientIdentityPenetration={{ .Values.authentication.enabled }}"
|
||||
- "--cluster-gateway-proxy-config=/etc/proxy-config/config.yaml"
|
||||
{{- if .Values.multicluster.clusterGateway.secureTLS.enabled }}
|
||||
- "--tls-cert-file={{ .Values.multicluster.clusterGateway.secureTLS.certPath }}/tls.crt"
|
||||
- "--tls-private-key-file={{ .Values.multicluster.clusterGateway.secureTLS.certPath }}/tls.key"
|
||||
@@ -42,14 +43,20 @@ spec:
|
||||
{{- toYaml .Values.multicluster.clusterGateway.resources | nindent 12 }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.multicluster.clusterGateway.port }}
|
||||
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
|
||||
volumeMounts:
|
||||
- mountPath: /etc/proxy-config
|
||||
name: proxy-config
|
||||
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
|
||||
- mountPath: {{ .Values.multicluster.clusterGateway.secureTLS.certPath }}
|
||||
name: tls-cert-vol
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
|
||||
volumes:
|
||||
- configMap:
|
||||
defaultMode: 420
|
||||
name: {{ .Release.Name }}-cluster-gateway-proxy-config
|
||||
name: proxy-config
|
||||
{{ if .Values.multicluster.clusterGateway.secureTLS.enabled }}
|
||||
- name: tls-cert-vol
|
||||
secret:
|
||||
defaultMode: 420
|
||||
@@ -74,6 +81,23 @@ spec:
|
||||
maxUnavailable: 1
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-cluster-gateway-proxy-config
|
||||
namespace: {{ .Release.Namespace }}
|
||||
data:
|
||||
config.yaml: |
|
||||
apiVersion: cluster.core.oam.dev/v1alpha1
|
||||
kind: ClusterGatewayProxyConfiguration
|
||||
spec:
|
||||
clientIdentityExchanger:
|
||||
rules:
|
||||
- name: super-user
|
||||
source:
|
||||
group: kubevela:ux
|
||||
type: PrivilegedIdentityExchanger
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-cluster-gateway-service
|
||||
|
||||
@@ -11,7 +11,10 @@ metadata:
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- '*'
|
||||
- deployments.apps
|
||||
- statefulsets.apps
|
||||
- daemonsets.apps
|
||||
- jobs.batch
|
||||
podDisruptive: true
|
||||
schematic:
|
||||
cue:
|
||||
|
||||
@@ -4,9 +4,7 @@ apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: Add annotations on K8s pod for your workload which follows the pod spec in path 'spec.template'.
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
definition.oam.dev/description: Add annotations on your workload. if it generates pod, add same annotations for generated pods.
|
||||
name: annotations
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
spec:
|
||||
@@ -20,13 +18,13 @@ spec:
|
||||
patch: {
|
||||
metadata: annotations: {
|
||||
for k, v in parameter {
|
||||
"\(k)": v
|
||||
(k): v
|
||||
}
|
||||
}
|
||||
if context.output.spec != _|_ && context.output.spec.template != _|_ {
|
||||
spec: template: metadata: annotations: {
|
||||
for k, v in parameter {
|
||||
"\(k)": v
|
||||
(k): v
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: Apply components of an application in parallel for your workflow steps
|
||||
labels:
|
||||
custom.definition.oam.dev/deprecated: "true"
|
||||
custom.definition.oam.dev/scope: Application
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: apply-application-in-parallel
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
|
||||
@@ -4,8 +4,10 @@ apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: Apply application for your workflow steps
|
||||
definition.oam.dev/description: Apply application for your workflow steps, it has no arguments, should be used for custom steps before or after application applied.
|
||||
labels:
|
||||
custom.definition.oam.dev/deprecated: "true"
|
||||
custom.definition.oam.dev/scope: Application
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: apply-application
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
|
||||
# Definition source cue file: vela-templates/definitions/internal/apply-component.cue
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: Apply a specific component and its corresponding traits in application
|
||||
labels:
|
||||
custom.definition.oam.dev/scope: Application
|
||||
name: apply-component
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
parameter: {
|
||||
// +usage=Specify the component name to apply
|
||||
component: string
|
||||
// +usage=Specify the cluster
|
||||
cluster: *"" | string
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
|
||||
# Definition source cue file: vela-templates/definitions/internal/apply-deployment.cue
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/alias: ""
|
||||
definition.oam.dev/description: Apply deployment with specified image and cmd.
|
||||
name: apply-deployment
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"vela/op"
|
||||
)
|
||||
|
||||
output: op.#Apply & {
|
||||
value: {
|
||||
apiVersion: "apps/v1"
|
||||
kind: "Deployment"
|
||||
metadata: {
|
||||
name: context.stepName
|
||||
namespace: context.namespace
|
||||
}
|
||||
spec: {
|
||||
selector: matchLabels: "workflow.oam.dev/step-name": "\(context.name)-\(context.stepName)"
|
||||
template: {
|
||||
metadata: labels: "workflow.oam.dev/step-name": "\(context.name)-\(context.stepName)"
|
||||
spec: containers: [{
|
||||
name: context.stepName
|
||||
image: parameter.image
|
||||
if parameter["cmd"] != _|_ {
|
||||
command: parameter.cmd
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
wait: op.#ConditionalWait & {
|
||||
continue: output.value.status.readyReplicas == 1
|
||||
}
|
||||
parameter: {
|
||||
image: string
|
||||
cmd?: [...string]
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ spec:
|
||||
cluster: parameter.cluster
|
||||
}
|
||||
parameter: {
|
||||
// +usage=Specify the value of the object
|
||||
// +usage=Specify Kubernetes native resource object to be applied
|
||||
value: {...}
|
||||
// +usage=Specify the cluster of the object
|
||||
// +usage=The cluster you want to apply the resource to, default is the current control plane cluster
|
||||
cluster: *"" | string
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
|
||||
kind: PolicyDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: Configure the behaviour of preventing configuration drift.
|
||||
definition.oam.dev/description: Allow configuration drift for applied resources, delivery the resource without continuously reconciliation.
|
||||
name: apply-once
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
spec:
|
||||
@@ -12,6 +12,8 @@ spec:
|
||||
cue:
|
||||
template: |
|
||||
#ApplyOnceStrategy: {
|
||||
// +usage=When the strategy takes effect,e.g. onUpdate、onStateKeep
|
||||
affect?: string
|
||||
// +usage=Specify the path of the resource that allow configuration drift
|
||||
path: [...string]
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: Apply remaining components and traits
|
||||
labels:
|
||||
custom.definition.oam.dev/deprecated: "true"
|
||||
custom.definition.oam.dev/scope: Application
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: apply-remaining
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
|
||||
# Definition source cue file: vela-templates/definitions/internal/apply-terraform-config.cue
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/alias: ""
|
||||
definition.oam.dev/description: Apply terraform configuration in the step
|
||||
definition.oam.dev/example-url: https://raw.githubusercontent.com/kubevela/workflow/main/examples/workflow-run/apply-terraform-resource.yaml
|
||||
name: apply-terraform-config
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
import (
|
||||
"vela/op"
|
||||
)
|
||||
|
||||
apply: op.#Apply & {
|
||||
value: {
|
||||
apiVersion: "terraform.core.oam.dev/v1beta2"
|
||||
kind: "Configuration"
|
||||
metadata: {
|
||||
name: "\(context.name)-\(context.stepName)"
|
||||
namespace: context.namespace
|
||||
}
|
||||
spec: {
|
||||
deleteResource: parameter.deleteResource
|
||||
variable: parameter.variable
|
||||
forceDelete: parameter.forceDelete
|
||||
if parameter.source.path != _|_ {
|
||||
path: parameter.source.path
|
||||
}
|
||||
if parameter.source.remote != _|_ {
|
||||
remote: parameter.source.remote
|
||||
}
|
||||
if parameter.source.hcl != _|_ {
|
||||
hcl: parameter.source.hcl
|
||||
}
|
||||
if parameter.providerRef != _|_ {
|
||||
providerRef: parameter.providerRef
|
||||
}
|
||||
if parameter.jobEnv != _|_ {
|
||||
jobEnv: parameter.jobEnv
|
||||
}
|
||||
if parameter.writeConnectionSecretToRef != _|_ {
|
||||
writeConnectionSecretToRef: parameter.writeConnectionSecretToRef
|
||||
}
|
||||
if parameter.region != _|_ {
|
||||
region: parameter.region
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
check: op.#ConditionalWait & {
|
||||
continue: apply.value.status != _|_ && apply.value.status.apply != _|_ && apply.value.status.apply.state == "Available"
|
||||
}
|
||||
parameter: {
|
||||
// +usage=specify the source of the terraform configuration
|
||||
source: close({
|
||||
// +usage=directly specify the hcl of the terraform configuration
|
||||
hcl: string
|
||||
}) | close({
|
||||
// +usage=specify the remote url of the terraform configuration
|
||||
remote: *"https://github.com/kubevela-contrib/terraform-modules.git" | string
|
||||
// +usage=specify the path of the terraform configuration
|
||||
path?: string
|
||||
})
|
||||
// +usage=whether to delete resource
|
||||
deleteResource: *true | bool
|
||||
// +usage=the variable in the configuration
|
||||
variable: {...}
|
||||
// +usage=this specifies the namespace and name of a secret to which any connection details for this managed resource should be written.
|
||||
writeConnectionSecretToRef?: {
|
||||
name: string
|
||||
namespace: *context.namespace | string
|
||||
}
|
||||
// +usage=providerRef specifies the reference to Provider
|
||||
providerRef?: {
|
||||
name: string
|
||||
namespace: *context.namespace | string
|
||||
}
|
||||
// +usage=region is cloud provider's region. It will override the region in the region field of providerRef
|
||||
region?: string
|
||||
// +usage=the envs for job
|
||||
jobEnv?: {...}
|
||||
// +usae=forceDelete will force delete Configuration no matter which state it is or whether it has provisioned some resources
|
||||
forceDelete: *false | bool
|
||||
}
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
|
||||
# Definition source cue file: vela-templates/definitions/internal/apply-terraform-provider.cue
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/alias: ""
|
||||
definition.oam.dev/description: Apply terraform provider config
|
||||
definition.oam.dev/example-url: https://raw.githubusercontent.com/kubevela/workflow/main/examples/workflow-run/apply-terraform-resource.yaml
|
||||
name: apply-terraform-provider
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
import (
|
||||
"vela/op"
|
||||
"strings"
|
||||
)
|
||||
|
||||
config: op.#CreateConfig & {
|
||||
name: "\(context.name)-\(context.stepName)"
|
||||
namespace: context.namespace
|
||||
template: "terraform-\(parameter.type)"
|
||||
config: {
|
||||
name: parameter.name
|
||||
if parameter.type == "alibaba" {
|
||||
ALICLOUD_ACCESS_KEY: parameter.accessKey
|
||||
ALICLOUD_SECRET_KEY: parameter.secretKey
|
||||
ALICLOUD_REGION: parameter.region
|
||||
}
|
||||
if parameter.type == "aws" {
|
||||
AWS_ACCESS_KEY_ID: parameter.accessKey
|
||||
AWS_SECRET_ACCESS_KEY: parameter.secretKey
|
||||
AWS_DEFAULT_REGION: parameter.region
|
||||
AWS_SESSION_TOKEN: parameter.token
|
||||
}
|
||||
if parameter.type == "azure" {
|
||||
ARM_CLIENT_ID: parameter.clientID
|
||||
ARM_CLIENT_SECRET: parameter.clientSecret
|
||||
ARM_SUBSCRIPTION_ID: parameter.subscriptionID
|
||||
ARM_TENANT_ID: parameter.tenantID
|
||||
}
|
||||
if parameter.type == "baidu" {
|
||||
BAIDUCLOUD_ACCESS_KEY: parameter.accessKey
|
||||
BAIDUCLOUD_SECRET_KEY: parameter.secretKey
|
||||
BAIDUCLOUD_REGION: parameter.region
|
||||
}
|
||||
if parameter.type == "ec" {
|
||||
EC_API_KEY: parameter.apiKey
|
||||
}
|
||||
if parameter.type == "gcp" {
|
||||
GOOGLE_CREDENTIALS: parameter.credentials
|
||||
GOOGLE_REGION: parameter.region
|
||||
GOOGLE_PROJECT: parameter.project
|
||||
}
|
||||
if parameter.type == "tencent" {
|
||||
TENCENTCLOUD_SECRET_ID: parameter.secretID
|
||||
TENCENTCLOUD_SECRET_KEY: parameter.secretKey
|
||||
TENCENTCLOUD_REGION: parameter.region
|
||||
}
|
||||
if parameter.type == "ucloud" {
|
||||
UCLOUD_PRIVATE_KEY: parameter.privateKey
|
||||
UCLOUD_PUBLIC_KEY: parameter.publicKey
|
||||
UCLOUD_PROJECT_ID: parameter.projectID
|
||||
UCLOUD_REGION: parameter.region
|
||||
}
|
||||
}
|
||||
}
|
||||
read: op.#Read & {
|
||||
value: {
|
||||
apiVersion: "terraform.core.oam.dev/v1beta1"
|
||||
kind: "Provider"
|
||||
metadata: {
|
||||
name: parameter.name
|
||||
namespace: context.namespace
|
||||
}
|
||||
}
|
||||
}
|
||||
check: op.#ConditionalWait & {
|
||||
if read.value.status != _|_ {
|
||||
continue: read.value.status.state == "ready"
|
||||
}
|
||||
if read.value.status == _|_ {
|
||||
continue: false
|
||||
}
|
||||
}
|
||||
providerBasic: {
|
||||
accessKey: string
|
||||
secretKey: string
|
||||
region: string
|
||||
}
|
||||
#AlibabaProvider: {
|
||||
providerBasic
|
||||
type: "alibaba"
|
||||
name: *"alibaba-provider" | string
|
||||
}
|
||||
#AWSProvider: {
|
||||
providerBasic
|
||||
token: *"" | string
|
||||
type: "aws"
|
||||
name: *"aws-provider" | string
|
||||
}
|
||||
#AzureProvider: {
|
||||
subscriptionID: string
|
||||
tenantID: string
|
||||
clientID: string
|
||||
clientSecret: string
|
||||
name: *"azure-provider" | string
|
||||
}
|
||||
#BaiduProvider: {
|
||||
providerBasic
|
||||
type: "baidu"
|
||||
name: *"baidu-provider" | string
|
||||
}
|
||||
#ECProvider: {
|
||||
type: "ec"
|
||||
apiKey: *"" | string
|
||||
name: *"ec-provider" | string
|
||||
}
|
||||
#GCPProvider: {
|
||||
credentials: string
|
||||
region: string
|
||||
project: string
|
||||
type: "gcp"
|
||||
name: *"gcp-provider" | string
|
||||
}
|
||||
#TencentProvider: {
|
||||
secretID: string
|
||||
secretKey: string
|
||||
region: string
|
||||
type: "tencent"
|
||||
name: *"tencent-provider" | string
|
||||
}
|
||||
#UCloudProvider: {
|
||||
publicKey: string
|
||||
privateKey: string
|
||||
projectID: string
|
||||
region: string
|
||||
type: "ucloud"
|
||||
name: *"ucloud-provider" | string
|
||||
}
|
||||
parameter: *#AlibabaProvider | #AWSProvider | #AzureProvider | #BaiduProvider | #ECProvider | #GCPProvider | #TencentProvider | #UCloudProvider
|
||||
|
||||
158
charts/vela-core/templates/defwithtemplate/build-push-image.yaml
Normal file
158
charts/vela-core/templates/defwithtemplate/build-push-image.yaml
Normal file
@@ -0,0 +1,158 @@
|
||||
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
|
||||
# Definition source cue file: vela-templates/definitions/internal/build-push-image.cue
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/alias: ""
|
||||
definition.oam.dev/description: Build and push image from git url
|
||||
definition.oam.dev/example-url: https://raw.githubusercontent.com/kubevela/workflow/main/examples/workflow-run/built-push-image.yaml
|
||||
name: build-push-image
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
import (
|
||||
"vela/op"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
)
|
||||
|
||||
url: {
|
||||
if parameter.context.git != _|_ {
|
||||
address: strings.TrimPrefix(parameter.context.git, "git://")
|
||||
value: "git://\(address)#refs/heads/\(parameter.context.branch)"
|
||||
}
|
||||
if parameter.context.git == _|_ {
|
||||
value: parameter.context
|
||||
}
|
||||
}
|
||||
kaniko: op.#Apply & {
|
||||
value: {
|
||||
apiVersion: "v1"
|
||||
kind: "Pod"
|
||||
metadata: {
|
||||
name: "\(context.name)-\(context.stepSessionID)-kaniko"
|
||||
namespace: context.namespace
|
||||
}
|
||||
spec: {
|
||||
containers: [
|
||||
{
|
||||
args: [
|
||||
"--dockerfile=\(parameter.dockerfile)",
|
||||
"--context=\(url.value)",
|
||||
"--destination=\(parameter.image)",
|
||||
"--verbosity=\(parameter.verbosity)",
|
||||
if parameter.platform != _|_ {
|
||||
"--customPlatform=\(parameter.platform)"
|
||||
},
|
||||
if parameter.buildArgs != _|_ for arg in parameter.buildArgs {
|
||||
"--build-arg=\(arg)"
|
||||
},
|
||||
]
|
||||
image: parameter.kanikoExecutor
|
||||
name: "kaniko"
|
||||
if parameter.credentials != _|_ && parameter.credentials.image != _|_ {
|
||||
volumeMounts: [
|
||||
{
|
||||
mountPath: "/kaniko/.docker/"
|
||||
name: parameter.credentials.image.name
|
||||
},
|
||||
]
|
||||
}
|
||||
if parameter.credentials != _|_ && parameter.credentials.git != _|_ {
|
||||
env: [
|
||||
{
|
||||
name: "GIT_TOKEN"
|
||||
valueFrom: secretKeyRef: {
|
||||
key: parameter.credentials.git.key
|
||||
name: parameter.credentials.git.name
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
]
|
||||
if parameter.credentials != _|_ && parameter.credentials.image != _|_ {
|
||||
volumes: [
|
||||
{
|
||||
name: parameter.credentials.image.name
|
||||
secret: {
|
||||
defaultMode: 420
|
||||
items: [
|
||||
{
|
||||
key: parameter.credentials.image.key
|
||||
path: "config.json"
|
||||
},
|
||||
]
|
||||
secretName: parameter.credentials.image.name
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
restartPolicy: "Never"
|
||||
}
|
||||
}
|
||||
}
|
||||
log: op.#Log & {
|
||||
source: resources: [{
|
||||
name: "\(context.name)-\(context.stepSessionID)-kaniko"
|
||||
namespace: context.namespace
|
||||
}]
|
||||
}
|
||||
read: op.#Read & {
|
||||
value: {
|
||||
apiVersion: "v1"
|
||||
kind: "Pod"
|
||||
metadata: {
|
||||
name: "\(context.name)-\(context.stepSessionID)-kaniko"
|
||||
namespace: context.namespace
|
||||
}
|
||||
}
|
||||
}
|
||||
wait: op.#ConditionalWait & {
|
||||
continue: read.value.status != _|_ && read.value.status.phase == "Succeeded"
|
||||
}
|
||||
#secret: {
|
||||
name: string
|
||||
key: string
|
||||
}
|
||||
#git: {
|
||||
git: string
|
||||
branch: *"master" | string
|
||||
}
|
||||
parameter: {
|
||||
// +usage=Specify the kaniko executor image, default to oamdev/kaniko-executor:v1.9.1
|
||||
kanikoExecutor: *"oamdev/kaniko-executor:v1.9.1" | string
|
||||
// +usage=Specify the context to build image, you can use context with git and branch or directly specify the context, please refer to https://github.com/GoogleContainerTools/kaniko#kaniko-build-contexts
|
||||
context: #git | string
|
||||
// +usage=Specify the dockerfile
|
||||
dockerfile: *"./Dockerfile" | string
|
||||
// +usage=Specify the image
|
||||
image: string
|
||||
// +usage=Specify the platform to build
|
||||
platform?: string
|
||||
// +usage=Specify the build args
|
||||
buildArgs?: [...string]
|
||||
// +usage=Specify the credentials to access git and image registry
|
||||
credentials?: {
|
||||
// +usage=Specify the credentials to access git
|
||||
git?: {
|
||||
// +usage=Specify the secret name
|
||||
name: string
|
||||
// +usage=Specify the secret key
|
||||
key: string
|
||||
}
|
||||
// +usage=Specify the credentials to access image registry
|
||||
image?: {
|
||||
// +usage=Specify the secret name
|
||||
name: string
|
||||
// +usage=Specify the secret key
|
||||
key: *".dockerconfigjson" | string
|
||||
}
|
||||
}
|
||||
// +usage=Specify the verbosity level
|
||||
verbosity: *"info" | "panic" | "fatal" | "error" | "warn" | "debug" | "trace"
|
||||
}
|
||||
|
||||
60
charts/vela-core/templates/defwithtemplate/clean-jobs.yaml
Normal file
60
charts/vela-core/templates/defwithtemplate/clean-jobs.yaml
Normal file
@@ -0,0 +1,60 @@
|
||||
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
|
||||
# Definition source cue file: vela-templates/definitions/internal/clean-jobs.cue
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: clean applied jobs in the cluster
|
||||
name: clean-jobs
|
||||
namespace: {{ include "systemDefinitionNamespace" . }}
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
template: |
|
||||
import (
|
||||
"vela/op"
|
||||
)
|
||||
|
||||
parameter: {
|
||||
labelselector?: {...}
|
||||
namespace: *context.namespace | string
|
||||
}
|
||||
cleanJobs: op.#Delete & {
|
||||
value: {
|
||||
apiVersion: "batch/v1"
|
||||
kind: "Job"
|
||||
metadata: {
|
||||
name: context.name
|
||||
namespace: parameter.namespace
|
||||
}
|
||||
}
|
||||
filter: {
|
||||
namespace: parameter.namespace
|
||||
if parameter.labelselector != _|_ {
|
||||
matchingLabels: parameter.labelselector
|
||||
}
|
||||
if parameter.labelselector == _|_ {
|
||||
matchingLabels: "workflow.oam.dev/name": context.name
|
||||
}
|
||||
}
|
||||
}
|
||||
cleanPods: op.#Delete & {
|
||||
value: {
|
||||
apiVersion: "v1"
|
||||
kind: "pod"
|
||||
metadata: {
|
||||
name: context.name
|
||||
namespace: parameter.namespace
|
||||
}
|
||||
}
|
||||
filter: {
|
||||
namespace: parameter.namespace
|
||||
if parameter.labelselector != _|_ {
|
||||
matchingLabels: parameter.labelselector
|
||||
}
|
||||
if parameter.labelselector == _|_ {
|
||||
matchingLabels: "workflow.oam.dev/name": context.name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user