Compare commits

...

657 Commits

Author SHA1 Message Date
github-actions[bot]
54477eabf5 Fix: env trait error when existing env exists (#4039)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 2d5a16d45f)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-05-27 21:12:22 +08:00
Zheng Xi Zhou
43bbc97319 Fix: failed to create Provider by CLI (#3964)
Fix #3955

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-05-24 16:42:22 +08:00
github-actions[bot]
cbed2b5cb3 Fix: remove last-applied-config annotation for configmap and secret (#3942)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 4789fa8833)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-05-20 17:09:50 +08:00
github-actions[bot]
8be75545bc Fix: modify the template definition to solve the trait cli error Signed-off-by: Shijie Zhong <zhongsjie@cmbchina.com> (#3880)
Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
(cherry picked from commit b3ef120f95)

Co-authored-by: ZhongsJie <zhongsjie@gmail.com>
2022-05-13 10:54:03 +08:00
github-actions[bot]
d748096f7c Fix: the endpoints is repeated and can not query the ingress with v1 version (#3864)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 31c28b6d00)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-11 14:34:28 +08:00
github-actions[bot]
d4ab93c232 Fix: ignore no kind match error in gc (#3863)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 0021f8823f)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-05-11 12:43:50 +08:00
Zheng Xi Zhou
37a656a292 Fix: update Terraform Configuration CRDS test file (#3857)
Updated Terraform Configuration CRDS to v1beta2 to fix the UT
issue of https://github.com/kubevela/kubevela/pull/3851

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-05-11 10:09:47 +08:00
github-actions[bot]
3c94ac1bc1 [Backport release-1.3] Fix(makefile): update kustomize version to be available for darwin-arm64 (#3858)
* Fix(makefile): update kustomize version to be available for darwin-arm64

Signed-off-by: Carmendelope <carmen@napptive.com>
(cherry picked from commit ad81fffe4f)

* make reviewable changes

Signed-off-by: Carmendelope <carmen@napptive.com>
(cherry picked from commit 84dd93425c)

Co-authored-by: Carmendelope <carmen@napptive.com>
2022-05-11 10:08:04 +08:00
StevenLeiZhang
8499dffcd7 Fix: The new addon can not shown in the Addons page (#3851)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-10 23:10:04 +08:00
StevenLeiZhang
30a6e85023 Fix: sensitive field of addon registry is exposed (#3852)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-10 20:25:10 +08:00
github-actions[bot]
11530e2720 Fix: add parse comments in lookupScript to make patch work (#3844)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 1758dc319d)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-10 13:38:30 +08:00
github-actions[bot]
f53466bc7d [Backport release-1.3] Fix: resolve locally installed addons not being displayed (#3842)
* Fix: resolve locally installed addons not being displayed

Addressed an issue where locally installed addons may not be displayed
if one with the same name is in the registry

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
(cherry picked from commit 799a099890)

* Style: revert incorrect auto-formatting

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
(cherry picked from commit 1430aac438)

* Refactor: change original variable name to avoid confusions

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
(cherry picked from commit 0c1e347106)

* Test: add tests for outputs from `vela addon list`
when an addon with the same as registry one is locally installed

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
(cherry picked from commit e6b3bb024c)

* Refactor: use more concise method to check length

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
(cherry picked from commit afbb062e7c)

* Test: add one more test condition for dual addons
i.e. local and registry

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
(cherry picked from commit ac0718a662)

* Refactor: simplify testing logic by removing unneeded looping

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
(cherry picked from commit 75185f0f0d)

* Style: add missing license header

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
(cherry picked from commit e1d8e99288)

Co-authored-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-05-10 13:37:37 +08:00
github-actions[bot]
e8ea8ec48f [Backport release-1.3] Fix: don't override user definied region (#3833)
* Fix: don't override user definied `region`

Fix #https://github.com/oam-dev/kubevela/issues/3384

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit 0b2f0e381f)

* fix check-diff

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit a9156212d0)

* fix CI

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit 423ce6ece1)

* fix CI

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit 5a827d2ef0)

* fix UT

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit 4b71568547)

* revert some changes

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit cde8d3a957)

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-05-09 15:16:21 +08:00
github-actions[bot]
6c4c9bdf7e [Backport release-1.3] Fix: update latest version Fix: 1.2 upgrade 1.3 workflowstep XXX not found (#3819)
* Fix: 1.2 upgrade 1.3 workflowstep XXX not found

Signed-off-by: cezhang <c1zhang.dev@gmail.com>

handle publishversion case

Signed-off-by: cezhang <c1zhang.dev@gmail.com>
(cherry picked from commit 9cea9b0914)

* add test

Signed-off-by: cezhang <c1zhang.dev@gmail.com>

add test

Signed-off-by: cezhang <c1zhang.dev@gmail.com>

lint code

Signed-off-by: cezhang <c1zhang.dev@gmail.com>
(cherry picked from commit 10b2f691c1)

Co-authored-by: cezhang <c1zhang.dev@gmail.com>
2022-05-07 13:25:52 +08:00
github-actions[bot]
e7930a2da0 Fix: update latest version (#3796)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 202ccf7b68)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-29 17:50:43 +08:00
github-actions[bot]
45e1de19dc Fix: log message wraps wrong arguments (#3793)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
(cherry picked from commit 79362f0648)

Co-authored-by: StevenLeiZhang <zhangleiic@163.com>
2022-04-29 13:34:15 +08:00
github-actions[bot]
d910bb7928 [Backport release-1.3] Chore: sync the cli binaries to OSS (#3785)
* Feat: show the parsing capability error message

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 99b57236eb)

* Chore: sync the cli binaries to OSS

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 81e01e7f56)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-29 10:14:43 +08:00
github-actions[bot]
a580c9a44c Fix: env trait compatible with valueFrom (#3784)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit d0506db414)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-04-28 18:19:01 +08:00
github-actions[bot]
8f5eaefd89 Fix: kubectl check err (#3779)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 3bbcbe0e6f)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-04-28 16:33:28 +08:00
github-actions[bot]
7c3a35ae87 [Backport release-1.3] Fix: addon cli parse any type (#3777)
* fix addon parse any type

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
(cherry picked from commit fdda3a70e5)

* test int

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
(cherry picked from commit ca47004529)

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-28 16:08:48 +08:00
github-actions[bot]
ea0003f7cb Fix: fix revision in webservice (#3766)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 1ab13437b4)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-27 14:19:43 +08:00
Zheng Xi Zhou
3728857c82 Fix: use Terraform provider name as application in CLI (#3742) (#3756)
* Fix: use Terraform provider name as application in CLI

In CLI, use Terraform provider name as application name when
create a Provider. Also display there providers in VelaUX.
1). manually created a Terraform Provider object, like https://github.com/oam-dev/terraform-controller/blob/master/getting-started.md#aws
2). by enabling a Terraform provider addon in version older than v1.3.0
3). by create a Terraform provider via `vela provider add`
4). by VelaUX

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-26 22:17:17 +08:00
github-actions[bot]
8e6c49cb37 [Backport release-1.3] Fix: fix the bug of vela cli enable addon by localDir on windows os (#3762)
* fix windows bug

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix several issue

fix bug

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix unit-test

(cherry picked from commit 956dff3261)

* add more tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
(cherry picked from commit 497a6ebcae)

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-26 20:53:34 +08:00
github-actions[bot]
4b31274bda [Backport release-1.3] Fix: velaux addon hint after enable (#3760)
* Fix: velaux addon hint after enable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
(cherry picked from commit 5adfd6210f)

* check if upgrade

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
(cherry picked from commit 5a7467a494)

Co-authored-by: qiaozp <chivalry.pp@gmail.com>
2022-04-26 16:47:36 +08:00
github-actions[bot]
429e62d11b [Backport release-1.3] Feat: check whether a project matched a config's project (#3757)
* Feat: check whether a project matched a config's project

If the config project is not nil, it's matched whether the project
matched the target project.
If the config project is nil, the target project matched the config.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit dca9646693)

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-26 14:59:41 +08:00
github-actions[bot]
841a18189a Fix: public image registry config could not be created (#3748)
Fix #3663

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit 4fc599b8c9)

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-25 13:59:00 +08:00
github-actions[bot]
59bd066c05 use unical project filter func to list secret (#3746)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix pointer

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
(cherry picked from commit b441878545)

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-25 10:06:37 +08:00
github-actions[bot]
efa9dedb85 Fix: vela-cli does not print cluster name, if application installed in default cluster (#3740)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
(cherry picked from commit 3819981dd4)

Co-authored-by: StevenLeiZhang <zhangleiic@163.com>
2022-04-24 09:17:39 +08:00
Xiangbo Ma
fdffde4dfd Fix: cherry-pick #3724 to delete apprev annotation. Signed-off-by: Xiangbo Ma <maxiangboo@cmbchina.com> (#3739)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-04-24 09:17:15 +08:00
wyike
d08aa7d12c fix several issues (#3729) (#3735)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-22 17:29:01 +08:00
wyike
f9755a405f Fix: change systemInfo some fields (cp #3715) (#3723)
* Fix: change systemInfo some  fields (#3715)

* add some field an calculate workflow step

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix the calculate job cannot start issue

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix comments

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* add suit test framework

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* modify the go mod file

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix worry file name

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-22 16:42:54 +08:00
github-actions[bot]
d751d95bac Feat: change the webservice and config-image-registry definitions (#3733)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 300f0c5ace)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-22 16:34:28 +08:00
github-actions[bot]
e86eec07e0 specify staticcheck version (#3728)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix the workflow

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix

try to fix

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix make file

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix makefile

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
(cherry picked from commit 7b62664332)

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-22 14:26:37 +08:00
github-actions[bot]
4abb5c6ced [Backport release-1.3] Fix: embed.FS filepath that follow the unix style file path when running on windows (#3720)
* fix: "builtin-apply-component.cue: file does not exist"

Signed-off-by: lei.chu <1062186165@qq.com>
(cherry picked from commit fba60a1af1)

* fix: "builtin-apply-component.cue: file does not exist"

Signed-off-by: lei.chu <1062186165@qq.com>
(cherry picked from commit 9e74023951)

Co-authored-by: lei.chu <1062186165@qq.com>
2022-04-21 14:32:30 +08:00
github-actions[bot]
32d9a9ec94 Fix: vela-core does not report error, when component depends on invalid component (#3712)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
(cherry picked from commit 01781bdc02)

Co-authored-by: StevenLeiZhang <zhangleiic@163.com>
2022-04-20 13:39:53 +08:00
github-actions[bot]
f6f9ef4ded Feat: support disable legacy gc upgrade operation (#3697)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 31ab3d859c)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-04-19 09:53:10 +08:00
github-actions[bot]
166c93d548 Fix: set provider name as the config name (#3695)
- For VelaUX, hidden a provider name (users don't need to manual set it). Used
the application/component name (config name) to be the provider name.
- Store description of a config to the annotation of the config application

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit e3feeeec24)

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-18 16:48:37 +08:00
github-actions[bot]
8f767068bf Fix: rt resource key compare mismatch local cluster (#3685)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit fa12bc1950)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-04-15 16:37:00 +08:00
github-actions[bot]
8d9e2a71e7 [Backport release-1.3] Fix: can not query the instance list for the app with apply once policy (#3684)
* Fix: can not query the instance list for the app with apply once policy

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit fbcba8da98)

* Fix: change the test case about ListResourcesInApp

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 91c45132b0)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-15 15:04:04 +08:00
wyike
58b3bca537 cherrypick 3665 and 3605 to release 1.3 (#3668)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-15 12:11:05 +08:00
github-actions[bot]
825f1aaa22 [Backport release-1.3] Fix: fix token invalid after the server restarted (#3662)
* Fix: fix token invalid after the server restarted

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 13c6f0c5a3)

* fix lint

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 96896d4956)

* Pending test temporary

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 33160fd199)

* Pending test temporary

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit c858b81d86)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-14 22:26:57 +08:00
github-actions[bot]
82075427e6 Fix: vela status tree show cluster alias & raw format (#3661)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 4ff0f53c04)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-04-14 19:40:14 +08:00
github-actions[bot]
f89cf673c0 Fix: add label from inner system in CR can prevent sync (#3660)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit dceb642ad6)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-04-14 19:33:35 +08:00
github-actions[bot]
ce53f6922f [Backport release-1.3] Fix: duplicately list pods in velaQL (#3656)
* Fix: duplicately list pods in velaQL

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 5917141b12)

* Fix: the create time of synced app is empty

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit d404c4b507)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-14 17:46:08 +08:00
github-actions[bot]
b6f70d9a3c Fix: failed to deploy application when no there is no avaiable (#3654)
When there are configs, but not in the project where the appliation
is about to deploy, the sync application will hit an issue. It will
lead to block the deploy of an application.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit 6cac625d53)

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-14 17:26:31 +08:00
Somefive
64d063ccfe [Backport release-1.3] vela status tree & controller flags fix (#3649)
* Feat: vela status --tree (#3609)

* Feat: vela status --tree

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: support show not-deployed clusters

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add tests

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add multicluster e2e coverage

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: minor fix

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: cli default switch on feature flags (#3625)

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: support alias in cluster (#3630)

* Feat: support alias in cluster

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test for cluster alias

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: rework vela up to support specified revision (#3634)

* Feat: rework vela up to support specified revision

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add legacy compatibility

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: fix test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: enhance vela status tree print (#3639)

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-14 16:36:35 +08:00
github-actions[bot]
a98278fb7a [Backport release-1.3] Fix: refine the config sync logic (#3647)
* Fix: refine config management

- Refine the config sync logics

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit 97cc021d7a)

* address comments

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit 3e0f9c07a8)

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-14 13:05:01 +08:00
wyike
0553d603e6 Chore: cherry-pick 3641 to release 1.3 (#3646)
* Fix: try to fix CVE (#3641)


* use santize

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-14 11:25:02 +08:00
github-actions[bot]
a36e99308f [Backport release-1.3] Fix: clear info when addon version cannot meet require (#3645)
* first

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

version miss match erro for addon

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

add log

(cherry picked from commit 14fda35867)

* add test for this

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

small fix

(cherry picked from commit 1e218b5732)

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-14 10:03:42 +08:00
github-actions[bot]
947bac2d35 Fix: verify password valid (#3643)
Signed-off-by: Zhiyu Wang <zhiyuwang.newbis@gmail.com>
(cherry picked from commit b623976f1e)

Co-authored-by: Zhiyu Wang <zhiyuwang.newbis@gmail.com>
2022-04-13 19:40:05 +08:00
github-actions[bot]
7644cc59cb Feat: refine config creation and provide config list (#3640)
- Make the api of creation a config to be async
- In listing config page, show the status of a config

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit 5314e5bf9e)

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-13 13:48:20 +08:00
github-actions[bot]
89a441b8ce [Backport release-1.3] Fix: fix dex login with existed email (#3633)
* Fix: fix dex login with existed email

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 15400df15e)

* add dex connector check

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit a7062e08e1)

* unset users' alias

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 1a818f4b8b)

* fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 1b3768ca73)

* fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit e54fc776b0)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-12 16:30:10 +08:00
github-actions[bot]
780572c68f Fix: flags for controller (#3632)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit e5a5916973)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-04-12 16:13:50 +08:00
github-actions[bot]
a13cab65b2 [Backport release-1.3] Feat: support basic auth private helm repo (#3631)
* support auth

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
(cherry picked from commit 54c05afb1a)

* add test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix check diff

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix test

fix

add comments

fix test

(cherry picked from commit a8961ec8cc)

* add tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix

add more test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
(cherry picked from commit 4f45a6af8e)

* add more test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
(cherry picked from commit dee791aa51)

* extract set auth info as a global func

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
(cherry picked from commit f8fb0137e3)

* return bcode

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
(cherry picked from commit 057a67d8b9)

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-12 16:10:48 +08:00
Min Kim
e26104adcc bump cluster-gateway to 1.3.2 (#3620)
Signed-off-by: yue9944882 <291271447@qq.com>
2022-04-11 19:49:20 +08:00
github-actions[bot]
26ac584655 [Backport release-1.3] Feat: add api of listing configs for project when creating a target (#3626)
* Feat: add api of listing configs for project

In a project, list configs by its type

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit 87aae26f3f)

* address comments

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit 830cc79dcf)

* fix ci

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit bf10455f6b)

* add query parameter definition

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit 73ff31382b)

* Update pkg/apiserver/rest/webservice/project.go

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit f0b346a1cb)

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-11 19:06:31 +08:00
github-actions[bot]
482976990d Fix: reuse chart values in vela install (#3617)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 5bf0dd045f)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-04-11 09:52:03 +08:00
github-actions[bot]
bc4812a12e [Backport release-1.3] Fix: vela logs without specified resource name (#3608)
* Fix: vela logs without specified resource name

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
(cherry picked from commit 43df60cb87)

* add unittest

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
(cherry picked from commit daacb88601)

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
(cherry picked from commit 195585b69f)

Co-authored-by: qiaozp <chivalry.pp@gmail.com>
2022-04-08 17:57:15 +08:00
github-actions[bot]
58c2208e2a add sorting for properties, outputs, writeSecretRefParameters in vela def doc-gen (#3604)
Signed-off-by: Nicola115 <2225992901@qq.com>
(cherry picked from commit f1f5fa563d)

Co-authored-by: Nicola115 <2225992901@qq.com>
2022-04-08 15:32:09 +08:00
github-actions[bot]
f83d88cfb0 [Backport release-1.3] Fix: add terraform aws provider without AWS_SESSION_TOKEN (#3594)
* Fix: add terraform aws provider without AWS_SESSION_TOKEN

Fix #3589 and refine prompts for cli

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
(cherry picked from commit 904a72857b)
2022-04-07 17:03:35 +08:00
Somefive
8af3dec0df Fix: add feature-gates to command-line args (#3591)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-06 17:00:44 +08:00
Tianxin Dong
edebcc6c59 Fix: fix refresh code expired bcode (#3582)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-06 14:36:05 +08:00
Jianbo Sun
32382ba6be Chore: add new code flow for kubevela milestone (#3586)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-04-06 13:34:30 +08:00
Zheng Xi Zhou
46ef6f9df4 Fix: add response struct to config deletion api (#3579)
Added an empty struct in the API of config deletion

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-06 13:32:49 +08:00
Jianbo Sun
aea98ff5bf Chore: try fix lint (#3571)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-04-06 10:19:53 +08:00
wyike
c093676575 aglin config secret label (#3576)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix not update label

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix addon cannot update label bug

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

revert
2022-04-01 16:59:15 +08:00
wyike
ed05b4b035 aglin config secret label (#3574)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-01 16:13:12 +08:00
Zheng Xi Zhou
3aa4412a0f Fix: remove config image registry (#3572)
Temporarily removed image registry config

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-01 01:07:43 +08:00
wyike
ef4b9816e1 fix bug (#3569)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix bugs

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix

fix
2022-04-01 01:04:29 +08:00
Tianxin Dong
1c5aab1852 Fix: fix dex config field (#3568)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-01 00:51:17 +08:00
Zheng Xi Zhou
966dbc1c74 Feat: add config management apis (#3562)
* Feat: add config management apis

Added some APIs for config management

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix check-diff

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix ci issue

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix config sync

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix static check

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix sync

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Fix: sync config bug

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-01 00:15:03 +08:00
qiaozp
4eafb46c87 Chore: bump test k8s to 1.20 (#3567)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-03-31 22:12:55 +08:00
Tianxin Dong
a97a4d0ed7 Feat: add update dex config in apiserver (#3548)
* Feat: add update dex config in apiserver

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* use get connectors to get dex connectors

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* lint the code

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: seperate dex config from a component to an application

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: use dex config from secret

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix not found

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix restart dex

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix system info

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix restart

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-31 18:42:18 +08:00
Jianbo Sun
77c02f9eec Chore: add video records in readme for chinese community call (#3565)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-31 18:05:22 +08:00
Jianbo Sun
3157efd421 Chore: refine chart readme and notes (#3563)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-31 17:33:06 +08:00
wyike
8ff93b33e2 Feat: add helm repo list endpoint (#3564)
* add helm repo list

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix commit

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix comments

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* build swagger

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-31 17:18:54 +08:00
qiaozp
c6b9abe4c4 Chore: bump k8s version contraint (#3560)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-03-31 16:42:14 +08:00
Somefive
150ef6e99e Fix: livediff minor bug (#3558)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-31 13:13:55 +08:00
wyike
0ada407fbe optimize the ux of addon (#3557)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix

fix
2022-03-31 10:24:20 +08:00
Somefive
c4af1ba643 Fix: topology use original resource namespace when not specify (#3554)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-30 19:52:10 +08:00
qiaozp
de84421487 Feat: add name param in vela logs (#3556)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-03-30 17:56:59 +08:00
yangs
38a8a7f88a Fix: fix the componentDefinition webservice parameter error (#3553)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-03-30 15:55:49 +08:00
Xiangbo Ma
b4ddf0e4c3 Feat: a new ComponentDefinition cron-task Signed-off-by: Xiangbo Ma <maxiangboo@cmbchina.com> (#3541)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-03-30 13:27:21 +08:00
wyike
47050c90b6 Fix: cli addon multicluster bug (#3547)
* fix addon multicluster bug

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

delete useless test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

asd

asd

* fix test race condition

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-29 23:03:57 +08:00
barnettZQG
685d73a20c Feat: support with metadata as context render cue file in the addon (#3549)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-29 22:13:56 +08:00
Somefive
dde8a8e4c0 Fix: addon support empty components (#3542)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-29 16:42:43 +08:00
Min Kim
943af3ddf6 bump cluster-gateway to v1.3.0 (#3540)
Signed-off-by: yue9944882 <291271447@qq.com>
2022-03-29 16:18:38 +08:00
Somefive
a5c2edf777 Feat: allow select resource by component name for gc policy (#3539)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-29 14:00:50 +08:00
wyike
83d8022ce9 quick fix addon registry (#3537)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-29 12:40:25 +08:00
Zheng Xi Zhou
6d63014c6f Feat: support config management (#3430)
* Feat: componentDefinitions for Config management

Added ComponentDefinitions for config management
- helm chart repository
- image registry
- Dex connector
- Terraform provider

Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>
Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update vela-templates/definitions/internal/component/config-image-registry.cue

Co-authored-by: Jianbo Sun <wonderflow@icloud.com>

* address comments again

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>
Co-authored-by: Jianbo Sun <wonderflow@icloud.com>
2022-03-29 10:28:07 +08:00
Jianbo Sun
d3fbd5fd45 Fix: addon API panic and override workflow step for addon installation (#3533)
* Fix: addon API panic

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: use policy to deploy addon

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: use create or update app instead of patch apply on addon update

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: unit test

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-29 02:37:57 +08:00
barnettZQG
b0202ebf14 Fix: change the default permission name (#3531)
* Fix: change default permission name

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: the addon api bug

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: set local cluster name

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-28 23:37:25 +08:00
Tianxin Dong
295164229d Fix: optimize err for auth in apiserver (#3526)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-28 22:35:56 +08:00
Jianbo Sun
ba09cf5c2e Fix: fix migrate data duplicate in list API and add cluster info in addon status (#3528)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-28 22:30:35 +08:00
Somefive
099e25a552 Fix: enhance ref object to support health check for deployment (#3529)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-28 22:13:51 +08:00
Min Kim
b2f5b69380 chore: bump cluster-register (#3514)
Signed-off-by: yue9944882 <291271447@qq.com>
2022-03-28 21:57:44 +08:00
Zheng Xi Zhou
5d61cee3f6 Fix: support multiple-tenant cloud resources (#3305)
* Fix: support multiple-tenant cloud resources

Split terraform-xxx to two parts, the original addon will only install
definitions, and the provider object will be created by `vela provider`

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* continue

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* continue 0302

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* support `vela provider list`

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* generate a configmap in an addon terraform-xxx

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix listing providers

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* support add a provider

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* support delete a provider

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* support legacy providers

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-03-28 21:55:33 +08:00
Somefive
2af198bda7 Docs: add feature docs for multi-cluster and application revision (#3530)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-28 21:47:57 +08:00
wyike
161d2646cb Feat: helm repo as addon registry to support addon's multi-version (#3523)
* versioned registry impl
add more test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix ci

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix ui

fix

fix

fix

modify addon registry
2022-03-28 21:25:38 +08:00
Avery
4f8e7506f9 Fix: fix bugs in vela def doc-gen from local file (#3490)
* fix bugs in using local filepath as markdown filename; fix bugs in parseLocalFile

Signed-off-by: Nicola115 <2225992901@qq.com>

* ignore control character mismatch between lc.TerraformConfiguration and raw text

Signed-off-by: Nicola115 <2225992901@qq.com>

* goimports

Signed-off-by: Nicola115 <2225992901@qq.com>

* store remote and local in MarkDownReference struct

Signed-off-by: Nicola115 <2225992901@qq.com>

* gofmt

Signed-off-by: Nicola115 <2225992901@qq.com>

* fix too many argument bugs in generate.go:45

Signed-off-by: Nicola115 <2225992901@qq.com>

* fix invalid comment

Signed-off-by: Nicola115 <2225992901@qq.com>
2022-03-28 20:57:24 +08:00
Somefive
160ef64855 Feat: support livediff for referred object (#3525)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-28 17:52:33 +08:00
Guangzhe Huang
905c49eb81 Fix: fix undefined field error in email workflowstep (#3522)
Signed-off-by: huanggze <gzhuang2014@gmail.com>
2022-03-28 16:14:13 +08:00
Somefive
c4a8fcf29c Feat: rework referred objects for version (#3446)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-28 16:09:12 +08:00
Somefive
e72690bade Fix: ignore kubebuilder generated file in code coverage (#3524)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-28 16:08:59 +08:00
barnettZQG
044c4bf73c Feat: add RBAC support (#3493)
* Feat: add the rbac data model

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add some api about the project

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add CRUD about the project and the project user

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add CRUD about the role and perm check filter function

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: update swagger config

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add default roles and perm policies

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add perm check filter for all webservice

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: change the method that find project name

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: query applications and envs by user perm

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: support get login user info

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: change default permissions

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: change PermPolicy to Permission

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add some unit test and fix the e2e test error

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: change some comment word

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: e2e api path error

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-28 16:03:11 +08:00
Somefive
795231ceb5 Feat: add revision command (#3506)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-28 14:47:47 +08:00
Min Kim
3f621e57b2 bugfix: helm install cluster-gateway be compatible w/ existing APIService w/o annoation (#3512)
Signed-off-by: yue9944882 <291271447@qq.com>
2022-03-28 11:52:47 +08:00
Somefive
9fc992ea3e Fix: concurrent write to controller revision (#3520)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-27 19:56:25 +08:00
Tianxin Dong
c2f5175fd1 Fix: fix parse token error validate (#3507)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-25 22:34:32 +08:00
Kunshuai Zhu
a7d3cd5d1a Chore: Nominate JooKS-me as a Reviewer member (#3508)
Signed-off-by: zhukunshuai <jookunshuai@gmail.com>
2022-03-25 18:04:11 +08:00
yangs
ccfab6ce7f Feat: add health check for componentdefinition task (#3509)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-03-25 16:21:57 +08:00
Tianxin Dong
03cd0d144a Feat: add login handle for apiserver (#3471)
* Feat: add login handle for apiserver

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix go lint

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: clean up code and add user in ctx

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: fix swagger conflict

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: add auth in apiserver e2e test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: nit fix for apiserver e2e test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-24 17:59:09 +08:00
Somefive
741544c00c Feat: rework apprev (#3498)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-24 14:40:19 +08:00
Jianbo Sun
723a5d83ca Fix: vela status --endpoint format (#3502)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-24 09:47:15 +08:00
StevenLeiZhang
8af5afa5dc Fix: api-server fail to start, when multi-cluster is disabled (#3501)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-03-23 20:46:29 +08:00
Tianxin Dong
aaa1db8760 Fix: fix workflow cli must have workflow in spec (#3469)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-23 17:16:39 +08:00
Jianbo Sun
c5baa1cae9 Feat: support specify cluster in addon installation (#3497)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-23 14:33:15 +08:00
Wei (段少)
eda7e6c5a0 Chore: Nomiante Daniel as a Maintainer (#3491)
Signed-off-by: BinaryHB0916 <davidduan0916@gmail.com>
2022-03-23 09:49:38 +08:00
Jianbo Sun
e5fd150cd5 Fix: add client validation and severside dry run for vela dry-run (#3485)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-22 16:39:36 +08:00
barnettZQG
d041d8c35d Feat: support delete the readonly application (#3492)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-22 15:49:55 +08:00
wyike
345e4c8144 fix disable addon check several bugs (#3488)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-22 10:06:16 +08:00
Jianbo Sun
9a8ec5d797 Fix: delete app won't be synced in UI (#3487)
* Fix: delete app won't be synced in UI

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: cache should be ignored in app meta not exist

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-22 10:04:10 +08:00
Jianbo Sun
d9a676a688 Feat: add page index for env list API (#3482)
* Feat: add page index for env list API

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: add check for target create without namespace or name

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: adress commnets

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-21 19:28:28 +08:00
Jianbo Sun
9a3ad7ef84 Feat: add readOnly for velaux application which is synced from CR (#3479)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-21 16:33:29 +08:00
朱晓兵
9671e3b232 Fix(context): add support for context.appLables and context.appAnnotations (#3463) (#3468)
* Fix(context): add support for context.appLables and context.appAnnotations (#3463)

Signed-off-by: zxbyoyoyo <596908030@qq.com>
Signed-off-by: 朱晓兵 <596908030@qq.com>

* Fix: unit test

Signed-off-by: 朱晓兵 <596908030@qq.com>

* Fix: recover deleted field

Signed-off-by: 朱晓兵 <596908030@qq.com>
2022-03-21 12:02:30 +08:00
Jianbo Sun
0c97f8311c Chore: Nominate fourierr as a Reviewer member (#3475)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-21 12:01:39 +08:00
wyike
a6460d67b6 Feat: check if an addon is been used while disabling. (#3457)
* first commit

add more tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix ci

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix ci

fix test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fetch only definitions from registry for lagacy addon app

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix ci

* fix error test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-21 10:38:56 +08:00
Tianxin Dong
3ea2ac6d0f Feat: add user management apis (#3458)
* Feat: add user management apis

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: add e2e test and some nit fix

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: add password validate

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: add email modification in update user

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: fix user detail to user base

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: fix test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: fix rebase

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: add password check in create user

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: fix bcode confilt

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-19 15:51:32 +08:00
wyike
13c420dada Fix: optimize helm repository logic put cache lower layer and return bcode when error (#3466)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-18 18:36:19 +08:00
Jianbo Sun
6354912bba Feat: sync application from CR to data store (#3428)
* Feat: sync application from CR to data store

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Feature: address comments

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Feat: add migrate database feature to avoid max 63 charactor in kubeapi storage

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* update the sync data

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-18 09:55:15 +08:00
barnettZQG
5209be6da9 Feat: add the conditions for ui schema spec (#3461)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-18 09:52:58 +08:00
maxiangbo
8f9908e723 Feat: support the mountPath of trait-storage-secret is optional (#3462)
* Feat: support the mountPath parameter of trait-storage-secret is optional Signed-off-by: maxiangbo maxiangboo@cmbchina.com

Signed-off-by: fourierr <maxiangboo@qq.com>

* Feat: support the mountPath parameter of trait-storage is optional Signed-off-by: maxiangbo maxiangboo@cmbchina.com

Signed-off-by: fourierr <maxiangboo@qq.com>
2022-03-17 20:04:57 +08:00
Evan Li
296c82344b Fix(workflow): correct terraform component health check (#3456)
Closes: #3355
Signed-off-by: Evan Li <evan.li97@outlook.com>
2022-03-16 20:30:50 +08:00
Somefive
2d19454a35 Feat: enhance labels & annotations trait (#3454)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-16 17:50:12 +08:00
maxiangbo
f67d2db0d1 Fix: trait env and storage conflict Signed-off-by: maxiangbo maxiangboo@cmbchina.com (#3452)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-03-16 15:14:18 +08:00
Avery
3634ad6f18 Fix: enable provider elastic (#3453)
* enable provider ec

Signed-off-by: Nicola115 <2225992901@qq.com>

* rename provider ec as elastic

Signed-off-by: Nicola115 <2225992901@qq.com>
2022-03-16 15:07:25 +08:00
Tianxin Dong
6c5a40d768 Feat: add dex login in apiserver (#3417)
* Feat: add dex login in apiserver

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* resolve comments

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: get dex config from secret

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: delete cache for dex config

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ci

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-16 14:37:41 +08:00
wyike
c91a7ac273 Feat(apiserver): helm apiserver webservice (list chart, list version, extract helm values) (#3398)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-16 11:42:08 +08:00
barnettZQG
b437cf4310 Feat: support query the policy definitions (#3445)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-16 10:56:53 +08:00
Sunghoon Kang
040d5e1776 Chore: fix issue-commands workflow (#3451)
It seems that the `issue-commands` workflow keeps failing.

This commit fixes the `issue-commands` workflow by bumping up the
action version and replacing `npm install` with `npm ci` for
reproducibility.

Refs: https://github.com/oam-dev/kubevela-github-actions/pull/11

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>
2022-03-16 10:12:58 +08:00
barnettZQG
7bec3506f5 Feat: add auto clear data function for the memory cache (#3439)
* Feat: add auto clear data function for the memory cache

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add memory cache store

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add some test case for the utils package

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-15 19:14:20 +08:00
Jianbo Sun
efc1597317 Nominate devholic as as a Review member (#3444)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-15 16:45:26 +08:00
Kunshuai Zhu
38665e319d Feat: poll multi-cluster metrics and export to prometheus (#3429)
* Feat: poll multi-cluster metrics and export to prometheus

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* pass context to polling loop

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* move metrics definition to montitor/metrics/multicluster.go

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* remove pod usage metric and make reviewable

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* revert the change of GetClusterMetricsFromMetricsAPI

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* revert the change of GetClusterMetricsFromMetricsAPI

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Separate the polling logic into a function

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* add start menber function

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* make refreshPeriod a menber var

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* fix typo

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>
2022-03-15 13:03:10 +08:00
barnettZQG
1e0f329304 Feat: add component definiton in the detail component response body (#3437)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-15 11:57:16 +08:00
Sunghoon Kang
1300a980f0 Feat: reconcile app with scoped permissions (#3434)
* Refactor: refactor multi cluster round trippers

Before adding more RoundTrippers, it would be better to expose common
logic in the utility package.

This commit exports `tryCancelRequest` at `utils` package, and make
`secretMultiClusterRoundTripper` implement `RoundTripperWrapper`
interface to allow chaining multiple round trippers.

Refs #3432

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Feat: reconcile app with scoped permissions

Currently, all Application resources are reconciled by the Roles bound
to the controller service account. This behavior gives us the power to
manage resources across multiple namespaces. However, this behavior can
be problematic in the soft-multitenancy environment.

This commit adds `serviceAccountName` to ApplicationSepc to reconcile
Application with the given service account for reconciling Application
with scoped permissions.

Refs #3432

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Refactor: extract context setter as method

https://github.com/oam-dev/kubevela/pull/3434#discussion_r825561603

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Feat: use annotation instead of spec

https://github.com/oam-dev/kubevela/issues/3432#issuecomment-1066460269

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Refactor: unify service account setter caller

https://github.com/oam-dev/kubevela/pull/3434#discussion_r825853612

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Refactor: rename GetServiceAccountName

https://github.com/oam-dev/kubevela/pull/3434#discussion_r826514565

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>
2022-03-15 11:55:50 +08:00
Zheng Xi Zhou
b6b81c336e Fix: add generate JDBC connection workflowDefintion (#3360)
* Fix: add generate JDBC connection workflowDefintion

Added a WorkflowDefinition

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* format .cue definition

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-03-15 10:53:22 +08:00
Somefive
e2275efe56 Feat: local virtual cluster + namespace in topology (#3436)
* Feat: virtual cluster local + namespace

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: refactor some names

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-15 10:06:36 +08:00
Somefive
c054ee32b1 Fix: use clusterLabelSelector as default (#3438)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-14 19:30:52 +08:00
Somefive
19424cfaa4 Fix: add state keep for healthy suspend (#3426)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-14 14:38:43 +08:00
Rimond
a5fb09814e Fix(docs): rollout example error (#3427)
* modify docs errors

Signed-off-by: liming.jlm <liming.jlm@alibaba-inc.com>

* modify the incorrect file name

Signed-off-by: liming.jlm <liming.jlm@alibaba-inc.com>

Co-authored-by: liming.jlm <liming.jlm@alibaba-inc.com>
2022-03-14 13:13:05 +08:00
Hongchao Deng
c1b116b360 Chore: update CODEOWNERS to promote barnettZQG and leejanee (#3435)
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2022-03-14 10:22:57 +08:00
Shukun Zhang
3af893950e add vela status --endpoint into the tips for vela up (#3433)
Co-authored-by: zhangshukun <zhangshukun.7@bytedance.com>
2022-03-14 09:39:11 +08:00
barnettZQG
20583e089a Feat: support query applied resources by velaQL (#3423)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-11 21:22:58 +08:00
qiaozp
96f8e4dc4c Feat: support preventing component from garbage collection (#3424)
* Feat: support preventing component from garbage collect

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Chore: add doc for changes

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Chore: add comments

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Chore: change json tag

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-03-11 17:32:21 +08:00
wyike
68e2634911 add more test for complicated semver check (#3425)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-11 16:19:32 +08:00
Zheng Xi Zhou
c06dbf3142 Feat: upgrade API version for Terraform Controller (#3396)
* Upgrade API version for Terraform Controller

- Change json tag of spec.Region to `customRegion` in Configuration https://github.com/oam-dev/kubevela/issues/3384
- Use .status.observedGeneration to make Terraform outputs is latest https://github.com/oam-dev/terraform-controller/pull/269

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix ci

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-03-11 16:13:30 +08:00
Somefive
598de21f67 Feat: add support for json-patch and json-merge-patch (#3406)
* Feat: add support for json-patch and json-merge-patch

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add e2e test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: refactor json-patch field

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-11 14:57:50 +08:00
wyike
b13132ceba Feat: helm chart keep fluxcd addon while delete (#3404)
* keep fluxcd addon will delete

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-11 14:46:28 +08:00
Somefive
70408e4712 Feat: support vela cluster labels add/del to manage cluster labels (#3413)
* Feat: add vela cluster label command

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add vela cluster label command to help manage cluster labels

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add e2e test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: use vela cluster labels

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-11 14:13:17 +08:00
Somefive
b975c313c3 Fix: add parallelism params for deploy step (#3411)
* Fix: add parallelism params for deploy step

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add e2e test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-11 13:20:12 +08:00
Somefive
a8dfc99ec9 Fix: pend registry test (#3420)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-11 11:35:40 +08:00
Zheng Xi Zhou
ca8d66471a Feat: add @evanli18 as one Reviewer (#3402)
Fix #3330

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-03-10 20:25:47 +08:00
Somefive
d5e8b68ad2 Fix: rework parallel execution for ApplyComponents and ResourceKeeper Dispatch (#3407)
* Fix: applyComponents lock and rework parallel execution

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: rename

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-10 16:43:22 +08:00
Somefive
d8f95c9cf8 Feat: support multicluster service in application status (#3387)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-10 10:21:56 +08:00
maxiangbo
52f3636a2d Feat: support gitee repository in addon registry (#3393)
* Feat: support gitee repository in addon registry
Signed-off-by: fourierr <maxiangboo@163.com>

* Feat: support gitee repository in addon registry
Signed-off-by: maxiangbo <maxiangboo@cmbchina.com>

Signed-off-by: fourierr <maxiangboo@yeah.net>

* Feat: support gitee repository in addon registry Signed-off-by: maxiangbo <maxiangboo@cmbchina.com>

* Feat: support gitee repository in addon registry Signed-off-by: maxiangbo <maxiangboo@cmbchina.com>

Signed-off-by: fourierr <maxiangboo@qq.com>

Co-authored-by: fourierr <maxiangboo@yeah.net>
2022-03-10 10:11:45 +08:00
Diego Pinheiro
04db938ffa fix - rename docs example dir (#3408)
Signed-off-by: GitHub <noreply@github.com>
2022-03-10 10:02:46 +08:00
Somefive
f9635de027 Fix: auto deploy spec missing (#3386)
* Fix: auto deploy spec missing

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: modify test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-09 11:28:52 +08:00
Diego Pinheiro
d5ad037173 Fix: Helm Chart values.yaml typo (#3403)
* fix - typo

Signed-off-by: GitHub <noreply@github.com>

* fix - typo helm values

Signed-off-by: GitHub <noreply@github.com>
2022-03-09 11:18:46 +08:00
barnettZQG
600b3a7044 Feat: make the component list is in reverse order (#3350)
* Feat: update api doc

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: make the component list is in reverse order.

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: update swagger config

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-08 17:59:22 +08:00
Avery
7bc34b8dd9 Feat: support def doc-gen <LocalFile.yaml> and corresponding functions (#3368)
* add doc-gen --local <LocalFile> and corresponding functions

Signed-off-by: Nicola115 <2225992901@qq.com>

* go format

Signed-off-by: Nicola115 <2225992901@qq.com>

* refactor the usage of vela def doc-gen from local file; refactor the function GenerateReferenceDoc

Signed-off-by: Nicola115 <2225992901@qq.com>

* gofmt and goimports

Signed-off-by: Nicola115 <2225992901@qq.com>

* update prompts info

Signed-off-by: Nicola115 <2225992901@qq.com>

* remove parseLocalDefinition struct, using ComponentDefinition instead

Signed-off-by: Nicola115 <2225992901@qq.com>

* standardize the function ParseLocalFile

Signed-off-by: Nicola115 <2225992901@qq.com>

* add unit test for ParseLocalFile

Signed-off-by: Nicola115 <2225992901@qq.com>

* remove redundant functions

Signed-off-by: Nicola115 <2225992901@qq.com>

* remove redundant lines and do goimports formatting

Signed-off-by: Nicola115 <2225992901@qq.com>
2022-03-08 16:58:39 +08:00
Tianxin Dong
bef24bdf22 Fix: separate waiting and failed backoff time and make them configurable (#3362)
* Fix: separate waiting and failed backoff time and make them configurable

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* change var name in chart values

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ci

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-08 16:04:19 +08:00
Zhiyu Wang
bed1fb373e Fix: The generated swagger.json is malformed. (#3372) (#3373)
Signed-off-by: Zhiyu Wang <zhiyuwang.newbis@gmail.com>
2022-03-08 15:48:05 +08:00
Somefive
b5ce5df9c5 Fix: remove deprecated rt field in app status (#3388)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-08 15:40:31 +08:00
Somefive
6e73c52116 Feat: enhance container related traits (#3359)
* Feat: enhance env trait

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: enhance container image trait

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add command trait

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-08 15:40:04 +08:00
Kunshuai Zhu
0b0ed60b42 Feat: init multi-cluster metrics management (#3365)
* Feat: init multi-cluster metrics management

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Refactor and add metrics collection for metrics-server

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Modify comment

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Fix staticcheck

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Fix some error

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Fix

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>
2022-03-08 14:20:36 +08:00
Somefive
aeaa199982 Fix: remove useless envbinding crd (#3379)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-08 13:40:05 +08:00
qiaozp
751aed0098 Fix: install definition script (#3376)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-03-08 12:26:25 +08:00
Somefive
17ee4268e2 Fix: upgrade dependency to fix alerts (#3378)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-07 14:16:40 +08:00
Somefive
7a30ec61d6 Fix: remove unused variable (#3377)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-07 11:57:59 +08:00
Somefive
de81c24f42 Feat: support standalone style multi-cluster (#3223)
* Feat: ref component

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: support topology and override

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add support for external policy and workflow

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add admission control

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: disable cross namespace ref object

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: refactor

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: support labelSelector in ref-objects

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add pre approve for deploy step

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: refactor

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: support comp/trait type in override policy even not used by prototype

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: support regex match for patch component name

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: labelSelector not work for cluster

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: ref workflow contains external policy

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: revision test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: parallel apply components

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add test for oam provider

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: service ref-comp & indirect trait ns

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: align namespace setting for chart

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add strict unmarshal and reformat

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: merge with cluster rework

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: patch trait-def

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: apply components + load dynamic component

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test for loadPoliciesInOrder

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add test for open merge

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: reformat & add test for step generator

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test for parse override policy related defs

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test for multicluster provider (expandTopology and overrideConfiguration)

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add admission test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: revert trait status pass in component status

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test for dependency in workflowstep & standalone multicluster test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add check for ref and steps in WorkflowStep & enhance ref-objects scheme check

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-07 10:21:00 +08:00
dependabot[bot]
93425889ef Chore(deps): Bump github.com/containerd/containerd from 1.4.12 to 1.4.13 (#3364)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.4.12 to 1.4.13.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.4.12...v1.4.13)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-04 09:43:04 +08:00
old prince
91c6458f35 Fix:deploy application api return value (#3358) 2022-03-03 18:27:13 +08:00
wyike
1cb4426e4b fix windows bug (#3351)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-03 14:43:40 +08:00
Sunghoon Kang
3399742709 Fix: clone request if round tripper modifies it (#3354)
Currently, multicluster round trippers are modifying request directly.
However, golang documentation says `RoundTrip` should not modify the
request.

This commit fixes round trippers to clone the request before the
modification.

https://pkg.go.dev/net/http#RoundTripper

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>
2022-03-03 14:42:24 +08:00
c1_zh
4ec919e009 Feat: Addon yaml files discovery logic improvement (#3356)
Signed-off-by: cezhang <c1zhang.dev@gmail.com>
2022-03-03 13:12:23 +08:00
StevenLeiZhang
dfd316ef7b Fix: Position of parameter is always changing on addon's details page. (#3345)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-03-02 20:46:13 +08:00
Kingram
7f20b7c5be Fix: Fix the inaccurate judgment of ready status (#3317)
* fix: Fix the inaccurate judgment of ready status

Signed-off-by: kingram <kingram@163.com>

* fix: solve inaccurate isHealth

Signed-off-by: kingram <kingram@163.com>

* fix: update readyReplicas type

Signed-off-by: kingram <kingram@163.com>
2022-03-02 13:17:55 +08:00
wyike
12f63dcae5 fix hard code service account name in test (#3346)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-02 12:20:05 +08:00
barnettZQG
342b853315 Feat: add api for delete component (#3341)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-01 22:13:24 +08:00
Tianxin Dong
d6cf2cdd2f Fix: add process context in workflow (#3318)
* Fix: add process context in workflow

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* add context data in process context

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* delete usesless func

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* use multi cluster ctx in process ctx

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* remove debug log

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-02-28 10:30:55 +08:00
Tianxin Dong
b8fd610523 Feat: add helm chart doc and make command (#3331)
* Feat: add helm chart doc and make command

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix makefile and add generate helm doc in release ci

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-02-28 10:03:23 +08:00
Wei (段少)
4a58af76cf Update: Nominee Wei as a maintainer (#3326) 2022-02-24 14:52:52 +08:00
StevenLeiZhang
b54ddf4c1c Fix: The order of status displayed by vela ls is not correct (#3302)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-02-23 14:50:04 +08:00
wyike
ca486be4eb Fix: addon store&show complicated parameter (#3310)
* fix

fix complicate args storage

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* wrap logic in func and add mock test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

solve confict

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix
2022-02-23 14:35:18 +08:00
barnettZQG
13b1e85442 Feat: add style and immutable parameters for uischema (#3309)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-23 14:23:07 +08:00
wyike
16414a0d9f Feat: addon support version check (#3304)
* addon support version check

add more tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* add kubernetes tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* add more tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* reorgnize the check logic

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix addon error bug in apiserver

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix comments

fix test

* add err addon bcode

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix comments

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-02-23 12:17:31 +08:00
Somefive
7059c8df79 Feat: rework cluster to align velaux and cli (#3299)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-02-22 15:48:22 +08:00
Jian.Li
fb831345f0 Fix: Let versioned controller uses a separate election locker in one cluster. (#3298)
* versioned leader election id

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* modify GenerateLeaderElectionID

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* add license header

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>
2022-02-21 19:54:49 +08:00
Tianxin Dong
170debf3ae Fix: change seldon service from istio to ambassador (#3278)
* Fix: change seldon service from istio to ambassador

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix lint

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* get service name form sdep

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-02-20 13:06:24 +08:00
wyike
015f3cf72b Feat: vela can set default namespace and user can enable fluxcd addon by default (#3280)
* vela default namespace and enable addon by default

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix lint

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix cli error

fix comments

* add tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-02-18 17:23:50 +08:00
yangs
67e88ffbaf Fix(charts): the qps and brust of reconcile client configurable (#3289)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-02-18 16:27:37 +08:00
Zheng Xi Zhou
37a523cbf7 Fix: not steady unit test (#3293)
The UT `TestGetOpenAPISchemaFromTerraformComponentDefinition` won't
succeed 100%. The required variables in the generated isn't in the expected
order all the time.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-02-18 15:15:10 +08:00
Jianbo Sun
42837ef162 Fix: make e2e CI more stable in vela show case (#3292)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-02-18 15:06:28 +08:00
Nash Tsai
1e022999a8 Refactor: refactor Helm chart with unnecessary 'systemDefinitionNames` value (#3267)
* refactor: refactor Helm chart with unnecessary 'systemDefinitionNamespace' value

* Revert "refactor: refactor Helm chart with unnecessary 'systemDefinitionNamespace' value"

This reverts commit 2ae764737f.

* Fix: Helm chart's 'Values.systemDefinitionNamespace' have default value of '.Release.Namespace' if unspecified.

* fix: fixed vela cli  referenced '{{.Values.systemDefinitionNamespace}}'

Co-authored-by: yungcheng.tyc <yungcheng.tyc@alibaba-inc.com>
2022-02-18 14:05:38 +08:00
Rui Jiang
8a1d0107b9 concurrent reconciles configurable (#3285)
Signed-off-by: jrkeen <jrkeen@hotmail.com>
2022-02-18 11:05:00 +08:00
Jianbo Sun
d3500b6d7c Chore: remove useless controller args to avoid confusion (#3284)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-02-17 19:13:40 +08:00
朱晓兵
debd9f2b40 Feat: add api for app compare、reset、dryrun (#3136)
* Feat: add api for app compare or reset

Signed-off-by: zxbyoyoyo <596908030@qq.com>

* Fix: fix lint

Signed-off-by: zxbyoyoyo <596908030@qq.com>

* Fix: fix lint

Signed-off-by: zxbyoyoyo <596908030@qq.com>

* Fix: fix imports

Signed-off-by: zxbyoyoyo <596908030@qq.com>
2022-02-17 13:58:48 +08:00
Zheng Xi Zhou
8eaa438631 Feat: add @wangwang as one Reviewer (#3268)
https://github.com/oam-dev/kubevela/issues/3261

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-02-16 19:46:24 +08:00
StevenLeiZhang
7102d7ad20 Fix: vela status api can not return customized arguments of addon (#3275)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-02-16 19:23:51 +08:00
Tianxin Dong
7b42515818 Fix: add DisableUpdateAnnotation for addon (#3260)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-02-16 15:27:22 +08:00
Tianxin Dong
7ee4b14a88 Feat: add seldon virtual service support in endpoints (#3259)
* Feat: add seldon virtual service support in endpoints

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-02-16 14:25:34 +08:00
barnettZQG
3d0b9b7c71 Feat: rollout controller is disabled by default (#3250)
* Feat: rollout controller is disabled by default

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: change rollout image pull policy

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: remove controller from the rollout addon in testdata

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: rollout controller is disabled by default

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: extended waiting time for the addon mock server

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-16 14:25:04 +08:00
Kunshuai Zhu
4bae08c2e2 Fix: Optimize error msg of addon enable/upgrade local path (#3222)
* Optimize error msg of addon enable/upgrade local path

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Fix and add unit test

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Run make reviewable to include all changes

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* remove test case for windows

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* fix unit test.

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>
2022-02-16 14:20:37 +08:00
Zheng Xi Zhou
46fce3262e Fix: properties table of cloud resource doc is broken (#3256)
If one column of a table contianers multiple line of a json
struct, it will break the table.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-02-16 11:03:11 +08:00
Zheng Xi Zhou
46967daf11 Fix: fixed required items for a Terraform ComponentDefinition (#3257)
If a Terraform variable is required, the item in OpenAPI schema
is required.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-02-15 18:53:40 +08:00
Wei (段少)
2fd8b7bc52 Feat: update owners_aliases (#3246)
* Update: ownerer-aliases

* Fix: keep up bootstrap-contributors

* Fix: reformat

* Fix: inherit all the maintainers from who maintain controller
2022-02-15 15:59:40 +08:00
Wei (段少)
a9e511d3a8 Feat: update logo to .svg (#3254) 2022-02-15 15:29:09 +08:00
Wei (段少)
37fb45bab8 Feat: update community.md (#3248) 2022-02-14 18:41:19 +08:00
barnettZQG
4a29776e8e Fix: registry don't have enough info to build a reader (#3237)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-14 18:04:34 +08:00
yangs
65522cabdb Fix: fix panic when user disable create apprevision (#3244)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-02-14 17:54:41 +08:00
Avery
d145487b96 Add cli support for provider gcp and baidu. (#3242)
Signed-off-by: Nicola115 <2225992901@qq.com>
2022-02-14 16:40:18 +08:00
wyike
7523576905 Feat: support complicated addon parameter (#3232)
* support complicated addon parameter

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix: go mod tidy

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-02-14 14:02:16 +08:00
barnettZQG
5b356af7dc Fix: can not collector pod list with rollout trait (#3225)
* Fix: can not collector pod list with rollout trait

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: cue format error

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: default values and optional parameters cannot coexist

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-14 13:05:01 +08:00
wangcanfengxs
72a434134a Fix: remove duplicative route in application webservice. (#3236)
Signed-off-by: wangcanfeng <wangcanfeng@corp.netease.com>

Co-authored-by: wangcanfeng <wangcanfeng@corp.netease.com>
2022-02-14 13:03:58 +08:00
barnettZQG
5ab9f0986e Feat: remove the duplicate command (#3228)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-14 10:35:31 +08:00
barnettZQG
9fe9f98e30 Fix: apply crd error that the annotations too lang (#3231)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-14 10:33:50 +08:00
barnettZQG
fee4a3f2b8 Fix: the definition namespace is empty (#3227)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-11 19:56:29 +08:00
Shaw Ho
f0cbe816a6 Fix: ControllerRevision typo (#3214)
Signed-off-by: Xiaoxi He <xxhe@alauda.io>
2022-02-10 15:43:11 +08:00
Somefive
d7261cd965 Fix: disable cochange for apprev when def changes (#3217)
* Fix: disable cochange for apprev when def changes

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-02-10 11:40:46 +08:00
barnettZQG
17794e4ce1 Fix: upgrade package github.com/docker/cli for CVE-2021-41092 (#3216)
* Fix: upgrade package github.com/docker/cli for CVE-2021-41092

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Chore: change go version to 1.17

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Chore: change go mod

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: change install cue shell

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-09 19:18:40 +08:00
barnettZQG
15418a6523 Feat: the golang version upgrade to 1.7 (#3208)
* Feat: the golang version upgrade to 1.7

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: install expat lib

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-09 15:17:50 +08:00
barnettZQG
fa1409f974 Fix: fix flag conflict (#3211)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-09 15:17:04 +08:00
Jianbo Sun
3157e65d8a Feat: Add image scan for vela core (#3210)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-02-09 14:00:12 +08:00
barnettZQG
f6eea78ec8 Feat: support install and uninstall vela core (#3181)
* Feat: support install and uninstall vela core

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: support upgrade crd

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: support set reuse args

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: apply CRD before install or upgrade

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-09 11:48:38 +08:00
Zheng Xi Zhou
24f147a72c Fix: support more Terraform variable types (#3204)
Support Any, set and some complicated variable types

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-02-08 18:48:38 +08:00
Jianbo Sun
7395994bdd Feat: add componentName in context for traitDefinition (#3200)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-02-08 16:26:16 +08:00
yangs
91125c6fec Feat: dispatch manifests in concurrent (#3060)
* Feat: dispatch manifests in concurrent

Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

* Fix: merge workflow pkg convert to pkg util

Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-02-08 16:25:57 +08:00
Jianbo Sun
0d8a9fc0de Chore: remove hack/website as docs moved to kubevela.io repo (#3197)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-02-08 16:24:26 +08:00
Jian.Li
68ada429f0 Feat: application support controller requirement (#3192)
* application controller version control

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* modify command arg name

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>
2022-02-08 15:44:38 +08:00
Zheng Xi Zhou
2c41ee9c3c Fix: add unit test for getting Terraform Configuration from remote git (#3193)
Add another unit test when the configuration of Terraform locates
in a subpath of a git remote repository

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-02-08 10:16:13 +08:00
Chazza
53198a9d9d Add nodeselector to jobs (#2811)
Signed-off-by: Chazza <github@whalecoiner.com>

Co-authored-by: Chazza <charlie@whalecoiner.com>
2022-02-08 09:36:51 +08:00
Somefive
7e102d70e0 Fix: error msg in webhook too complicated to read (#3169)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-01-27 16:09:23 +08:00
Jianbo Sun
ce25bd9985 Chore: add changelog of v1.2.x (#3167)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-26 11:23:01 +08:00
Oliver Otte
225b59156f Fix: Use systemDefinitionNamespace core Helm Chart (#3163)
Use value in Addon Registry CM and the Test Application

Signed-off-by: Oliver Otte <otte@gonicus.de>
2022-01-25 19:16:38 +08:00
Jianbo Sun
a73a4c64c2 Fix: krew install template of kubectl-vela.exe (#3162)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-25 18:46:05 +08:00
Tianxin Dong
614472b95a Feat: support vela show for workflow step definition (#3140)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-01-25 15:03:38 +08:00
zeed-w-beez
8b350a7258 Fix: add context parameters into the error message (#3145)
Signed-off-by: zeed-w-beez <zeed.w.zhao@gmail.com>
2022-01-25 13:27:26 +08:00
wyike
8d13c3c7bc fix: vela addnon enable cannot support = (#3156)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-01-25 13:22:45 +08:00
wyike
2da60419fc Feat: addon parameter support ui-shcema (#3154)
* Feat: addon parameter support ui-shcema

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix ci

* add more tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-01-25 10:43:38 +08:00
Zheng Xi Zhou
7895560675 Fix: retrieve Terraform variables from variables.tf (#3149)
* Fix: retrieve Terraform variables from variables.tf

If Terraform modules/resources are stored in remote git repos, get
variables from file `varialbes.tf`, or from `main.tf`.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-24 11:52:07 +08:00
Zheng Xi Zhou
75dc45ced6 Fix: add providerRef in generated ComponentDefinition (#3142)
If the provider is not provider, append the providerRef section in
the generated ComponentDefinition

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-24 10:27:37 +08:00
Sunghoon Kang
665e2b6340 Feat: extend gateway trait to set class in spec (#3138)
* Feat: extend gateway trait to set class in spec

`kubernetes.io/ingress.class` annotation is deprecated in favor of
`.spec.ingressClassName`. However, there is no way to set it through
the gateway trait for now.

This commit extends the gateway trait by adding `classInSpec` to
parameter. Forcing the use of `.spec.ingressClassName` makes sense, but
some ingress controllers (including old versions) may not recognize
this field. Therefore, set default value of `classInSpec` to `false`
for backward compatibility.

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Chore: update classInSpec usage

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>
2022-01-23 10:11:47 +08:00
Tianxin Dong
cb7bc0e7f4 Fix: handle workflow cache reconcile (#3128)
* Fix: handle workflow cache reconcile

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix return and move backoff to memory

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* handle failed to patch case

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* add store in err case

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* make reviewable

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* do cleanup in ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-01-22 15:54:17 +08:00
Sunghoon Kang
4ad8913bbd Fix: prioritize namespace flag for vela up (#3135)
* Fix: prioritize namespace flag for `vela up`

Currently, CLI applies application to `default` namespace when there is
no explicit namespace in application spec, even if the namespace flag
is set.

This commit fixes issue by overriding the namespace if the namespace
flag is set.

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Test: add test cases for overriding namespaces

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>
2022-01-21 10:22:25 +08:00
Zheng Xi Zhou
947455adb9 Fix: support generate Terraform ComponentDefinition from local HCL file (#3132)
Besides generating a Terraform ComponentDefinition from a remote git repo,
support generate one from local HCL file

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-20 14:15:22 +08:00
Jian.Li
354e92cfbd Fix: workflow skip executing all steps occasionally (#3025)
* fix asi

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* fix lint

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* add trace tag

* add args for this feature

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* enable-asi-compatibility

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>
2022-01-19 16:07:19 +08:00
StevenLeiZhang
7bdd3dd6e8 add imagePullSecrets for helm templates to support private docker registry (#3122)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-01-19 12:59:21 +08:00
Tianxin Dong
408c893cff Feat: add port name in webservice (#3110)
* Feat: add port name in webservice

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix port name in container

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* generate port name if not specified

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-01-18 18:59:48 +08:00
Zheng Xi Zhou
dd9ec2325a Fix: add app samples for Terraform definition (#3118)
Added application samples for all Terraform typed ComponentDefinition,
and also localize the title for AWS and AZure

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-18 18:08:30 +08:00
chwetion
951506b79b fix revision will change when add new trait with skiprevisionaffect to application (#3032)
Signed-off-by: chwetion <chwetion@foxmail.com>

Co-authored-by: chwetion <chwetion@foxmail.com>
2022-01-18 13:40:30 +08:00
Somefive
14b1354a68 Feat: support wild match for env patch (#3111)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-01-18 12:58:50 +08:00
qiaozp
bd2e574007 Fix: trait/comp command output without a new line (#3112)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-01-18 12:46:59 +08:00
chwetion
438a9fe7a5 Feat: add JFrog webhook trigger (#3104)
* add jfrog webhook to update application image

Signed-off-by: chwetion <chwetion@foxmail.com>

* edit jfrog default request header

Signed-off-by: chwetion <chwetion@foxmail.com>

Co-authored-by: chwetion <chwetion@foxmail.com>
2022-01-18 10:25:28 +08:00
Somefive
12f392cd92 Fix: rollout workload namespace not aligned with rollout (#3107)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-01-17 20:06:27 +08:00
StevenLeiZhang
af27e6a776 ignore vela-system, which is specified in needNamespace for addon metadata information (#3109)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-01-17 20:02:05 +08:00
StevenLeiZhang
f57815a5bf ignore files under the addon path of github addon registry (#3099)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-01-17 20:01:46 +08:00
Somefive
69527b257c Feat: support external revision in patch component (#3106)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-01-17 19:29:28 +08:00
barnettZQG
d88d4d8eca Fix: clear old data in mongodb unit test case (#3103)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-17 19:06:29 +08:00
Zheng Xi Zhou
4e881b44af Fix: support generate cloud resource docs in Chinese (#3079)
* Fix: support generate cloud resource docs in Chinese

`vela def doc-gen` will also generate Chinese cloud resource docs

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Continue the development

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* add ut

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* add ut and fix linting issue

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Address comments

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Fix `Should not use dot imports. (ST1001) ` issue

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* add copyright

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-17 16:18:59 +08:00
wyike
800b50cf0b fix acr image no version (#3100)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-01-17 16:09:21 +08:00
Jianbo Sun
3d9e1c7d80 Fix: use personel token of vela-bot instead of github token for homebrew update (#3096)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-17 11:45:01 +08:00
barnettZQG
fccc5df25e Fix: can't query data from the MongoDB (#3095)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-17 11:25:09 +08:00
yangsoon
6cee468743 Feat: add more performance optimization and prometheus metrics for controller (#3086)
* Feat: add more prometheus metrics

Signed-off-by: yangsoon <yangsoonlx@gmail.com>

* Feat: add detail gc rt duration metrics

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add monitor to client

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add all cache object

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Fix: watch job

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add deleg client

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add optimize for rt list and disable controllerrevision

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add apprev disable optimize

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Fix: optimize log

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add time recorder for app ctrl

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add in-memory workflow context

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add reconcile-reduction & random-pick-gc & optimize rt record

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add optimize for healthcheck & resourcetracker trigger

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: refactor

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: record the resource-tracker number by informer event-handler

Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

* Feat: add promethus collect annotation in template

Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

* Fix: command line comment bug

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: rename args and remove legacy controller metrics

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: make code reviewable

Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

* Chore: optimize flag descriptions

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: break optimize package

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: gc policy test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Co-authored-by: Yin Da <yd219913@alibaba-inc.com>
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-01-14 15:18:02 +08:00
wyike
102a155194 fix lost create time and spell error (#3089)
Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-14 15:10:56 +08:00
wyike
f39a3fb792 Feat: system information collection logic in apiserver (#3082)
* Feat: userInfoCollection

Signed-off-by: wangyike <wangyike_wyk@163.com>

* Signed-off-by: wangyike <wangyike_wyk@163.com>

change enable/disable to update interface

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-14 10:16:31 +08:00
Somefive
8b5d7ed395 Feat: reset re-sync time (#3008)
* Feat: set resync

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: rename re-sync period

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: refactor return value

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-01-13 20:12:54 +08:00
wyike
5b1c47c918 cue template health check skipStandard workload and fix test diverge (#3087)
Signed-off-by: wangyike <wangyike_wyk@163.com>

add annotation

Signed-off-by: wangyike <wangyike_wyk@163.com>

set skipStandardworkload in wl

Signed-off-by: wangyike <wangyike_wyk@163.com>

add annotation

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-13 19:08:43 +08:00
Jianbo Sun
c298c98f25 Fix: vela logs for namespace get from CLI and add container name args (#3084)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-12 21:22:42 +08:00
Jianbo Sun
7f7a9dcac0 Feat: vela up support read from stdin && refine CLI output && fix vela addon command (#3080)
* Feat: vela up support read from stdin

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: addon name missed in output and fix test

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Chore: refine CLI output

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Fix: add retry-on conflict on CLI

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-12 17:43:08 +08:00
barnettZQG
b4732ed275 Feat: add cluster name in service endpoint (#3076)
* Feat: add cluster name in service endpoint

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add cli unit test

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-12 14:44:22 +08:00
chwetion
bfbdb85503 Feat: add DockerHub webhook trigger (#3081)
* add dockerhub webhook to update application image

Signed-off-by: chwetion <chwetion@foxmail.com>

* fix e2e webhook response return value

Signed-off-by: chwetion <chwetion@foxmail.com>

* add e2e for dockerhub webhook

Signed-off-by: chwetion <chwetion@foxmail.com>

Co-authored-by: chwetion <chwetion@foxmail.com>
2022-01-12 11:37:06 +08:00
Zheng Xi Zhou
f41e0a3bb5 Fix: change vela def gen-doc to vela def doc-gen (#3078)
* Fix: change `vela def gen-doc` to `vela def doc-gen`

Address the comments to change the command line name

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix CI

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2022-01-12 11:35:41 +08:00
Jianbo Sun
19a542ff11 Feat: support vela up from remote url file (#3075)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-11 17:28:45 +08:00
wyike
d64c78db47 Feat: addon enable support local dir for install offline (#3066)
* local reader

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix lint

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix comments and add test

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-11 11:29:10 +08:00
Kingram
ceb95229cd Feat: add Harbor webhook trigger (#3065)
* Feat: add harbor webhook trigger (#3029)

Signed-off-by: kingram <kingram@163.com>

* resolve comments

Signed-off-by: kingram <kingram@163.com>

* fix: add comments

Signed-off-by: kingram <kingram@163.com>
2022-01-10 21:26:43 +08:00
barnettZQG
ece47b5961 Fix: change namespace for the service-endpoints-view velaQL (#3071)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-10 21:25:07 +08:00
Basuotian
8be11a7e7e Feat: Add Lark support for notification (#3053) (#3059)
Signed-off-by: Shuai Tian <tians1@xiaopeng.com>

Co-authored-by: Shuai Tian <tians1@xiaopeng.com>
2022-01-10 19:42:06 +08:00
Zheng Xi Zhou
b354d2faa9 Fix: generate Terraform ComponentDefinition by vela cli (#3067)
* Fix: generate Terraform ComponentDefinition by vela cli

Support generate Terraform typed ComponentDefinition by `vela def init`

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-10 19:12:32 +08:00
Jianbo Sun
3af323365b Chore: refine CLI help message and docs (#3068)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-10 17:45:20 +08:00
Jianbo Sun
6a512c02a6 Chore: add autogen CLI reference doc script (#3063)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-10 15:28:04 +08:00
Minglong Song
b30ca0c8a2 Fix: Do not fiter event triggered by resync for application controller (#3064)
Signed-off-by: songminglong <1247768069@qq.com>
2022-01-10 14:48:58 +08:00
Zheng Xi Zhou
1a50dd76b5 Fix: generate docs for Terraform ComponentDefinition (#3051)
* Fix: generate docs for Terraform ComponentDefinition

Generated kubevela.io docs for Terraform typed ComponentDefinition
with `vela def gen-doc xxx` cli.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Refactor code

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* add ut

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* add ut

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* refine cloud resource title

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-10 14:08:48 +08:00
Zheng Xi Zhou
b17abe0081 Fix: add cue binary requirement in Development doc (#3062)
* Fix: add cue binary requirement in Development doc

If the version of cue binary is less than v0.3.0, like v0.2.0, `make reviewable`
will fail due to issue: "make: *** [fmt] Error 1". As `make reviewable` is a
required step for code contribution, add this prerequiste in the doc.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update contribute/developer-guide.md

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2022-01-10 13:01:46 +08:00
Jianbo Sun
12a106fcfe Fix: migrate test from crd v1beta1 to v1 (#3061)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-10 10:25:35 +08:00
barnettZQG
53d3ff6915 Fix: security alerts (#3058)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-07 16:27:23 +08:00
barnettZQG
d4762e09cd Feat: support query endpoints in status command and speed up CLI response (#3052)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-07 15:49:27 +08:00
Tianxin Dong
578aae6482 Fix: fix component definition status message (#3054)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-01-06 23:12:29 +08:00
Zheng Xi Zhou
96485ea0db Fix: when a provider is set in ComponentDefinition, it should look for the provider (#3047)
* Fix: when a provider is set in ComponentDefinition, it should look for the provider

Fixed the issue "The error message is not correct when AWS provider is not available"

Fix #3046

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-06 19:02:03 +08:00
Tianxin Dong
251c440453 Feat: add ACR webhook trigger (#3044)
* Feat: add ACR webhook trigger

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* resolve comments

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* change to interface

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix payload types

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-01-06 17:31:02 +08:00
wyike
770894412a Chore: deprecate appDeployment related logic (#3050)
* deperecated appDeployment

Signed-off-by: wangyike <wangyike_wyk@163.com>

* delete more code

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-06 16:24:09 +08:00
Tianxin Dong
4d6c0eb9d5 Fix: reset step status to stopped if the workflow is terminated (#3049)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-01-06 15:15:28 +08:00
wyike
53081d043b Chore: deprecate and delete approllout related code (#3040)
* Fex: delete useles approllout related code

Signed-off-by: wangyike <wangyike_wyk@163.com>

fix failed test

Signed-off-by: wangyike <wangyike_wyk@163.com>

Fix: failed e2e test

Signed-off-by: wangyike <wangyike_wyk@163.com>

fix-test

Signed-off-by: wangyike <wangyike_wyk@163.com>

fix test

Signed-off-by: wangyike <wangyike_wyk@163.com>

fix e2e-test

Signed-off-by: wangyike <wangyike_wyk@163.com>

fix e2e rollout test

Signed-off-by: wangyike <wangyike_wyk@163.com>

* delete useless test code

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix failed unit-test

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-06 14:33:11 +08:00
Jianbo Sun
8495465087 Refactor: refine cli commands && align kubectl-vela with vela && use getnamespaceAndEnv for all (#3048)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-06 13:29:02 +08:00
qiaozp
5f31b9aad0 Feat: add test for registry name in addon response (#2858)
* add test for registry name when list addon

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* revert

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-01-06 11:48:34 +08:00
barnettZQG
9f2e43756e Feat: support query service endpoints by velaql (#3036)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-06 00:35:46 +08:00
Zheng Xi Zhou
8033279751 Fix: Generate doc for Terraform typed ComponentDefinition (#3041)
* Fix: Generate doc for Terraform typed ComponentDefinition

When the configuration of a Terraform Typed ComponentDefinition is in
remote Git, generate the properties for it. And generated outputs for
all Terraform ComponentDefinition

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-05 19:45:30 +08:00
chwetion
070b313897 Feat: support application trigger deletion (#3037)
* support application trigger deletion

Signed-off-by: chwetion <chwetion@foxmail.com>

* add unit test for deleting application trigger

Signed-off-by: chwetion <chwetion@foxmail.com>

Co-authored-by: chwetion <chwetion@foxmail.com>
2022-01-05 14:25:24 +08:00
wyike
c170cecd34 fix addon panic bug (#3026)
Signed-off-by: wangyike <wangyike_wyk@163.com>

Fix lint

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-05 13:40:51 +08:00
Somefive
acac0554f3 Fix: filter managedfields update events (#3043)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2022-01-05 13:30:58 +08:00
wyike
1bceea29be Fix: helm addon demo issues (#3033)
* helm-port-forward

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix several issues

Signed-off-by: wangyike <wangyike_wyk@163.com>

* Fix comments

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-04 15:57:57 +08:00
Jianbo Sun
3066cde46b Fix: fix vela show --web that can not show elems (#3039)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-04 15:57:24 +08:00
Jianbo Sun
15be6bc388 Fix: check error when client not created (#3038)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-04 14:52:35 +08:00
qiaozp
ac6b125b7f Fix: error case is not tested when generate api schema (#3035)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-01-04 11:14:57 +08:00
Zheng Xi Zhou
24c00fc99b Fix: don't skip health check for observability in single cluster (#3031)
* Fix: don't skip health check for observability in single cluster

When there is no clusters, users use cli to enable observability,
we use workflow `apply-application-in-parallel` to enable the addon.
This workflow will skip health check and the addon won't become ready.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Fix CI issue

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-04 11:13:09 +08:00
barnettZQG
f468814371 Feat: add uischema manage command (#3021)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-30 14:38:00 +08:00
barnettZQG
a1b1d4a6f8 Fix: trigger webbook bug (#3024)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-30 14:37:40 +08:00
Tianxin Dong
82453b45f5 Fix: fix webhook definition (#3022)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-30 10:11:19 +08:00
Tianxin Dong
72a00b57e6 Feat: add webhook token in application (#2970)
* Feat: add webhook token in application

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* resolve comments

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: change update cm to commit context

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* refactor the code

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix json merge

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* add create and update time

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-30 10:10:34 +08:00
Jamie
ff4b10f0ee Fix: op.#Task couldn't work, debug task.cue and fix bugs (#3005)
Signed-off-by: yunjiazhong <yunjiazhong@tencent.com>

Co-authored-by: yunjiazhong <yunjiazhong@tencent.com>
2021-12-29 19:26:27 +08:00
Somefive
746eb0dbe4 Feat: support logs for velaql (#3011)
* Feat: support logs for velaql

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: extend parameter

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-28 20:49:56 +08:00
Somefive
a33d1e488a Feat: gc process ignore cluster not exists (#3007)
* Feat: gc process ignore cluster not exists

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: gc process ignore cluster not exists

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-28 13:12:23 +08:00
Somefive
0d6173c1ca Fix: pending deprecated test (#3009)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-28 13:12:09 +08:00
barnettZQG
00a80b9ecb Feat: add request logging for the apiserver (#3012)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-28 11:41:53 +08:00
barnettZQG
8284581e0c Feat: set GOPROXY build arg (#3004)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-28 10:26:07 +08:00
Tianxin Dong
8a5759949a Fix: fix notfication properties for schema (#3006) 2021-12-27 20:00:26 +08:00
Zheng Xi Zhou
820db96eae Fix: change Grafana service type and remove domain parameter (#2996)
* Fix: change Grafana service type and remove domain parameter

Use Grafana service's external IP to visit the dashboard and
remove the prameter domain

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* address CI issues

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix api issue

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix ci

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix ci

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-12-26 20:38:19 +08:00
barnettZQG
4d69027300 Feat: check target where create and update env (#3003)
* Feat: check target where create and update env

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: list applications by env

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-25 14:20:36 +08:00
wyike
5210800cac Fix: add registryName into addon list (#2993)
* Fix: add registryName into addon list

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix congig map

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix several comments

Signed-off-by: wangyike <wangyike_wyk@163.com>

* small fix

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-25 12:37:23 +08:00
wyike
66881c13d3 Fix: more app info in addon status (#3000)
Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-25 11:01:59 +08:00
Jianbo Sun
5648c56cf5 Refactor: align velaux env and CLI env, they both use K8s namespace as (#2975)
* Refactor: use createOrUpdateNamespace as a common util function

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Feat: add ENV webservice handelr

* Fix: fix Env usecase logic

* Feat: Add Delete Env API

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: filter empty addon data

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Feat: split makefiels and make it clear

* Feat: add k8s utils test

* Feat: Add env update interface

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Feat: change env implementation

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: minor fix

* Revert "Fix: minor fix"

This reverts commit 9cafefa65a.

* Fix: use appusecase as parameter

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Refactor: align CLI vela env with new env design

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: minor fix

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Feat: add page index and alias of env

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: fix tests and licence header

* Fix: fix makefile and add default target

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: update build swagger.json

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: change update env api

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: list env with alias

* Feat: add log to env delete

* Fix: can not get app status

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: support update workflow and refactor code

* Fix: lint

* Fix: remove swagger check

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: fix cli vela delete

* Fix: update test

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: update test

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: app deploy unit test case

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: SortOrderDescending is not effective

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: e2e test case

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: support default project/target/env

* Fix: make test and add swagger

* Fix: use separated datasource for unit test

* Fix: app rollback bug

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: fix e2e test

* Fix: kubeapi driver sort bug

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: e2e test

* Fix: api e2e test

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: e2e test fix

* Fix: try fix e2e test

* Fix: api e2e test

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-25 10:36:54 +08:00
Min Kim
27252f32de idempotent conditional apiservice deletion (#2997)
Signed-off-by: yue9944882 <291271447@qq.com>
2021-12-24 18:36:21 +08:00
Somefive
775faee96f Chore: add welcome logo in helm install notes (#2994)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-24 16:15:28 +08:00
qiaozp
e818921a87 Fix: return reasonable error make multi-registry work (#2995)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-24 16:06:07 +08:00
wyike
551992e8f2 fix panic bug of addon enable (#2985)
Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-24 11:12:26 +08:00
wyike
e519c6142a Chore: delete useless test (#2984)
* delete useless test

Signed-off-by: wangyike <wangyike_wyk@163.com>

* delete healthscope related test

Signed-off-by: wangyike <wangyike_wyk@163.com>

* small fix

Signed-off-by: wangyike <wangyike_wyk@163.com>

* remove useless report

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-23 18:13:00 +08:00
wyike
3198693ad7 Fix: cli addon registry style small fix (#2980)
* small fix

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix comments

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-23 14:37:22 +08:00
Tianxin Dong
88aa6c0e83 Fix: change update cm to commit context (#2979)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-23 11:45:56 +08:00
Zheng Xi Zhou
8b82a79d1d Fix: vela port-forward supports Addon Observability (#2977)
* Fix: vela port-forward supports Addon Observability

Support port forwarding service of Addon Observability in
multiple clusters

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix CI issues

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-12-22 21:08:00 +08:00
wyike
14a57fc656 vela cli support oss path and cli upgrade an addon (#2976)
Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-22 19:31:20 +08:00
Zheng Xi Zhou
d7ee46134d Fix: lowercase the key name in API response (#2978) 2021-12-22 18:14:34 +08:00
Jian.Li
6e5e26c19d fix message invalid (#2968)
Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>
2021-12-22 12:47:27 +08:00
Zheng Xi Zhou
8750fc8fab Fix: implement addons/observability/status API (#2966)
* Fix: implement addons/observability/status API

Return all domains and the IPs from all clusters. And
provider the way to visit the console of observability

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* add unit tests

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-12-22 10:54:46 +08:00
qiaozp
7ed293e27e Fix: list addon will always return non-nil err (#2967)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-22 09:28:10 +08:00
Somefive
36ad77493c Fix: resource policy test flaky (#2969)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-22 09:27:21 +08:00
qiaozp
9317bb1cab Refactor: addon cache mechanism and code architecture (#2956)
* Refactor: fix addon cache and code

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* basic trim

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Fix list OSS bucket addon's meta

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* rename listAddonMeta func

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix enable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* rename and trim cache func call

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* remove same source code, use Registry to implement Source interface. Keep the compatibility of DeployTo fields.

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* complete github reader

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix read from github, fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* header

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* rename function, restore test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* try CI

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* sort out functions name. add detail test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* filter directory without metadata.yaml in oss

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add GitHub reader unit test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* clean up

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* header

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add cache arg

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* change field name

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* build swagger

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* some json tag, revert cache logic

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-12-21 09:31:37 +08:00
barnettZQG
2543b7b510 Fix: can not find target name in pod list (#2936)
* Fix: can not find target name in pod list

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: set create time for init trait

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-20 18:51:21 +08:00
qiaozp
7ef8cea7ce Chore: remove addons stored in configmap (#2951)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-20 17:21:03 +08:00
wyike
ae06ddacac Feat: addon compability code for 1.1 (#2961)
Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-20 14:34:45 +08:00
Somefive
db189f7527 Fix: optimize resourcetracker upgrade (#2959)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-20 13:05:53 +08:00
Tianxin Dong
9599e2da9d Docs: update some outdated content in workflow doc (#2962)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-20 11:35:22 +08:00
Tianxin Dong
6c4b7699b9 Fix: nit fix for workflow (#2957)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-20 11:00:07 +08:00
Tianxin Dong
add5d40bfc Feat: add init secret demo (#2955)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-18 14:31:18 +08:00
Somefive
2f7b20d8b8 Fix: amend fix for log sanitize (#2953)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-18 10:16:36 +08:00
Tianxin Dong
b85be11324 Feat: add workflow stability mechanism doc (#2960)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-18 10:11:38 +08:00
Zheng Xi Zhou
d11d171be8 Fix: enable Observability in runtime clusters (#2886)
* Fix: enable Observability in runtime clusters

Enabled add-on observability in runtime clusters. In each cluster, a sub-domain
will be allocated to the cluste

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>


* Fix:add workflow step definition and ut

Added a new workflow step definition `apply-application-in-parallel`,
and added more unit tests
2021-12-17 23:04:54 +08:00
Somefive
cb0e88d590 Fix: nil pointer aliyun sdk (#2954)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-17 15:15:23 +08:00
Tianxin Dong
f0d95c566f Fix: fix notification definition to show better (#2952)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-17 01:09:56 +08:00
Somefive
0a2a41046c Fix: ack dashboard url (#2932)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-16 21:25:43 +08:00
yangsoon
b57db36dd3 Fix: velaql compatible with v1.2.0-beta version (#2946)
Signed-off-by: yangsoon <yangsoonlx@gmail.com>
2021-12-16 21:15:07 +08:00
Tianxin Dong
f5e04a5575 Fix: fix apiserver snake case (#2944)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-16 21:14:25 +08:00
Somefive
4e91e3ab8d Fix: workflow step definition for ui (#2948)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-16 21:10:09 +08:00
Somefive
478d134778 Feat: upgrade cluster-gateway (#2941)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-16 21:06:02 +08:00
Somefive
5f2085b470 Feat: support parallel apply in deploy2env (#2938)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-16 21:05:23 +08:00
Somefive
416fc45999 Fix: security alert (#2945)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-16 21:03:54 +08:00
Jian.Li
133a89be3f Fix: deprecate CRD discovery for CUE import in Definition to prevent memory leak and OOM crash (#2925)
* Pause test case

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* fix lint

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* diable discover the open api of the CRD

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* fix definition test cases

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>
2021-12-16 17:53:15 +08:00
yangsoon
3b1f097807 Fix: change catlog helm repo path to https://charts.kubevela.net/example (#2942)
Signed-off-by: yangsoon <yangsoonlx@gmail.com>
2021-12-16 15:17:00 +08:00
wyike
e49dec5a3a Feat(cli): app status more info (#2937)
* Feat(cli): app status more info

Signed-off-by: wangyike <wangyike_wyk@163.com>

* more info

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix: delete invisible check

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-16 11:12:06 +08:00
Somefive
f15d748251 Feat: add cluster alias to dt (#2929)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-15 16:33:45 +08:00
barnettZQG
e17f6b931a Feat: support specified existing namespace while creating a project (#2931)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-15 14:42:18 +08:00
Somefive
a3bf61fa4f Feat: set multicluster enabled by default (#2930)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-15 12:11:28 +08:00
Tianxin Dong
655c2615e1 Feat: add workflow reconciling backoff time and failed limit times (#2881)
* Feat: add workflow failed after retries

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: add workflow reconcile backoff time

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix lint

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* make reviewable

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* resolve some comments

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* add tests

* fix rebase

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix status

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix requeue time interval

* resolve comments

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* change time to pointer

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix pointer test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* change time to cm

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* resolve comments and add e2e test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-15 11:33:33 +08:00
Somefive
4dc213469a Feat: add compatibility code for new rt (#2920)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-14 21:27:47 +08:00
yangsoon
03d79db919 Fix: fix sync-api CI (#2923)
Signed-off-by: yangsoon <yangsoonlx@gmail.com>
2021-12-14 17:25:24 +08:00
qiaozp
0fc65eb787 Feat: add mock server (#2911)
* add mock server

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* use mock server

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* complate terraform-alibaba addon

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* move to test dir

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* complete terraform

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add back oss

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* remove useless readme

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-14 14:52:10 +08:00
yangsoon
6d536a84d7 Feat: refactor velaql provider with new ResourceTracker architecture (#2915)
* Feat: refactor velaql with new ResourceTracker architecture

Signed-off-by: yangsoon <yangsoonlx@gmail.com>

* Feat: concurrently request the pod created by helm

Signed-off-by: yangsoon <yangsoonlx@gmail.com>
2021-12-14 13:09:40 +08:00
wyike
f5f5ff514f Feat: cli manage addon registry and apiserver addon status return app status info (#2910)
* Fix: cli add addon registry

add more detail info for addon workflow info

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix: set app status in addon status directly

Signed-off-by: wangyike <wangyike_wyk@163.com>

* add e2e test

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-13 19:47:32 +08:00
qiaozp
a67b7e90d0 Feat: add path argument to addon oss source (#2907)
* add path

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* pending test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* license

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* keep compatible

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-13 19:43:15 +08:00
Somefive
a89bb69a62 Fix: add design docs for ResourceTracker (#2909)
* Fix: enhance rt logic and add docs

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Fix: test conflict

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-13 19:41:42 +08:00
Min Kim
c5c664f316 pin ocm images version to v0.5.0 (#2900)
Signed-off-by: yue9944882 <291271447@qq.com>
2021-12-13 17:57:45 +08:00
qiaozp
53006b4137 Fix: move addon api to pkg/addon (#2905)
* move addon api to pkg/addon

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* license

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-13 17:47:53 +08:00
barnettZQG
f47ae0e498 Feat: support automatically creating scaler trait for webservice component (#2908)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-10 15:04:31 +08:00
Somefive
b622cbdb7f Feat: ResourceTracker new architecture (#2849)
* Feat: new rt

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Fix: add publish version

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-10 15:00:03 +08:00
qiaozp
94f32a317d Feat: support addon definition in cue format (#2896)
* move def func to pkg

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* split def schema render

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* render CUE definition

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-09 20:31:19 +08:00
Min Kim
b483840987 honor existing cluster-gateway installation if exists (#2904)
Signed-off-by: yue9944882 <291271447@qq.com>
2021-12-09 15:59:16 +08:00
Jian.Li
3e81fdf008 remove InsecureSkipVerify (#2903)
Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>
2021-12-09 09:20:49 +08:00
barnettZQG
ad4b44696a Feat: add the project api (#2899)
* Feat: add the project api

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: fix e2e test bug

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-08 19:08:35 +08:00
barnettZQG
1563c582bc Feat: support additional properties parameter (#2880)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-08 17:46:45 +08:00
Jian.Li
3f2e76c75a Feat: HTTP Provider requires adding certificate chain from secret (#2771)
* http support load tls certs

* fix: TLS MinVersion too low
2021-12-08 11:39:04 +08:00
wyike
f7ebbf4fa0 Fix: create vela namespace (#2893)
Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-08 09:12:37 +08:00
Somefive
330c3e269c Fix: kubeconfig tmp file security (#2894)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-08 09:12:07 +08:00
Snyk bot
41e6a895a1 fix: hack/website/Dockerfile to reduce vulnerabilities (#2857)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-DEBIAN9-CURL-1585151
- https://snyk.io/vuln/SNYK-DEBIAN9-GLIBC-356851
- https://snyk.io/vuln/SNYK-DEBIAN9-GLIBC-356851
- https://snyk.io/vuln/SNYK-DEBIAN9-GLIBC-356851
- https://snyk.io/vuln/SNYK-DEBIAN9-GLIBC-356851

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-12-07 18:07:19 +08:00
Jianbo Sun
e8f2b79721 Fix: use specific cli release download folder (#2889)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-12-07 17:53:04 +08:00
qiaozp
2947da2611 Fix: OSS read data race (#2875)
* Fix: read oss addon prefix bug

This bug is about list OSS bucket by prefix which will cause confusion between `terraform` and `terraform-alibaba`

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix data race

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix channel block

add test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-07 16:17:11 +08:00
Tianxin Dong
4b07f1d000 Feat: support generate definition schema from terraform remote (#2860) 2021-12-07 15:50:04 +08:00
wyike
99757814ab Feat: algin addon cli and apiserver (#2867)
Feat: cli aligin with apiserver

Fix comments

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-07 15:11:52 +08:00
Jianbo Sun
ecd7f62f89 Chore: add more frequency on CI image clean job && delete rollout-test image (#2883)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-12-06 16:37:34 +08:00
qiaozp
a62724fbd7 Fix: addon timeout is not acturally tracked (#2863)
* Fix: addon timeout is not acturally tracked,  better addon enable fail message

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add namespace

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* change wording

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-06 12:33:52 +08:00
Tianxin Dong
33ffc00c2e Fix: fix webservice and worker def (#2865) 2021-12-06 11:21:41 +08:00
Zheng Xi Zhou
bf03c82bc7 Fix: support displaying logs for Terraform typed applications (#2879)
Refined the logic to display logs for Terraform typed applications,
and upated the namespace of the pod running Terraform jobs

Fix https://github.com/oam-dev/kubevela/issues/2670

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-12-03 18:31:30 +08:00
yangsoon
a528431d63 Feat: add trait service-account (#2878)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-12-03 18:24:50 +08:00
Jianbo Sun
fb5716cc13 Feat: add vela apiserver release into github workflow (#2877)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-12-03 17:01:50 +08:00
Min Kim
589480af62 idempotent cluster join: filter out the clusters not yet accepted (#2859)
Signed-off-by: yue9944882 <291271447@qq.com>
2021-12-03 14:17:38 +08:00
Jianbo Sun
b8640222c8 Fix: mark test chart image in a fixed tag to avoid changed by release action (#2873)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-12-03 13:05:28 +08:00
Tianxin Dong
56f300846c Fix: fix sync from status version instead of anno (#2870)
* Fix: fix workflow sort

* fix sync from status

* fix lint

* fix apply

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix lint

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-03 11:22:55 +08:00
qiaozp
95c2b8ce04 Fix: query addon status api 500 because of secret (#2866)
* Fix: query addon status api 500 because of secret

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Fix: enable addon failed because the file name of the cue template is used as the component name

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Fix: fix several oss read problem

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix lint

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* use oss test endpoint

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix ut

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-03 10:59:46 +08:00
Tianxin Dong
9b7286d6f5 Fix: fix workflow apserver sort and rollback status (#2862)
* Fix: fix workflow apiserver sort and rollback status

* fix ut
2021-12-02 20:04:53 +08:00
barnettZQG
27e1dd4a1b Fix: cloud resource type applications could not be identified (#2856)
* Fix: cloud resource type applications could not be identified

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: the cloud app properties can not set empty region value

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-02 17:11:50 +08:00
Zheng Xi Zhou
7d341c4bd3 Fix: pass on properties of Terraform typed application to Configuration (#2847)
* Fix: pass on properties of Terraform typed application to Configuration

Pass on properties like `writeConnectionSecretRef`, `Region` and `providerRef`
to Configuration.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* revert definitions

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-12-02 15:45:50 +08:00
Chwetion
59b458404e Feat: add deleting phase for apiserver application status model (#2854)
Signed-off-by: chwetion <chwetion@foxmail.com>

Co-authored-by: chwetion <chwetion@foxmail.com>
2021-12-02 10:16:27 +08:00
qiaozp
a6ef0644ff Feat: oss suppurt for addon (#2848)
* Add OSS source support for addon

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add unit test for pkg/addon

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix lint

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add license

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-01 19:15:48 +08:00
Min Kim
d56a1e534b alternatively using the original endpoint from the hub kubeconfig as registry endpoint (#2751)
Signed-off-by: yue9944882 <291271447@qq.com>

upgrade cluster-register to v1.0.2

Signed-off-by: yue9944882 <291271447@qq.com>

improve logging

Signed-off-by: yue9944882 <291271447@qq.com>
2021-12-01 14:47:26 +08:00
Tianxin Dong
374c3cd3e0 Fix: reset record status when a new one is created (#2846)
* Fix: reset record status when a new one is created

* skip the new created one
2021-12-01 10:52:07 +08:00
wyike
163415479b Feat: list enabled addon from cluster interface and update addon (#2832)
make reviewable

lint

Feat: interface for update addon

nit import

fix comments

fix status args return

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-01 10:27:26 +08:00
barnettZQG
4294cc8a98 Feat: automatically populate the provider and region configuration for cloud app (#2841)
* Feat: automatically populate the provider and region configuration for cloud app.

* Fix: fix e2e test bug

* Fix: component name and type inconsistency

* Fix: fix unit test bug

* Fix: fix unit test bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-12-01 10:26:33 +08:00
Zheng Xi Zhou
5630c02d7f Fix: add more fields for Terraform types definitions in api schema (#2836)
* Fix: add more fields for Terraform types definitions in api schema

Added `writeConnectionStringSecrecto`, `region` and `deleteResoruce`
fields for Terraform types definitions in OpenAPI schema

* fix ci issue

* fix header
2021-12-01 10:03:08 +08:00
Tianxin Dong
8dad1eadb4 Feat: add alias in list record api (#2833) 2021-11-30 19:04:42 +08:00
Zheng Xi Zhou
c588f85438 Fix: sync status of Terraform typed components to application (#2844)
Synchronized the status of an Terraform typed components to .status.
services of the application

Signed-off-by: zzxwill <zzxwill@gmail.com>
2021-11-30 17:49:59 +08:00
朱晓兵
13c0b08081 Fix: update envBinding related workflow bug (#2831)
* Fix: fix update envBinding related workflow bug

* Fix: support cloudresource step

* Fix: add unit test

* Fix: add unit test

* Fix: add unit test

* unit test

Co-authored-by: zhuxiaobing <zhuxiaobing@lixiang.com>
2021-11-30 17:24:29 +08:00
Tianxin Dong
52ac570faa Feat: add filter in list definitions (#2835)
* Feat: add filter in list definitions

* add workload type
2021-11-30 16:53:01 +08:00
Jian.Li
ec105cbb02 Fix: application conditions confusion. (#2834)
* fix condition confusion

* fix test cases
2021-11-30 16:43:27 +08:00
Wei (段少)
f8e1ddc52c Add up CII Best Practices badge (#2843) 2021-11-30 15:13:56 +08:00
barnettZQG
2abd98301f Feat: remove apiserver component from the chart (#2838)
Co-authored-by: barnettZQG <yiyun.pro>
2021-11-30 12:42:18 +08:00
yangsoon
13b07674f1 Fix: fix flaky e2e-test of apiserver (#2840)
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-11-30 10:37:52 +08:00
Somefive
f9ecc02417 Feat: rework rt (#2797) 2021-11-29 16:14:30 +08:00
Tianxin Dong
d1f56743cc Feat: add core definitions (#2664)
* Feat: add components and storage api-oriented defs

* add some examples

* change the dir

* resolve comments

* make reviewable

* fix example

* add labels and annotations in component

* add config map ref key in env

* add more traits

* add wfstep defs and rename

* fmt the cue

* re-struct all the definitions

* revert deprecated defs and add webhook def

* delete useless network trait

* fix generated tab

* fix indent

* fix webservice

* add labels

* comment webservice and worker's health check

* fix retainkeys

* fix webservice and worker's health check

* add suspend def which will be replaced by internal def

* fix cli and add labels

* fix script

* add ignore

* fix healthscope example
2021-11-29 15:02:16 +08:00
wyike
6184b6e0e6 Feat: install helm addon schema (#2815)
Fix: fix bug

Fix: rebase bug

fix rebase -i master

rename func
2021-11-29 13:24:52 +08:00
Zheng Xi Zhou
ac2169e2fa Fix: upgrade terraform controller to v0.2.10 (#2827)
- Clean RBAC
- Generate Job/Pod/ConfigMap/Secret in the namespace of a Configuration
- Fix: The secret generated by Terraform won't regenerate after it's manually deleted
- Fix status ProvisioningAndChecking
- The Kubernetes backend should keep consistent
- Override Region of a provider in Configuration
- Set region to spec.region
2021-11-29 10:38:27 +08:00
barnettZQG
96a9fb7d9e Feat: support auto creating workflow step for cloud app (#2826)
* Feat: support auto creating workflow step for cloud app

* Fix: fix unit test bug

* Fix: fix component cant not find bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-29 10:20:15 +08:00
Zheng Xi Zhou
92335eca17 Fix: support exposing cloud resource identifier and console url (#2825)
* Fix: support exposing cloud resource identifier and console url

To help users quickly navigate to the instance in the web console, exposing
necessary information in ComponentDefinition and convert them to Configuration

* fix ci

* Check whether wl.FullTemplate.ComponentDefinition is nil before getting annotations
2021-11-28 17:21:12 +08:00
yangsoon
23bceb9f9c Fix: velaql miss query the resources created by the old application version (#2824)
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-11-27 13:57:48 +08:00
qiaozp
b05deeca55 Feat: add addon invisible field (#2820)
* Feat: add addon invisible field

* reviewable
2021-11-27 13:06:45 +08:00
Zheng Xi Zhou
7bdf4c176b Fix: install Terraform and apply the support for a provider in one jump (#2778)
* Fix: install Terraform and apply the support for a provider in one jump

- Fix issue: addon name should not include forward-slash "/" cloud-resource fix addon name should not include forward-slash "/" #2588
- Install terraform and the provider in one jump. Instead of installing terraform
and terraform-xxx in two steps
2021-11-26 23:01:11 +08:00
Tianxin Dong
334ef864da Feat: add alias in workflow step status (#2821)
* Feat: add alias in workflow step status

* fix lint

* add revision
2021-11-26 20:35:04 +08:00
Somefive
f5fc822a3e Fix legacy resourcetracker not garbage collect while previousRT is empty or equals currentRT (#2817) 2021-11-26 17:48:17 +08:00
Somefive
dd84700657 Fix: health check appRev label bug (#2816)
* Fix: healthscope failed since appRevision is not set && rollout controller amend appRevision to workload since compRev does not have this one

* Fix: test
2021-11-26 17:47:43 +08:00
Somefive
782025507c Fix: health check do not check resource in correct namespace while ns is override by envbinding (#2818) 2021-11-26 16:04:44 +08:00
Tianxin Dong
bab241e969 Feat: add more logs in workflow sync (#2806) 2021-11-26 15:34:25 +08:00
Jianbo Sun
27c4dd1bc5 Fix: don't invoke docker command if not exist (#2813)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-11-26 13:54:44 +08:00
Zheng Xi Zhou
41f384e36b Fix: addon name should not add prefix resources (#2808)
* Fix: addon name should not add prefix `resources`

- Adding prefix `resources will hit issues as:
'unable to parse requirement: invalid label value:
"resources-prometheus-server-register-grafana-datasource-5576f7f6b4":
      at key: "controller.oam.dev/component": must be no more than 63 characters'
- This won't avoid the name confliction with other components

* address comments
2021-11-25 21:01:56 +08:00
qiaozp
2be261e3f7 Feat: optimize addon enable experience (#2677)
* Feat: better addon enable experience

* better

* Update references/cli/addon.go

typo

Co-authored-by: yangsoon <yangsoonlx@gmail.com>

Co-authored-by: yangsoon <yangsoonlx@gmail.com>
2021-11-25 14:08:20 +08:00
qiaozp
b279df0451 Fix: add lock to avoid addon concurrency read error (#2803)
* make read func table driven

* add mutex

* fix
2021-11-25 11:50:29 +08:00
Zheng Xi Zhou
bbb1c1767e Fix: remove .cue suffix from the component name of observability (#2796)
If the component name has a suffix `.cue`, it will hit issue of not
match a DNS name
2021-11-25 11:06:08 +08:00
Zheng Xi Zhou
40f100ec27 Fix: support naming a terraform provider (#2794)
* Fix: support naming a terraform provider

Support set the name for a terraform provider.

Fix #2595

* Style: format

Co-authored-by: Yin Da <yd219913@alibaba-inc.com>
2021-11-25 10:32:30 +08:00
Tianxin Dong
6f90155ccd Feat: add workflow rollback cli (#2795)
* Feat: add workflow rollback cli

* fix ci
2021-11-24 21:34:44 +08:00
Zheng Xi Zhou
216a95a2dd Fix: the way to renderCUETemplate for terraform provider is wrong (#2798)
Fixed the probelm of renderring cue template for terraform provider
after #2788
2021-11-24 21:34:06 +08:00
Somefive
d1f70def0e Fix: healthscope support envbinding (namespace) (#2783)
* Fix: healthscope support envbinding (namespace)

* Fix: ensure healthscope not patch status when application workflow is still running
2021-11-24 21:26:06 +08:00
yangsoon
65f8614fd8 Feat: vela delete add wait and force option (#2747) 2021-11-24 21:00:03 +08:00
wyike
66e8398ab8 Fix: add back missed commit and add tests (#2781)
* Fix: missed commit

Test: add test

* Fix: add e2e test addon rely on core feature

fix test

Fix: e2e-test

* Fix: create vela-system namespace when cluster join

fix

* Fix: fix comments add args in command
2021-11-24 20:59:08 +08:00
Tianxin Dong
f1eef83809 Feat: add workflow name for frontend (#2787) 2021-11-24 20:18:27 +08:00
barnettZQG
99d473df2a Feat: translate the object type to Group (#2786)
* Feat:  translate the object type to Group

* Fix: fix unit test bug

* Fix: fix workflow do not delete after delete env bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-24 20:17:40 +08:00
Jian.Li
da251f1cb6 Fix: lookupByScript don't support import (#2788)
* fix lookupByScript

* fix lint
2021-11-24 19:57:54 +08:00
Zheng Xi Zhou
14770dff0d Fix: arguments map[string]string doesn't support observability's args (#2790)
* Fix: arguments map[string]string doesn't support observability's args

As there are bool typed arguments, the current arguments type doesn't
support.
2021-11-24 19:52:59 +08:00
Zheng Xi Zhou
4b72954c86 Fix: addon with arguments could not be installed (#2789)
With the fix #2766 to install addon without arguments, fix the issue of
installing addons with arguments.
2021-11-24 19:52:13 +08:00
yangsoon
3d2fcacb5a Feat: built in gc policy to application (#2575) 2021-11-24 15:38:13 +08:00
Zheng Xi Zhou
e5a86ef537 Fix: the first addon should not be example (#2793)
As addon example has been removed, the first addon on should not
be `example`
2021-11-24 13:44:55 +08:00
yangsoon
ec5e2b4660 Fix: clean up the view api (#2779) 2021-11-24 11:09:50 +08:00
barnettZQG
8c276e226b Fix: fix update component and list workflow bug (#2782)
* Fix: fix update component and list workflow bug (#2763)

* Fix: fix update component and list workflow bug

* Fix: change e2e test case

* Fix: change e2e case

Co-authored-by: barnettZQG <yiyun.pro>

* Fix: fix sync controller revision (#2772)

Co-authored-by: Tianxin Dong <dongtianxin.tx@alibaba-inc.com>
Co-authored-by: barnettZQG <yiyun.pro>
2021-11-23 19:30:54 +08:00
Jianbo Sun
8bcffb92bf Merge pull request #2769 from oam-dev/merge
Feat: Merge APIServer Into Master
2021-11-23 10:08:01 +08:00
Zheng Xi Zhou
2e417641cd Revert "Fix: install Terraform and apply the support for a provider in a jump (#2718)" (#2773)
This reverts commit 3bf365322b.
2021-11-22 11:48:49 -05:00
Zheng Xi Zhou
3bf365322b Fix: install Terraform and apply the support for a provider in a jump (#2718) 2021-11-23 00:08:37 +08:00
yangsoon
6dff9ab679 Fix: fix compatibility test 2021-11-22 23:21:17 +08:00
Yin Da
395b594b84 Fix: fix package test 2021-11-22 22:02:49 +08:00
yangsoon
cee66fd03f Fix: remove useless test 2021-11-22 21:46:49 +08:00
Hongchao Deng
5c46aa2f7f fix header 2021-11-22 19:07:13 +08:00
Hongchao Deng
cf4aaf51c8 fix imports 2021-11-22 18:47:47 +08:00
Hongchao Deng
5e9d51997f fix err check 2021-11-22 18:26:26 +08:00
Hongchao Deng
367ed23eea fix gofmt 2021-11-22 18:22:55 +08:00
Yin Da
4f2bf29a65 Fix: upgrade aliyun provider for terraform controller 2021-11-22 17:58:04 +08:00
qiaozp
eece41c03c fix import (#2770)
Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
2021-11-22 17:49:26 +08:00
Hongchao Deng
8699346401 Merge branch 'apiserver' into merge 2021-11-22 17:27:40 +08:00
Hongchao Deng
e5aba94cd1 Merge branch 'apiserver' into merge 2021-11-22 17:25:50 +08:00
qiaozp
2b8a89d9fa Fix: get addon omit uiSchema (#2768) 2021-11-22 17:13:05 +08:00
qiaozp
58293dcf20 Feat: check addon dependencies when enable (#2741) 2021-11-22 17:12:55 +08:00
Zheng Xi Zhou
5b7b7138e2 Fix: enable addon without arguments (#2766)
If an addon like `fluxcd` doesn't need arguments to be enabled, we
should not parse the arugments
2021-11-22 16:30:11 +08:00
Tianxin Dong
47a565d00d Fix: controllerrevision can not be updated (#2764) 2021-11-22 10:58:23 +08:00
Jianbo Sun
a67bd24967 Feat: support user defined image registry (#2623)
* Feat: support user defined image registry

* Feat: add test app image repo into values
2021-11-22 10:56:36 +08:00
wyike
4ad27e9bcd Fix: (#2761)
1. load component in arrary, so apply them in order addon's needNamespace will be apply firstly
2. apply application  in controle plane will be first workflowStep
3. bigger application reconcile timeout context get avoid of time out
2021-11-21 21:03:41 +08:00
qiaozp
1ea26865aa Fix: lint apiserver code, fix panic (#2755)
* lint code

* fix error judge
try

* fix multicluster enable panic

* add err log

* fix can not get parameter

* debug

* try ci

* debug

* debug

* debug

* debugo

Co-authored-by: barnettZQG <576501057@qq.com>
2021-11-21 18:09:19 +08:00
朱晓兵
51b6e8b459 Fix: fix envbinding related workflow logic,add unit test (#2758)
* Fix: fix envbinding related workflow logic,add unit test

* Fix: bcode field

* Update envbinding.go

Co-authored-by: zhuxiaobing <zhuxiaobing@lixiang.com>
Co-authored-by: barnettZQG <576501057@qq.com>
2021-11-21 17:27:35 +08:00
barnettZQG
4799cbf6cc Feat: workflow support update (#2760)
* Feat: workflow support update

* Fix: fix recycle bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-21 16:43:10 +08:00
yangsoon
99ffe80eb4 Feat: component-pod-view support filter resource by cluster name and cluster namespace (#2754) 2021-11-21 14:56:01 +08:00
Tianxin Dong
32103f53fc Feat: add list application records api (#2757)
* Feat: add list application records api

* remove workflow checker

* Update envbinding.go

Co-authored-by: barnettZQG <576501057@qq.com>
2021-11-21 10:45:03 +08:00
barnettZQG
8181b4d266 Fix: fix the envbinding can not be deleted bug (#2756)
* Fix: fix the envbinding can not be deleted bug

* Fix: fix target must be interface or implement error

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-21 10:15:15 +08:00
barnettZQG
adcb7bd65e Feat: support update component and query app statistics info (#2746)
* Feat: change swagger config

* Feat: support update component and query app statistics info

* Fix: fix workflow list bug

* Fix: fix test bug

* Fix: fix e2e test bug

* Feat: change workflow api

* Fix: fix app deploy e2e test bug

* Fix: change e2e test

* Fix: fix workflow bug

* Fix: fix deploy bug

* Fix: fix selector bug

* Feat: support recycle env

* Fix: debug e2e

* Fix: fix e2e case bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-20 19:50:36 +08:00
Somefive
34aa74ff48 Feat: envbinding support cloud resource deploy and share (#2734)
* Feat: envbinding support cloud resource deploy and bind

* Fix: change bind-cloud-resource to share-cloud-resource
2021-11-20 13:07:27 +08:00
Tianxin Dong
ff405cd62a Feat: add workflow record actions (#2733)
* Feat: add application revision actions

* refactor workflow record and application revision

* generate doc

* fix rebase

* fix rebase

* delete comment

* fix comment

* delete suspend status

* use apply instead of update

* find latest comlete revision if the revision is not specified

* delete name

* fix primary key
2021-11-20 13:05:52 +08:00
qiaozp
54eb662959 Feat: add definitions to addon detail API, fix addon cache, async download files (#2738)
* add definition to addon detail API

* change little

* tmp

* fix cache

* fix import
2021-11-20 12:24:35 +08:00
qiaozp
b38aa1cdf0 Fix: Align -n command argument (#2719)
* add namespace flag

fix

fix test

fix tests

* try test

* try test

* fix tests
2021-11-19 18:00:03 +08:00
wyike
36f5bbc973 Fix: addon spell issue (#2748)
Fix: small issue
2021-11-19 17:57:50 +08:00
Somefive
1a2c964dac Fix: enhance cluster api (#2742) 2021-11-19 15:39:54 +08:00
dependabot[bot]
aa2a0e94bf Chore(deps): Bump github.com/containerd/containerd from 1.4.11 to 1.4.12 (#2744)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.4.11 to 1.4.12.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.4.11...v1.4.12)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-19 11:12:00 +08:00
朱晓兵
ffd25a4cbf Feat: refactor envbinding for adapt policy placement (#2731)
* Feat: refactor envbinding for adapt policy placement

* Fix: refactor envbinding logic

* Fix: fix some bug

* Fix: fix unit test

* Fix: fix unit test

* Fix: fix unit test

* Fix: fix unit test

* Fix: fix unit test ...

* Fix: fix unit test

Co-authored-by: zhuxiaobing <zhuxiaobing@lixiang.com>
2021-11-19 10:37:40 +08:00
Jian.Li
d954bbac00 Fix: applied-resources overflow (#2740)
* fix applied-resources overflow

* add test cases
2021-11-18 20:04:21 +08:00
Hongchao Deng
b6a14e435b Feat: EnableAddon supports runtime cluster (#2739)
* Feat: EnableAddon supports runtime cluster

If use runtime cluster mode, the definitions will be applied to control plane k8s directly, not included in the Application object.

* add owner

* comment
2021-11-18 17:32:14 +08:00
qiaozp
575ecc3136 fix istio (#2691) 2021-11-18 12:50:34 +08:00
qiaozp
bade23cecf Feat: add addon arguments API (#2732)
* temp

* test

* move to status
2021-11-18 12:24:01 +08:00
yangsoon
530f158795 Feat: velaql support query the resources created by helmrelease (#2726)
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-11-18 11:53:38 +08:00
Tianxin Dong
2fc0f1cd2b Feat: add app revision list and detail api (#2722)
* Feat: add app revision list and detail api

* add envName and status filter

* make swagger doc

* revert ui-schema
2021-11-17 15:29:36 +08:00
Somefive
ba4a28fa0d Feat: cherry-pick #2720 into apiserver: support list runtime cluster (#2730)
* Feat: support list runtime cluster (#2720)

* Fix: style
2021-11-17 15:12:06 +08:00
wyike
0555623b3e Feat: add triat alias description time (#2727)
* Feat: add triat alias description time

* Fix: remove modle
2021-11-17 13:06:30 +08:00
Somefive
55070033eb Feat: support list runtime cluster (#2720) 2021-11-17 09:45:03 +08:00
lowkeyrd
b3423116bf add alicloud sls resources (#2701) 2021-11-16 22:50:18 +08:00
yangsoon
0673bc9cd5 Fix: fix workflowstep depends-on-app (#2723)
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-11-16 22:48:26 +08:00
barnettZQG
1465aba177 Fix: fix build bug (#2724)
* Fix: fix build bug

* Fix: change api spec

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-16 21:31:24 +08:00
qiaozp
061c061867 Feat: add redis definition (#2507) 2021-11-16 20:12:22 +08:00
Zheng Xi Zhou
7a0670113f Fix: allow external cloud resources to be kept when Application is deleted (#2698)
* Fix: allow external cloud resources to be kept when Application is deleted

Provide an option for users whether to keep provisioned cloud resources when Terraform-typed Application is deleted.

Fix #2697

* delete file

* upgrade release version of Terraform controller

* fix ci
2021-11-16 19:33:21 +08:00
Tianxin Dong
c42ea7c948 Feat: add record status sync (#2627)
* Feat: add record status sync

* fix typo

* optimize the code

* fix the port

* fix go mod

* fix rebase
2021-11-16 14:47:13 +08:00
barnettZQG
ba1f8e4793 Feat: change the model to support multiple environments (#2721)
* Feat: change swagger config

* Feat: change the model to support multiple environments.

* Feat: support query targets by namespace

* Fix: fix definition unit test case

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-16 14:45:49 +08:00
qiaozp
15795fbe25 Fix: observability installation (#2676)
* fix observability installation

* fix nil pointer

* fix nil pointer

* remove asset, build in trait
2021-11-16 13:56:39 +08:00
wyike
43aa05673e Feat: manage trait (#2702)
* Feat: manage trait

fix test

* fix test
2021-11-15 21:04:03 +08:00
qiaozp
1c7e0c054d Fix: add detail cache, fix uiSchema (#2716)
* add detail cache, fix uischema

* remove
2021-11-15 17:17:07 +08:00
Zheng Xi Zhou
3df47d74f1 Fix: stop installing golangci-lint each time (#2712)
When golangci-lint doesn't locate in $PATH, it will be installed in
$GOBIN every single time.
2021-11-15 15:02:48 +08:00
qiaozp
27490c4bce Refactor: refactor addon for later reusing code in CLI (#2708)
* refactor addon for later reuse code in CLI

* fix import
2021-11-15 12:16:32 +08:00
朱晓兵
4eb9cc114e Feat: add delivery-target API (#2703)
* Feat: add delivery-target API

* Fix: for unit test

Co-authored-by: zhuxiaobing <zhuxiaobing@lixiang.com>
2021-11-15 10:28:41 +08:00
Tianxin Dong
b3014c2f62 Fix: fix backport script (#2699) 2021-11-12 22:34:12 +08:00
Zheng Xi Zhou
b10e4a05a0 Fix: add Alibaba Cloud ASK (#2700)
Added Serverless Kubernetes (ASK) for Alibaba Cloud
2021-11-12 22:33:40 +08:00
barnettZQG
e1c64540f4 Feat: change api spec (#2695)
* Feat: change api spec

* Feat: change DeployEvent to ApplicationRevision

* Fix: fix test bug

* Fix: fix unit test bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-12 17:19:34 +08:00
yangsoon
722ed480e9 Feat: add more views (#2689)
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-11-12 14:34:26 +08:00
barnettZQG
3e68f8a83b Feat: change model name (#2688)
* Feat: change mode name

* Fix: fix e2e test bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-12 11:58:13 +08:00
Jian.Li
0803b45faf Feat: output log with structured tag & add step duration metrics (#2683)
* debug task

* metrics

* trace context

* add step_duration metrics

* add readme docs
2021-11-12 11:48:41 +08:00
wyike
b0577a979a Fix: fix delete a component from application not delete workload (#2680)
lint

Fix: error test

Fix: fix e2e rollout

Fix comment
2021-11-12 11:45:45 +08:00
Zheng Xi Zhou
4e9e88e4a5 Fix: pushing to ACR won't succeed all the way (#2685)
* Fix: pushing to ACR won't succeed all the way

Use action `docker/login-action` instead of `docker/login-action` to
login in ACR

* poc

* manual login

* manual push

* cat

* format

* echo

* dockerfile

* docker build

* v0.9.9

* domain

* poc

* formal

* buildx

* split acr and dockerhub

* finalizer

* fix

* final
2021-11-12 11:45:24 +08:00
Somefive
cee3630ead Feat: upgrade cluster gateway to support remote debug (#2673) 2021-11-12 11:44:18 +08:00
Somefive
6f641caadc Fix: cluster url (#2675) 2021-11-12 11:43:46 +08:00
Zheng Xi Zhou
53d380ff41 Fix: application status.services doesn't include Terraform typed components (#2643)
* Fix: application status.services doesn't include Terraform typed components

Function aggregateHealthStatus() which is used to retrieve components status, was
abandoned. All unit-tests of it was abandoned too. Fixed it and restore all the unit
tests.
2021-11-11 14:07:46 +08:00
yangsoon
8a3b7b6a05 Feat: add query provider and get view template from configmap (#2619) 2021-11-11 13:40:14 +08:00
lowkeyrd
4291e7c7ba Docs: add vpc and vswitch cloud resource templates of alicloud (#2663)
* add vpc and vswitch cloud resources of alicloud

* modified by make reviewable
2021-11-10 16:49:10 +08:00
qiaozp
49ba77c0d3 Feat: add addon registry update API (#2671)
* add addon registry update API

* add detailed cache, fix cache bug

* use PUT

* add Reads

* use UpdateAddonRegistryRequest
2021-11-10 12:41:29 +08:00
Somefive
fd66e6a228 Fix: revision namespace override (#2550) 2021-11-09 23:36:43 +08:00
Somefive
f3899e38ef Feat: multicluster vela status/exec/port-forward (#2662)
* Fix: vela status from app.status.services

* Feat: refine cli and support terraform logs

* Feat: support remote exec

* Feat: port-forward support multicluster

* Fix: vela status+port-forward test

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-11-09 19:08:47 +08:00
Maciej Gwizdała
d945eb35df Feat: Add Terraform Azure Storage Account (#2646)
* Feat: Add Terraform Azure Storage Account

* Fix: Added resource group creation for tests

* Feat: Added EOF for tf azure storage account

Co-authored-by: Maciej Gwizdała <maciej.gwizdala-ext@leica-geosystems.com>
2021-11-09 15:15:28 +08:00
Somefive
7103f8ff52 Feat: merge master into apiserver (#2660)
* Feat(rollout): fill rolloutBatches if empty when scale up/down (#2569)

* Feat: fill rolloutBatches if empty

* Fix: fix unit-test

* Test: add more test

Fix: lint

Fix: fix lint

* Update release.yml (#2537)

* Feat: add registry, merge registry and cap center (#2528)

* Feat: add registry command

* Refactor: comp/trait command combine with registry

* Feat: refactor `vela comp/trait`

* Fix: import

* Fix: fix if type is autodetects.core.oam.dev

* Fix: fix list from url

* Fix: test

* Feat: add test

* Fix: remove dup test

* Fix: test

* Fix: test

* Fix: fix label filter

* Fix: reviewable

* Fix test

* fix personal repo in test

* Fix test

* Fix test

* add some boundary check

* reviewable

* Fix: fix nocalhost trait (#2577)

* fix incorrect addon status (#2576)

* Fix(cli): client-side throttling in vela CLI (#2581)

* fix cli throttling

* fix import

* set to a lower value

* remove addon with no defs (#2574)

* Feat: vela logs support multicluster (#2593)

* Feat: add basic multiple cluster logs

* fix context

* Fix select style

* Fix select style

* remove useless env

* fix naming

* Feat: vela cluster support use ocm to join/list/detach cluster (#2599)

* Feat: add render component and apply component remaining (#2587)

* Feat: add render component and apply component remaining

* fix ut

* fix e2e

* allow import package in custom status cue template (#2585)

Co-authored-by: chwetion <chwetion@foxmail.com>

* Fix: abnormal aux name (#2612)

* Feat: store workflow step def properties in cm (#2592)

* Fix: fix notification def

* Feat: store workflow step def properties in cm

* fix ci

* fix data race

* Fix: change Initializer to Application for addon Observability (#2615)

In this doc, updated the Observability implementation from initializer
to Application. I also store definitions as it's not well stored in
vela-templates/addons/observability

* Fix: fix backport param (#2611)

* Fix: add owner reference in workflow context cm (#2573)

* Fix: add owner reference in workflow context cm

* fix ci

* delete useless test case

* Fix: op.delete bugs (#2622)

* Fix: op.delete some bugs

* Fix: app status update error

Fix: make reviewable

* Fix: show reconcile error log (#2626)

* Feat: add reconcile timeout configuration for vela-core (#2630)

* Fix: patch status retry while conflict happens (#2629)

* Fix: allow definition schema cm can be same name in different definition type (#2618)

* Fix: fix definition schema cm name

* fix ut

* fix ut

* fix show

* add switch default case

* Feat: remove envbinding policy into workflow (#2556)

Fix: add more test

* Feat: add vela prob to test cluster (#2635)

* Fix: upgrade stern lib to avoid panic for vela logs (#2650)

* Fix: filter loggable workload in vela logs (#2651)

* Fix: filter loggable workload in vela logs

* reviewable

* Feat: add vela exec for multi cluster (#2299)

fix

support vela exec

* Fix: health check will check for multiclusters (#2645)

* Fix: minor fix for vela cli printing (#2655)

* Fix: minor fix for vela cli printing

* add dockerfile go mod cache

* Feat: support apiserver-related multicluster features (#2625)

* Feat: remove envbinding policy into workflow

Feat: add support for env change (env gc)

Fix: fix rollout timeout setting bug

* Feat: support disable trait and env without workflow

* Fix: add hint for replaced value

Co-authored-by: wyike <wangyike_wyk@163.com>
Co-authored-by: basefas <basefas@hotmail.com>
Co-authored-by: qiaozp <47812250+chivalryq@users.noreply.github.com>
Co-authored-by: Tianxin Dong <dongtianxin.tx@alibaba-inc.com>
Co-authored-by: yangsoon <yangsoonlx@gmail.com>
Co-authored-by: Chwetion <137953601@qq.com>
Co-authored-by: chwetion <chwetion@foxmail.com>
Co-authored-by: Jian.Li <74582607+leejanee@users.noreply.github.com>
Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-11-09 13:06:55 +08:00
Hongchao Deng
3505c379d2 Fix: cache IsExpired() (#2669) 2021-11-09 12:39:36 +08:00
wyike
629cc67c6a Fix: load component can set parameter (#2661)
Fix: fix fmt
2021-11-09 10:51:10 +08:00
Zheng Xi Zhou
84315ff0e6 Fix: push docker images to Alibaba Cloud ACR (#2601)
* Fix: push docker images to Alibaba Cloud ACR

Added Github action to push docker images to Alibaba Cloud ACR

* Fix: change acr domain
2021-11-09 10:46:06 +08:00
barnettZQG
738b416ec2 Fix: fix can not create first app env plan bug (#2665)
* Fix: fix can not create first app env plan bug

* Fix: fix test bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-09 09:47:41 +08:00
qiaozp
39e8bc0b98 add addon parameter openAPI schema (#2666) 2021-11-08 10:13:04 -05:00
Somefive
64ab932c6d Feat: support apiserver-related multicluster features (#2625)
* Feat: remove envbinding policy into workflow

Feat: add support for env change (env gc)

Fix: fix rollout timeout setting bug

* Feat: support disable trait and env without workflow

* Fix: add hint for replaced value
2021-11-08 10:11:50 -05:00
Hongchao Deng
976da6f35a Feat: add local cache of addons to avoid Github limit (#2558)
* Feat: add local cache of addons to avoid Github limit

comment

* comment
2021-11-08 20:04:08 +08:00
qiaozp
b98cec127e add addon template reading (#2648)
render definition into application

new format

fix cue render

fix one bad registry make all addon unusable
2021-11-08 16:34:03 +08:00
barnettZQG
eb258fae66 Feat: support ui schema (#2647)
* Docs: change swagger api config

* Docs: change swagger api config

* Docs: change swagger api config

* Feat: support ui schema

* Fix: distinguish between structs and arrays

* Feat: support build swagger config

* Feat: support update ui schema

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-08 14:13:22 +08:00
Jianbo Sun
fede2235a9 Fix: minor fix for vela cli printing (#2655)
* Fix: minor fix for vela cli printing

* add dockerfile go mod cache
2021-11-07 17:25:52 +08:00
Jianbo Sun
4ca68f2030 Fix: health check will check for multiclusters (#2645) 2021-11-07 11:50:27 +08:00
Jianbo Sun
e5745bb3f3 Feat: add vela exec for multi cluster (#2299)
fix

support vela exec
2021-11-07 08:54:48 +08:00
qiaozp
3e9b702328 Fix: filter loggable workload in vela logs (#2651)
* Fix: filter loggable workload in vela logs

* reviewable
2021-11-06 17:31:50 +08:00
Jianbo Sun
f7dc9934b1 Fix: upgrade stern lib to avoid panic for vela logs (#2650) 2021-11-06 17:23:37 +08:00
Jianbo Sun
c448ba0956 Feat: add vela prob to test cluster (#2635) 2021-11-06 11:28:11 +08:00
Tianxin Dong
5590c3d7b5 Fix: fix apiserver definition schema struct (#2644)
* Fix: fix apiserver definition schema struct

* use open api schema
2021-11-05 21:54:31 +08:00
Hongchao Deng
c821f2a929 Feat: rewrite Addon API to support new format (#2605)
* Feat: rewrite Addon API to support new format

fix test

fix

fix

add registry query parameter

skip enable test

add Definition meta

fix

fix ext

add cue rendering

return component name

update swagger.json

refactor addon cue/yaml tmpl to addonElementFile

apply app in enable

fix cue parse

comment

swagger

enable test

update

fix bug

fix cue render

fix apply fail, decode object

fix disable addon, todo: fix status api

* avoid to render a whole addon when check status

* fix

* fix

* add label

* remove todo

* fluxcd

* fix args

* add all path to addon component name

* reorder test

* add addon application prefix

* add

* add ns when test

* fix

Co-authored-by: qiaozp <chivalry.pp@gmail.com>
2021-11-05 17:39:31 +08:00
Somefive
bf3a1cddf9 Feat: remove envbinding policy into workflow (#2556)
Fix: add more test
2021-11-05 17:29:05 +08:00
Tianxin Dong
50cfe0c68f Fix: allow definition schema cm can be same name in different definition type (#2618)
* Fix: fix definition schema cm name

* fix ut

* fix ut

* fix show

* add switch default case
2021-11-05 16:07:04 +08:00
Somefive
9e73f5dee6 Fix: patch status retry while conflict happens (#2629) 2021-11-05 15:21:28 +08:00
barnettZQG
df5bc2727e Feat: supports setting environment differences for application plan (#2624)
* Feat: supports setting environment differences for application plan

* Feat: update swagger config

* Feat: CRUD of application env binding plan

* Style: change code style

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-05 10:42:18 +08:00
Tianxin Dong
cd686fbb24 Fix: fix definition schema struct (#2632)
* Fix: fix definition schema struct

* add more fields
2021-11-05 10:32:54 +08:00
Somefive
d2672cea48 Feat: add reconcile timeout configuration for vela-core (#2630) 2021-11-04 20:48:06 +08:00
Jianbo Sun
d8007d823d Fix: show reconcile error log (#2626) 2021-11-04 19:01:22 +08:00
wyike
f5b06f855a Fix: op.delete bugs (#2622)
* Fix: op.delete some bugs

* Fix: app status update error

Fix: make reviewable
2021-11-04 16:40:02 +08:00
Somefive
2337c82c3d Feat: add create ack api (#2596) 2021-11-04 16:39:32 +08:00
Tianxin Dong
e8969e4d17 Feat: add definition API (#2602)
* Feat: add definition API

* fix struct

* fix e2e

* optimize the code

* fix return

* fix const
2021-11-04 16:38:34 +08:00
Tianxin Dong
844479c7b5 Fix: add owner reference in workflow context cm (#2573)
* Fix: add owner reference in workflow context cm

* fix ci

* delete useless test case
2021-11-04 14:19:35 +08:00
Tianxin Dong
1438247aaf Fix: fix backport param (#2611) 2021-11-04 12:51:26 +08:00
Zheng Xi Zhou
356c6240bf Fix: change Initializer to Application for addon Observability (#2615)
In this doc, updated the Observability implementation from initializer
to Application. I also store definitions as it's not well stored in
vela-templates/addons/observability
2021-11-03 17:29:48 +08:00
barnettZQG
8e874bc3a9 Feat: change application to applicationplan (#2616)
* Feat: change application to applicationplan

* Feat: update swagger config

* Feat: change api spec

* Fix : fix e2e test case

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-03 17:25:37 +08:00
Tianxin Dong
117b9937f3 Feat: store workflow step def properties in cm (#2592)
* Fix: fix notification def

* Feat: store workflow step def properties in cm

* fix ci

* fix data race
2021-11-03 15:31:12 +08:00
Jian.Li
a5361b2deb Fix: abnormal aux name (#2612) 2021-11-03 15:19:32 +08:00
Chwetion
df3061f4c1 allow import package in custom status cue template (#2585)
Co-authored-by: chwetion <chwetion@foxmail.com>
2021-11-03 12:14:51 +08:00
Tianxin Dong
637ec6273f Feat: add render component and apply component remaining (#2587)
* Feat: add render component and apply component remaining

* fix ut

* fix e2e
2021-11-02 19:22:27 +08:00
yangsoon
7ba10d6864 Feat: vela cluster support use ocm to join/list/detach cluster (#2599) 2021-11-02 17:20:00 +08:00
qiaozp
aa0190c03d Feat: vela logs support multicluster (#2593)
* Feat: add basic multiple cluster logs

* fix context

* Fix select style

* Fix select style

* remove useless env

* fix naming
2021-11-02 14:45:15 +08:00
Hongchao Deng
5f09faeff0 Fix: delete addon registry (#2594)
* Fix: delete addon registry

* add validate Git should not be empty

* fix token could be nil

* GitSource Repo url is a must
2021-11-02 11:30:30 +08:00
Somefive
90e5fd9ed6 Fix: add fixes to cluster api (#2597) 2021-11-02 09:49:52 +08:00
qiaozp
5d9e3437a3 remove addon with no defs (#2574) 2021-11-01 20:58:09 +08:00
barnettZQG
9519d2443a Feat: add alias field and fix some code bug (#2589)
* Feat: add alias field and fix some code bug

* Fix: fix alias check rule bug

* Fix: fix addon e2e test bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-10-31 18:23:55 +08:00
qiaozp
b904f4fc0e Fix(cli): client-side throttling in vela CLI (#2581)
* fix cli throttling

* fix import

* set to a lower value
2021-10-29 15:07:15 +08:00
Tianxin Dong
6666c3a2bb Feat: add workflow record api (#2567)
* Feat: add workflow record api

* resolve comments

* add count function
2021-10-29 10:39:50 +08:00
qiaozp
68af605e75 fix incorrect addon status (#2576) 2021-10-28 20:41:43 +08:00
Tianxin Dong
1dc7647788 Fix: fix nocalhost trait (#2577) 2021-10-28 20:40:41 +08:00
qiaozp
f7e2123707 Feat: add registry, merge registry and cap center (#2528)
* Feat: add registry command

* Refactor: comp/trait command combine with registry

* Feat: refactor `vela comp/trait`

* Fix: import

* Fix: fix if type is autodetects.core.oam.dev

* Fix: fix list from url

* Fix: test

* Feat: add test

* Fix: remove dup test

* Fix: test

* Fix: test

* Fix: fix label filter

* Fix: reviewable

* Fix test

* fix personal repo in test

* Fix test

* Fix test

* add some boundary check

* reviewable
2021-10-28 20:26:08 +08:00
basefas
a8494d1bee Update release.yml (#2537) 2021-10-28 17:54:51 +08:00
wyike
7647ef9662 Feat(rollout): fill rolloutBatches if empty when scale up/down (#2569)
* Feat: fill rolloutBatches if empty

* Fix: fix unit-test

* Test: add more test

Fix: lint

Fix: fix lint
2021-10-28 17:50:28 +08:00
Jianbo Sun
3edb71891b Merge pull request #2572 from Somefive/apiserver_merge_master
Refactor: merge master
2021-10-28 17:30:54 +08:00
Yin Da
0fedad7cd2 Merge branch 'master' into apiserver 2021-10-28 15:19:03 +08:00
yangsoon
edf42074b9 Feat: add velaql webservice (#2532) 2021-10-28 12:05:12 +08:00
Tianxin Dong
828acd95fa Feat: add email support in webhook notification (#2535)
* Feat: add email support in webhook notification

* Fix: change sender and receiver to from and to

* fix the variable name

* fix wait return
2021-10-28 10:59:17 +08:00
Tianxin Dong
7e5dac7c98 Fix: fix backport command (#2557) 2021-10-27 14:18:37 +08:00
Somefive
9563391952 Fix: add local cluster & fix query parameter default value bug (#2561) 2021-10-27 11:37:47 +08:00
Tianxin Dong
b3f60b4b73 Feat: add cluster in read or apply object (#2551) 2021-10-27 10:05:57 +08:00
wyike
f48da214e3 Feat: health scope controller support check trait-managing workload (#2527)
* Feat: health scope controller support trait manage-workload

* Test: add multi-cluster and health policy e2e-test

Fix: e2e-test

lint

Fix: all e2e-test

Fix: modify port back

middle commit

middle pr

Fix: e2e-rollout-test

make reviewable

defet to rollout apply gvk annotation

fix e2e

* Update test/e2e-multicluster-test/multicluster_rollout_test.go

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
2021-10-26 19:51:53 +08:00
Yu Yicai
4dd18d1fc3 Feat: add nocalhost dev config trait definition (#2545)
* Feat: add nocalhost dev config trait definition

* Feat: add nocalhost dev config trait example

add nocalhost dev config trait example in `docs/examples/nocalhost`

Signed-off-by: yuyicai <yuyicai@hotmail.com>
2021-10-26 19:28:25 +08:00
Hongchao Deng
3ebc94394c Feat: addon service impl (#2515)
* Feat: addon service impl

* get addon from git/configmap

* add ListAddonRegistries

* add GetAddonModel

* add CreateAddonRegistry and bcode/addon.go

* add applyAddonData

* update

* Fix: getAddonFromGit

* Fix: getAddonFromGit, remove trailing .git

* add comment

* add enable/disable/status impl

* add deleteAddonRegistry and check dup addon

* read addon without accessing database

* change to query parameter, add addon detail

* Feat: add addon readme for apiserver

* Make enable/disable/status runnable

* chore: fix bcode

* Fix: refactor parse to util

* Fix: refactor addonutil to pkg

* add addon test for create and delete addon registry

* fix version prefix

* add post func

* add enable/disable test

* add provider aws readme

* done testing

* fix comment and refactor statusAddon

* move enable/disable logic to usecase

* add GITHUB_TOKEN env

* Fix: Add github token support and use it in test

* add license

Co-authored-by: qiaozp <chivalry.pp@gmail.com>
2021-10-26 17:52:34 +08:00
barnettZQG
964a12bb44 Feat: support manage multiple workflows in one application. (#2533)
* Docs: change swagger json

* Feat: support manage multiple workflows in one application.

* Docs: update swagger doc

* Fix: fix code bug

* Update pkg/apiserver/rest/webservice/workflow.go

Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>

Co-authored-by: barnettZQG <yiyun.pro>
Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>
2021-10-26 17:50:30 +08:00
Tianxin Dong
605fb58a3c Fix: pass on octokit error to make the check consistent (#2549) 2021-10-26 12:09:14 +08:00
Zheng Xi Zhou
7482388c84 Fix: CVE-2021-42836 (#2548)
CVE-2021-42836
GJSON before 1.9.3 allows a ReDoS (regular expression denial of service) attack.
2021-10-26 12:01:20 +08:00
Zheng Xi Zhou
e9ac4bb62f Fix: add another output CLUSTER_ID for Alibaba Cloud ack (#2543)
To support sub-path of a git repo which stores HCLs, also update the dependency
of Terraform controller
2021-10-24 10:02:39 +08:00
Zheng Xi Zhou
17dbf6de7e Fix: enable to allocate public connection string (#2530)
Also expose the connection string
2021-10-24 10:00:42 +08:00
yuyicai
b2fb9fc618 Fix: #2534 can't exit make when error occurs in curl (#2540)
- use `curl -sS` to show error
- use `set -eo pipefail` to exit `make` when error occurs in `curl`
2021-10-24 09:59:24 +08:00
Zheng Xi Zhou
cf039e27e5 Fix: format canary rollout manifests (#2542)
Formated canaray rollout manifests and changed orders for some traits
of a component to make it clear to see the difference between first-deploy.yaml
and rollout-v2.yaml, between rollout-v2.yaml and rollback.yaml
2021-10-24 09:58:32 +08:00
Jian.Li
dfbe65c9c0 Feat: Commit step-generate data without success (#2539)
* Feat: commit without success

* Feat: add test case
2021-10-23 11:25:50 +08:00
Somefive
accf0138f8 Feat: apiserver cluster api (#2526)
* Fix: multicluster api

* Feat: add apiserver cluster api & fix codecov

* Feat: add pod capacity and resourceused stat

* Feat: add cloud cluster manage

* Test: add test for cloud cluster

* Test: pending cloud resource api

* Style: refactor

* Fix: apiserver e2e test

* Fix: fix application usecase policy bug

* Style: add returns for cluster api

* Feat: add provider detail info & add cache & add rollback protection

* Style: refactor

* Style: add error code
2021-10-23 00:29:43 +08:00
barnettZQG
f0b91ef8d6 Feat: added environment binding capabilities to the application creation API. (#2523)
* Feat: add env binding support in app create api

* Feat: add query component types api

Co-authored-by: barnettZQG <yiyun.pro>
2021-10-23 00:29:43 +08:00
barnettZQG
b85dda35f3 Feat: add namesapce create and list api (#2514)
Co-authored-by: barnettZQG <yiyun.pro>
2021-10-23 00:29:43 +08:00
yangsoon
c7f9cdcbbf Feat: add the oam application api in apiserver (#2492)
* Feat: oam application api in apiserver

* Feat: enable unit-test and e2e-test
2021-10-23 00:29:42 +08:00
barnettZQG
d2dc9a8da7 Feat: application operation API implementation (#2478)
* Feat: application operation API implementation

* Docs: update swagger json

* Docs: update swagger config

* Feat: improve application management API implementation and testing

* Style: change code style

* Style: change some code style

Co-authored-by: barnettZQG <yiyun.pro>
2021-10-23 00:29:42 +08:00
Tianxin Dong
952af10a4b Fix: check pr title instead of commit msg (#2541) 2021-10-23 00:28:59 +08:00
Zheng Xi Zhou
e56a67acf5 Fix: support terraform/provider-aws addon (#2520)
Also added some componentdefinitions for AWS cloud resource
2021-10-22 00:02:35 +08:00
Tianxin Dong
cc292fe666 Feat: add list and delete kube provider (#2531) 2021-10-21 19:50:09 +08:00
Jian.Li
99f1743d25 Not update resource if render hash equal. (#2522)
* Feat: not apply if render hash not change

* Fix: generateRenderHash panic
2021-10-19 20:34:25 +08:00
qiaozp
f62deca440 Feat: add helm type component definition custom status (#2499) 2021-10-19 17:53:54 +08:00
Tianxin Dong
9d33b74278 Fix(cli): use flag instead of env in workflow cli (#2512) 2021-10-19 17:34:30 +08:00
Tianxin Dong
cf055a8331 Docs: update webhook example with url in secret (#2521) 2021-10-19 17:33:52 +08:00
Jian.Li
9fea82fd7b Feat: Record workflow execution state (#2479)
* Feat: workflow status add timestamp

* Feat: add workflow recorder

* Fix: finish state process

* Fix: test cases

* Fix: revert comments history->recorder

* Feat: omitempty execution time

* Fix: workflow_test.go

* Feat: add application test case for record

* Feat: terminate record

* Feat: trigger only by anno

* Feat: remove initializers CRD
2021-10-19 11:43:06 +08:00
Tianxin Dong
dcb677f976 Feat: support secret in webhook notification (#2509) 2021-10-19 10:42:40 +08:00
Zheng Xi Zhou
d1e814e7af Fix: aws/azure Terraform provider are broken (#2513)
Removed built-in aws/azure Terraform providers, and fix azure
mariadb definition issue.

Fix #2475
2021-10-19 10:15:35 +08:00
Tianxin Dong
d82f8e3cc6 Fix: fix the backport label permission to read (#2504) 2021-10-18 11:46:21 +08:00
Tianxin Dong
d8c9105a3a Test: add conversion test (#2497)
* Test: add conversion test

* Fix: make code reviewable
2021-10-18 11:46:01 +08:00
qiaozp
5b7b74c072 Feat: add imagePullPolicy/imagePullSecret to task def (#2503) 2021-10-18 11:13:52 +08:00
yangsoon
efea09db49 Feat: upgrade the image of kube-webhook-certgen (#2495) 2021-10-15 17:38:29 +08:00
Somefive
8336f5ae9c Fix: rework apiserver code coverage (#2489) 2021-10-15 15:37:19 +08:00
Tianxin Dong
e2ce40a551 Feat: add export config and secret def (#2484)
* Feat: add export config and secret def

* Fix: change the def name and optimize the example

* Fix: fix the name in def
2021-10-15 15:25:41 +08:00
Tianxin Dong
13c24e5697 Fix: fix label trigger from startWith to contains (#2496) 2021-10-15 15:24:32 +08:00
Tianxin Dong
17b840f402 Feat: add label backport in github action (#2494) 2021-10-15 13:24:44 +08:00
qiaozp
49bfeee53d Refactor: remove initializer (#2491) 2021-10-15 11:25:26 +08:00
Tianxin Dong
1801471099 Fix: add libgit2 support for gitops (#2477)
* Fix: add libgit2 support for gitops

* Fix: resolve rebase
2021-10-14 20:56:37 +08:00
Kinso
9d1ffd4c4b Fix(application): nil pointer for component properties (#2481)
Co-authored-by: kinsolee <lijingzhao@forchange.tech>
2021-10-14 19:17:50 +08:00
wyike
89eaf502fa Test: add e2e-test for multi-cluster rollout (#2472)
* Test: add e2e-test guarantee multi-cluster rollout

* Fix: install rollout runtime chart

add cluster name in dockerfile

Fix: build image error

enable all test

Fix: add rollout chart

add shebang

fix image repo
2021-10-14 18:27:50 +08:00
Tianxin Dong
56a8b0c002 Feat: add read object step def (#2480) 2021-10-14 18:23:43 +08:00
qiaozp
8c4af1d69c Refactor: addon migrate to application (#2444)
* Refactor: addon migrate to application

* Refactor: change test for addon

* Fix: golint

* Fix: add annotation const

* Refactor: make CLI compatible

* Fix: go-lint
2021-10-14 18:21:49 +08:00
Jianbo Sun
7ef800573a Fix: make nginx class to be default value and allow pvc trait to attach more than once (#2466)
* Fix: make nginx class to be default value

* Fix: allow pvc trait to attach more than once
2021-10-13 17:18:02 +08:00
wyike
4956d0e4e1 Fix: compatibility bug (#2467)
make reivwable
2021-10-13 16:58:41 +08:00
Tianxin Dong
85c887d3e4 Fix: change raw extension to pointer (#2451)
* Fix: change raw extension to pointer

* Test: fix ut
2021-10-13 16:16:53 +08:00
Zheng Xi Zhou
a4a1c39bbb Fix: refine Terraform Azure mariadb ComponentDefinition (#2465)
Added outputs for Azure mariadb and refine the variables
2021-10-13 15:43:52 +08:00
Jianbo Sun
f9ffb9e240 Chore: add example for env patch and fix e2e flaky (#2462) 2021-10-13 15:39:50 +08:00
barnettZQG
c3eaa74ee7 Feat: add BatchAdd function and entity index support (#2454)
Co-authored-by: barnettZQG <yiyun.pro>
2021-10-13 10:01:06 +08:00
Shaw Ho
75ba05f738 Fix: wrong log print format (#2430) 2021-10-12 19:27:11 +08:00
Jian.Li
8935a87c59 Fix: Closure Bug In newValue (#2437)
* Fix: new value bug

* Fix: strategyUnify Bug

* Fix: e2e error
2021-10-12 19:05:03 +08:00
Tianxin Dong
287c895daf Fix: fix unhandled err (#2423)
* Fix: fix unhandled err

refer to https://lift.sonatype.com/result/bhamail/kubevela/01FFT7CSVNCPF6808ZM856V3HN?tab=results

* Test: fix panic err
2021-10-12 14:36:09 +08:00
basefas
96c52ab2fc Chore: add homebrew bump (#2434)
* Chore:  add homebrew bump

* Chore: update token
2021-10-12 12:52:40 +08:00
barnettZQG
0d036e7449 Feat: initialize the Apiserver framework (#2417)
* Feat: add kubeapi and mongodb datastore implementation

* Style: change kubeapi import code style

* Style: change mongodb package import code style

* Style: add some comment

* Style: change databasePrefix to tableNamePrefix

* Chore: install mongodb in unit-test job

* Chore: install mongodb in compatibility-test job

* Feat: add apiserver e2e test case

* Docs: change developer guide doc

* Feat: use common.Scheme

Co-authored-by: barnettZQG <yiyun.pro>
2021-10-12 11:53:24 +08:00
Somefive
2e20f4862f Fix: update ingress class (#2445) 2021-10-11 20:48:39 +08:00
Zheng Xi Zhou
5865a69576 Fix: add Chart icon and url (#2441)
* Fix: add Chart icon and url

Added an icon and url for KubeVela chart

* Fix: remove local logo file and use a web image
2021-10-11 20:27:56 +08:00
wyike
9c76b2f3ac Fix: race condition of cloneset and statefulSet rollout plugin (#2394)
* Fix: clonset and stateful set

* Fix: e2e-test race condition
2021-10-11 15:47:20 +08:00
Somefive
472ed3a146 Feat: add support for envbinding with namespace selector (#2432)
* Feat: add support for envbinding with namespace selector

* Fix: service account kubeconfig e2e-test

* Docs: add comments to explain functions

* Docs: add envbinding example
2021-10-11 14:52:01 +08:00
Tianxin Dong
f06980c5f4 Fix: fix depends on app built-in step (#2429) 2021-10-09 18:48:53 +08:00
barnettZQG
f70133e5e6 Fix: fix apiserver 1.1.3 not available bug (#2425)
* Fix: fix apiserver 1.1.3 not available bug

* Feat: change apiserver image repository

* Fix(helm chart): fix startup args for apiserver

Co-authored-by: barnettZQG <yiyun.pro>
2021-10-09 16:50:02 +08:00
Somefive
bcd7f3e340 Feat: add secure tls for cluster-gateway (#2426) 2021-10-09 15:23:25 +08:00
Tianxin Dong
c049f497fb Feat: add apply raw built in workflow steps (#2420)
* Feat: add apply raw built in workflow steps

* Feat: add apply raw example

* Fix: change the name to apply object

* Fix: example server name
2021-10-09 12:20:32 +08:00
Jianbo Sun
8b98caaa40 Chore(deps): bump github.com/containerd/containerd from 1.4.8 to 1.4.11 (#2419) 2021-10-09 11:10:50 +08:00
Somefive
46e22cc203 Feat: multicluster support ServiceAccountToken (#2356)
* Feat: support serviceaccount in multicluster

* Fix: add compatibility & support sa

* Fix: add multicluster sa test

* Fix: add test for upgrade func

* Style: format
2021-10-08 14:45:04 +08:00
Jianbo Sun
426fe5cc11 Chore: add chaneglog and add backport github action and change the pull request template (#2410) 2021-10-08 13:35:04 +08:00
Somefive
a3f48425be Feat: use #ApplyComponent for EnvBinding (#2382)
* Feat: use #ApplyComponent in EnvBinding

* Fix: application test compRev control by resourcetracker

* Fix: add more detail in error info
2021-10-08 13:11:14 +08:00
qiaozp
a574fc0fbf Refactor(cli): Refactor vela env, deprecate vela config (#2037)
* Refactor(cli): cut env to namespace, use application to save

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Fix: test

* Fix: typo
2021-10-08 13:10:47 +08:00
Lei Zhang (Harry)
0396d8d8bf Docs: add CD system README (#2411) 2021-10-08 13:10:22 +08:00
Zheng Xi Zhou
b8894b7a44 Fix: support terraform/provider-azure addon (#2402)
Also added some componentdefinitions for Azure cloud resource
2021-10-08 11:35:52 +08:00
Lei Zhang (Harry)
5767d16169 Docs: use graph to explain vela in README (#2404) 2021-10-02 15:06:58 +08:00
GingoBang
83eec87da6 Refactor: change rollout's json tag (#2314)
* Refactor: set rollout as a pointer reference

see issue #2289 for more details

Closes #2289

* Refactor: set rollout as a pointer reference
see issue #2289 for more details

Closes #2289
2021-10-02 10:19:41 +08:00
Somefive
5704c3b83c Fix: fix multicluster coverage bug (#2401) 2021-10-01 08:25:56 +08:00
Reeta Singh
6647a11c86 Chore: deprecate containerized workload (#2330)
* Feat(trait): annotation and labels trait should also affect the workload object along with pod

* Feat(trait): annotation and labels trait should also affect the workload object along with pod

* Feat(trait): annotation and labels trait should also affect the workload object along with pod

* Feat(trait): annotation and labels trait should also affect the workload object along with pod

* Chore: deprecate containerized workload

* Chore: deprecate containerized workload

* Chore: run make reviewable as per review comment

* Chore: fix import

* Chore: merge with master

* Chore: merge with master

* Chore: remove references for containerized workload

* Chore: fix failiing e2e test

* Chore: fix failing e2e test

* Chore: fix failing e2e test

* Chore: fix failing e2e test

* Chore: fix e2e tests

* Chore: fix e2e tests

* Chore: fix e2e tests

* Chore: fix e2e tests

* Chore: fix e2e tests

* Chore: merge with upstream

Co-authored-by: Reeta Singh <reetas@twitter.com>
2021-09-30 16:06:29 +08:00
1328 changed files with 131619 additions and 58465 deletions

4
.github/CODEOWNERS vendored
View File

@@ -1,7 +1,7 @@
# This file is a github code protect rule follow the codeowners https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners#example-of-a-codeowners-file
* @hongchaodeng @wonderflow @leejanee
design/ @hongchaodeng @resouer @wonderflow
* @barnettZQG @wonderflow @leejanee
design/ @barnettZQG @leejanee @wonderflow
# Owner of CUE
pkg/cue @leejanee @FogDong

View File

@@ -1,36 +1,37 @@
<!--
Thank you for sending a pull request! Here are some tips:
1. If this is your first time, please read our contribution guide at https://github.com/oam-dev/kubevela/blob/master/CONTRIBUTING.md
2. Ensure you include and run the appropriate tests as part of your Pull Request.
3. In a new feature or configuration option, an update to the documentation is necessary. Everything related to the documentation is under the docs folder in the root of the repository.
4. If the Pull Request is a work in progress, make use of GitHub's "Draft PR" feature and mark it as such.
5. If you can not merge your Pull Request due to a merge conflict, Rebase it. This gets it in sync with the master branch.
6. Name your PR as "<FeatureArea>: Describe your change", e.g. Application: Add health check for application.
If it's a fix or feature relevant for the changelog describe the user impact in the title.
The PR title is used to auto-generate the changelog for issues marked with the "add to changelog" label.
-->
**What this PR does / why we need it**:
**Which issue(s) this PR fixes**:
### Description of your changes
<!--
- Automatically closes linked issue when the Pull Request is merged.
Usage: "Fixes #<issue number>", or "Fixes (paste link of issue)"
Briefly describe what this pull request does. We love pull requests that resolve an open KubeVela issue. If yours does, you
can uncomment the below line to indicate which issue your PR fixes, for example
"Fixes #500":
-->
Fixes #
**Special notes for your reviewer**:
I have:
- [ ] Read and followed KubeVela's [contribution process](https://github.com/oam-dev/kubevela/blob/master/contribute/create-pull-request.md).
- [ ] [Related Docs](https://github.com/oam-dev/kubevela.io) updated properly. In a new feature or configuration option, an update to the documentation is necessary.
- [ ] Run `make reviewable` to ensure this PR is ready for review.
- [ ] Added `backport release-x.y` labels to auto-backport this PR if necessary.
### How has this code been tested
<!--
Before reviewers can be confident in the correctness of this pull request, it
needs to tested and shown to be correct. Briefly describe the testing that has
already been done or which is planned for this change.
-->
### Special notes for your reviewer
<!--
Be sure to direct your reviewers'
attention to anything that needs special consideration.
-->

10
.github/pr-title-checker-config.json vendored Normal file
View File

@@ -0,0 +1,10 @@
{
"LABEL": {
"name": "title-needs-formatting",
"color": "EEEEEE"
},
"CHECKS": {
"prefixes": ["Fix: ", "Feat: ", "Docs: ", "Test: ", "Chore: ", "CI: ", "Perf: ", "Refactor: ", "Revert: ", "Style: ", "Test: ",
"Fix(", "Feat(", "Docs(", "Test(", "Chore(", "CI(", "Perf(", "Refactor(", "Revert(", "Style(", "Test(", "[Backport"]
}
}

121
.github/workflows/apiserver-test.yaml vendored Normal file
View File

@@ -0,0 +1,121 @@
name: APIServer Unit Test & E2E Test
on:
push:
branches:
- master
- release-*
- apiserver
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
- apiserver
env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
jobs:
detect-noop:
runs-on: ubuntu-20.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v3.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
apiserver-unit-tests:
runs-on: aliyun
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
submodules: true
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
- name: Setup Kind Cluster (Worker)
run: |
kind delete cluster --name worker
kind create cluster --image kindest/node:v1.20.7@sha256:688fba5ce6b825be62a7c7fe1415b35da2bdfbb5a69227c499ea4cc0008661ca --name worker
kubectl version
kubectl cluster-info
kind get kubeconfig --name worker --internal > /tmp/worker.kubeconfig
kind get kubeconfig --name worker > /tmp/worker.client.kubeconfig
- name: Setup Kind Cluster (Hub)
run: |
kind delete cluster
kind create cluster --image kindest/node:v1.20.7@sha256:688fba5ce6b825be62a7c7fe1415b35da2bdfbb5a69227c499ea4cc0008661ca
kubectl version
kubectl cluster-info
- name: Load Image to kind cluster
run: make kind-load
- name: Cleanup for e2e tests
run: |
make e2e-cleanup
make vela-cli
make e2e-setup-core
bin/vela addon enable fluxcd
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
- name: Run api server unit test
run: make unit-test-apiserver
- name: Run api server e2e test
run: |
export ALIYUN_ACCESS_KEY_ID=${{ secrets.ALIYUN_ACCESS_KEY_ID }}
export ALIYUN_ACCESS_KEY_SECRET=${{ secrets.ALIYUN_ACCESS_KEY_SECRET }}
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
make e2e-apiserver-test
- name: Stop kubevela, get profile
run: make end-e2e-core
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt,/tmp/e2e_apiserver_test.out
flags: apiserver-unittests
name: codecov-umbrella
- name: Clean e2e profile
run: rm /tmp/e2e-profile.out
- name: Cleanup image
if: ${{ always() }}
run: make image-cleanup

22
.github/workflows/back-port.yaml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Backport
on:
pull_request_target:
types:
- closed
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
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Open Backport PR
uses: zeebe-io/backport-action@v0.0.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}

View File

@@ -5,6 +5,30 @@ on:
branches: [ master, release-* ]
jobs:
images:
name: Image Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build Vela Core image from Dockerfile
run: |
docker build --build-arg GOPROXY=https://proxy.golang.org -t docker.io/oamdev/vela-core:${{ github.sha }} .
- name: Run Trivy vulnerability scanner for vela core
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/oamdev/vela-core:${{ github.sha }}'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
if: always()
with:
sarif_file: 'trivy-results.sarif'
analyze:
name: Analyze
runs-on: ubuntu-latest

View File

@@ -1,13 +1,19 @@
name: Lint Commit Messages
on: [push, pull_request]
name: PR Title Checker
on:
pull_request:
types:
- opened
- edited
- synchronize
- labeled
- unlabeled
jobs:
commitlint:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: thehanimo/pr-title-checker@v1.3.1
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
with:
helpURL: https://github.com/oam-dev/kubevela/blob/master/contribute/create-pull-request.md#commit-message-format
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pass_on_octokit_error: true
configuration_path: ".github/pr-title-checker-config.json"

View File

@@ -13,7 +13,7 @@ on:
env:
# Common versions
GO_VERSION: '1.16'
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
@@ -60,7 +60,7 @@ jobs:
- name: Setup Kind Cluster (Worker)
run: |
kind delete cluster --name worker
kind create cluster --image kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4 --name worker
kind create cluster --image kindest/node:v1.20.7@sha256:688fba5ce6b825be62a7c7fe1415b35da2bdfbb5a69227c499ea4cc0008661ca --name worker
kubectl version
kubectl cluster-info
kind get kubeconfig --name worker --internal > /tmp/worker.kubeconfig
@@ -69,7 +69,7 @@ jobs:
- name: Setup Kind Cluster (Hub)
run: |
kind delete cluster
kind create cluster --image kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4
kind create cluster --image kindest/node:v1.20.7@sha256:688fba5ce6b825be62a7c7fe1415b35da2bdfbb5a69227c499ea4cc0008661ca
kubectl version
kubectl cluster-info
@@ -79,10 +79,15 @@ jobs:
- name: Cleanup for e2e tests
run: |
make e2e-cleanup
make vela-cli
make e2e-setup-core
make
make setup-runtime-e2e-cluster
- name: Run e2e multicluster tests
run: make e2e-multicluster-test
run: |
export PATH=$(pwd)/bin:$PATH
make e2e-multicluster-test
- name: Stop kubevela, get profile
run: make end-e2e-core

View File

@@ -13,7 +13,7 @@ on:
env:
# Common versions
GO_VERSION: '1.16'
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
@@ -60,7 +60,7 @@ jobs:
- name: Setup Kind Cluster
run: |
kind delete cluster
kind create cluster --image kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4
kind create cluster --image kindest/node:v1.20.7@sha256:688fba5ce6b825be62a7c7fe1415b35da2bdfbb5a69227c499ea4cc0008661ca
kubectl version
kubectl cluster-info
@@ -90,12 +90,12 @@ jobs:
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/e2e-profile.out,/tmp/oam-e2e-profile.out
files: /tmp/e2e-profile.out
flags: e2e-rollout-tests
name: codecov-umbrella
- name: Clean e2e profile
run: rm /tmp/e2e-profile.out /tmp/oam-e2e-profile.out
run: rm /tmp/e2e-profile.out
- name: Cleanup image
if: ${{ always() }}

View File

@@ -13,7 +13,7 @@ on:
env:
# Common versions
GO_VERSION: '1.16'
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
@@ -60,7 +60,7 @@ jobs:
- name: Setup Kind Cluster
run: |
kind delete cluster
kind create cluster --image kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4
kind create cluster --image kindest/node:v1.20.7@sha256:688fba5ce6b825be62a7c7fe1415b35da2bdfbb5a69227c499ea4cc0008661ca
kubectl version
kubectl cluster-info
@@ -83,6 +83,9 @@ jobs:
- name: Run api e2e tests
run: make e2e-api-test
- name: Run addons e2e tests
run: make e2e-addon-test
- name: Run e2e tests
run: make e2e-test
@@ -93,12 +96,12 @@ jobs:
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/e2e-profile.out,/tmp/oam-e2e-profile.out
files: /tmp/e2e-profile.out
flags: e2etests
name: codecov-umbrella
- name: Clean e2e profile
run: rm /tmp/e2e-profile.out /tmp/oam-e2e-profile.out
run: rm /tmp/e2e-profile.out
- name: Cleanup image
if: ${{ always() }}

View File

@@ -13,7 +13,7 @@ on:
env:
# Common versions
GO_VERSION: '1.16'
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
@@ -33,52 +33,6 @@ jobs:
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
compatibility-test:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
submodules: true
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Install ginkgo
run: |
sudo apt-get install -y golang-ginkgo-dev
- name: Setup Kind Cluster
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ env.KIND_VERSION }}
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@v1.2
with:
version: 3.1.0
kubebuilderOnly: false
kubernetesVersion: v1.21.2
- name: Run Make compatibility-test
run: make compatibility-test
- name: Clean up testdata
run: make compatibility-testdata-cleanup
staticcheck:
runs-on: ubuntu-20.04
needs: detect-noop
@@ -103,7 +57,7 @@ jobs:
restore-keys: ${{ runner.os }}-pkg-
- name: Install StaticCheck
run: GO111MODULE=off go get honnef.co/go/tools/cmd/staticcheck
run: GO111MODULE=on go get honnef.co/go/tools/cmd/staticcheck@v0.3.0
- name: Static Check
run: staticcheck ./...
@@ -117,6 +71,11 @@ jobs:
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout
uses: actions/checkout@v2
with:
@@ -134,7 +93,7 @@ jobs:
# version, but we prefer this action because it leaves 'annotations' (i.e.
# it comments on PRs to point out linter violations).
- name: Lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_VERSION }}
@@ -154,6 +113,11 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Cache Go Dependencies
uses: actions/cache@v2
with:

View File

@@ -6,7 +6,7 @@ on:
types: [created]
jobs:
main:
bot:
runs-on: ubuntu-latest
steps:
- name: Checkout Actions
@@ -14,11 +14,56 @@ jobs:
with:
repository: "oam-dev/kubevela-github-actions"
path: ./actions
ref: v0.4.1
ref: v0.4.2
- name: Install Actions
run: npm install --production --prefix ./actions
run: npm ci --production --prefix ./actions
- name: Run Commands
uses: ./actions/commands
with:
token: ${{secrets.VELA_BOT_TOKEN}}
configPath: issue-commands
backport:
runs-on: ubuntu-18.04
if: github.event.issue.pull_request && contains(github.event.comment.body, '/backport')
steps:
- name: Extract Command
id: command
uses: xt0rted/slash-command-action@v1
with:
repo-token: ${{ secrets.VELA_BOT_TOKEN }}
command: backport
reaction: "true"
reaction-type: "eyes"
allow-edits: "false"
permission-level: read
- name: Handle Command
uses: actions/github-script@v4
env:
VERSION: ${{ steps.command.outputs.command-arguments }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const version = process.env.VERSION
let label = "backport release-" + version
if (version.includes("release")) {
label = "backport " + version
}
// Add our backport label.
github.issues.addLabels({
// Every pull request is an issue, but not every issue is a pull request.
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [label]
})
console.log("Added '" + label + "' label.")
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Open Backport PR
uses: zeebe-io/backport-action@v0.0.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}

View File

@@ -44,12 +44,23 @@ jobs:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login Alibaba Cloud ACR
uses: docker/login-action@v1
with:
registry: kubevela-registry.cn-hangzhou.cr.aliyuncs.com
username: ${{ secrets.ACR_USERNAME }}@aliyun-inner.com
password: ${{ secrets.ACR_PASSWORD }}
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
with:
driver-opts: image=moby/buildkit:master
- name: Build & Pushing vela-core for ACR
run: |
docker build --build-arg GOPROXY=https://proxy.golang.org --build-arg VERSION=${{ steps.get_version.outputs.VERSION }} --build-arg GITVERSION=git-${{ steps.vars.outputs.git_revision }} -t kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }} .
docker push kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
- uses: docker/build-push-action@v2
name: Build & Pushing
name: Build & Pushing vela-core for Dockerhub and GHCR
with:
context: .
file: Dockerfile
@@ -61,11 +72,39 @@ jobs:
build-args: |
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
GOPROXY=https://proxy.golang.org
tags: |-
ghcr.io/${{ github.repository }}/vela-core:${{ steps.get_version.outputs.VERSION }}
docker.io/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository }}/vela-core:${{ steps.get_version.outputs.VERSION }}
- name: Build & Pushing vela-apiserver for ACR
run: |
docker build --build-arg GOPROXY=https://proxy.golang.org --build-arg VERSION=${{ steps.get_version.outputs.VERSION }} --build-arg GITVERSION=git-${{ steps.vars.outputs.git_revision }} -t kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }} -f Dockerfile.apiserver .
docker push kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }}
- uses: docker/build-push-action@v2
name: Build & Pushing runtime rollout
name: Build & Pushing vela-apiserver for Dockerhub and GHCR
with:
context: .
file: Dockerfile.apiserver
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/vela-apiserver:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository }}/vela-apiserver:${{ steps.get_version.outputs.VERSION }}
- name: Build & Pushing vela runtime rollout for ACR
run: |
docker build --build-arg GOPROXY=https://proxy.golang.org --build-arg VERSION=${{ steps.get_version.outputs.VERSION }} --build-arg GITVERSION=git-${{ steps.vars.outputs.git_revision }} -t kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }} .
docker push kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
- uses: docker/build-push-action@v2
name: Build & Pushing runtime rollout for Dockerhub and GHCR
with:
context: .
file: runtime/rollout/Dockerfile
@@ -77,9 +116,10 @@ jobs:
build-args: |
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
GOPROXY=https://proxy.golang.org
tags: |-
ghcr.io/${{ github.repository }}/vela-rollout:${{ steps.get_version.outputs.VERSION }}
docker.io/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository }}/vela-rollout:${{ steps.get_version.outputs.VERSION }}
publish-charts:
env:
@@ -102,6 +142,13 @@ jobs:
uses: azure/setup-helm@v1
with:
version: v3.4.0
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Generate helm doc
run: |
make helm-doc-gen
- name: Prepare legacy chart
run: |
rsync -r $LEGACY_HELM_CHART $HELM_CHARTS_DIR
@@ -115,7 +162,7 @@ jobs:
releases-only: true
id: latest_tag
- name: Tag helm chart image
run: |
run: |
latest_repo_tag=${{ steps.latest_tag.outputs.tag }}
sub="."
major="$(cut -d"$sub" -f1 <<<"$latest_repo_tag")"
@@ -147,10 +194,9 @@ jobs:
run: ./ossutil --config-file .ossutilconfig sync oss://$BUCKET/core $LOCAL_OSS_DIRECTORY
- name: add artifacthub stuff to the repo
run: |
rsync README.md $HELM_CHART/README.md
rsync README.md $LEGACY_HELM_CHART/README.md
rsync README.md $OAM_RUNTIME_HELM_CHART/README.md
rsync README.md $VELA_ROLLOUT_HELM_CHART/README.md
rsync $HELM_CHART/README.md $LEGACY_HELM_CHART/README.md
rsync $HELM_CHART/README.md $OAM_RUNTIME_HELM_CHART/README.md
rsync $HELM_CHART/README.md $VELA_ROLLOUT_HELM_CHART/README.md
sed -i "s/ARTIFACT_HUB_REPOSITORY_ID/$ARTIFACT_HUB_REPOSITORY_ID/g" hack/artifacthub/artifacthub-repo.yml
rsync hack/artifacthub/artifacthub-repo.yml $LOCAL_OSS_DIRECTORY
- name: Package helm charts
@@ -179,6 +225,6 @@ jobs:
- name: sync capabilities bucket to local
run: ./ossutil --config-file .ossutilconfig sync oss://$CAPABILITY_BUCKET $CAPABILITY_DIR
- name: rsync all capabilites
run: rsync vela-templates/registry/auto-gen/* $CAPABILITY_DIR
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

View File

@@ -4,126 +4,167 @@ on:
push:
tags:
- "v*"
workflow_dispatch: {}
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 }}
jobs:
publish-cli:
build:
runs-on: ubuntu-latest
name: build
strategy:
matrix:
TARGETS: [ linux/amd64, darwin/amd64, windows/amd64, linux/arm64, darwin/arm64 ]
env:
VELA_VERSION: ${{ github.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.16
id: go
- name: Check out code into the Go module directory
- name: Checkout
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Tag helm chart image
run: |
sed -i 's/latest/${{ steps.get_version.outputs.VERSION }}/g' charts/vela-core/values.yaml
sed -i 's/0.1.0/${{ steps.get_version.outputs.VERSION }}/g' charts/vela-core/Chart.yaml
- name: Run cross-build
run: make cross-build
- name: Run compress binary
run: make compress
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.2.2
- name: Upload Vela Linux amd64 tar.gz
- 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-linux-amd64.tar.gz
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz
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 Linux amd64 zip
- 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-linux-amd64.zip
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.zip
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 Vela MacOS tar.gz
- 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/vela/vela-darwin-amd64.tar.gz
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
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 Vela MacOS zip
- 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/vela/vela-darwin-amd64.zip
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.zip
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: Upload Vela Windows tar.gz
uses: actions/upload-release-asset@v1.0.2
- name: Post sha256
uses: actions/upload-artifact@v2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-windows-amd64.tar.gz
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Vela Windows zip
uses: actions/upload-release-asset@v1.0.2
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
- name: sync local to cloud
run: ./ossutil --config-file .ossutilconfig sync ./_bin/vela oss://$BUCKET/binary/vela/${{ env.VELA_VERSION }}
- name: sync the latest version file
run: |
echo ${{ env.VELA_VERSION }} > ./latest_version
./ossutil --config-file .ossutilconfig cp -u ./latest_version oss://$BUCKET/binary/vela/latest_version
upload-plugin-homebrew:
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:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-windows-amd64.zip
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela Linux amd64 tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-linux-amd64.tar.gz
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela Linux amd64 zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-linux-amd64.zip
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela MacOS tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-darwin-amd64.tar.gz
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela MacOS zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-darwin-amd64.zip
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela Windows tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-windows-amd64.tar.gz
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela Windows zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-windows-amd64.zip
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.zip
asset_content_type: binary/octet-stream
name: 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: ./_bin/sha256sums.txt
asset_path: cli-artifacts/sha256sums.txt
asset_name: sha256sums.txt
asset_content_type: text/plain
- name: Update kubectl plugin version in krew-index
uses: rajatjindal/krew-release-bot@v0.0.38
- name: Update Homebrew formula
uses: dawidd6/action-homebrew-bump-formula@v3
with:
token: ${{ secrets.HOMEBREW_TOKEN }}
formula: kubevela
tag: ${{ github.ref }}
revision: ${{ github.sha }}
force: false

View File

@@ -11,10 +11,10 @@ jobs:
sync-core-api:
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.16
- name: Set up Go 1.17
uses: actions/setup-go@v1
env:
GO_VERSION: '1.16'
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
with:
go-version: ${{ env.GO_VERSION }}

View File

@@ -1,7 +1,7 @@
name: Timed Task
on:
schedule:
- cron: '0 * * * *'
- cron: '* * * * *'
jobs:
clean-image:
runs-on: aliyun

View File

@@ -13,7 +13,7 @@ on:
env:
# Common versions
GO_VERSION: '1.16'
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
@@ -72,7 +72,7 @@ jobs:
version: 3.1.0
kubebuilderOnly: false
kubernetesVersion: v1.21.2
- name: Run Make test
run: make test
@@ -81,5 +81,5 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unittests
flags: core-unittests
name: codecov-umbrella

6
.gitignore vendored
View File

@@ -41,8 +41,12 @@ references/cmd/cli/fake/source.go
references/cmd/cli/fake/chart_source.go
charts/vela-core/crds/_.yaml
.test_vela
tmp/
.vela/
# check docs
git-page/
git-page/
# e2e rollout runtime image build
runtime/rollout/e2e/tmp

View File

@@ -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.exe"
to: "."
- from: "*/kubectl-vela"
to: "kubectl-vela.exe"
- from: "*/LICENSE"
to: "."
bin: "kubectl-vela.exe"

260
CHANGELOG/CHANGELOG-1.0.md Normal file
View File

@@ -0,0 +1,260 @@
# v1.0.7
This is a minor fix for release-1.0, please refer to release-1.1.x for the latest feature.
1. Fix podDisruptive field for inner traits #1844
# v1.0.6
1. fix bug: When the Component contains multiple traits of the same type, the status of the trait in the Application is reported incorrectly (#1731) (#1743)
2. Fix terraform component can't work normally, generate OpenAPI JSON schema for Terraform Component (#1738) (#1753)
3. Improve the logging system #1735 #1758
4. add ConcurrentReconciles for setting the concurrent reconcile number of the controller #1775
# v1.0.5
1. Fix Terraform application status issue (#1611)
2. applicaiton supports specifying different versions of Definition (#1597)
3. Enable Dynamic Admission Control for Application (#1619)
4. Update inner samples for "vela show xxx --web" (#1616)
5. fix empty rolloutBatch will panic whole controller bug (#1646)
6. Use stricter syntax check for CUE (#1643)
7. make ResourceTracker to own cluster-scope resource (#1634)
8. update docs
# v1.0.4
## Upgrade to this release
**Please update Application CRD to upgrade from v1.0.3 to this release**
```
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_applications.yaml
```
**Check the upgrade docs to upgrade from other release: https://kubevela.io/docs/advanced-install#upgrade**
## Changelog
1. add more PVC volume traits and docs (#1524)
2. automatically sync vela api code to the repo([kubevela-core-api](https://github.com/oam-dev/kubevela-core-api)) on release, you can use this repo as import package for kubevela integration (#1523)
3. fix cue template of worker and ingress with more accurate error info (#1532)
4. add critical path k8s event for Application (#1463)
5. support K8s Deployment for AppRollout #1539 #1557
6. vela cli: enable "vela show" to support namespaced capability (#1521)
7. Add scpoe reference in Application object `status.Service` (#1540)
8. vela cli: `vela show` support list the parameter of ComponentDefinition created by helm charts (#1543)
9. Add revision mechanism for Component/Trait Definition and default revision histroy will keep 20 revisions #1531
10. fix CRD for legacy K8s cluser(<=1.14) (#1531)
11. fix duplate key in kubevela chart webhook yaml (#1571)
12. Check whether parameter.cmd is nill for `sidecar` trait (#1575)
13. add e2e-test into test coverage report (#1553)
14. support krew install for kubectl vela plugin #1582
15. fix controller cannot start due to the format error of the third-party CRD (#1584)
16. use accelerate domain for helm chart repo to speed up for global users (#1585)
17. embed rollout in an application, now you can use rolloutPlan in Application (#1568)
18. Support server-side Terraform as cloud resource provider #1519
# v1.0.3
More end user guide was added in `Application Deployment` section.
1. add helm test to verify the chart of KubeVela have been installed successfully (#1415)
2. fix bug which Component/TraitDefinition won't work when contains “`_|_`” in value (#1450)
3. add volumes definition in worker/webservice (#1459)
4. Remove local kind binary dependency #1458
5. ignore error not found when deleting resourceTracker (#1462)
6. add context.appRevisionNum as runtime context (#1466)
7. implement cli `vela system live-diff` to check diff before upgrade (#1419)
8. add webhook validation on CUE template outputs name (#1460)
9. Fix helm chart about wrong webhook policy (#1483)
10. Remove trait-injector from controller options (#1490)
12. add app name as label for AppRevision (#1488)
13. Introduce vela as a kubectl plugin (#1485)
14. update status of appContext by patch to avoid resourceVersion conflict error (#1500)
15. add workloadDefinitionRef to application status.services (#1471)
16. Add garbage collection mechanism for AppRevision, it will only keep 10 revisions by default (#1501)
17. Remove AGE in definition crd print columns (#1509)
# v1.0.2
1. remove no used ingress notes in KubeVela charts (#1405)
2. fix import inner package in the format of third party package path and add docs (#1412 #1417)
3. vela cli support use "vela system cue-packages" to list cue-package (#1417)
4. Fix bug that the registered k8s built-in gvk does not exist in third party package path (#1414)
5. Fix bug that patchKey not work when strategyUnify function not work with close call (#1430)
6. add podDisruptive to traitdefinition to notify wether a trait update will cause restart of pod or not (#1192)
7. Add a new cloneset scale controller (#1301)
8. Support garbage collection for across-namespace workloads and traits (#1421)
9. Add short name for crds && Remove redundant and ambiguous short names #1434
10. Refresh built-in packages when component/trait definition are registered (#1402)
**You should upgrade following CRDs to upgrade from v1.0.1, all CRDs changes are backward compatible**:
```
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_resourcetrackers.yaml
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/standard.oam.dev_rollouttraits.yaml
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_traitdefinitions.yaml
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_applications.yaml
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_approllouts.yaml
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml
```
# v1.0.1
There are some fixes contained for release v1.0.0:
1. add initial finalizer and abandon support for app rollout, you can revert quickly now(#1362)
2. fix vela show fail to get component definition (#1366)
3. fix application context controller should not own application object (#1370)
4. fix: "system-definition-namespace" chart args not work in vela chart (#1371)
5. fix resources created in different namespace can not be updated (#1374)
6. fix automatically generate schema for helm values fail in array list value (#1375)
7. upgrade API version of mutate/validate webhook to v1 (#1383)
8. fix webhook not work by helm install kubevela without cert-manager #1267
7. remove create cert-manager issuer in vela CLI env command (#1267)
8. refine CRD print results: add additional print column and short Name for CRD (#1377)
Many other docs improvements.
Thanks for all the contributors!
# v1.0.0
We're excited to announce the release of KubeVela 1.0.0! 🎉🎉🎉🎉
Thanks to all the new and existing contributors who helped make this release happen!
You may already noticed the awesome community has shipped a brand new KubeVela website https://kubevela.io ! 🎉🎉
If you're new to KubeVela, feel free to start with its [getting started page](https://kubevela.io/docs/quick-start) and learning about [its core concepts](https://kubevela.io/docs/concepts). The full feature of vela is explained in [platform builder guide](https://kubevela.io/docs/platform-engineers/overview).
For existing adopters, please follow the [installing](https://kubevela.io/docs/install) or [upgrading](https://kubevela.io/docs/install#upgrade) KubeVela to version 1.0.0.
## Acknowledgements ❤️
Thanks to everyone who made this release possible!
@captainroy-hy @sunny0826 @leejanee @yangsoon @wangyikewxgm @hongchaodeng @zzxwill @ryanzhang-oss @resouer @wonderflow @hprotzek @vnzongzna @majian159 @Cweiping @mengjiao-liu @kushthedude @unknwon @Ghostbaby @mosesyou @dylandee @wangkai1994 @LeoLiuYan @just-do1 @hoopoe61 @Incubator4th @TomorJM @hahchenchen @zeed-w-beez @allenhaozi @mason1kwok @kinsolee @shikanon @96RadhikaJadhav
# What's New
## API version upgraded to `v1beta1`
All user facing APIs have been upgraded to `v1beta1`, you could learn more details in the [API Changes](#API-Changes) section below.
## `ComponentDefinition`
The [`ComponentDefinition`](https://kubevela.io/docs/platform-engineers/definition-and-templates) now takes the responsibility of defining encapsulation and abstraction for your app components. And you are free to choose to use Helm chart or CUE to define them. This leaves `WorkloadDefinition` focusing on declaring workload characteristic such as `replicable`, `childResource` etc, so the `spec.schematic` field in `WorkloadDefinition` could be deprecated in next few releases.
## Application Versioning and Progressive Rollout
* A rolling style upgrade was supported by the object called [`AppRollout`](https://kubevela.io/docs/rollout/rollout/). It can help you to upgrade an Application from source revision to the target and support Blue/Green, Canary and A/B testing rollout strategy.
* Multi-Version, Multi-Cluster Application Deployment was supported by the object called [`AppDeployment`](https://kubevela.io/docs/rollout/appdeploy). It can help you to deploy multiple revision apps to multiple clusters with leverage of Service Mesh.
## Visualization Enhancement
KubeVela now automatically generates Open-API-v3 Schema for all the definition abstractions including CUE, Helm and raw Kubernetes resource templates. You can integrate KubeVela with your own dashboard and [generate forms from definitions](https://kubevela.io/docs/platform-engineers/openapi-v3-json-schema) at ease!
## Application Abstraction
There're several major updates on the `Application` abstraction itself:
* [Helm based abstraction](https://kubevela.io/docs/helm/component) was supported with few [limitations](https://kubevela.io/docs/helm/known-issues). In other words, you can now declare any existing Helm chart as an app component in KubeVela. The most exciting part is the trait system of KubeVela works seamlessly with the Helm based components, yes, just [attach trait](https://kubevela.io/docs/helm/trait) to it!
* [Raw Kubernetes resource templates](https://kubevela.io/docs/kube/component) was still supported, that's simpler but less powerful comparing to [the CUE way](https://kubevela.io/docs/cue/component). Of course, the trait system also [works seamless](https://kubevela.io/docs/kube/trait) with it.
## CUE Template Enhancement
* [Runtime information context](https://kubevela.io/docs/cue/component#full-available-information-in-cue-context) was supported, you could use this information to render the resources in CUE template.
* [Data passing](https://kubevela.io/docs/cue/advanced#data-passing) was supported during CUE rendering. Specifically, the `context.output` contains the rendered workload API resource and the `context.outputs.<xx>` contains all the other rendered API resources.
* [K8s API resources are now built-in packages](https://kubevela.io/docs/cue/basic#import-kube-package): the K8s built-in API including CRD will be discovered by KubeVela and automatically built as CUE packages, you can use it in your CUE template. This is very helpful in validation especially on writing new CUE templates.
* [Dry-run Application](https://kubevela.io/docs/platform-engineers/debug-test-cue) was supported along with a debug and test guide for building CUE template. You can create CUE based definitions with confidence now!
* [Deploy resources in different namespaces](https://kubevela.io/docs/cue/cross-namespace-resource/) was supported now, you can specify namespace in your CUE template.
## Declare and Consume Cloud Resources
* [Declare and consume cloud resources](https://kubevela.io/docs/platform-engineers/cloud-services/) were supported now in KubeVela, you can easily register cloud resources by `ComponentDefinition` and bind the service into the applications.
## A brand new website
We have upgraded our website [kubevela.io](https://github.com/oam-dev/kubevela.io) based on "Docusaurus". All docs is automatically generated from [KubeVela](https://github.com/oam-dev/kubevela/tree/master/docs) while the blogs are on [kubevela.io/blogs](https://github.com/oam-dev/kubevela.io/tree/main/blog).
# Changes
## API Changes
1. Change definition from cluster scope to namespace scope #1085 the cluster scope CRD was still compatible.
2. Application Spec changes.
- `spec.components[x].settings` in v1alpha2 was changed to `spec.components[x].properties` in v1beta1
- `spec.components[x].traits[x].name` in v1alpha2 was changed to `spec.components[x].traits[x].type` in v1beta1
Example of the v1alpha2 Spec:
```
apiVersion: core.oam.dev/v1alpha2
kind: Application
metadata:
name: first-vela-app
spec:
components:
- name: express-server
type: webservice
settings:
...
traits:
- name: ingress
properties:
...
```
Example of the v1beta1 Spec:
```
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: first-vela-app
spec:
components:
- name: express-server
type: webservice
properties:
...
traits:
- type: ingress
properties:
...
```
## Deprecation
1. route/autoscaler/metrics these three traits and their controllers were moved out from the vela core. #1172 You could still find and use them from https://github.com/oam-dev/catalog.
2. the dashboard was deprecated in KubeVela and we will merge these features and create a new in [velacp](https://github.com/oam-dev/velacp) soon.
3. vela CLI will only support run/modify an app from appfile by using `vela up`, so some other commands related were deprecated, such as `vela svc deploy`, `vela <trait> ...`
## Other Notable changes
1. `prometheus` and `certmanager` CRD are not required in installation #1005
2. Parent overrides child when annotation/labels conflicts && one revision will apply once only in force mode && AC.status CRD updated #1109
3. `ApplicationRevision` CRD Object was introduced as revision of Application #1214
4. KubeVela chart image pull policy was changed to `Always` from `IfNotPresent` #1228
5.` Application` Controller will use `AppContext` to manage the resources generation #1245, in other word, you can run KubeVela `Application Controller` without any `v1apha2 Object`.
6. The regular time for all events automatically sync changed from 5min to 1 hour #1285
7. `vela system dry-run` will print raw K8s resources in a better format #1246
# Known Issues
1. Built-in CUE package was not supported now for K8s Cluster v1.20, we will support in the next release. #1313
2. Resources created in different namespace from application will only be garbage collected (GC) when the application deleted, an update will not trigger GC for now, we will fix it in the next release. #1339
Thanks again to all the contributors!

243
CHANGELOG/CHANGELOG-1.1.md Normal file
View File

@@ -0,0 +1,243 @@
# v1.1.3
## What's Changed
* Fix: remove ocm addon enable in Makefile by @Somefive in https://github.com/oam-dev/kubevela/pull/2327
* Chore(cli): remove useless deploy.yaml by @chivalryq in https://github.com/oam-dev/kubevela/pull/2335
* Fix: do not override the workload name if its specified by @FogDong in https://github.com/oam-dev/kubevela/pull/2336
* Fix: remove appcontext CRD and controller by @wonderflow in https://github.com/oam-dev/kubevela/pull/2270
* Feat: add revisionHistoryLimit to helm chart by @haugom in https://github.com/oam-dev/kubevela/pull/2343
* Chore: deprecate 'vela dashboard' apiserver by @chivalryq in https://github.com/oam-dev/kubevela/pull/2341
* Chore: remove e2e-api-test in rollout test to speed up by @chivalryq in https://github.com/oam-dev/kubevela/pull/2345
* Docs: rollout demo by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2348
* Feat: add vela minimal chart by @FogDong in https://github.com/oam-dev/kubevela/pull/2340
* Fix: runc security issue by @Somefive in https://github.com/oam-dev/kubevela/pull/2350
* Docs: add a WeChat QR code by @barnettZQG in https://github.com/oam-dev/kubevela/pull/2351
* Feat: Initialize api for vela dashboard and CLI by @barnettZQG in https://github.com/oam-dev/kubevela/pull/2339
* Fix(helm chart): fix startup args for apiserver by @yangsoon in https://github.com/oam-dev/kubevela/pull/2362
* Fix: dockerfile e2e test command lack environment configuration by @Somefive in https://github.com/oam-dev/kubevela/pull/2231
* Feat: inputs support setting value in array by @leejanee in https://github.com/oam-dev/kubevela/pull/2358
* Feat: support rollout controller for StatefulSet by @whichxjy in https://github.com/oam-dev/kubevela/pull/1969
* Fix: delete deprecated vela dashboard in e2e setup by @FogDong in https://github.com/oam-dev/kubevela/pull/2379
* Fix: try fix CI unit test by @wonderflow in https://github.com/oam-dev/kubevela/pull/2376
* Feat: Addon REST API by @hongchaodeng in https://github.com/oam-dev/kubevela/pull/2369
* Fix: fix built in workflow steps by @FogDong in https://github.com/oam-dev/kubevela/pull/2378
* Feat: add vela minimal in make manifests by @FogDong in https://github.com/oam-dev/kubevela/pull/2389
* Chore(deps): bump go.mongodb.org/mongo-driver from 1.3.2 to 1.5.1 by @wonderflow in https://github.com/oam-dev/kubevela/pull/2391
* Fix: use aliyun oss istio chart by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2392
* Support remote git repo for Terraform configuration by @zzxwill in https://github.com/oam-dev/kubevela/pull/2337
* Feat: add inputs test cases and optimize code by @leejanee in https://github.com/oam-dev/kubevela/pull/2388
* Fix: pass owner to workload if rollout failed by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2397
* Feat: bootstrap multicluster testing by @Somefive in https://github.com/oam-dev/kubevela/pull/2368
* Feat(workflow): add depends on in workflow by @FogDong in https://github.com/oam-dev/kubevela/pull/2387
* Fix: make the name of Terraform credential secret same to component name by @zzxwill in https://github.com/oam-dev/kubevela/pull/2399
* Fix: revision GC in workflow mode by @FogDong in https://github.com/oam-dev/kubevela/pull/2355
* Fix: Applied Resources Statistics Error by @leejanee in https://github.com/oam-dev/kubevela/pull/2398
# v1.1.2
This is a bug fix release.
Since the big v1.1.1 release, many users had given it try for our new features. We sincerely appreciate your enthusiasm and amazing feedback.
There are some small issues found by our users and we have fixed them. Most notably:
- The Charts of addons (prometheus, etc.) are moved to OSS to provide better accessibility and network speed.
- The FluxCD and Terraform addons are not enabled by default. Users can install them via `vela addon enable ...`.
We have located more small issues around templates as well and fixed them, and decided a bug fix release ASAP.
Users are highly recommended to use the v1.1.2 release instead. We want to thank all of our users sincerely! ❤️ ❤️ ❤️
## What's Changed
* Fix(rollout): improve rollback experience by @hongchaodeng in https://github.com/oam-dev/kubevela/pull/2294
* Fix: fix typo by @hughxia in https://github.com/oam-dev/kubevela/pull/2317
* Fix: fix cluster-gateway image tag in chart by @Somefive in https://github.com/oam-dev/kubevela/pull/2318
* Fix: workflow example by @leejanee in https://github.com/oam-dev/kubevela/pull/2323
* Fix: fix multicluster values bug by @Somefive in https://github.com/oam-dev/kubevela/pull/2326
* Fix(helm): Do not install fluxcd and terraform by default by @yangsoon in https://github.com/oam-dev/kubevela/pull/2328
* Fix: move charts from github repo to Alibaba Cloud OSS repo by @zzxwill in https://github.com/oam-dev/kubevela/pull/2324
* Fix: add comments and adjust helm typed component's spec by @zzxwill in https://github.com/oam-dev/kubevela/pull/2332
* Fix: fix multicluster template bug by @Somefive in https://github.com/oam-dev/kubevela/pull/2333
* Feat: add args for init-contianer and sidecar by @Gallardot in https://github.com/oam-dev/kubevela/pull/2331
# v1.1.1
Users are highly recommended to use the v1.1.2 release instead.
# Changes since v1.1.0
1. rollout trait change IncreaseFirst to DecreaseFirst (#2142)
2. Feat(definition): add built-in dingtalk workflow step definition (#2152)
3. Fix(dryrun): add default name and namespace in dry run (#2150)
4. Docs: fix typo about workflow rollout (#2163)
5. Fix: traitdefinition controller reconcile in a infinite loop (#2157)
6. Refactor: change the ownerReference of configMap which store the parameter for each revision to definitionRevision (#2164)
7. Fix: add fluxcd dashbaords (#2130)
8. Feat: modify apply component cue action to support skipWorkload trait (#2167)
9. Trait: Add TraitDefinition for PVC (#2158)
10. initilize KubeVela codeowner file (#2178)
11. Feat(cue): support access components artifacts in cue template context (#2161)
12. Feat(addon): add default enable addon (#2172)
13. Feat(envbinding): add resourceTracker for envBinding (#2179)
14. Fix: align all CUE template keyword to use parameter (#2181)
15. Feat: add vela live-diff , dry-run, cue-packages into vela commands (#2182)
16. Fix: move Terraform defintions charts/vela-core/templates/definitions (#2176)
17. Fix: add patchkey to volumes (#2191)
18. Feat(workflow): add depends-on workflow step definition (#2190)
19. Feat: add pprof (#2192)
20. Feat: add more registry traits as internal ones (#2184)
21. Fix: support more Terraform variable types (#2194)
22. Fix: update help message of ingress trait (#2198)
23. Refactor(#2185): remove unused config options in Makefile (#2200)
24. Docs: update environment design (#2199)
25. Fix: modify service-binding with more accurate type (#2209)
26. Feat(healthscope): add health-scope-binding policy and e2e test for health scope (#2205)
27. Feat(workflow): support dingding and slack in webhook notification (#2213)
28. Feat(workflow): add apply application workflow step definition (#2186)
29. Feat(workflow): input.ParameterKey described like paths notation (#2214)
30. Fix(upgrade): upgrade controller-tools from 0.2 to 0.6.2 (#2215)
31. Fix(app): When only the policy is specified, the resources in the app need to be rendered and created (#2197)
32. Feat(workflow): outputs support script notation (#2218)
33. Fix(addon): rename clonset-service to clonse (#2219)
34. Feat(workflow): Add op.#Task action (#2220)
35. Fix(webhook): only check the uniqueness of component names under the same namespace (#2222)
36. Feat(apiserver): add apiserver service to helm chart (#2225)
37. Fix: add flag --label to filer components and traits (#2217)
38. Fix(addons): remove kruise addon (#2226)
39. Feat: add pressure-test parameter optimize (#2230)
40. Fix: align the envbind-app name with the original application name (#2232)
41. Feat(workflow): add status check for workflow mutil-env deploy (#2229)
42. Refactor: move from io/ioutil to io and os package (#2234)
43. Feat(trait): annotation and labels trait should also affect the workload object along with pod (#2237)
44. Feat(app): show health status from HealthScope in application (#2228)
45. Fix: kustomize json patch trait definition (#2239)
46. Docs: canary rollout demo (rollout part only) (#2177)
47. Feat: vela show annotations display undefined should be refined (#2244)
48. Feat: support code-generator and sync to kubevela-core-api (#2174)
49. Feat: add image auto update for gitops (#2251)
50. Fix: fix the output DB_PASSWORD for rds definition (#2267)
51. Fix: add alibaba eip cloud resource (#2268)
52. Refactor application code to make it run as Dag workflow (#2236)
53. Fix: remove podspecworkload controller and CRD (#2269)
54. Feat: add more options for leader election configuration to avoid pressure on apiserver
55. Feat: istio addon and use case demo (#2276)
56. Fix: patch any key using retainKeys strategy (#2280)
57. Fix: add exponential backoff wait time for workflow reconciling (#2279)
58. Refactor: change field exportKey to valueFrom (#2284)
59. Fix(helm): enable apiserver by default (#2249)
60. Feat: alibaba provider addon (#2243)
61. Support MultiCluster EnvBinding with cluster-gateway (#2247)
62. Fix: fix apply application workflow step (#2288)
63. Fix: fix alibaba cloud rds module (#2293)
64. Feat: add commit msg in kustomize (#2296)
65. Feat: allow user specify alibaba provider addon's region (#2297)
66. Fix: generate service in canary-traffic trait (#2300)
67. Fix: imagePullSecrets error from cloneset (#2305)
68. Fix: add application logging dashboard (#2301)
69. Feat: Make applicationComponent can be modified in step (#2304)
70. Fix: generate service in canary-traffic trait (#2307)
# v1.1.0
Note: the documents (https://kubevela.io/) for v1.1.0 is still WIP, so we mark it as pre-release. The ETA for documents is next 2 weeks.
We would like to extend our thanks to all [the new and existing contributors](https://github.com/oam-dev/kubevela/graphs/contributors) who helped make this release happen.
Please follow the guide to [install](https://kubevela.io/docs/next/getting-started/quick-install) or [upgrade](https://kubevela.io/docs/next/platform-engineers/advanced-install/) KubeVela to version v1.1.0.
## What's New
- **Hybrid Environment App Delivery Control plane**
- In the new release, we have fully upgraded KubeVela to a multi-cluster/hybrid-cloud/multi-cloud app delivery control plane with leverage of OAM as the consistent app delivery model across clouds and infrastructures.
- **Workflow**
- KubeVela has added a Workflow mechanism that empowers users to glue any operational tasks to customize the control logic to build more complex operations. Workflow is modular by design and each module is mainly composed in CUE -- so you can define complex operations in a declarative, data-driven manner.
- **Environment**
- KubeVela added an Initializer which allow users to define what constructs the environment. The environment Initialized by the Initilizer could contain different kinds of resources include K8s cluster, system components, policies and almost everything. Of course, you can destry an environment very easily with the help of Initializer.
- **Out of Box Addons**
- With the help of Initilizer, KubeVela has support lots of out of box addons. You can list/enable/disable them by `vela addon` command. Each addon is an Initializer that deloy the CRD Controllers and other resources related.
- **Cloud Resources Support**
- We also support terraform to provision almost every cloud resources and pass through to other components defined in KubeVela application.
- **Tools to edit and manage X-Definition**
- We also provide the `vela def` tool sets to provide unified CUE based capability to manage X-Definition.
- **Others**
- Allow specify name for component revision auto-generated by Application. Allow specify name for auto generated Definition revision.
- Controller runtime dependency upgrade that can compatible with Kubernetes v1.21 . KubeVela support Kubernetes v1.18~v1.21.
- Other details you could read changelog in the release history.
## Change log since v1.1-rc2
1. fix configmap patchkey bug (#2080)
2. Merge velacp to apiserver branch in oam repo (#2039) (#2127) (#2087)
3. support rollout controller seprated and install as helm chart in runtime cluster (#2075)
4. fix bug that KubeVela can not be installed in specified namespace (#2083)
5. enable vela def to use import decl (#2084)
6. enhance envbinding: support apply resources to cluster (#2093)
7. Add obsevability addon (#2091)
8. Feat(vela): add vela workflow suspend command (#2108)
9. feat(def): add built-in workflow definitions (#2094)
10. Feat(vela): add vela workflow resume command (#2114)
11. upgrade openkruise version to v0.9.0 (#2076)
12. Fix(workflow): set workload name in configmap if the name is not specified (#2119)
13. helm component support OSS bucket (#2104)
14. add rollout demo with Workflow (#2121)
15. Support script as parameter and make the WorkflowStepDefinition more universal (#2124)
16. fix(cli) fix bug when vela show componetdefinition's workload type is AutoDetectWorkloadDefinition (#2125)
17. Fix(workflow): set the namespace to app's ns if it's not specified (#2133)
18. fix specify external revision bug (#2126)
19. add CUE-based health check in HealthScope controller (#1956)
20. Feat(addon): Add source and patch to kustomize definition (#2138)
21. Feat(vela): add vela workflow terminate and restart command (#2131)
# v1.1.0-rc.2
1. Allow users to specify component revision name in Application (#1929) the new field `externalRevision` can specify the revision name.
```
kind: Application
spec:
components:
- name: mycomp
type: webservice
externalRevision: my-revision-v1
properties:
...
```
2. Add more workflow demo and fix some demos #2042 #2059 #2060 #2064
3. Add cloneset ComponentDefinition into kruise addon (#2050)
4. definitions support specify the revision name (#2044), you can specify the name by adding an annotation `definitionrevision.oam.dev/name`
```
apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
name: worker
annotations:
# you can specify the revision name in annotations
definitionrevision.oam.dev/name: "1.1.3"
spec:
...
```
5. fix definition controller log error cause by openapi schema generation error (#2063)
6. Add add-on input go-template implementation (#2049)
# v1.1.0-rc.1
1. Workflow support specify Order Steps by Field Tag (#2022)
2. support application policy (#2011)
3. add OCM multi cluster demo (#1992)
4. Fix(volume): seperate volume to trait (#2027)
5. allow application skip gc resource and leave workload ownerReference controlled by rollout(#2024)
6. Store component parameters in context (#2030)
7. Allow specify chart values for helm trait(#2033)
8. workflow support http provider (#2029)
9. Use vela def commands to replace mergedef.sh for internal definition generation (#2031)
# Other release histories
Refer to https://github.com/oam-dev/kubevela/releases

205
CHANGELOG/CHANGELOG-1.2.md Normal file
View File

@@ -0,0 +1,205 @@
# v1.2.2
## What's Changed
* Feat: add JFrog webhook trigger by @chwetion in https://github.com/oam-dev/kubevela/pull/3104
* Fix: trait/comp command output without a new line by @chivalryq in https://github.com/oam-dev/kubevela/pull/3112
* Feat: support wild match for env patch by @Somefive in https://github.com/oam-dev/kubevela/pull/3111
* Fix: fix revision will change when add new trait with skiprevisionaffect to application by @chwetion in https://github.com/oam-dev/kubevela/pull/3032
* Fix: add app samples for Terraform definition by @zzxwill in https://github.com/oam-dev/kubevela/pull/3118
* Feat: add port name in webservice by @FogDong in https://github.com/oam-dev/kubevela/pull/3110
* Fix: add imagePullSecrets for helm templates to support private docker registry by @StevenLeiZhang in https://github.com/oam-dev/kubevela/pull/3122
* Fix: workflow skip executing all steps occasionally by @leejanee in https://github.com/oam-dev/kubevela/pull/3025
* Fix: support generate Terraform ComponentDefinition from local HCL file by @zzxwill in https://github.com/oam-dev/kubevela/pull/3132
* Fix: prioritize namespace flag for `vela up` by @devholic in https://github.com/oam-dev/kubevela/pull/3135
* Fix: handle workflow cache reconcile by @FogDong in https://github.com/oam-dev/kubevela/pull/3128
* Feat: extend gateway trait to set class in spec by @devholic in https://github.com/oam-dev/kubevela/pull/3138
* Fix: add providerRef in generated ComponentDefinition by @zzxwill in https://github.com/oam-dev/kubevela/pull/3142
* Fix: retrieve Terraform variables from variables.tf by @zzxwill in https://github.com/oam-dev/kubevela/pull/3149
* Feat: addon parameter support ui-shcema by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/3154
* Fix: vela addnon enable cannot support '=' by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/3156
* Fix: add context parameters into the error message by @zeed-w-beez in https://github.com/oam-dev/kubevela/pull/3145
* Feat: support vela show for workflow step definition by @FogDong in https://github.com/oam-dev/kubevela/pull/3140
## New Contributors
* @devholic made their first contribution in https://github.com/oam-dev/kubevela/pull/3135
**Full Changelog**: https://github.com/oam-dev/kubevela/compare/v1.2.1...v1.2.2
# v1.2.1
## What's Changed
* Fix: can't query data from the MongoDB by @barnettZQG in https://github.com/oam-dev/kubevela/pull/3095
* Fix: use personel token of vela-bot instead of github token for homebrew update by @wonderflow in https://github.com/oam-dev/kubevela/pull/3096
* Fix: acr image no version by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/3100
* Fix: support generate cloud resource docs in Chinese by @zzxwill in https://github.com/oam-dev/kubevela/pull/3079
* Fix: clear old data in mongodb unit test case by @barnettZQG in https://github.com/oam-dev/kubevela/pull/3103
* Feat: support external revision in patch component by @Somefive in https://github.com/oam-dev/kubevela/pull/3106
* Fix: file under the path of github addon registry is not ignored by @StevenLeiZhang in https://github.com/oam-dev/kubevela/pull/3099
* Fix: Vela is crashed, when disabling addon, which needs namespace vela-system by @StevenLeiZhang in https://github.com/oam-dev/kubevela/pull/3109
* Fix: rollout workload namespace not aligned with rollout by @Somefive in https://github.com/oam-dev/kubevela/pull/3107
## New Contributors
* @StevenLeiZhang made their first contribution in https://github.com/oam-dev/kubevela/pull/3099
**Full Changelog**: https://github.com/oam-dev/kubevela/compare/v1.2.0...v1.2.1
# v1.2.0
❤️ KubeVela v1.2.0 released ! ❤️
Docs have been updated about the release at https://kubevela.io/docs/next/ .
**Changelog Between v1.2.0-rc.2~v1.2.0**: https://github.com/oam-dev/kubevela/compare/v1.2.0-rc.2...v1.2.0
## What's New
### UI Console Supported
Check how to use the GUI by this [how-to document](https://kubevela.io/docs/next/how-to/dashboard/application/create-application).
**GUI frontend code repo is here: https://github.com/oam-dev/velaux**
**API Server Code is here: https://github.com/oam-dev/kubevela/tree/master/pkg/apiserver**
We also add a [VelaQL](https://kubevela.io/docs/next/platform-engineers/system-operation/velaql) feature that could allow apiserver to interact with K8s Object in an extended way.
### Addon System
We add a new addon system in v1.2, this helps KubeVela install it's extension including more than X-Definition files.
The community has already supported some built-in addons herehttps://github.com/oam-dev/catalog/tree/master/addons , there're also some experimental addons here https://github.com/oam-dev/catalog/tree/master/experimental/addons
You can learn how to use it [from docs](https://kubevela.io/docs/next/how-to/cli/addon/addon).
You can [build and contribute](https://kubevela.io/docs/next/platform-engineers/addon/intro) your own addons.
### CI/CD Integration
You can use triggers to integrate with different CI and image registry systems on VelaUX.
* Feat: add ACR webhook trigger for CI/CD (#3044)
* Feat: add Harbor image registry webhook trigger for CI/CD (#3065)
* Feat: add DockerHub webhook trigger for CI/CD (#3081)
### Cloud Resources Enhancement
* Feature: support terraform/provider-azure addon by @zzxwill in https://github.com/oam-dev/kubevela/pull/2402
* Fix: aws/azure Terraform provider are broken by @zzxwill in https://github.com/oam-dev/kubevela/pull/2513 , https://github.com/oam-dev/kubevela/pull/2520 , https://github.com/oam-dev/kubevela/pull/2465
* Feat: Add Terraform Azure Storage Account by @maciejgwizdala in https://github.com/oam-dev/kubevela/pull/2646
* Docs: add vpc and vswitch cloud resource templates of alicloud by @lowkeyrd in https://github.com/oam-dev/kubevela/pull/2663
* Fix: allow external cloud resources to be kept when Application is deleted by @zzxwill in https://github.com/oam-dev/kubevela/pull/2698
* Feat: add alibaba cloud redis definition by @chivalryq in https://github.com/oam-dev/kubevela/pull/2507
* Feat: envbinding support cloud resource deploy and share by @Somefive in https://github.com/oam-dev/kubevela/pull/2734
* Fix: support naming a terraform provider by @zzxwill in https://github.com/oam-dev/kubevela/pull/2794
### Multi-Cluster Enhancement
* Feat: multicluster support ServiceAccountToken by @Somefive in https://github.com/oam-dev/kubevela/pull/2356
* Feat: add secure tls for cluster-gateway by @Somefive in https://github.com/oam-dev/kubevela/pull/2426
* Feat: add support for envbinding with namespace selector by @Somefive in https://github.com/oam-dev/kubevela/pull/2432
* Feat: upgrade cluster gateway to support remote debug by @Somefive in https://github.com/oam-dev/kubevela/pull/2673
* Feat: set multicluster enabled by default by @Somefive in #2930
### Workflow Enhancement
* Feat: add apply raw built in workflow steps by @FogDong in https://github.com/oam-dev/kubevela/pull/2420
* Feat: add read object step def by @FogDong in https://github.com/oam-dev/kubevela/pull/2480
* Feat: add export config and secret def for workflow by @FogDong in https://github.com/oam-dev/kubevela/pull/2484
* Feat: support secret in webhook notification by @FogDong in https://github.com/oam-dev/kubevela/pull/2509
* Feat: Record workflow execution state by @leejanee in https://github.com/oam-dev/kubevela/pull/2479
* Fix(cli): use flag instead of env in workflow cli by @FogDong in https://github.com/oam-dev/kubevela/pull/2512
* Not update resource if render hash equal. by @leejanee in https://github.com/oam-dev/kubevela/pull/2522
* Feat: add email support in webhook notification by @FogDong in https://github.com/oam-dev/kubevela/pull/2535
* Feat: add render component and apply component remaining by @FogDong in https://github.com/oam-dev/kubevela/pull/2587
* Feat: add list application records api by @FogDong in https://github.com/oam-dev/kubevela/pull/2757
* Feat: component-pod-view support filter resource by cluster name and cluster namespace by @yangsoon in https://github.com/oam-dev/kubevela/pull/2754
* Feat: workflow support update by @barnettZQG in https://github.com/oam-dev/kubevela/pull/2760
* Feat: add workflow reconciling backoff time and failed limit times by @FogDong in #2881
### Component/Trait Enhancement
* Feat: add health check and custom status for helm type component by @chivalryq in https://github.com/oam-dev/kubevela/pull/2499
* Feat: add nocalhost dev config trait definition by @yuyicai in https://github.com/oam-dev/kubevela/pull/2545
* Feat(rollout): fill rolloutBatches if empty when scale up/down by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2569
* Feat: allow import package in custom status cue template by @Chwetion in https://github.com/oam-dev/kubevela/pull/2585
* Feat: add trait service-account by @yangsoon in https://github.com/oam-dev/kubevela/pull/2878
* Fix: add ingress class as arguments by @Somefive in https://github.com/oam-dev/kubevela/pull/2445
* Fix: add libgit2 support for gitops by @FogDong in https://github.com/oam-dev/kubevela/pull/2477
* Fix: make nginx class to be default value and allow pvc trait to attach more than once by @wonderflow in https://github.com/oam-dev/kubevela/pull/2466
* Feat: add imagePullPolicy/imagePullSecret to task def by @chivalryq in https://github.com/oam-dev/kubevela/pull/2503
### Vela CLI Enhancement
* Feat: add vela prob to test cluster by @wonderflow in https://github.com/oam-dev/kubevela/pull/2635
* Feat: vela logs support multicluster by @chivalryq in https://github.com/oam-dev/kubevela/pull/2593
* Feat: vela-cli support use ocm to join/list/detach cluster by @yangsoon in https://github.com/oam-dev/kubevela/pull/2599
* Feat: add vela exec for multi cluster by @wonderflow in https://github.com/oam-dev/kubevela/pull/2299
* Feat: multicluster vela status/exec/port-forward by @Somefive in https://github.com/oam-dev/kubevela/pull/2662
* Fix: support `-n` flag for all commands to specify namespace by @chivalryq in https://github.com/oam-dev/kubevela/pull/2719
* Feat: vela delete add wait and force options by @yangsoon in https://github.com/oam-dev/kubevela/pull/2747
* Feat: add workflow rollback cli by @FogDong in https://github.com/oam-dev/kubevela/pull/2795
* Refactor: refine cli commands && align kubectl-vela with vela && use getnamespaceAndEnv for all by @wonderflow in #3048
### Overall Enhancements
* Feat: ResourceTracker new architecture by @Somefive in https://github.com/oam-dev/kubevela/pull/2849
* New Resource Management Model: Garbage Collection and Resource State Keeper [Desigin Doc](https://github.com/oam-dev/kubevela/blob/master/design/vela-core/resourcetracker_design.md)
* Feat: output log with structured tag & add step duration metrics by @leejanee in https://github.com/oam-dev/kubevela/pull/2683
* Feat: support user defined image registry that allows private installation by @wonderflow in https://github.com/oam-dev/kubevela/pull/2623
* Feat: add a built in garbage-collect policy to application by @yangsoon in https://github.com/oam-dev/kubevela/pull/2575
* Feat: health scope controller support check trait-managing workload by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2527
* Chore: add homebrew bump to support `brew install kubevela` by @basefas in https://github.com/oam-dev/kubevela/pull/2434
* Chore: Update release action to support build binaries for more platform by @basefas in https://github.com/oam-dev/kubevela/pull/2537
* Feat: add reconcile timeout configuration for vela-core by @Somefive in https://github.com/oam-dev/kubevela/pull/2630
* Chore: push docker images to Alibaba Cloud ACR by @zzxwill in https://github.com/oam-dev/kubevela/pull/2601
## What's Changed/Deprecated
* Deprecated: containerized workload by @reetasingh in https://github.com/oam-dev/kubevela/pull/2330
* Deprecated: initializer CRD controller by @chivalryq in https://github.com/oam-dev/kubevela/pull/2491
* Deprecated: remove envbinding controller, use #ApplyComponent for EnvBinding by @Somefive in https://github.com/oam-dev/kubevela/pull/2556 , https://github.com/oam-dev/kubevela/pull/2382
* Deprecated(cli): CLI vela config by @chivalryq in https://github.com/oam-dev/kubevela/pull/2037
* Deprecated: remove addon with no definitions by @chivalryq in https://github.com/oam-dev/kubevela/pull/2574
* Refactor: remove apiserver component from the chart, users should use velaux addon instead by @barnettZQG in https://github.com/oam-dev/kubevela/pull/2838
* Refactor: all addons are migrated from initializer to application objects by @chivalryq in https://github.com/oam-dev/kubevela/pull/2444
* Refactor: change rollout's json tag so the status of rollout will be optional by @GingoBang in https://github.com/oam-dev/kubevela/pull/2314
* Deprecated: deprecate CRD discovery for CUE import in Definition to prevent memory leak and OOM crash (#2925)
* Deprecated: delete approllout related code #3040
* Deprecate: delete appDeployment related logic #3050
## Bugfix
* Feat: rework resource tracker to solve bugs by @Somefive in https://github.com/oam-dev/kubevela/pull/2797
* Fix: change raw extension to pointer by @FogDong in https://github.com/oam-dev/kubevela/pull/2451
* Fix: show reconcile error log by @wonderflow in https://github.com/oam-dev/kubevela/pull/2626
* Fix: Closure Bug In newValue by @leejanee in https://github.com/oam-dev/kubevela/pull/2437
* Fix: resourceTracker compatibility bug by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2467
* Fix(application): nil pointer for component properties by @kinsolee in https://github.com/oam-dev/kubevela/pull/2481
* Fix: Commit step-generate data without success by @leejanee in https://github.com/oam-dev/kubevela/pull/2539
* Fix(cli): client-side throttling in vela CLI by @chivalryq in https://github.com/oam-dev/kubevela/pull/2581
* Fix: fix delete a component from application not delete workload by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2680
* Fix: lookupByScript don't support `import` by @leejanee in https://github.com/oam-dev/kubevela/pull/2788
* Fix: resourcetracker do not garbage collect legacyRTs correctly by @Somefive in https://github.com/oam-dev/kubevela/pull/2817
* Fix: application conditions confusion. by @leejanee in https://github.com/oam-dev/kubevela/pull/2834
## New Contributors
* @GingoBang made their first contribution in https://github.com/oam-dev/kubevela/pull/2314
* @basefas made their first contribution in https://github.com/oam-dev/kubevela/pull/2434
* @yuyicai made their first contribution in https://github.com/oam-dev/kubevela/pull/2540
* @maciejgwizdala made their first contribution in https://github.com/oam-dev/kubevela/pull/2646
* @lowkeyrd made their first contribution in https://github.com/oam-dev/kubevela/pull/2663
* @zxbyoyoyo made their first contribution in https://github.com/oam-dev/kubevela/pull/2703
* @yue9944882 made their first contribution in https://github.com/oam-dev/kubevela/pull/2751
* @snyk-bot made their first contribution in https://github.com/oam-dev/kubevela/pull/2857
* @yunjianzhong made their first contribution in https://github.com/oam-dev/kubevela/pull/3005
* @songminglong made their first contribution in https://github.com/oam-dev/kubevela/pull/3064
* @basuotian made their first contribution in https://github.com/oam-dev/kubevela/pull/3059
* @K1ngram4 made their first contribution in https://github.com/oam-dev/kubevela/pull/3065
**Full Changelog**: https://github.com/oam-dev/kubevela/compare/v1.1.3...v1.2.0

13
CHANGELOG/README.md Normal file
View File

@@ -0,0 +1,13 @@
# CHANGELOGs
## Development release
- [CHANGELOG-1.2.md](./CHANGELOG-1.2.md)
## Current release
- [CHANGELOG-1.1.md](./CHANGELOG-1.1.md)
## Older releases
- [CHANGELOG-1.0.md](./CHANGELOG-1.0.md)

View File

@@ -1,10 +1,16 @@
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16-alpine as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# It's a proxy for CN developer, please unblock it if you have network issue
ARG GOPROXY
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
# 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
@@ -15,6 +21,7 @@ COPY cmd/apiserver/main.go cmd/apiserver/main.go
COPY apis/ apis/
COPY pkg/ pkg/
COPY version/ version/
COPY references/ references/
# Build
ARG TARGETARCH
@@ -24,24 +31,18 @@ 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
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
-o apiserver-${TARGETARCH} cmd/apiserver/main.go
# Use alpine as base image due to the discussion in issue #1448
# You can replace distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-alpine:latest}
FROM ${BASE_IMAGE:-alpine:3.15}
# This is required by daemon connnecting with cri
RUN apk add --no-cache ca-certificates bash
RUN apk add --no-cache ca-certificates bash expat
WORKDIR /
ARG TARGETARCH
COPY --from=builder /workspace/manager-${TARGETARCH} /usr/local/bin/manager
COPY --from=builder /workspace/apiserver-${TARGETARCH} /usr/local/bin/apiserver
COPY entrypoint.sh /usr/local/bin/

49
Dockerfile.apiserver Normal file
View File

@@ -0,0 +1,49 @@
ARG BASE_IMAGE
# Build the manager 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 cmd/core/main.go main.go
COPY cmd/apiserver/main.go cmd/apiserver/main.go
COPY apis/ apis/
COPY pkg/ pkg/
COPY version/ version/
COPY references/ references/
# Build
ARG TARGETARCH
ARG VERSION
ARG GITVERSION
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
-o apiserver-${TARGETARCH} cmd/apiserver/main.go
# Use alpine as base image due to the discussion in issue #1448
# You can replace distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
FROM ${BASE_IMAGE:-alpine:3.15}
# This is required by daemon connnecting with cri
RUN apk add --no-cache ca-certificates bash expat
WORKDIR /
ARG TARGETARCH
COPY --from=builder /workspace/apiserver-${TARGETARCH} /usr/local/bin/apiserver
COPY entrypoint.sh /usr/local/bin/
ENTRYPOINT ["entrypoint.sh"]
CMD ["apiserver"]

View File

@@ -1,5 +1,6 @@
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16-alpine as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
WORKDIR /workspace
# Copy the Go Modules manifests
@@ -17,6 +18,7 @@ COPY cmd/ cmd/
COPY apis/ apis/
COPY pkg/ pkg/
COPY version/ version/
COPY references/ references/
# Build
ARG TARGETARCH
@@ -24,8 +26,8 @@ ARG VERSION
ARG GITVERSION
RUN apk add gcc musl-dev libc-dev ;\
GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go test -c -o manager-${TARGETARCH} -cover -covermode=atomic -coverpkg ./... .
GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go test -c -o manager-${TARGETARCH} -cover -covermode=atomic -coverpkg ./... .
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
@@ -35,10 +37,10 @@ RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
# You can replace distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-alpine:latest}
FROM ${BASE_IMAGE:-alpine:3.15}
# This is required by daemon connnecting with cri
RUN apk add --no-cache ca-certificates bash
RUN apk add --no-cache ca-certificates bash expat
WORKDIR /

281
Makefile
View File

@@ -1,108 +1,39 @@
# Vela version
VELA_VERSION ?= master
# Repo info
GIT_COMMIT ?= git-$(shell git rev-parse --short HEAD)
GIT_COMMIT_LONG ?= $(shell git rev-parse HEAD)
VELA_VERSION_KEY := github.com/oam-dev/kubevela/version.VelaVersion
VELA_GITVERSION_KEY := github.com/oam-dev/kubevela/version.GitRevision
LDFLAGS ?= "-s -w -X $(VELA_VERSION_KEY)=$(VELA_VERSION) -X $(VELA_GITVERSION_KEY)=$(GIT_COMMIT)"
GOBUILD_ENV = GO111MODULE=on CGO_ENABLED=0
GOX = go run github.com/mitchellh/gox
TARGETS := darwin/amd64 linux/amd64 windows/amd64
DIST_DIRS := find * -type d -exec
TIME_LONG = `date +%Y-%m-%d' '%H:%M:%S`
TIME_SHORT = `date +%H:%M:%S`
TIME = $(TIME_SHORT)
BLUE := $(shell printf "\033[34m")
YELLOW := $(shell printf "\033[33m")
RED := $(shell printf "\033[31m")
GREEN := $(shell printf "\033[32m")
CNone := $(shell printf "\033[0m")
INFO = echo ${TIME} ${BLUE}[ .. ]${CNone}
WARN = echo ${TIME} ${YELLOW}[WARN]${CNone}
ERR = echo ${TIME} ${RED}[FAIL]${CNone}
OK = echo ${TIME} ${GREEN}[ OK ]${CNone}
FAIL = (echo ${TIME} ${RED}[FAIL]${CNone} && false)
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
# Image URL to use all building/pushing image targets
VELA_CORE_IMAGE ?= vela-core:latest
VELA_CORE_TEST_IMAGE ?= vela-core-test:$(GIT_COMMIT)
VELA_RUNTIME_ROLLOUT_IMAGE ?= vela-runtime-rollout:latest
include makefiles/const.mk
include makefiles/dependency.mk
include makefiles/release.mk
include makefiles/develop.mk
include makefiles/build.mk
include makefiles/e2e.mk
.DEFAULT_GOAL := all
all: build
# Run tests
test: vet lint staticcheck
go test -coverprofile=coverage.txt ./pkg/... ./cmd/...
go test ./references/appfile/... ./references/cli/... ./references/common/... ./references/plugins/...
test: vet lint staticcheck unit-test-core test-cli-gen
@$(OK) unit-tests pass
test-cli-gen:
mkdir -p ./bin/doc
go run ./hack/docgen/gen.go ./bin/doc
unit-test-core:
go test -coverprofile=coverage.txt $(shell go list ./pkg/... ./cmd/... ./apis/... | grep -v apiserver)
go test $(shell go list ./references/... | grep -v apiserver)
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
@$(OK) build succeed
vela-cli:
$(GOBUILD_ENV) go build -o bin/vela -a -ldflags $(LDFLAGS) ./references/cmd/cli/main.go
kubectl-vela:
$(GOBUILD_ENV) go build -o bin/kubectl-vela -a -ldflags $(LDFLAGS) ./cmd/plugin/main.go
doc-gen:
rm -r docs/en/cli/*
go run hack/docgen/gen.go
PWD := $(shell pwd)
cross-build:
rm -rf _bin
go get github.com/mitchellh/gox@v0.4.0
$(GOBUILD_ENV) $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/vela/{{.OS}}-{{.Arch}}/vela" -osarch='$(TARGETS)' ./references/cmd/cli
$(GOBUILD_ENV) $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/kubectl-vela/{{.OS}}-{{.Arch}}/kubectl-vela" -osarch='$(TARGETS)' ./cmd/plugin
$(GOBUILD_ENV) $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/apiserver/{{.OS}}-{{.Arch}}/apiserver" -osarch="$(TARGETS)" ./cmd/apiserver
build-cleanup:
rm -rf _bin
compress:
( \
echo "\n## Release Info\nVERSION: $(VELA_VERSION)" >> README.md && \
echo "GIT_COMMIT: $(GIT_COMMIT_LONG)\n" >> README.md && \
cd _bin/vela && \
$(DIST_DIRS) cp ../../LICENSE {} \; && \
$(DIST_DIRS) cp ../../README.md {} \; && \
$(DIST_DIRS) tar -zcf vela-{}.tar.gz {} \; && \
$(DIST_DIRS) zip -r vela-{}.zip {} \; && \
cd ../kubectl-vela && \
$(DIST_DIRS) cp ../../LICENSE {} \; && \
$(DIST_DIRS) cp ../../README.md {} \; && \
$(DIST_DIRS) tar -zcf kubectl-vela-{}.tar.gz {} \; && \
$(DIST_DIRS) zip -r kubectl-vela-{}.zip {} \; && \
cd .. && \
sha256sum vela/vela-* kubectl-vela/kubectl-vela-* > sha256sums.txt \
)
# Run against the configured Kubernetes cluster in ~/.kube/config
run:
go run ./cmd/core/main.go --application-revision-limit 5
run-apiserver:
go run ./cmd/apiserver/main.go
# Run go fmt against code
fmt: goimports installcue
go fmt ./...
$(GOIMPORTS) -local github.com/oam-dev/kubevela -w $$(go list -f {{.Dir}} ./...)
$(CUE) fmt ./vela-templates/definitions/internal/*
$(CUE) fmt ./vela-templates/definitions/deprecated/*
$(CUE) fmt ./vela-templates/definitions/registry/*
$(CUE) fmt ./pkg/stdlib/pkgs/*
$(CUE) fmt ./pkg/stdlib/op.cue
@@ -117,7 +48,7 @@ staticcheck: staticchecktool
lint: golangci
$(GOLANGCILINT) run ./...
reviewable: manifests fmt vet lint staticcheck
reviewable: manifests fmt vet lint staticcheck helm-doc-gen
go mod tidy
# Execute auto-gen code commands and ensure branch is clean.
@@ -126,89 +57,43 @@ check-diff: reviewable
git diff --quiet || ($(ERR) please run 'make reviewable' to include all changes && false)
@$(OK) branch is clean
# Build the docker image
docker-build:
docker build --build-arg=VERSION=$(VELA_VERSION) --build-arg=GITVERSION=$(GIT_COMMIT) -t $(VELA_CORE_IMAGE) .
# Build the runtime docker image
docker-build-runtime-rollout:
docker build --build-arg=VERSION=$(VELA_VERSION) --build-arg=GITVERSION=$(GIT_COMMIT) -t $(VELA_RUNTIME_ROLLOUT_IMAGE) -f runtime/rollout/Dockerfile .
# Push the docker image
docker-push:
docker push $(VELA_CORE_IMAGE)
e2e-setup-core:
sh ./hack/e2e/modify_charts.sh
helm upgrade --install --create-namespace --namespace vela-system --set image.pullPolicy=IfNotPresent --set image.repository=vela-core-test --set applicationRevisionLimit=5 --set dependCheckWait=10s --set image.tag=$(GIT_COMMIT) --set multicluster.enabled=true --wait kubevela ./charts/vela-core
kubectl wait --for=condition=Available deployment/kubevela-vela-core -n vela-system --timeout=180s
build-swagger:
go run ./cmd/apiserver/main.go build-swagger ./docs/apidoc/swagger.json
e2e-setup:
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.9.0/kruise-chart.tgz --set featureGates="PreDownloadImageForInPlaceUpdate=true"
sh ./hack/e2e/modify_charts.sh
helm upgrade --install --create-namespace --namespace vela-system --set image.pullPolicy=IfNotPresent --set image.repository=vela-core-test --set applicationRevisionLimit=5 --set dependCheckWait=10s --set image.tag=$(GIT_COMMIT) --wait kubevela ./charts/vela-core
helm upgrade --install --create-namespace --namespace oam-runtime-system --set image.pullPolicy=IfNotPresent --set image.repository=vela-core-test --set dependCheckWait=10s --set image.tag=$(GIT_COMMIT) --wait oam-runtime ./charts/oam-runtime
bin/vela addon enable fluxcd
bin/vela addon enable terraform
ginkgo version
ginkgo -v -r e2e/setup
timeout 600s bash -c -- 'while true; do kubectl get ns flux-system; if [ $$? -eq 0 ] ; then break; else sleep 5; fi;done'
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-core,app.kubernetes.io/instance=kubevela -n vela-system --timeout=600s
kubectl wait --for=condition=Ready pod -l app=source-controller -n flux-system --timeout=600s
kubectl wait --for=condition=Ready pod -l app=helm-controller -n flux-system --timeout=600s
e2e-api-test:
# Run e2e test
ginkgo -v -skipPackage capability,setup,application -r e2e
ginkgo -v -r e2e/application
e2e-test:
# Run e2e test
ginkgo -v --skip="rollout related e2e-test." ./test/e2e-test
@$(OK) tests pass
e2e-rollout-test:
ginkgo -v --focus="rollout related e2e-test." ./test/e2e-test
@$(OK) tests pass
e2e-multicluster-test:
go test -v -coverpkg=./... -coverprofile=/tmp/e2e_multicluster_test.out ./test/e2e-multicluster-test
@$(OK) tests pass
compatibility-test: vet lint staticcheck generate-compatibility-testdata
# Run compatibility test with old crd
COMPATIBILITY_TEST=TRUE go test -race ./pkg/...
@$(OK) compatibility-test pass
generate-compatibility-testdata:
mkdir -p ./test/compatibility-test/testdata
go run ./test/compatibility-test/convert/main.go ./charts/vela-core/crds ./test/compatibility-test/testdata
compatibility-testdata-cleanup:
rm -f ./test/compatibility-test/testdata/*
e2e-cleanup:
# Clean up
rm -rf ~/.vela
image-cleanup:
# Delete Docker image
ifneq (, $(shell which docker))
# Delete Docker images
ifneq ($(shell docker images -q $(VELA_CORE_TEST_IMAGE)),)
docker rmi -f $(VELA_CORE_TEST_IMAGE)
endif
end-e2e-core:
sh ./hack/e2e/end_e2e_core.sh
ifneq ($(shell docker images -q $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE)),)
docker rmi -f $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE)
endif
endif
end-e2e:
sh ./hack/e2e/end_e2e.sh
# load docker image to the kind cluster
kind-load:
kind-load: kind-load-runtime-cluster
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; }
kind-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; }
# Run tests
core-test: fmt vet manifests
go test ./pkg/... -coverprofile cover.out
@@ -221,24 +106,6 @@ manager: fmt vet lint manifests
vela-runtime-rollout-manager: fmt vet lint manifests
$(GOBUILD_ENV) go build -o ./runtime/rollout/bin/manager -a -ldflags $(LDFLAGS) ./runtime/rollout/cmd/main.go
# Run against the configured Kubernetes cluster in ~/.kube/config
core-run: fmt vet manifests
go run ./cmd/core/main.go
# Run against the configured Kubernetes cluster in ~/.kube/config with debug logs
core-debug-run: fmt vet manifests
go run ./cmd/core/main.go --log-debug=true
# Install CRDs and Definitions of Vela Core into a cluster, this is for develop convenient.
core-install: manifests
kubectl apply -f hack/namespace.yaml
kubectl apply -f charts/vela-core/crds/
@$(OK) install succeed
# Uninstall CRDs and Definitions of Vela Core from a cluster, this is for develop convenient.
core-uninstall: manifests
kubectl delete -f charts/vela-core/crds/
# Generate manifests e.g. CRD, RBAC etc.
manifests: installcue kustomize
go generate $(foreach t,pkg apis,./$(t)/...)
@@ -248,83 +115,21 @@ manifests: installcue kustomize
go run ./hack/crd/dispatch/dispatch.go config/crd/base charts/vela-core/crds charts/oam-runtime/crds runtime/ charts/vela-minimal/crds
rm -f config/crd/base/*
./vela-templates/gen_definitions.sh
go run ./vela-templates/gen_addons.go
GOLANGCILINT_VERSION ?= v1.38.0
HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
HOSTARCH := $(shell uname -m)
ifeq ($(HOSTARCH),x86_64)
HOSTARCH := amd64
endif
golangci:
ifeq (, $(shell which golangci-lint))
@{ \
set -e ;\
echo 'installing golangci-lint-$(GOLANGCILINT_VERSION)' ;\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) $(GOLANGCILINT_VERSION) ;\
echo 'Install succeed' ;\
}
GOLANGCILINT=$(GOBIN)/golangci-lint
else
GOLANGCILINT=$(shell which golangci-lint)
endif
.PHONY: staticchecktool
staticchecktool:
ifeq (, $(shell which staticcheck))
@{ \
set -e ;\
echo 'installing honnef.co/go/tools/cmd/staticcheck ' ;\
GO111MODULE=off go get honnef.co/go/tools/cmd/staticcheck ;\
}
STATICCHECK=$(GOBIN)/staticcheck
else
STATICCHECK=$(shell which staticcheck)
endif
.PHONY: goimports
goimports:
ifeq (, $(shell which goimports))
@{ \
set -e ;\
GO111MODULE=off go get -u golang.org/x/tools/cmd/goimports ;\
}
GOIMPORTS=$(GOBIN)/goimports
else
GOIMPORTS=$(shell which goimports)
endif
.PHONY: installcue
installcue:
ifeq (, $(shell which cue))
@{ \
set -e ;\
GO111MODULE=off go get -u cuelang.org/go/cmd/cue ;\
}
CUE=$(GOBIN)/cue
else
CUE=$(shell which cue)
endif
KUSTOMIZE_VERSION ?= 3.8.2
.PHONY: kustomize
kustomize:
ifeq (, $(shell kustomize version | grep $(KUSTOMIZE_VERSION)))
@{ \
set -e ;\
echo 'installing kustomize-v$(KUSTOMIZE_VERSION) into $(GOBIN)' ;\
curl -s https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh | bash -s $(KUSTOMIZE_VERSION) $(GOBIN);\
echo 'Install succeed' ;\
}
KUSTOMIZE=$(GOBIN)/kustomize
else
KUSTOMIZE=$(shell which kustomize)
endif
check-license-header:
./hack/licence/header-check.sh
def-install:
./hack/utils/installdefinition.sh
helm-doc-gen: helmdoc
readme-generator -v charts/vela-core/values.yaml -r charts/vela-core/README.md
readme-generator -v charts/vela-minimal/values.yaml -r charts/vela-minimal/README.md

View File

@@ -1,44 +1,60 @@
aliases:
kubevela-devex:
- hongchaodeng
- wonderflow
Reviewers:
- Ghostbaby
- StevenLeiZhang
- chwetion
- yue9944882
- zxbyoyoyo
- reetasingh
- wangwang
- evanli18
- devholic
- fourierr
- JooKS-me
kubevela-dashboard-approver:
- zzxwill
- hongchaodeng
Approvers:
- Somefive (Multi-Cluster)
- chivalryq (Vela CLI)
- sunny0826 (kubevela.io)
- hanxie-crypto (VelaUX)
- FogDong (Workflow)
- wangyikewxgm (Addon)
- yangsoon (VelaQL
kubevela-dashboard-reviewer:
- sunny0826
- hanxie-crypto
Maintainers:
- wonderflow
- hongchaodeng
- captainroy-hy
- resouer
- barnettZQG
- leejanee
- zzxwill
- BinaryHB0916
- dhiguero
kubevela-controller:
- resouer
- wonderflow
- hongchaodeng
- zzxwill
- ryanzhang-oss
- captainroy-hy
Emeritus Members:
- ryanzhang-oss
- Fei-Guo
- szihai
- xiaoyuaiheshui
- wenxinnnnn
- silenceper
- erdun
- mosesyou
- artursouza
- woshilanren11
oam-spec: # inherit from https://github.com/oam-dev/spec/blob/master/OWNERS.md
- hongchaodeng
- resouer
community-collaborators:
- Fei-Guo
- szihai
bootstrap-contributors: # thank you for bootstrapping KubeVela at the very early stage!
- xiaoyuaiheshui
- Ghostbaby
- wenxinnnnn
- silenceper
- erdun
- sunny0826
- mosesyou
- artursouza
- wonderflow
- hongchaodeng
- ryanzhang-oss
- woshilanren11
- hanxie-crypto
- zzxwill
bootstrap-contributors: # thank you for bootstrapping KubeVela at the very early stage!
- xiaoyuaiheshui
- Ghostbaby
- wenxinnnnn
- silenceper
- erdun
- sunny0826
- mosesyou
- artursouza
- wonderflow
- hongchaodeng
- ryanzhang-oss
- woshilanren11
- hanxie-crypto
- zzxwill

View File

@@ -1,3 +1,11 @@
<div style="text-align: center">
<p align="center">
<img src="https://raw.githubusercontent.com/oam-dev/kubevela.io/main/docs/resources/KubeVela-03.png">
<br><br>
<i>Make shipping applications more enjoyable.</i>
</p>
</div>
![Build status](https://github.com/oam-dev/kubevela/workflows/E2E/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/oam-dev/kubevela)](https://goreportcard.com/report/github.com/oam-dev/kubevela)
![Docker Pulls](https://img.shields.io/docker/pulls/oamdev/vela-core)
@@ -7,22 +15,23 @@
[![TODOs](https://img.shields.io/endpoint?url=https://api.tickgit.com/badge?repo=github.com/oam-dev/kubevela)](https://www.tickgit.com/browse?repo=github.com/oam-dev/kubevela)
[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2Foam_dev)](https://twitter.com/oam_dev)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kubevela)](https://artifacthub.io/packages/search?repo=kubevela)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4602/badge)](https://bestpractices.coreinfrastructure.org/projects/4602)
![logo](https://raw.githubusercontent.com/oam-dev/kubevela.io/main/docs/resources/KubeVela-03.png)
## Introduction
*Make shipping applications more enjoyable.*
KubeVela is a modern application delivery platform that makes deploying and operating applications across today's hybrid, multi-cloud environments easier, faster and more reliable.
# KubeVela
![](docs/resources/what-is-kubevela.png)
KubeVela is a modern application platform that makes deploying and managing applications across today's hybrid, multi-cloud environments easier and faster.
## Highlights
## Features
KubeVela practices the "render, orchestrate, deploy" workflow with below highlighted values added to existing ecosystem:
**Application Centric** - KubeVela introduces [Open Application Model (OAM)](https://oam.dev/) as the consistent yet higher level API to capture a full deployment of microservices on top of hybrid environments. Placement strategy, traffic shifting and rolling update are declared at application level. No infrastructure level concern, simply deploy.
- *Application Centric* - KubeVela introduces [Open Application Model (OAM)](https://oam.dev/) as the consistent yet higher level API to capture and render a full deployment of microservices on top of hybrid environments. Placement strategy, traffic shifting and rolling update are declared at application level. No infrastructure level concern, simply deploy.
**Programmable Workflow** - KubeVela leverages [CUE](https://cuelang.org/) to implement its model layer. This allows you to declare application deployment workflow as a DAG, with all steps and application's needs glued together in programmable approach. No restrictions, natively extensible.
- *Programmable Workflow* - KubeVela models application delivery as DAG (Directed Acyclic Graph) and expresses it with [CUE](https://cuelang.org/) - a modern data configuration language. This allows you to design application deployment steps per needs and orchestrate them in programmable approach. No restrictions, natively extensible.
**Runtime Agnostic** - KubeVela works as an application delivery control plane that is fully runtime agnostic. It can deploy and manage any application components including containers, cloud functions, databases, or even EC2 instances across hybrid environments, following the workflow you defined.
- *Infrastructure Agnostic* - KubeVela works as an application delivery control plane that is fully decoupled from runtime infrastructure. It can deploy any workload types including containers, cloud services, databases, or even VM instances to any cloud or Kubernetes cluster, following the workflow designed by you.
## Getting Started
@@ -42,7 +51,8 @@ Full documentation is available on the [KubeVela website](https://kubevela.io/).
- Wechat Group (*Chinese*): Broker wechat to add you into the user group.
<img src="https://static.kubevela.net/images/barnett-wechat.jpg" width="200" />
- Bi-weekly Community Call: [Meeting Notes](https://docs.google.com/document/d/1nqdFEyULekyksFHtFvgvFAYE-0AMHKoS3RMnaKsarjs)
- Bi-weekly Community Call: [Meeting Notes](https://docs.google.com/document/d/1nqdFEyULekyksFHtFvgvFAYE-0AMHKoS3RMnaKsarjs).
- Bi-weekly Chinese Community Call: [Video Records](https://space.bilibili.com/180074935/channel/seriesdetail?sid=1842207).
## Talks and Conferences

View File

@@ -17,12 +17,18 @@ limitations under the License.
package common
import (
"encoding/json"
"errors"
"github.com/oam-dev/terraform-controller/api/v1beta2"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"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"
)
// Kube defines the encapsulation in raw Kubernetes resource format
@@ -109,6 +115,11 @@ type Terraform struct {
// +kubebuilder:default:=hcl
// +kubebuilder:validation:Enum:=hcl;json;remote
Type string `json:"type,omitempty"`
// Path is the sub-directory of remote git repository. It's valid when remote is set
Path string `json:"path,omitempty"`
v1beta2.BaseConfigurationSpec `json:",inline"`
}
// A WorkloadTypeDescriptor refer to a Workload Type
@@ -157,7 +168,7 @@ type Status struct {
HealthPolicy string `json:"healthPolicy,omitempty"`
}
// ApplicationPhase is a label for the condition of a application at the current time
// ApplicationPhase is a label for the condition of an application at the current time
type ApplicationPhase string
const (
@@ -181,26 +192,36 @@ const (
ApplicationRunning ApplicationPhase = "running"
// ApplicationUnhealthy means the app finished rendering and applied result to the cluster, but still unhealthy
ApplicationUnhealthy ApplicationPhase = "unhealthy"
// ApplicationDeleting means application is being deleted
ApplicationDeleting ApplicationPhase = "deleting"
)
// WorkflowState is a string that mark the workflow state
type WorkflowState string
const (
// WorkflowStateInitializing means the workflow is in initial state
WorkflowStateInitializing WorkflowState = "initializing"
// WorkflowStateTerminated means workflow is terminated manually, and it won't be started unless the spec changed.
WorkflowStateTerminated WorkflowState = "terminated"
// WorkflowStateSuspended means workflow is suspended manually, and it can be resumed.
WorkflowStateSuspended WorkflowState = "suspended"
// WorkflowStateFinished means workflow is running successfully, all steps finished.
// WorkflowStateSucceeded means workflow is running successfully, all steps finished.
WorkflowStateSucceeded WorkflowState = "Succeeded"
// WorkflowStateFinished means workflow is end.
WorkflowStateFinished WorkflowState = "finished"
// WorkflowStateExecuting means workflow is still running or waiting some steps.
WorkflowStateExecuting WorkflowState = "executing"
// WorkflowStateSkipping means it will skip this reconcile and let next reconcile to handle it.
WorkflowStateSkipping WorkflowState = "skipping"
)
// ApplicationComponentStatus record the health status of App component
type ApplicationComponentStatus struct {
Name string `json:"name"`
Env string `json:"env,omitempty"`
Name string `json:"name"`
Namespace string `json:"namespace,omitempty"`
Cluster string `json:"cluster,omitempty"`
Env string `json:"env,omitempty"`
// WorkloadDefinition is the definition of a WorkloadDefinition, such as deployments/apps.v1
WorkloadDefinition WorkloadGVK `json:"workloadDefinition,omitempty"`
Healthy bool `json:"healthy"`
@@ -243,6 +264,10 @@ type WorkflowStepStatus struct {
// A brief CamelCase message indicating details about why the workflowStep is in this state.
Reason string `json:"reason,omitempty"`
SubSteps *SubStepsStatus `json:"subSteps,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"`
}
// WorkflowSubStepStatus record the status of a workflow step
@@ -267,8 +292,6 @@ type AppStatus struct {
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
Rollout AppRolloutStatus `json:"rollout,omitempty"`
Phase ApplicationPhase `json:"status,omitempty"`
// Components record the related Components created by Application Controller
@@ -277,9 +300,6 @@ type AppStatus struct {
// Services record the status of the application services
Services []ApplicationComponentStatus `json:"services,omitempty"`
// ResourceTracker record the status of the ResourceTracker
ResourceTracker *corev1.ObjectReference `json:"resourceTracker,omitempty"`
// Workflow record the status of workflow
Workflow *WorkflowStatus `json:"workflow,omitempty"`
@@ -289,18 +309,50 @@ type AppStatus struct {
// AppliedResources record the resources that the workflow step apply.
AppliedResources []ClusterObjectReference `json:"appliedResources,omitempty"`
// PolicyStatus records the status of policy
PolicyStatus []PolicyStatus `json:"policy,omitempty"`
}
// PolicyStatus records the status of policy
type PolicyStatus struct {
Name string `json:"name"`
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
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"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties *runtime.RawExtension `json:"properties,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"`
Suspend bool `json:"suspend"`
Terminated bool `json:"terminated"`
Finished bool `json:"finished"`
ContextBackend *corev1.ObjectReference `json:"contextBackend,omitempty"`
Steps []WorkflowStepStatus `json:"steps,omitempty"`
StartTime metav1.Time `json:"startTime,omitempty"`
}
// SubStepsStatus record the status of workflow steps.
@@ -316,7 +368,7 @@ type WorkflowStepPhase string
const (
// WorkflowStepPhaseSucceeded will make the controller run the next step.
WorkflowStepPhaseSucceeded WorkflowStepPhase = "succeeded"
// WorkflowStepPhaseFailed will make the controller stop the workflow and report error in `message`.
// WorkflowStepPhaseFailed will report error in `message`.
WorkflowStepPhaseFailed WorkflowStepPhase = "failed"
// WorkflowStepPhaseStopped will make the controller stop the workflow.
WorkflowStepPhaseStopped WorkflowStepPhase = "stopped"
@@ -369,7 +421,7 @@ type AppRolloutStatus struct {
type ApplicationTrait struct {
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
}
// ApplicationComponent describe the component of application
@@ -379,7 +431,7 @@ type ApplicationComponent struct {
// ExternalRevision specified the component revisionName
ExternalRevision string `json:"externalRevision,omitempty"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs StepInputs `json:"inputs,omitempty"`
@@ -446,9 +498,141 @@ const (
WorkflowResourceCreator ResourceCreatorRole = "workflow"
)
// OAMObjectReference defines the object reference for an oam resource
type OAMObjectReference struct {
Component string `json:"component,omitempty"`
Trait string `json:"trait,omitempty"`
Env string `json:"env,omitempty"`
}
// Equal check if two references are equal
func (in OAMObjectReference) Equal(r OAMObjectReference) bool {
return in.Component == r.Component && in.Trait == r.Trait && in.Env == r.Env
}
// AddLabelsToObject add labels to object if properties are not empty
func (in OAMObjectReference) AddLabelsToObject(obj client.Object) {
labels := obj.GetLabels()
if labels == nil {
labels = map[string]string{}
}
if in.Component != "" {
labels[oam.LabelAppComponent] = in.Component
}
if in.Trait != "" {
labels[oam.TraitTypeLabel] = in.Trait
}
if in.Env != "" {
labels[oam.LabelAppEnv] = in.Env
}
obj.SetLabels(labels)
}
// NewOAMObjectReferenceFromObject create OAMObjectReference from object
func NewOAMObjectReferenceFromObject(obj client.Object) OAMObjectReference {
if labels := obj.GetLabels(); labels != nil {
return OAMObjectReference{
Component: labels[oam.LabelAppComponent],
Trait: labels[oam.TraitTypeLabel],
Env: labels[oam.LabelAppEnv],
}
}
return OAMObjectReference{}
}
// ClusterObjectReference defines the object reference with cluster.
type ClusterObjectReference struct {
Cluster string `json:"cluster,omitempty"`
Creator ResourceCreatorRole `json:"creator,omitempty"`
corev1.ObjectReference `json:",inline"`
}
// Equal check if two references are equal
func (in ClusterObjectReference) Equal(r ClusterObjectReference) bool {
return in.APIVersion == r.APIVersion && in.Kind == r.Kind && in.Name == r.Name && in.Namespace == r.Namespace && in.UID == r.UID && in.Creator == r.Creator && in.Cluster == r.Cluster
}
// RawExtensionPointer is the pointer of raw extension
type RawExtensionPointer struct {
RawExtension *runtime.RawExtension
}
// MarshalJSON may get called on pointers or values, so implement MarshalJSON on value.
// http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go
func (re RawExtensionPointer) MarshalJSON() ([]byte, error) {
if re.RawExtension == nil {
return nil, nil
}
if re.RawExtension.Raw == nil {
// TODO: this is to support legacy behavior of JSONPrinter and YAMLPrinter, which
// expect to call json.Marshal on arbitrary versioned objects (even those not in
// the scheme). pkg/kubectl/resource#AsVersionedObjects and its interaction with
// kubectl get on objects not in the scheme needs to be updated to ensure that the
// objects that are not part of the scheme are correctly put into the right form.
if re.RawExtension.Object != nil {
return json.Marshal(re.RawExtension.Object)
}
return []byte("null"), nil
}
// TODO: Check whether ContentType is actually JSON before returning it.
return re.RawExtension.Raw, nil
}
// ApplicationConditionType is a valid value for ApplicationCondition.Type
type ApplicationConditionType int
const (
// ParsedCondition indicates whether the parsing is successful.
ParsedCondition ApplicationConditionType = iota
// RevisionCondition indicates whether the generated revision is successful.
RevisionCondition
// PolicyCondition indicates whether policy processing is successful.
PolicyCondition
// RenderCondition indicates whether render processing is successful.
RenderCondition
// WorkflowCondition indicates whether workflow processing is successful.
WorkflowCondition
// RolloutCondition indicates whether rollout processing is successful.
RolloutCondition
// ReadyCondition indicates whether whole application processing is successful.
ReadyCondition
)
var conditions = map[ApplicationConditionType]string{
ParsedCondition: "Parsed",
RevisionCondition: "Revision",
PolicyCondition: "Policy",
RenderCondition: "Render",
WorkflowCondition: "Workflow",
RolloutCondition: "Rollout",
ReadyCondition: "Ready",
}
// String returns the string corresponding to the condition type.
func (ct ApplicationConditionType) String() string {
return conditions[ct]
}
// ParseApplicationConditionType parse ApplicationCondition Type.
func ParseApplicationConditionType(s string) (ApplicationConditionType, error) {
for k, v := range conditions {
if v == s {
return k, nil
}
}
return -1, errors.New("unknown condition type")
}
// ReferredObject the referred Kubernetes object
type ReferredObject struct {
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
runtime.RawExtension `json:",inline"`
}
// ReferredObjectList a list of referred Kubernetes objects
type ReferredObjectList struct {
// Objects a list of Kubernetes objects.
// +optional
Objects []ReferredObject `json:"objects,omitempty"`
}

View File

@@ -0,0 +1,60 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package common
import (
"testing"
"github.com/stretchr/testify/require"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
func TestOAMObjectReference(t *testing.T) {
r := require.New(t)
o1 := OAMObjectReference{
Component: "component",
Trait: "trait",
Env: "env",
}
obj := &unstructured.Unstructured{}
o2 := NewOAMObjectReferenceFromObject(obj)
r.False(o2.Equal(o1))
o1.AddLabelsToObject(obj)
r.Equal(3, len(obj.GetLabels()))
o3 := NewOAMObjectReferenceFromObject(obj)
r.True(o1.Equal(o3))
o3.Component = "comp"
r.False(o3.Equal(o1))
r.True(o1.Equal(*o1.DeepCopy()))
o4 := OAMObjectReference{}
o1.DeepCopyInto(&o4)
r.True(o4.Equal(o1))
}
func TestClusterObjectReference(t *testing.T) {
r := require.New(t)
o1 := ClusterObjectReference{
Cluster: "cluster",
ObjectReference: v1.ObjectReference{Kind: "kind"},
}
o2 := *o1.DeepCopy()
r.True(o1.Equal(o2))
o2.Cluster = "c"
r.False(o2.Equal(o1))
}

View File

@@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
@@ -22,6 +23,7 @@ package common
import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@@ -44,7 +46,6 @@ func (in *AppRolloutStatus) DeepCopy() *AppRolloutStatus {
func (in *AppStatus) DeepCopyInto(out *AppStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
in.Rollout.DeepCopyInto(&out.Rollout)
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]v1.ObjectReference, len(*in))
@@ -57,11 +58,6 @@ func (in *AppStatus) DeepCopyInto(out *AppStatus) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.ResourceTracker != nil {
in, out := &in.ResourceTracker, &out.ResourceTracker
*out = new(v1.ObjectReference)
**out = **in
}
if in.Workflow != nil {
in, out := &in.Workflow, &out.Workflow
*out = new(WorkflowStatus)
@@ -77,6 +73,13 @@ func (in *AppStatus) DeepCopyInto(out *AppStatus) {
*out = make([]ClusterObjectReference, len(*in))
copy(*out, *in)
}
if in.PolicyStatus != nil {
in, out := &in.PolicyStatus, &out.PolicyStatus
*out = make([]PolicyStatus, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppStatus.
@@ -92,7 +95,11 @@ func (in *AppStatus) DeepCopy() *AppStatus {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationComponent) DeepCopyInto(out *ApplicationComponent) {
*out = *in
in.Properties.DeepCopyInto(&out.Properties)
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))
@@ -163,7 +170,11 @@ func (in *ApplicationComponentStatus) DeepCopy() *ApplicationComponentStatus {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationTrait) DeepCopyInto(out *ApplicationTrait) {
*out = *in
in.Properties.DeepCopyInto(&out.Properties)
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationTrait.
@@ -387,6 +398,41 @@ func (in *KubeParameter) DeepCopy() *KubeParameter {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OAMObjectReference) DeepCopyInto(out *OAMObjectReference) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAMObjectReference.
func (in *OAMObjectReference) DeepCopy() *OAMObjectReference {
if in == nil {
return nil
}
out := new(OAMObjectReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PolicyStatus) DeepCopyInto(out *PolicyStatus) {
*out = *in
if in.Status != nil {
in, out := &in.Status, &out.Status
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyStatus.
func (in *PolicyStatus) DeepCopy() *PolicyStatus {
if in == nil {
return nil
}
out := new(PolicyStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RawComponent) DeepCopyInto(out *RawComponent) {
*out = *in
@@ -403,6 +449,64 @@ func (in *RawComponent) DeepCopy() *RawComponent {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RawExtensionPointer) DeepCopyInto(out *RawExtensionPointer) {
*out = *in
if in.RawExtension != nil {
in, out := &in.RawExtension, &out.RawExtension
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawExtensionPointer.
func (in *RawExtensionPointer) DeepCopy() *RawExtensionPointer {
if in == nil {
return nil
}
out := new(RawExtensionPointer)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReferredObject) DeepCopyInto(out *ReferredObject) {
*out = *in
in.RawExtension.DeepCopyInto(&out.RawExtension)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReferredObject.
func (in *ReferredObject) DeepCopy() *ReferredObject {
if in == nil {
return nil
}
out := new(ReferredObject)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReferredObjectList) DeepCopyInto(out *ReferredObjectList) {
*out = *in
if in.Objects != nil {
in, out := &in.Objects, &out.Objects
*out = make([]ReferredObject, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReferredObjectList.
func (in *ReferredObjectList) DeepCopy() *ReferredObjectList {
if in == nil {
return nil
}
out := new(ReferredObjectList)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Revision) DeepCopyInto(out *Revision) {
*out = *in
@@ -439,7 +543,7 @@ func (in *Schematic) DeepCopyInto(out *Schematic) {
if in.Terraform != nil {
in, out := &in.Terraform, &out.Terraform
*out = new(Terraform)
**out = **in
(*in).DeepCopyInto(*out)
}
}
@@ -529,6 +633,7 @@ func (in *SubStepsStatus) DeepCopy() *SubStepsStatus {
// 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
in.BaseConfigurationSpec.DeepCopyInto(&out.BaseConfigurationSpec)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Terraform.
@@ -556,6 +661,7 @@ func (in *WorkflowStatus) DeepCopyInto(out *WorkflowStatus) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
in.StartTime.DeepCopyInto(&out.StartTime)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStatus.
@@ -568,6 +674,41 @@ 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.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 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 *WorkflowStepStatus) DeepCopyInto(out *WorkflowStepStatus) {
*out = *in
@@ -576,6 +717,8 @@ func (in *WorkflowStepStatus) DeepCopyInto(out *WorkflowStepStatus) {
*out = new(SubStepsStatus)
(*in).DeepCopyInto(*out)
}
in.FirstExecuteTime.DeepCopyInto(&out.FirstExecuteTime)
in.LastExecuteTime.DeepCopyInto(&out.LastExecuteTime)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStepStatus.

View File

@@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*

View File

@@ -0,0 +1,27 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
const (
// ApplyOncePolicyType refers to the type of configuration drift policy
ApplyOncePolicyType = "apply-once"
)
// ApplyOncePolicySpec defines the spec of preventing configuration drift
type ApplyOncePolicySpec struct {
Enable bool `json:"enable"`
}

View File

@@ -0,0 +1,74 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
const (
// RefObjectsComponentType refers to the type of ref-objects
RefObjectsComponentType = "ref-objects"
)
// RefObjectsComponentSpec defines the spec of ref-objects component
type RefObjectsComponentSpec struct {
// Objects the referrers to the Kubernetes objects
Objects []ObjectReferrer `json:"objects,omitempty"`
}
// ObjectReferrer selects Kubernetes objects
type ObjectReferrer struct {
// ObjectTypeIdentifier identifies the type of referred objects
ObjectTypeIdentifier `json:",inline"`
// ObjectSelector select object by name or labelSelector
ObjectSelector `json:",inline"`
}
// ObjectTypeIdentifier identifies the scheme of Kubernetes object
type ObjectTypeIdentifier struct {
// Resource is the resource name of the Kubernetes object.
Resource string `json:"resource"`
// Group is the API Group of the Kubernetes object.
Group string `json:"group"`
// LegacyObjectTypeIdentifier is the legacy identifier
// Deprecated: use resource/group instead
LegacyObjectTypeIdentifier `json:",inline"`
}
// LegacyObjectTypeIdentifier legacy object type identifier
type LegacyObjectTypeIdentifier struct {
// APIVersion is the APIVersion of the Kubernetes object.
APIVersion string `json:"apiVersion"`
// APIVersion is the Kind of the Kubernetes object.
Kind string `json:"kind"`
}
// ObjectSelector selector for Kubernetes object
type ObjectSelector struct {
// Name is the name of the Kubernetes object.
// If empty, it will inherit the application component's name.
Name string `json:"name,omitempty"`
// Namespace is the namespace for selecting Kubernetes objects.
// If empty, it will inherit the application's namespace.
Namespace string `json:"namespace,omitempty"`
// Cluster is the cluster for selecting Kubernetes objects.
// If empty, it will use the local cluster
Cluster string `json:"cluster,omitempty"`
// LabelSelector selects Kubernetes objects by labels
// Exclusive to "name"
LabelSelector map[string]string `json:"labelSelector,omitempty"`
// DeprecatedLabelSelector a deprecated alias to LabelSelector
// Deprecated: use labelSelector instead.
DeprecatedLabelSelector map[string]string `json:"selector,omitempty"`
}

View File

@@ -17,48 +17,63 @@
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// ClusterManagementEngine represents a multi-cluster management solution
type ClusterManagementEngine string
const (
// OCMEngine represents Open-Cluster-Management multi-cluster management solution
OCMEngine ClusterManagementEngine = "ocm"
// SingleClusterEngine represents single cluster ClusterManagerEngine
SingleClusterEngine ClusterManagementEngine = "single-cluster"
// ClusterGatewayEngine represents multi-cluster management solution with cluster-gateway
ClusterGatewayEngine ClusterManagementEngine = "cluster-gateway"
// EnvBindingPolicyType refers to the type of EnvBinding
EnvBindingPolicyType = "env-binding"
)
// EnvBindingPhase is a label for the condition of a EnvBinding at the current time
type EnvBindingPhase string
// EnvTraitPatch is the patch to trait
type EnvTraitPatch struct {
Type string `json:"type"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
Disable bool `json:"disable,omitempty"`
}
const (
// EnvBindingPrepare means EnvBinding is preparing the pre-work for cluster scheduling
EnvBindingPrepare EnvBindingPhase = "preparing"
// ToApplicationTrait convert EnvTraitPatch into ApplicationTrait
func (in *EnvTraitPatch) ToApplicationTrait() *common.ApplicationTrait {
out := &common.ApplicationTrait{Type: in.Type}
if in.Properties != nil {
out.Properties = in.Properties.DeepCopy()
}
return out
}
// EnvBindingRendering means EnvBinding is rendering the apps in different envs
EnvBindingRendering EnvBindingPhase = "rendering"
// EnvComponentPatch is the patch to component
type EnvComponentPatch struct {
Name string `json:"name"`
Type string `json:"type"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
Traits []EnvTraitPatch `json:"traits,omitempty"`
ExternalRevision string `json:"externalRevision,omitempty"`
}
// EnvBindingScheduling means EnvBinding is deciding which cluster the apps is scheduled to.
EnvBindingScheduling EnvBindingPhase = "scheduling"
// EnvBindingFinished means EnvBinding finished env binding
EnvBindingFinished EnvBindingPhase = "finished"
)
// ToApplicationComponent convert EnvComponentPatch into ApplicationComponent
func (in *EnvComponentPatch) ToApplicationComponent() *common.ApplicationComponent {
out := &common.ApplicationComponent{
Name: in.Name,
Type: in.Type,
}
if in.Properties != nil {
out.Properties = in.Properties.DeepCopy()
}
if in.Traits != nil {
for _, trait := range in.Traits {
if !trait.Disable {
out.Traits = append(out.Traits, *trait.ToApplicationTrait())
}
}
}
return out
}
// EnvPatch specify the parameter configuration for different environments
type EnvPatch struct {
Components []common.ApplicationComponent `json:"components"`
Components []EnvComponentPatch `json:"components,omitempty"`
}
// NamespaceSelector defines the rules to select a Namespace resource.
@@ -86,90 +101,39 @@ type EnvConfig struct {
Name string `json:"name"`
Placement EnvPlacement `json:"placement,omitempty"`
Selector *EnvSelector `json:"selector,omitempty"`
Patch EnvPatch `json:"patch"`
Patch EnvPatch `json:"patch,omitempty"`
}
// AppTemplate represents a application to be configured.
type AppTemplate struct {
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
runtime.RawExtension `json:",inline"`
}
// ClusterDecision recorded the mapping of environment and cluster
type ClusterDecision struct {
Env string `json:"env"`
Cluster string `json:"cluster,omitempty"`
Namespace string `json:"namespace,omitempty"`
}
// A ConfigMapReference is a reference to a configMap in an arbitrary namespace.
type ConfigMapReference struct {
// Name of the secret.
Name string `json:"name"`
// Namespace of the secret.
Namespace string `json:"namespace,omitempty"`
}
// A EnvBindingSpec defines the desired state of a EnvBinding.
// EnvBindingSpec defines a list of envs
type EnvBindingSpec struct {
Engine ClusterManagementEngine `json:"engine,omitempty"`
// AppTemplate indicates the application template.
AppTemplate AppTemplate `json:"appTemplate"`
Envs []EnvConfig `json:"envs"`
// OutputResourcesTo specifies the namespace and name of a ConfigMap
// which store the resources rendered after differentiated configuration
// +optional
OutputResourcesTo *ConfigMapReference `json:"outputResourcesTo,omitempty"`
}
// A EnvBindingStatus is the status of EnvBinding
// PlacementDecision describes the placement of one application instance
type PlacementDecision struct {
Cluster string `json:"cluster"`
Namespace string `json:"namespace"`
}
// String encode placement decision
func (in PlacementDecision) String() string {
return in.Cluster + "/" + in.Namespace
}
// EnvStatus records the status of one env
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)
type ClusterConnection struct {
ClusterName string `json:"clusterName"`
LastActiveRevision string `json:"lastActiveRevision"`
}
// EnvBindingStatus records the status of all env
type EnvBindingStatus struct {
// ConditionedStatus reflects the observed status of a resource
condition.ConditionedStatus `json:",inline"`
Phase EnvBindingPhase `json:"phase,omitempty"`
ClusterDecisions []ClusterDecision `json:"clusterDecisions,omitempty"`
// ResourceTracker record the status of the ResourceTracker
ResourceTracker *corev1.ObjectReference `json:"resourceTracker,omitempty"`
}
// EnvBinding is the Schema for the EnvBinding API
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=envbind
// +kubebuilder:printcolumn:name="ENGINE",type=string,JSONPath=`.spec.engine`
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type EnvBinding struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec EnvBindingSpec `json:"spec,omitempty"`
Status EnvBindingStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// EnvBindingList contains a list of EnvBinding.
type EnvBindingList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []EnvBinding `json:"items"`
}
// SetConditions set condition for EnvBinding
func (e *EnvBinding) SetConditions(c ...condition.Condition) {
e.Status.SetConditions(c...)
}
// GetCondition gets condition from EnvBinding
func (e *EnvBinding) GetCondition(conditionType condition.ConditionType) condition.Condition {
return e.Status.GetCondition(conditionType)
Envs []EnvStatus `json:"envs"`
ClusterConnections []ClusterConnection `json:"clusterConnections"`
}

View File

@@ -0,0 +1,75 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// +kubebuilder:object:root=true
// Policy is the Schema for the policy API
// +kubebuilder:storageversion
// +kubebuilder:resource:categories={oam}
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.type`
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Policy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties *runtime.RawExtension `json:"properties,omitempty"`
}
// +kubebuilder:object:root=true
// PolicyList contains a list of Policy
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type PolicyList struct {
metav1.TypeMeta `json:",inline"`
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"`
}

View File

@@ -0,0 +1,91 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"github.com/oam-dev/kubevela/pkg/oam"
)
const (
// GarbageCollectPolicyType refers to the type of garbage-collect
GarbageCollectPolicyType = "garbage-collect"
)
// GarbageCollectPolicySpec defines the spec of configuration drift
type GarbageCollectPolicySpec struct {
// KeepLegacyResource if is set, outdated versioned resourcetracker will not be recycled automatically
// outdated resources will be kept until resourcetracker be deleted manually
KeepLegacyResource bool `json:"keepLegacyResource,omitempty"`
// Rules defines list of rules to control gc strategy at resource level
// if one resource is controlled by multiple rules, first rule will be used
Rules []GarbageCollectPolicyRule `json:"rules,omitempty"`
}
// GarbageCollectPolicyRule defines a single garbage-collect policy rule
type GarbageCollectPolicyRule struct {
Selector GarbageCollectPolicyRuleSelector `json:"selector"`
Strategy GarbageCollectStrategy `json:"strategy"`
}
// GarbageCollectPolicyRuleSelector select the targets of the rule
// if both traitTypes and componentTypes are specified, combination logic is OR
// if one resource is specified with conflict strategies, strategy as component go first.
type GarbageCollectPolicyRuleSelector struct {
CompNames []string `json:"componentNames"`
CompTypes []string `json:"componentTypes"`
TraitTypes []string `json:"traitTypes"`
}
// GarbageCollectStrategy the strategy for target resource to recycle
type GarbageCollectStrategy string
const (
// GarbageCollectStrategyNever do not recycle target resource, leave it
GarbageCollectStrategyNever GarbageCollectStrategy = "never"
// GarbageCollectStrategyOnAppDelete do not recycle target resource until application is deleted
// this means the resource will be kept even it is not used in the latest version
GarbageCollectStrategyOnAppDelete GarbageCollectStrategy = "onAppDelete"
// GarbageCollectStrategyOnAppUpdate recycle target resource when it is not inUse
GarbageCollectStrategyOnAppUpdate GarbageCollectStrategy = "onAppUpdate"
)
// FindStrategy find gc strategy for target resource
func (in GarbageCollectPolicySpec) FindStrategy(manifest *unstructured.Unstructured) *GarbageCollectStrategy {
for _, rule := range in.Rules {
var compName, compType, traitType string
if labels := manifest.GetLabels(); labels != nil {
compName = labels[oam.LabelAppComponent]
compType = labels[oam.WorkloadTypeLabel]
traitType = labels[oam.TraitTypeLabel]
}
match := func(src []string, val string) (found bool) {
for _, _val := range src {
found = found || _val == val
}
return val != "" && found
}
if match(rule.Selector.CompNames, compName) ||
match(rule.Selector.CompTypes, compType) ||
match(rule.Selector.TraitTypes, traitType) {
return &rule.Strategy
}
}
return nil
}

View File

@@ -0,0 +1,125 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
"testing"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"github.com/oam-dev/kubevela/pkg/oam"
)
func TestGarbageCollectPolicySpec_FindStrategy(t *testing.T) {
testCases := map[string]struct {
rules []GarbageCollectPolicyRule
input *unstructured.Unstructured
notFound bool
expectStrategy GarbageCollectStrategy
}{
"trait type rule match": {
rules: []GarbageCollectPolicyRule{{
Selector: GarbageCollectPolicyRuleSelector{TraitTypes: []string{"a"}},
Strategy: GarbageCollectStrategyNever,
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{oam.TraitTypeLabel: "a"},
},
}},
expectStrategy: GarbageCollectStrategyNever,
},
"trait type rule mismatch": {
rules: []GarbageCollectPolicyRule{{
Selector: GarbageCollectPolicyRuleSelector{TraitTypes: []string{"a"}},
Strategy: GarbageCollectStrategyNever,
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{}},
notFound: true,
},
"trait type rule multiple match": {
rules: []GarbageCollectPolicyRule{{
Selector: GarbageCollectPolicyRuleSelector{TraitTypes: []string{"a"}},
Strategy: GarbageCollectStrategyOnAppDelete,
}, {
Selector: GarbageCollectPolicyRuleSelector{TraitTypes: []string{"a"}},
Strategy: GarbageCollectStrategyNever,
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{oam.TraitTypeLabel: "a"},
},
}},
expectStrategy: GarbageCollectStrategyOnAppDelete,
},
"component type rule match": {
rules: []GarbageCollectPolicyRule{{
Selector: GarbageCollectPolicyRuleSelector{CompTypes: []string{"comp"}},
Strategy: GarbageCollectStrategyNever,
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{oam.WorkloadTypeLabel: "comp"},
},
}},
expectStrategy: GarbageCollectStrategyNever,
},
"rule match both component type and trait type, component type first": {
rules: []GarbageCollectPolicyRule{
{
Selector: GarbageCollectPolicyRuleSelector{CompTypes: []string{"comp"}},
Strategy: GarbageCollectStrategyNever,
},
{
Selector: GarbageCollectPolicyRuleSelector{TraitTypes: []string{"trait"}},
Strategy: GarbageCollectStrategyOnAppDelete,
},
},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{oam.WorkloadTypeLabel: "comp", oam.TraitTypeLabel: "trait"},
},
}},
expectStrategy: GarbageCollectStrategyNever,
},
"component name rule match": {
rules: []GarbageCollectPolicyRule{{
Selector: GarbageCollectPolicyRuleSelector{CompNames: []string{"comp-name"}},
Strategy: GarbageCollectStrategyNever,
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{oam.LabelAppComponent: "comp-name"},
},
}},
expectStrategy: GarbageCollectStrategyNever,
},
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
r := require.New(t)
spec := GarbageCollectPolicySpec{Rules: tc.rules}
strategy := spec.FindStrategy(tc.input)
if tc.notFound {
r.Nil(strategy)
} else {
r.Equal(tc.expectStrategy, *strategy)
}
})
}
}

View File

@@ -0,0 +1,53 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
const (
// TopologyPolicyType refers to the type of topology policy
TopologyPolicyType = "topology"
// OverridePolicyType refers to the type of override policy
OverridePolicyType = "override"
)
// TopologyPolicySpec defines the spec of topology policy
type TopologyPolicySpec struct {
// Placement embeds the selectors for choosing cluster
Placement `json:",inline"`
// Namespace is the target namespace to deploy in the selected clusters.
// +optional
Namespace string `json:"namespace,omitempty"`
}
// Placement describes which clusters to be selected in this topology
type Placement struct {
// Clusters is the names of the clusters to select.
Clusters []string `json:"clusters,omitempty"`
// ClusterLabelSelector is the label selector for clusters.
// Exclusive to "clusters"
ClusterLabelSelector map[string]string `json:"clusterLabelSelector,omitempty"`
// DeprecatedClusterSelector is a depreciated alias for ClusterLabelSelector.
// Deprecated: Use clusterLabelSelector instead.
DeprecatedClusterSelector map[string]string `json:"clusterSelector,omitempty"`
}
// OverridePolicySpec defines the spec of override policy
type OverridePolicySpec struct {
Components []EnvComponentPatch `json:"components,omitempty"`
Selector []string `json:"selector,omitempty"`
}

View File

@@ -17,8 +17,6 @@
package v1alpha1
import (
"reflect"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
@@ -35,16 +33,24 @@ var (
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
// AddToScheme is a global function that registers this API group & version to a scheme
AddToScheme = SchemeBuilder.AddToScheme
)
// EnvBinding type metadata.
// Policy meta
var (
EnvBindingKind = reflect.TypeOf(EnvBinding{}).Name()
EnvBindingGroupKind = schema.GroupKind{Group: Group, Kind: EnvBindingKind}.String()
EnvBindingKindAPIVersion = EnvBindingKind + "." + SchemeGroupVersion.String()
EnvBindingKindVersionKind = SchemeGroupVersion.WithKind(EnvBindingKind)
PolicyKind = "Policy"
PolicyGroupVersionKind = SchemeGroupVersion.WithKind(PolicyKind)
)
// Workflow meta
var (
WorkflowKind = "Workflow"
WorkflowGroupVersionKind = SchemeGroupVersion.WithKind(WorkflowKind)
)
func init() {
SchemeBuilder.Register(&EnvBinding{}, &EnvBindingList{})
SchemeBuilder.Register(&Policy{}, &PolicyList{})
SchemeBuilder.Register(&Workflow{}, &WorkflowList{})
}

View File

@@ -1,116 +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 v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// WorkflowStepPhase describes the phase of a workflow step.
type WorkflowStepPhase string
const (
// WorkflowStepPhaseSucceeded will make the controller run the next step.
WorkflowStepPhaseSucceeded WorkflowStepPhase = "succeeded"
// WorkflowStepPhaseFailed will make the controller stop the workflow and report error in `message`.
WorkflowStepPhaseFailed WorkflowStepPhase = "failed"
// WorkflowStepPhaseTerminated will make the controller terminate the workflow.
WorkflowStepPhaseTerminated WorkflowStepPhase = "terminated"
// WorkflowStepPhaseSuspending will make the controller suspend the workflow.
WorkflowStepPhaseSuspending WorkflowStepPhase = "suspending"
// WorkflowStepPhaseRunning will make the controller continue the workflow.
WorkflowStepPhaseRunning WorkflowStepPhase = "running"
)
// WorkflowStep defines how to execute a workflow step.
type WorkflowStep struct {
// Name is the unique name of the workflow step.
Name string `json:"name"`
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
Inputs common.StepInputs `json:"inputs,omitempty"`
Outputs common.StepOutputs `json:"outputs,omitempty"`
}
// A WorkflowSpec defines the desired state of a Workflow.
type WorkflowSpec struct {
Steps []WorkflowStep `json:"steps,omitempty"`
}
// A WorkflowStatus is the status of Workflow
type WorkflowStatus struct {
// ConditionedStatus reflects the observed status of a resource
condition.ConditionedStatus `json:",inline"`
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
StepIndex int `json:"stepIndex,omitempty"`
Suspend bool `json:"suspend"`
Terminated bool `json:"terminated"`
ContextBackend *corev1.ObjectReference `json:"contextBackend"`
Steps []WorkflowStepStatus `json:"steps,omitempty"`
}
// WorkflowStepStatus record the status of a workflow step
type WorkflowStepStatus struct {
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"`
ResourceRef corev1.ObjectReference `json:"resourceRef,omitempty"`
}
// Workflow is the Schema for the Workflow API
// +kubebuilder:object:root=true
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=workflow
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type Workflow struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec WorkflowSpec `json:"spec,omitempty"`
Status WorkflowStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// WorkflowList contains a list of Workflow.
type WorkflowList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Workflow `json:"items"`
}
// SetConditions set condition for Workflow
func (w *Workflow) SetConditions(c ...condition.Condition) {
w.Status.SetConditions(c...)
}
// GetCondition gets condition from Workflow
func (w *Workflow) GetCondition(conditionType condition.ConditionType) condition.Condition {
return w.Status.GetCondition(conditionType)
}

View File

@@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
@@ -21,121 +22,44 @@ limitations under the License.
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppTemplate) DeepCopyInto(out *AppTemplate) {
func (in *ApplyOncePolicySpec) DeepCopyInto(out *ApplyOncePolicySpec) {
*out = *in
in.RawExtension.DeepCopyInto(&out.RawExtension)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppTemplate.
func (in *AppTemplate) DeepCopy() *AppTemplate {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplyOncePolicySpec.
func (in *ApplyOncePolicySpec) DeepCopy() *ApplyOncePolicySpec {
if in == nil {
return nil
}
out := new(AppTemplate)
out := new(ApplyOncePolicySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterDecision) DeepCopyInto(out *ClusterDecision) {
func (in *ClusterConnection) DeepCopyInto(out *ClusterConnection) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDecision.
func (in *ClusterDecision) DeepCopy() *ClusterDecision {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConnection.
func (in *ClusterConnection) DeepCopy() *ClusterConnection {
if in == nil {
return nil
}
out := new(ClusterDecision)
out := new(ClusterConnection)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConfigMapReference) DeepCopyInto(out *ConfigMapReference) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapReference.
func (in *ConfigMapReference) DeepCopy() *ConfigMapReference {
if in == nil {
return nil
}
out := new(ConfigMapReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvBinding) DeepCopyInto(out *EnvBinding) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvBinding.
func (in *EnvBinding) DeepCopy() *EnvBinding {
if in == nil {
return nil
}
out := new(EnvBinding)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *EnvBinding) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvBindingList) DeepCopyInto(out *EnvBindingList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]EnvBinding, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvBindingList.
func (in *EnvBindingList) DeepCopy() *EnvBindingList {
if in == nil {
return nil
}
out := new(EnvBindingList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *EnvBindingList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvBindingSpec) DeepCopyInto(out *EnvBindingSpec) {
*out = *in
in.AppTemplate.DeepCopyInto(&out.AppTemplate)
if in.Envs != nil {
in, out := &in.Envs, &out.Envs
*out = make([]EnvConfig, len(*in))
@@ -143,11 +67,6 @@ func (in *EnvBindingSpec) DeepCopyInto(out *EnvBindingSpec) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.OutputResourcesTo != nil {
in, out := &in.OutputResourcesTo, &out.OutputResourcesTo
*out = new(ConfigMapReference)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvBindingSpec.
@@ -163,16 +82,17 @@ func (in *EnvBindingSpec) DeepCopy() *EnvBindingSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvBindingStatus) DeepCopyInto(out *EnvBindingStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.ClusterDecisions != nil {
in, out := &in.ClusterDecisions, &out.ClusterDecisions
*out = make([]ClusterDecision, len(*in))
copy(*out, *in)
if in.Envs != nil {
in, out := &in.Envs, &out.Envs
*out = make([]EnvStatus, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.ResourceTracker != nil {
in, out := &in.ResourceTracker, &out.ResourceTracker
*out = new(v1.ObjectReference)
**out = **in
if in.ClusterConnections != nil {
in, out := &in.ClusterConnections, &out.ClusterConnections
*out = make([]ClusterConnection, len(*in))
copy(*out, *in)
}
}
@@ -186,6 +106,33 @@ func (in *EnvBindingStatus) DeepCopy() *EnvBindingStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvComponentPatch) DeepCopyInto(out *EnvComponentPatch) {
*out = *in
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
if in.Traits != nil {
in, out := &in.Traits, &out.Traits
*out = make([]EnvTraitPatch, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvComponentPatch.
func (in *EnvComponentPatch) DeepCopy() *EnvComponentPatch {
if in == nil {
return nil
}
out := new(EnvComponentPatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvConfig) DeepCopyInto(out *EnvConfig) {
*out = *in
@@ -213,7 +160,7 @@ func (in *EnvPatch) DeepCopyInto(out *EnvPatch) {
*out = *in
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]common.ApplicationComponent, len(*in))
*out = make([]EnvComponentPatch, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@@ -275,6 +222,129 @@ func (in *EnvSelector) DeepCopy() *EnvSelector {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvStatus) DeepCopyInto(out *EnvStatus) {
*out = *in
if in.Placements != nil {
in, out := &in.Placements, &out.Placements
*out = make([]PlacementDecision, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvStatus.
func (in *EnvStatus) DeepCopy() *EnvStatus {
if in == nil {
return nil
}
out := new(EnvStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvTraitPatch) DeepCopyInto(out *EnvTraitPatch) {
*out = *in
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvTraitPatch.
func (in *EnvTraitPatch) DeepCopy() *EnvTraitPatch {
if in == nil {
return nil
}
out := new(EnvTraitPatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GarbageCollectPolicyRule) DeepCopyInto(out *GarbageCollectPolicyRule) {
*out = *in
in.Selector.DeepCopyInto(&out.Selector)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GarbageCollectPolicyRule.
func (in *GarbageCollectPolicyRule) DeepCopy() *GarbageCollectPolicyRule {
if in == nil {
return nil
}
out := new(GarbageCollectPolicyRule)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GarbageCollectPolicyRuleSelector) DeepCopyInto(out *GarbageCollectPolicyRuleSelector) {
*out = *in
if in.CompNames != nil {
in, out := &in.CompNames, &out.CompNames
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.CompTypes != nil {
in, out := &in.CompTypes, &out.CompTypes
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.TraitTypes != nil {
in, out := &in.TraitTypes, &out.TraitTypes
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GarbageCollectPolicyRuleSelector.
func (in *GarbageCollectPolicyRuleSelector) DeepCopy() *GarbageCollectPolicyRuleSelector {
if in == nil {
return nil
}
out := new(GarbageCollectPolicyRuleSelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GarbageCollectPolicySpec) DeepCopyInto(out *GarbageCollectPolicySpec) {
*out = *in
if in.Rules != nil {
in, out := &in.Rules, &out.Rules
*out = make([]GarbageCollectPolicyRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GarbageCollectPolicySpec.
func (in *GarbageCollectPolicySpec) DeepCopy() *GarbageCollectPolicySpec {
if in == nil {
return nil
}
out := new(GarbageCollectPolicySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LegacyObjectTypeIdentifier) DeepCopyInto(out *LegacyObjectTypeIdentifier) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LegacyObjectTypeIdentifier.
func (in *LegacyObjectTypeIdentifier) DeepCopy() *LegacyObjectTypeIdentifier {
if in == nil {
return nil
}
out := new(LegacyObjectTypeIdentifier)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NamespaceSelector) DeepCopyInto(out *NamespaceSelector) {
*out = *in
@@ -297,13 +367,256 @@ func (in *NamespaceSelector) DeepCopy() *NamespaceSelector {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ObjectReferrer) DeepCopyInto(out *ObjectReferrer) {
*out = *in
out.ObjectTypeIdentifier = in.ObjectTypeIdentifier
in.ObjectSelector.DeepCopyInto(&out.ObjectSelector)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReferrer.
func (in *ObjectReferrer) DeepCopy() *ObjectReferrer {
if in == nil {
return nil
}
out := new(ObjectReferrer)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ObjectSelector) DeepCopyInto(out *ObjectSelector) {
*out = *in
if in.LabelSelector != nil {
in, out := &in.LabelSelector, &out.LabelSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.DeprecatedLabelSelector != nil {
in, out := &in.DeprecatedLabelSelector, &out.DeprecatedLabelSelector
*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 ObjectSelector.
func (in *ObjectSelector) DeepCopy() *ObjectSelector {
if in == nil {
return nil
}
out := new(ObjectSelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ObjectTypeIdentifier) DeepCopyInto(out *ObjectTypeIdentifier) {
*out = *in
out.LegacyObjectTypeIdentifier = in.LegacyObjectTypeIdentifier
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectTypeIdentifier.
func (in *ObjectTypeIdentifier) DeepCopy() *ObjectTypeIdentifier {
if in == nil {
return nil
}
out := new(ObjectTypeIdentifier)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OverridePolicySpec) DeepCopyInto(out *OverridePolicySpec) {
*out = *in
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]EnvComponentPatch, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
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 OverridePolicySpec.
func (in *OverridePolicySpec) DeepCopy() *OverridePolicySpec {
if in == nil {
return nil
}
out := new(OverridePolicySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Placement) DeepCopyInto(out *Placement) {
*out = *in
if in.Clusters != nil {
in, out := &in.Clusters, &out.Clusters
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.ClusterLabelSelector != nil {
in, out := &in.ClusterLabelSelector, &out.ClusterLabelSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.DeprecatedClusterSelector != nil {
in, out := &in.DeprecatedClusterSelector, &out.DeprecatedClusterSelector
*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 Placement.
func (in *Placement) DeepCopy() *Placement {
if in == nil {
return nil
}
out := new(Placement)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PlacementDecision) DeepCopyInto(out *PlacementDecision) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementDecision.
func (in *PlacementDecision) DeepCopy() *PlacementDecision {
if in == nil {
return nil
}
out := new(PlacementDecision)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Policy) DeepCopyInto(out *Policy) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy.
func (in *Policy) DeepCopy() *Policy {
if in == nil {
return nil
}
out := new(Policy)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Policy) 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 *PolicyList) DeepCopyInto(out *PolicyList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Policy, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyList.
func (in *PolicyList) DeepCopy() *PolicyList {
if in == nil {
return nil
}
out := new(PolicyList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PolicyList) 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 *RefObjectsComponentSpec) DeepCopyInto(out *RefObjectsComponentSpec) {
*out = *in
if in.Objects != nil {
in, out := &in.Objects, &out.Objects
*out = make([]ObjectReferrer, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RefObjectsComponentSpec.
func (in *RefObjectsComponentSpec) DeepCopy() *RefObjectsComponentSpec {
if in == nil {
return nil
}
out := new(RefObjectsComponentSpec)
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
in.Placement.DeepCopyInto(&out.Placement)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologyPolicySpec.
func (in *TopologyPolicySpec) DeepCopy() *TopologyPolicySpec {
if in == nil {
return nil
}
out := new(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)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
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.
@@ -355,93 +668,3 @@ func (in *WorkflowList) DeepCopyObject() runtime.Object {
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowSpec) DeepCopyInto(out *WorkflowSpec) {
*out = *in
if in.Steps != nil {
in, out := &in.Steps, &out.Steps
*out = make([]WorkflowStep, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowSpec.
func (in *WorkflowSpec) DeepCopy() *WorkflowSpec {
if in == nil {
return nil
}
out := new(WorkflowSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowStatus) DeepCopyInto(out *WorkflowStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.ContextBackend != nil {
in, out := &in.ContextBackend, &out.ContextBackend
*out = new(v1.ObjectReference)
**out = **in
}
if in.Steps != nil {
in, out := &in.Steps, &out.Steps
*out = make([]WorkflowStepStatus, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStatus.
func (in *WorkflowStatus) DeepCopy() *WorkflowStatus {
if in == nil {
return nil
}
out := new(WorkflowStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowStep) DeepCopyInto(out *WorkflowStep) {
*out = *in
in.Properties.DeepCopyInto(&out.Properties)
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 *WorkflowStepStatus) DeepCopyInto(out *WorkflowStepStatus) {
*out = *in
out.ResourceRef = in.ResourceRef
}
// 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
}

View File

@@ -54,7 +54,7 @@ type AppStatus struct {
type ApplicationTrait struct {
Name string `json:"name"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
}
// ApplicationComponent describe the component of application

View File

@@ -1,86 +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 (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
)
// AppRolloutSpec defines how to describe an upgrade between different apps
type AppRolloutSpec struct {
// TargetAppRevisionName contains the name of the applicationRevision that we need to upgrade to.
TargetAppRevisionName string `json:"targetAppRevisionName"`
// SourceAppRevisionName contains the name of the applicationRevision that we need to upgrade from.
// it can be empty only when the rolling is only a scale event
SourceAppRevisionName string `json:"sourceAppRevisionName,omitempty"`
// The list of component to upgrade in the application.
// We only support single component application so far
// TODO: (RZ) Support multiple components in an application
// +optional
ComponentList []string `json:"componentList,omitempty"`
// RolloutPlan is the details on how to rollout the resources
RolloutPlan v1alpha1.RolloutPlan `json:"rolloutPlan"`
// RevertOnDelete revert the rollout when the rollout CR is deleted
// It will remove the target app from the kubernetes if it's set to true
// +optional
RevertOnDelete *bool `json:"revertOnDelete,omitempty"`
}
// AppRolloutStatus defines the observed state of AppRollout
type AppRolloutStatus struct {
v1alpha1.RolloutStatus `json:",inline"`
// LastUpgradedTargetAppRevision contains the name of the app that we upgraded to
// We will restart the rollout if this is not the same as the spec
LastUpgradedTargetAppRevision string `json:"lastTargetAppRevision"`
// LastSourceAppRevision contains the name of the app that we need to upgrade from.
// We will restart the rollout if this is not the same as the spec
LastSourceAppRevision string `json:"LastSourceAppRevision,omitempty"`
}
// AppRollout is the Schema for the AppRollout API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=approllout
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="TARGET",type=string,JSONPath=`.status.rolloutStatus.rolloutTargetSize`
// +kubebuilder:printcolumn:name="UPGRADED",type=string,JSONPath=`.status.rolloutStatus.upgradedReplicas`
// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.rolloutStatus.upgradedReadyReplicas`
// +kubebuilder:printcolumn:name="BATCH-STATE",type=string,JSONPath=`.status.rolloutStatus.batchRollingState`
// +kubebuilder:printcolumn:name="ROLLING-STATE",type=string,JSONPath=`.status.rolloutStatus.rollingState`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type AppRollout struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AppRolloutSpec `json:"spec,omitempty"`
Status AppRolloutStatus `json:"status,omitempty"`
}
// AppRolloutList contains a list of AppRollout
// +kubebuilder:object:root=true
type AppRolloutList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AppRollout `json:"items"`
}

View File

@@ -20,6 +20,7 @@ import (
"fmt"
"reflect"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/conversion"
@@ -44,7 +45,7 @@ func ApplicationV1alpha2ToV1beta1(v1a2 *Application, v1b1 *v1beta1.Application)
for j, trait := range comp.Traits {
traits[j] = common.ApplicationTrait{
Type: trait.Name,
Properties: *trait.Properties.DeepCopy(),
Properties: trait.Properties.DeepCopy(),
}
}
@@ -58,13 +59,11 @@ func ApplicationV1alpha2ToV1beta1(v1a2 *Application, v1b1 *v1beta1.Application)
v1b1.Spec.Components = append(v1b1.Spec.Components, common.ApplicationComponent{
Name: comp.Name,
Type: comp.WorkloadType,
Properties: *comp.Settings.DeepCopy(),
Properties: comp.Settings.DeepCopy(),
Traits: traits,
Scopes: scopes,
})
}
// 3.2) convert Spec.RolloutPlan
v1b1.Spec.RolloutPlan = v1a2.Spec.RolloutPlan.DeepCopy()
// 4) convert Status common.AppStatus
v1b1.Status = *v1a2.Status.DeepCopy()
@@ -104,7 +103,7 @@ func (app *Application) ConvertFrom(src conversion.Hub) error {
for j, trait := range comp.Traits {
traits[j] = ApplicationTrait{
Name: trait.Type,
Properties: *trait.Properties.DeepCopy(),
Properties: trait.Properties.DeepCopy(),
}
}
@@ -115,16 +114,21 @@ func (app *Application) ConvertFrom(src conversion.Hub) error {
}
// convert component
// `.properties` -> `.settings`
var compProperties runtime.RawExtension
if comp.Properties != nil {
compProperties = *comp.Properties.DeepCopy()
}
app.Spec.Components = append(app.Spec.Components, ApplicationComponent{
Name: comp.Name,
WorkloadType: comp.Type,
Settings: *comp.Properties.DeepCopy(),
Settings: compProperties,
Traits: traits,
Scopes: scopes,
})
}
// 3.2) convert Spec.RolloutPlan
app.Spec.RolloutPlan = sourceApp.Spec.RolloutPlan.DeepCopy()
// 4) convert Status common.AppStatus
app.Status = *sourceApp.Status.DeepCopy()

View File

@@ -0,0 +1,117 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha2
import (
"fmt"
"testing"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/stretchr/testify/require"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1"
)
var app = Application{
Spec: ApplicationSpec{
Components: []ApplicationComponent{{
Name: "test-component",
WorkloadType: "worker",
Traits: []ApplicationTrait{},
Scopes: map[string]string{},
}},
},
}
type errType struct {
}
func (*errType) Hub() {}
func (*errType) DeepCopyObject() runtime.Object {
return nil
}
func (*errType) GetObjectKind() schema.ObjectKind {
return nil
}
func TestApplicationV1alpha2ToV1beta1(t *testing.T) {
r := require.New(t)
expected := &v1beta1.Application{}
ApplicationV1alpha2ToV1beta1(&app, expected)
r.Equal(expected, &v1beta1.Application{
Spec: v1beta1.ApplicationSpec{
Components: []common.ApplicationComponent{{
Name: "test-component",
Type: "worker",
Properties: &runtime.RawExtension{},
Traits: []common.ApplicationTrait{},
Scopes: map[string]string{},
}},
},
})
}
func TestConvertTo(t *testing.T) {
r := require.New(t)
expected := &v1beta1.Application{}
err := app.ConvertTo(expected)
r.NoError(err)
r.Equal(expected, &v1beta1.Application{
Spec: v1beta1.ApplicationSpec{
Components: []common.ApplicationComponent{{
Name: "test-component",
Type: "worker",
Properties: &runtime.RawExtension{},
Traits: []common.ApplicationTrait{},
Scopes: map[string]string{},
}},
},
})
errCase := &errType{}
err = app.ConvertTo(errCase)
r.Equal(err, fmt.Errorf("unsupported convertTo object *v1alpha2.errType"))
}
func TestConvertFrom(t *testing.T) {
r := require.New(t)
to := &Application{}
from := &v1beta1.Application{
Spec: v1beta1.ApplicationSpec{
Components: []common.ApplicationComponent{{
Name: "test-component",
Type: "worker",
Properties: &runtime.RawExtension{},
Traits: []common.ApplicationTrait{},
Scopes: map[string]string{},
}},
},
}
err := to.ConvertFrom(from)
r.NoError(err)
r.Equal(to.Spec, app.Spec)
errCase := &errType{}
err = app.ConvertFrom(errCase)
r.Equal(err, fmt.Errorf("unsupported ConvertFrom object *v1alpha2.errType"))
}

View File

@@ -19,14 +19,8 @@ limitations under the License.
package v1alpha2
import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/pkg/oam"
)
// An OperatingSystem required by a containerised workload.
@@ -359,53 +353,3 @@ type Container struct {
// +optional
ImagePullSecret *string `json:"imagePullSecret,omitempty"`
}
// A ContainerizedWorkloadSpec defines the desired state of a
// ContainerizedWorkload.
type ContainerizedWorkloadSpec struct {
// OperatingSystem required by this workload.
// +kubebuilder:validation:Enum=linux;windows
// +optional
OperatingSystem *OperatingSystem `json:"osType,omitempty"`
// CPUArchitecture required by this workload.
// +kubebuilder:validation:Enum=i386;amd64;arm;arm64
// +optional
CPUArchitecture *CPUArchitecture `json:"arch,omitempty"`
// Containers of which this workload consists.
Containers []Container `json:"containers"`
}
// A ContainerizedWorkloadStatus represents the observed state of a
// ContainerizedWorkload.
type ContainerizedWorkloadStatus struct {
condition.ConditionedStatus `json:",inline"`
// Resources managed by this containerised workload.
Resources []corev1.ObjectReference `json:"resources,omitempty"`
}
var _ oam.Workload = &ContainerizedWorkload{}
// +kubebuilder:object:root=true
// A ContainerizedWorkload is a workload that runs OCI containers.
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
type ContainerizedWorkload struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ContainerizedWorkloadSpec `json:"spec,omitempty"`
Status ContainerizedWorkloadStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ContainerizedWorkloadList contains a list of ContainerizedWorkload.
type ContainerizedWorkloadList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ContainerizedWorkload `json:"items"`
}

View File

@@ -64,16 +64,6 @@ func (cm *Component) SetConditions(c ...condition.Condition) {
cm.Status.SetConditions(c...)
}
// GetCondition of this ContainerizedWorkload.
func (wl *ContainerizedWorkload) GetCondition(ct condition.ConditionType) condition.Condition {
return wl.Status.GetCondition(ct)
}
// SetConditions of this ContainerizedWorkload.
func (wl *ContainerizedWorkload) SetConditions(c ...condition.Condition) {
wl.Status.SetConditions(c...)
}
// GetCondition of this HealthScope.
func (hs *HealthScope) GetCondition(ct condition.ConditionType) condition.Condition {
return hs.Status.GetCondition(ct)

View File

@@ -85,14 +85,6 @@ var (
ApplicationConfigurationGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationConfigurationKind)
)
// ContainerizedWorkload type metadata.
var (
ContainerizedWorkloadKind = reflect.TypeOf(ContainerizedWorkload{}).Name()
ContainerizedWorkloadGroupKind = schema.GroupKind{Group: Group, Kind: ContainerizedWorkloadKind}.String()
ContainerizedWorkloadKindAPIVersion = ContainerizedWorkloadKind + "." + SchemeGroupVersion.String()
ContainerizedWorkloadGroupVersionKind = SchemeGroupVersion.WithKind(ContainerizedWorkloadKind)
)
// ManualScalerTrait type metadata.
var (
ManualScalerTraitKind = reflect.TypeOf(ManualScalerTrait{}).Name()
@@ -117,14 +109,6 @@ var (
ApplicationKindVersionKind = SchemeGroupVersion.WithKind(ApplicationKind)
)
// AppRollout type metadata.
var (
AppRolloutKind = reflect.TypeOf(AppRollout{}).Name()
AppRolloutGroupKind = schema.GroupKind{Group: Group, Kind: AppRolloutKind}.String()
AppRolloutKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
AppRolloutKindVersionKind = SchemeGroupVersion.WithKind(AppRolloutKind)
)
// ApplicationRevision type metadata
var (
ApplicationRevisionKind = reflect.TypeOf(ApplicationRevision{}).Name()
@@ -140,10 +124,8 @@ func init() {
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
SchemeBuilder.Register(&Component{}, &ComponentList{})
SchemeBuilder.Register(&ApplicationConfiguration{}, &ApplicationConfigurationList{})
SchemeBuilder.Register(&ContainerizedWorkload{}, &ContainerizedWorkloadList{})
SchemeBuilder.Register(&ManualScalerTrait{}, &ManualScalerTraitList{})
SchemeBuilder.Register(&HealthScope{}, &HealthScopeList{})
SchemeBuilder.Register(&Application{}, &ApplicationList{})
SchemeBuilder.Register(&AppRollout{}, &AppRolloutList{})
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})
}

View File

@@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
@@ -76,107 +77,6 @@ func (in *AppReference) DeepCopy() *AppReference {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRollout) DeepCopyInto(out *AppRollout) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRollout.
func (in *AppRollout) DeepCopy() *AppRollout {
if in == nil {
return nil
}
out := new(AppRollout)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AppRollout) 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 *AppRolloutList) DeepCopyInto(out *AppRolloutList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]AppRollout, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutList.
func (in *AppRolloutList) DeepCopy() *AppRolloutList {
if in == nil {
return nil
}
out := new(AppRolloutList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AppRolloutList) 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 *AppRolloutSpec) DeepCopyInto(out *AppRolloutSpec) {
*out = *in
if in.ComponentList != nil {
in, out := &in.ComponentList, &out.ComponentList
*out = make([]string, len(*in))
copy(*out, *in)
}
in.RolloutPlan.DeepCopyInto(&out.RolloutPlan)
if in.RevertOnDelete != nil {
in, out := &in.RevertOnDelete, &out.RevertOnDelete
*out = new(bool)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutSpec.
func (in *AppRolloutSpec) DeepCopy() *AppRolloutSpec {
if in == nil {
return nil
}
out := new(AppRolloutSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRolloutStatus) DeepCopyInto(out *AppRolloutStatus) {
*out = *in
in.RolloutStatus.DeepCopyInto(&out.RolloutStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutStatus.
func (in *AppRolloutStatus) DeepCopy() *AppRolloutStatus {
if in == nil {
return nil
}
out := new(AppRolloutStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppStatus) DeepCopyInto(out *AppStatus) {
*out = *in
@@ -600,7 +500,11 @@ func (in *ApplicationSpec) DeepCopy() *ApplicationSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationTrait) DeepCopyInto(out *ApplicationTrait) {
*out = *in
in.Properties.DeepCopyInto(&out.Properties)
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationTrait.
@@ -1209,118 +1113,6 @@ func (in *ContainerResources) DeepCopy() *ContainerResources {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ContainerizedWorkload) DeepCopyInto(out *ContainerizedWorkload) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedWorkload.
func (in *ContainerizedWorkload) DeepCopy() *ContainerizedWorkload {
if in == nil {
return nil
}
out := new(ContainerizedWorkload)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ContainerizedWorkload) 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 *ContainerizedWorkloadList) DeepCopyInto(out *ContainerizedWorkloadList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ContainerizedWorkload, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedWorkloadList.
func (in *ContainerizedWorkloadList) DeepCopy() *ContainerizedWorkloadList {
if in == nil {
return nil
}
out := new(ContainerizedWorkloadList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ContainerizedWorkloadList) 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 *ContainerizedWorkloadSpec) DeepCopyInto(out *ContainerizedWorkloadSpec) {
*out = *in
if in.OperatingSystem != nil {
in, out := &in.OperatingSystem, &out.OperatingSystem
*out = new(OperatingSystem)
**out = **in
}
if in.CPUArchitecture != nil {
in, out := &in.CPUArchitecture, &out.CPUArchitecture
*out = new(CPUArchitecture)
**out = **in
}
if in.Containers != nil {
in, out := &in.Containers, &out.Containers
*out = make([]Container, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedWorkloadSpec.
func (in *ContainerizedWorkloadSpec) DeepCopy() *ContainerizedWorkloadSpec {
if in == nil {
return nil
}
out := new(ContainerizedWorkloadSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ContainerizedWorkloadStatus) DeepCopyInto(out *ContainerizedWorkloadStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.Resources != nil {
in, out := &in.Resources, &out.Resources
*out = make([]v1.ObjectReference, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedWorkloadStatus.
func (in *ContainerizedWorkloadStatus) DeepCopy() *ContainerizedWorkloadStatus {
if in == nil {
return nil
}
out := new(ContainerizedWorkloadStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DataInput) DeepCopyInto(out *DataInput) {
*out = *in

View File

@@ -1,176 +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 v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// AppDeploymentPhase defines the phase that the AppDeployment is undergoing.
type AppDeploymentPhase string
const (
// PhaseRolling is the phase when the AppDeployment is rolling live instances from old revisions to new ones.
PhaseRolling AppDeploymentPhase = "Rolling"
// PhaseCompleted is the phase when the AppDeployment is done with reconciliation.
PhaseCompleted AppDeploymentPhase = "Completed"
// PhaseFailed is the phase when the AppDeployment has failed in reconciliation due to unexpected conditions.
PhaseFailed AppDeploymentPhase = "Failed"
)
// HTTPMatchRequest specifies a set of criterion to be met in order for the
// rule to be applied to the HTTP request. For example, the following
// restricts the rule to match only requests where the URL path
// starts with /ratings/v2/ and the request contains a custom `end-user` header
// with value `jason`.
type HTTPMatchRequest struct {
// URI defines how to match with an URI.
URI *URIMatch `json:"uri,omitempty"`
}
// URIMatch defines the rules to match with an URI.
type URIMatch struct {
Prefix string `json:"prefix,omitempty"`
}
// HTTPRule defines the rules to match and split http traffic across revisions.
type HTTPRule struct {
// Match defines the conditions to be satisfied for the rule to be
// activated. All conditions inside a single match block have AND
// semantics, while the list of match blocks have OR semantics. The rule
// is matched if any one of the match blocks succeed.
Match []*HTTPMatchRequest `json:"match,omitempty"`
// WeightedTargets defines the revision targets to select and route traffic to.
WeightedTargets []WeightedTarget `json:"weightedTargets,omitempty"`
}
// WeightedTarget defines the revision target to select and route traffic to.
type WeightedTarget struct {
// RevisionName is the name of the app revision.
RevisionName string `json:"revisionName,omitempty"`
// ComponentName is the name of the component.
// Note that it is the original component name in the Application. No need to append revision.
ComponentName string `json:"componentName,omitempty"`
// Port is the port to route traffic towards.
Port int `json:"port,omitempty"`
// Weight defines the proportion of traffic to be forwarded to the service
// version. (0-100). Sum of weights across destinations SHOULD BE == 100.
// If there is only one destination in a rule, the weight value is assumed to
// be 100.
Weight int `json:"weight,omitempty"`
}
// Traffic defines the traffic rules to apply across revisions.
type Traffic struct {
// Hosts are the destination hosts to which traffic is being sent. Could
// be a DNS name with wildcard prefix or an IP address.
Hosts []string `json:"hosts,omitempty"`
// Gateways specifies the names of gateways that should apply these rules.
// Gateways in other namespaces may be referred to by
// `<gateway namespace>/<gateway name>`; specifying a gateway with no
// namespace qualifier is the same as specifying the AppDeployment's namespace.
Gateways []string `json:"gateways,omitempty"`
// HTTP defines the rules to match and split http traffoc across revisions.
HTTP []HTTPRule `json:"http,omitempty"`
}
// AppRevision specifies an AppRevision resource to and the rules to apply to it.
type AppRevision struct {
// RevisionName is the name of the AppRevision.
RevisionName string `json:"revisionName,omitempty"`
// Placement defines the cluster placement rules for an app revision.
Placement []common.ClusterPlacement `json:"placement,omitempty"`
}
// ClusterPlacementStatus shows the placement results of a cluster.
type ClusterPlacementStatus struct {
// ClusterName indicates the name of the cluster to deploy apps to.
// If empty, it indicates the host cluster per se.
ClusterName string `json:"clusterName,omitempty"`
// Replicas indicates the replica number of an app revision to deploy to a cluster.
Replicas int `json:"replicas,omitempty"`
}
// PlacementStatus shows the cluster placement results of an app revision.
type PlacementStatus struct {
// RevisionName is the name of the AppRevision.
RevisionName string `json:"revisionName,omitempty"`
// Clusters shows cluster placement results.
Clusters []ClusterPlacementStatus `json:"clusters,omitempty"`
}
// AppDeploymentSpec defines how to describe an upgrade between different apps
type AppDeploymentSpec struct {
// Traffic defines the traffic rules to apply across revisions.
Traffic *Traffic `json:"traffic,omitempty"`
// AppRevision specifies AppRevision resources to and the rules to apply to them.
AppRevisions []AppRevision `json:"appRevisions,omitempty"`
}
// AppDeploymentStatus defines the observed state of AppDeployment
type AppDeploymentStatus struct {
// Conditions represents the latest available observations of a CloneSet's current state.
condition.ConditionedStatus `json:",inline"`
// Phase shows the phase that the AppDeployment is undergoing.
// If Phase is Rolling, no update should be made to the spec.
Phase AppDeploymentPhase `json:"phase,omitempty"`
// Placement shows the cluster placement results of the app revisions.
Placement []PlacementStatus `json:"placement,omitempty"`
}
// AppDeployment is the Schema for the AppDeployment API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=appdeploy
// +kubebuilder:subresource:status
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type AppDeployment struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AppDeploymentSpec `json:"spec,omitempty"`
Status AppDeploymentStatus `json:"status,omitempty"`
}
// AppDeploymentList contains a list of AppDeployment
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type AppDeploymentList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AppDeployment `json:"items"`
}

View File

@@ -17,12 +17,14 @@
package v1beta1
import (
"encoding/json"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
)
const (
@@ -44,28 +46,15 @@ type AppPolicy struct {
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
}
// WorkflowStep defines how to execute a workflow step.
type WorkflowStep struct {
// Name is the unique name of the workflow step.
Name string `json:"name"`
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs common.StepInputs `json:"inputs,omitempty"`
Outputs common.StepOutputs `json:"outputs,omitempty"`
}
type WorkflowStep common.WorkflowStep
// Workflow defines workflow steps and other attributes
type Workflow struct {
Ref string `json:"ref,omitempty"`
Steps []WorkflowStep `json:"steps,omitempty"`
}
@@ -86,11 +75,6 @@ type ApplicationSpec struct {
Workflow *Workflow `json:"workflow,omitempty"`
// TODO(wonderflow): we should have application level scopes supported here
// RolloutPlan is the details on how to rollout the resources
// The controller simply replace the old resources with the new one if there is no rollout plan involved
// +optional
RolloutPlan *v1alpha1.RolloutPlan `json:"rolloutPlan,omitempty"`
}
// +kubebuilder:object:root=true
@@ -144,3 +128,36 @@ func (app *Application) GetComponent(workloadType string) *common.ApplicationCom
}
return nil
}
// Unstructured convert application to unstructured.Unstructured.
func (app *Application) Unstructured() (*unstructured.Unstructured, error) {
var obj = &unstructured.Unstructured{}
app.SetGroupVersionKind(ApplicationKindVersionKind)
bt, err := json.Marshal(app)
if err != nil {
return nil, err
}
if err := obj.UnmarshalJSON(bt); err != nil {
return nil, err
}
if app.Status.Services == nil {
if err := unstructured.SetNestedSlice(obj.Object, []interface{}{}, "status", "services"); err != nil {
return nil, err
}
}
if app.Status.AppliedResources == nil {
if err := unstructured.SetNestedSlice(obj.Object, []interface{}{}, "status", "appliedResources"); err != nil {
return nil, err
}
}
if wfStatus := app.Status.Workflow; wfStatus != nil && wfStatus.Steps == nil {
if err := unstructured.SetNestedSlice(obj.Object, []interface{}{}, "status", "workflow", "steps"); err != nil {
return nil, err
}
}
return obj, nil
}

View File

@@ -17,11 +17,10 @@
package v1beta1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha1"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
@@ -52,19 +51,23 @@ type ApplicationRevisionSpec struct {
// ScopeGVK records the apiVersion to GVK mapping
ScopeGVK map[string]metav1.GroupVersionKind `json:"scopeGVK,omitempty"`
// Components records the rendered components from Application, it will contains the whole K8s CR of workload in it.
// +deprecated
Components []common.RawComponent `json:"components,omitempty"`
// Policies records the external policies
Policies map[string]v1alpha1.Policy `json:"policies,omitempty"`
// ApplicationConfiguration records the rendered applicationConfiguration from Application,
// it will contains the whole K8s CR of trait and the reference component in it.
// +kubebuilder:validation:EmbeddedResource
// Workflow records the external workflow
Workflow *v1alpha1.Workflow `json:"workflow,omitempty"`
// ReferredObjects records the referred objects used in the ref-object typed components
// +kubebuilder:pruning:PreserveUnknownFields
// +deprecated
ApplicationConfiguration runtime.RawExtension `json:"applicationConfiguration,omitempty"`
ReferredObjects []common.ReferredObject `json:"referredObjects,omitempty"`
}
// ResourcesConfigMap references the ConfigMap that's generated to contain all final rendered resources.
ResourcesConfigMap corev1.LocalObjectReference `json:"resourcesConfigMap,omitempty"`
// 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"`
}
// +kubebuilder:object:root=true
@@ -72,14 +75,18 @@ type ApplicationRevisionSpec struct {
// ApplicationRevision is the Schema for the ApplicationRevision API
// +kubebuilder:storageversion
// +kubebuilder:resource:categories={oam},shortName=apprev
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
// +kubebuilder:printcolumn:name="PUBLISH_VERSION",type=string,JSONPath=`.metadata.annotations['app\.oam\.dev\/publishVersion']`
// +kubebuilder:printcolumn:name="SUCCEEDED",type=string,JSONPath=`.status.succeeded`
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ApplicationRevision struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ApplicationRevisionSpec `json:"spec,omitempty"`
Spec ApplicationRevisionSpec `json:"spec,omitempty"`
Status ApplicationRevisionStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true

View File

@@ -1,81 +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 v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
)
// AppRolloutSpec defines how to describe an upgrade between different apps
type AppRolloutSpec struct {
// TargetAppRevisionName contains the name of the applicationConfiguration that we need to upgrade to.
// Here we use an applicationConfiguration as a revision of an application, thus the name alone is suffice
TargetAppRevisionName string `json:"targetAppRevisionName"`
// SourceAppRevisionName contains the name of the applicationConfiguration that we need to upgrade from.
// it can be empty only when it's the first time to deploy the application
SourceAppRevisionName string `json:"sourceAppRevisionName,omitempty"`
// The list of component to upgrade in the application.
// We only support single component application so far
// TODO: (RZ) Support multiple components in an application
// +optional
ComponentList []string `json:"componentList,omitempty"`
// RolloutPlan is the details on how to rollout the resources
RolloutPlan v1alpha1.RolloutPlan `json:"rolloutPlan"`
// RevertOnDelete revert the failed rollout when the rollout CR is deleted
// It will revert the change back to the source version at once (not in batches)
// Default is false
// +optional
RevertOnDelete bool `json:"revertOnDelete,omitempty"`
}
// AppRollout is the Schema for the AppRollout API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=approllout
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="TARGET",type=string,JSONPath=`.status.rolloutTargetSize`
// +kubebuilder:printcolumn:name="UPGRADED",type=string,JSONPath=`.status.upgradedReplicas`
// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.upgradedReadyReplicas`
// +kubebuilder:printcolumn:name="BATCH-STATE",type=string,JSONPath=`.status.batchRollingState`
// +kubebuilder:printcolumn:name="ROLLING-STATE",type=string,JSONPath=`.status.rollingState`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type AppRollout struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AppRolloutSpec `json:"spec,omitempty"`
Status common.AppRolloutStatus `json:"status,omitempty"`
}
// AppRolloutList contains a list of AppRollout
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type AppRolloutList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AppRollout `json:"items"`
}

View File

@@ -1,64 +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 v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// ClusterSpec defines the desired state of Cluster
type ClusterSpec struct {
// KubeconfigSecretRef specifies the reference to the secret
// that contains the kubeconfig in field `config`.
KubeconfigSecretRef LocalSecretReference `json:"kubeconfigSecretRef,omitempty"`
}
// LocalSecretReference is a reference to a secret within the enclosing
// namespace.
type LocalSecretReference struct {
// Name of a secret within the enclosing namespace.
Name string `json:"name"`
}
// ClusterStatus defines the observed state of Cluster
type ClusterStatus struct {
}
// +kubebuilder:object:root=true
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Cluster is the Schema for the clusters API
type Cluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ClusterSpec `json:"spec,omitempty"`
Status ClusterStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ClusterList contains a list of Cluster
type ClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Cluster `json:"items"`
}

View File

@@ -17,7 +17,6 @@
package v1beta1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
@@ -257,32 +256,3 @@ type ScopeDefinitionList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []ScopeDefinition `json:"items"`
}
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// An ResourceTracker represents a tracker for track cross namespace resources
// +kubebuilder:resource:scope=Cluster,categories={oam},shortName=tracker
type ResourceTracker struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Status ResourceTrackerStatus `json:"status,omitempty"`
}
// ResourceTrackerStatus define the status of resourceTracker
type ResourceTrackerStatus struct {
TrackedResources []corev1.ObjectReference `json:"trackedResources,omitempty"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ResourceTrackerList contains a list of ResourceTracker
type ResourceTrackerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ResourceTracker `json:"items"`
}

View File

@@ -1,100 +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 v1beta1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// InitializerPhase is a label for the condition of a initializer at the current time
type InitializerPhase string
const (
// InitializerCheckingDependsOn means the initializer is checking the status of dependent Initializer
InitializerCheckingDependsOn InitializerPhase = "checkingDependsOn"
// InitializerInitializing means the initializer is initializing
InitializerInitializing InitializerPhase = "initializing"
// InitializerSuccess means the initializer successfully initialized the environment
InitializerSuccess InitializerPhase = "success"
)
// DependsOn refer to an object which Initializer depends on
type DependsOn struct {
Ref corev1.ObjectReference `json:"ref"`
}
// A InitializerSpec defines the desired state of a Initializer.
type InitializerSpec struct {
// AppTemplate indicates the application template to render and deploy an system application.
AppTemplate Application `json:"appTemplate"`
// DependsOn indicates the other initializers that this depends on.
// It will not apply its components until all dependencies exist.
DependsOn []DependsOn `json:"dependsOn,omitempty"`
}
// InitializerStatus is the status of Initializer
type InitializerStatus struct {
// ConditionedStatus reflects the observed status of a resource
condition.ConditionedStatus `json:",inline"`
Phase InitializerPhase `json:"status,omitempty"`
// The generation observed by the Initializer controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration"`
}
// +kubebuilder:object:root=true
// Initializer is the Schema for the Initializer API
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=init
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.status`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Initializer struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec InitializerSpec `json:"spec,omitempty"`
Status InitializerStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// InitializerList contains a list of Initializer.
type InitializerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Initializer `json:"items"`
}
// SetConditions set condition for Initializer
func (i *Initializer) SetConditions(c ...condition.Condition) {
i.Status.SetConditions(c...)
}
// GetCondition gets condition from Initializer
func (i *Initializer) GetCondition(conditionType condition.ConditionType) condition.Condition {
return i.Status.GetCondition(conditionType)
}

View File

@@ -61,7 +61,7 @@ func (d *PolicyDefinition) GetCondition(conditionType condition.ConditionType) c
// +kubebuilder:object:root=true
// PolicyDefinition is the Schema for the policydefinitions API
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=policy
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=def-policy
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +genclient

View File

@@ -96,14 +96,6 @@ var (
ApplicationKindVersionKind = SchemeGroupVersion.WithKind(ApplicationKind)
)
// AppRollout type metadata.
var (
AppRolloutKind = reflect.TypeOf(AppRollout{}).Name()
AppRolloutGroupKind = schema.GroupKind{Group: Group, Kind: AppRolloutKind}.String()
AppRolloutKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
AppRolloutKindVersionKind = SchemeGroupVersion.WithKind(AppRolloutKind)
)
// ApplicationRevision type metadata
var (
ApplicationRevisionKind = reflect.TypeOf(ApplicationRevision{}).Name()
@@ -128,30 +120,6 @@ var (
ResourceTrackerKindVersionKind = SchemeGroupVersion.WithKind(ResourceTrackerKind)
)
// AppDeployment type metadata.
var (
AppDeploymentKind = reflect.TypeOf(AppDeployment{}).Name()
AppDeploymentGroupKind = schema.GroupKind{Group: Group, Kind: AppDeploymentKind}.String()
AppDeploymentKindAPIVersion = AppDeploymentKind + "." + SchemeGroupVersion.String()
AppDeploymentKindVersionKind = SchemeGroupVersion.WithKind(AppDeploymentKind)
)
// Cluster type metadata.
var (
ClusterKind = reflect.TypeOf(Cluster{}).Name()
ClusterGroupKind = schema.GroupKind{Group: Group, Kind: ClusterKind}.String()
ClusterKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
ClusterKindVersionKind = SchemeGroupVersion.WithKind(ClusterKind)
)
// Initializer type metadata.
var (
InitializerKind = reflect.TypeOf(Initializer{}).Name()
InitializerGroupKind = schema.GroupKind{Group: Group, Kind: InitializerKind}.String()
InitializerKindAPIVersion = InitializerKind + "." + SchemeGroupVersion.String()
InitializerKindVersionKind = SchemeGroupVersion.WithKind(InitializerKind)
)
func init() {
SchemeBuilder.Register(&ComponentDefinition{}, &ComponentDefinitionList{})
SchemeBuilder.Register(&WorkloadDefinition{}, &WorkloadDefinitionList{})
@@ -161,12 +129,8 @@ func init() {
SchemeBuilder.Register(&DefinitionRevision{}, &DefinitionRevisionList{})
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
SchemeBuilder.Register(&Application{}, &ApplicationList{})
SchemeBuilder.Register(&AppRollout{}, &AppRolloutList{})
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})
SchemeBuilder.Register(&AppDeployment{}, &AppDeploymentList{})
SchemeBuilder.Register(&Cluster{}, &ClusterList{})
SchemeBuilder.Register(&ResourceTracker{}, &ResourceTrackerList{})
SchemeBuilder.Register(&Initializer{}, &InitializerList{})
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource

View File

@@ -0,0 +1,283 @@
/*
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"
"reflect"
"strings"
errors2 "github.com/pkg/errors"
v1 "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/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"
)
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// An ResourceTracker represents a tracker for track cross namespace resources
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.spec.type`
// +kubebuilder:printcolumn:name="APP",type=string,JSONPath=`.metadata.labels['app\.oam\.dev\/name']`
// +kubebuilder:printcolumn:name="APP-NS",type=string,JSONPath=`.metadata.labels['app\.oam\.dev\/namespace']`
// +kubebuilder:printcolumn:name="APP-GEN",type=number,JSONPath=`.spec.applicationGeneration`
// +kubebuilder:resource:scope=Cluster,categories={oam},shortName=rt
type ResourceTracker struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ResourceTrackerSpec `json:"spec,omitempty"`
Status ResourceTrackerStatus `json:"status,omitempty"`
}
// ResourceTrackerType defines the type of resourceTracker
type ResourceTrackerType string
const (
// ResourceTrackerTypeRoot means resources in this resourceTracker will only be recycled when application is deleted
ResourceTrackerTypeRoot = ResourceTrackerType("root")
// ResourceTrackerTypeVersioned means resources in this resourceTracker will be recycled when this version is unused and this resource is not managed by latest RT
ResourceTrackerTypeVersioned = ResourceTrackerType("versioned")
// ResourceTrackerTypeComponentRevision stores all component revisions used
ResourceTrackerTypeComponentRevision = ResourceTrackerType("component-revision")
)
// ResourceTrackerSpec define the spec of resourceTracker
type ResourceTrackerSpec struct {
Type ResourceTrackerType `json:"type,omitempty"`
ApplicationGeneration int64 `json:"applicationGeneration"`
ManagedResources []ManagedResource `json:"managedResources,omitempty"`
}
// ManagedResource define the resource to be managed by ResourceTracker
type ManagedResource struct {
common.ClusterObjectReference `json:",inline"`
common.OAMObjectReference `json:",inline"`
// +kubebuilder:pruning:PreserveUnknownFields
Data *runtime.RawExtension `json:"raw,omitempty"`
// Deleted marks the resource to be deleted
Deleted bool `json:"deleted,omitempty"`
}
// Equal check if two managed resource equals
func (in ManagedResource) Equal(r ManagedResource) bool {
if !in.ClusterObjectReference.Equal(r.ClusterObjectReference) {
return false
}
if !in.OAMObjectReference.Equal(r.OAMObjectReference) {
return false
}
return reflect.DeepEqual(in.Data, r.Data)
}
// DisplayName readable name for locating resource
func (in ManagedResource) DisplayName() string {
s := in.Kind + " " + in.Name
if in.Namespace != "" || in.Cluster != "" {
s += " ("
if in.Cluster != "" {
s += "Cluster: " + in.Cluster
if in.Namespace != "" {
s += ", "
}
}
if in.Namespace != "" {
s += "Namespace: " + in.Namespace
}
s += ")"
}
return s
}
// NamespacedName namespacedName
func (in ManagedResource) NamespacedName() types.NamespacedName {
return types.NamespacedName{Namespace: in.Namespace, Name: in.Name}
}
// 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()
cluster := in.Cluster
if cluster == "" {
cluster = velatypes.ClusterLocalName
}
return strings.Join([]string{gv, kind, cluster, in.Namespace, in.Name}, "/")
}
// ComponentKey computes the key for the component which managed resource belongs to
func (in ManagedResource) ComponentKey() string {
return strings.Join([]string{in.Env, in.Component}, "/")
}
// 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 json.Unmarshal(in.Data.Raw, obj)
}
// ToUnstructured converts managed resource into unstructured
func (in ManagedResource) ToUnstructured() *unstructured.Unstructured {
obj := &unstructured.Unstructured{}
obj.SetGroupVersionKind(in.GroupVersionKind())
obj.SetName(in.Name)
if in.Namespace != "" {
obj.SetNamespace(in.Namespace)
}
oam.SetCluster(obj, in.Cluster)
return obj
}
// ToUnstructuredWithData converts managed resource into unstructured and unmarshal data
func (in ManagedResource) ToUnstructuredWithData() (*unstructured.Unstructured, error) {
obj := in.ToUnstructured()
if err := in.UnmarshalTo(obj); err != nil {
if errors2.Is(err, errors.ManagedResourceHasNoDataError{}) {
return nil, err
}
}
return obj, nil
}
// ResourceTrackerStatus define the status of resourceTracker
// For backward-compatibility
type ResourceTrackerStatus struct {
// Deprecated
TrackedResources []common.ClusterObjectReference `json:"trackedResources,omitempty"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ResourceTrackerList contains a list of ResourceTracker
type ResourceTrackerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ResourceTracker `json:"items"`
}
func (in *ResourceTracker) findMangedResourceIndex(mr ManagedResource) int {
for i, _mr := range in.Spec.ManagedResources {
if mr.ClusterObjectReference.Equal(_mr.ClusterObjectReference) {
return i
}
}
return -1
}
// AddManagedResource add object to managed resources, if exists, update
func (in *ResourceTracker) AddManagedResource(rsc client.Object, metaOnly bool) (updated bool) {
gvk := rsc.GetObjectKind().GroupVersionKind()
mr := ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{
ObjectReference: v1.ObjectReference{
APIVersion: gvk.GroupVersion().String(),
Kind: gvk.Kind,
Name: rsc.GetName(),
Namespace: rsc.GetNamespace(),
},
Cluster: oam.GetCluster(rsc),
},
OAMObjectReference: common.NewOAMObjectReferenceFromObject(rsc),
Deleted: false,
}
if !metaOnly {
mr.Data = &runtime.RawExtension{Object: rsc}
}
if idx := in.findMangedResourceIndex(mr); idx >= 0 {
if reflect.DeepEqual(in.Spec.ManagedResources[idx], mr) {
return false
}
in.Spec.ManagedResources[idx] = mr
} else {
in.Spec.ManagedResources = append(in.Spec.ManagedResources, mr)
}
return true
}
// DeleteManagedResource if remove flag is on, it will remove the object from recorded resources.
// otherwise, it will mark the object as deleted instead of removing it
// workflow stage: resources are marked as deleted (and execute the deletion action)
// state-keep stage: resources marked as deleted and successfully deleted will be removed from resourcetracker
func (in *ResourceTracker) DeleteManagedResource(rsc client.Object, remove bool) (updated bool) {
gvk := rsc.GetObjectKind().GroupVersionKind()
mr := ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{
ObjectReference: v1.ObjectReference{
APIVersion: gvk.GroupVersion().String(),
Kind: gvk.Kind,
Name: rsc.GetName(),
Namespace: rsc.GetNamespace(),
},
Cluster: oam.GetCluster(rsc),
},
Deleted: true,
}
if idx := in.findMangedResourceIndex(mr); idx >= 0 {
if remove {
in.Spec.ManagedResources = append(in.Spec.ManagedResources[:idx], in.Spec.ManagedResources[idx+1:]...)
} else {
if reflect.DeepEqual(in.Spec.ManagedResources[idx], mr) {
return false
}
in.Spec.ManagedResources[idx] = mr
}
} else {
if !remove {
in.Spec.ManagedResources = append(in.Spec.ManagedResources, mr)
}
}
return true
}
// addClusterObjectReference
// Deprecated
func (in *ResourceTracker) addClusterObjectReference(ref common.ClusterObjectReference) bool {
for _, _rsc := range in.Status.TrackedResources {
if _rsc.Equal(ref) {
return true
}
}
in.Status.TrackedResources = append(in.Status.TrackedResources, ref)
return false
}
// AddTrackedResource add new object reference into tracked resources, return if already exists
// Deprecated
func (in *ResourceTracker) AddTrackedResource(rsc interfaces.TrackableResource) bool {
return in.addClusterObjectReference(common.ClusterObjectReference{
ObjectReference: v1.ObjectReference{
APIVersion: rsc.GetAPIVersion(),
Kind: rsc.GetKind(),
Name: rsc.GetName(),
Namespace: rsc.GetNamespace(),
UID: rsc.GetUID(),
},
})
}

View File

@@ -0,0 +1,184 @@
/*
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"
"testing"
"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"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/utils/pointer"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/pkg/oam"
"github.com/oam-dev/kubevela/pkg/utils/errors"
)
func TestManagedResource_DeepCopyEqual(t *testing.T) {
r := require.New(t)
mr := ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{Cluster: "cluster"},
OAMObjectReference: common.OAMObjectReference{Component: "component"},
Data: &runtime.RawExtension{Raw: []byte("data")},
}
r.True(mr.Equal(*mr.DeepCopy()))
}
func TestManagedResource_Equal(t *testing.T) {
testCases := map[string]struct {
input1 ManagedResource
input2 ManagedResource
equal bool
}{
"equal": {
input1: ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{Cluster: "cluster"},
OAMObjectReference: common.OAMObjectReference{Component: "component"},
Data: &runtime.RawExtension{Raw: []byte("data")},
},
input2: ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{Cluster: "cluster"},
OAMObjectReference: common.OAMObjectReference{Component: "component"},
Data: &runtime.RawExtension{Raw: []byte("data")},
},
equal: true,
},
"ClusterObjectReference not equal": {
input1: ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{Cluster: "cluster"},
},
input2: ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{Cluster: "c"},
},
equal: false,
},
"OAMObjectReference not equal": {
input1: ManagedResource{
OAMObjectReference: common.OAMObjectReference{Component: "component"},
},
input2: ManagedResource{
OAMObjectReference: common.OAMObjectReference{Component: "c"},
},
equal: false,
},
"Data content not equal": {
input1: ManagedResource{
Data: &runtime.RawExtension{Raw: []byte("data")},
},
input2: ManagedResource{
Data: &runtime.RawExtension{Raw: []byte("d")},
},
equal: false,
},
"one data empty, one data not empty": {
input1: ManagedResource{Data: nil},
input2: ManagedResource{
Data: &runtime.RawExtension{Raw: []byte("d")},
},
equal: false,
},
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
r := require.New(t)
r.Equal(tc.equal, tc.input1.Equal(tc.input2))
r.Equal(tc.equal, tc.input2.Equal(tc.input1))
})
}
}
func TestManagedResourceKeys(t *testing.T) {
r := require.New(t)
input := ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{
Cluster: "cluster",
ObjectReference: v1.ObjectReference{
Namespace: "namespace",
Name: "name",
APIVersion: v12.SchemeGroupVersion.String(),
Kind: "Deployment",
},
},
OAMObjectReference: common.OAMObjectReference{
Env: "env",
Component: "component",
Trait: "trait",
},
}
r.Equal("namespace/name", input.NamespacedName().String())
r.Equal("apps/v1/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
deploy1.Spec.Replicas = pointer.Int32(5)
bs, err := json.Marshal(deploy1)
r.NoError(err)
r.ErrorIs(input.UnmarshalTo(&deploy2), errors.ManagedResourceHasNoDataError{})
_, err = input.ToUnstructuredWithData()
r.ErrorIs(err, errors.ManagedResourceHasNoDataError{})
input.Data = &runtime.RawExtension{Raw: bs}
r.NoError(input.UnmarshalTo(&deploy2))
r.Equal(deploy1, deploy2)
obj := input.ToUnstructured()
r.Equal("Deployment", obj.GetKind())
r.Equal("apps/v1", obj.GetAPIVersion())
r.Equal("name", obj.GetName())
r.Equal("namespace", obj.GetNamespace())
r.Equal("cluster", oam.GetCluster(obj))
obj, err = input.ToUnstructuredWithData()
r.NoError(err)
val, correct, err := unstructured.NestedInt64(obj.Object, "spec", "replicas")
r.NoError(err)
r.True(correct)
r.Equal(int64(5), val)
}
func TestResourceTracker_ManagedResource(t *testing.T) {
r := require.New(t)
input := &ResourceTracker{}
deploy1 := v12.Deployment{ObjectMeta: v13.ObjectMeta{Name: "deploy1"}}
input.AddManagedResource(&deploy1, true)
r.Equal(1, len(input.Spec.ManagedResources))
cm2 := v1.ConfigMap{ObjectMeta: v13.ObjectMeta{Name: "cm2"}}
input.AddManagedResource(&cm2, false)
r.Equal(2, len(input.Spec.ManagedResources))
pod3 := v1.Pod{ObjectMeta: v13.ObjectMeta{Name: "pod3"}}
input.AddManagedResource(&pod3, false)
r.Equal(3, len(input.Spec.ManagedResources))
deploy1.Spec.Replicas = pointer.Int32(5)
input.AddManagedResource(&deploy1, false)
r.Equal(3, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&cm2, false)
r.Equal(3, len(input.Spec.ManagedResources))
r.True(input.Spec.ManagedResources[1].Deleted)
input.DeleteManagedResource(&cm2, true)
r.Equal(2, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&deploy1, true)
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"}}
input.DeleteManagedResource(&secret4, true)
r.Equal(0, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&secret4, false)
r.Equal(1, len(input.Spec.ManagedResources))
}

View File

@@ -38,7 +38,8 @@ type WorkflowStepDefinitionSpec struct {
type WorkflowStepDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
condition.ConditionedStatus `json:",inline"`
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
ConfigMapRef string `json:"configMapRef,omitempty"`
// LatestRevision of the component definition
// +optional
LatestRevision *common.Revision `json:"latestRevision,omitempty"`

View File

@@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
@@ -21,127 +22,21 @@ limitations under the License.
package v1beta1
import (
corev1 "k8s.io/api/core/v1"
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/standard.oam.dev/v1alpha1"
"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.
func (in *AppDeployment) DeepCopyInto(out *AppDeployment) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppDeployment.
func (in *AppDeployment) DeepCopy() *AppDeployment {
if in == nil {
return nil
}
out := new(AppDeployment)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AppDeployment) 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 *AppDeploymentList) DeepCopyInto(out *AppDeploymentList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]AppDeployment, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppDeploymentList.
func (in *AppDeploymentList) DeepCopy() *AppDeploymentList {
if in == nil {
return nil
}
out := new(AppDeploymentList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AppDeploymentList) 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 *AppDeploymentSpec) DeepCopyInto(out *AppDeploymentSpec) {
*out = *in
if in.Traffic != nil {
in, out := &in.Traffic, &out.Traffic
*out = new(Traffic)
(*in).DeepCopyInto(*out)
}
if in.AppRevisions != nil {
in, out := &in.AppRevisions, &out.AppRevisions
*out = make([]AppRevision, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppDeploymentSpec.
func (in *AppDeploymentSpec) DeepCopy() *AppDeploymentSpec {
if in == nil {
return nil
}
out := new(AppDeploymentSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppDeploymentStatus) DeepCopyInto(out *AppDeploymentStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.Placement != nil {
in, out := &in.Placement, &out.Placement
*out = make([]PlacementStatus, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppDeploymentStatus.
func (in *AppDeploymentStatus) DeepCopy() *AppDeploymentStatus {
if in == nil {
return nil
}
out := new(AppDeploymentStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppPolicy) DeepCopyInto(out *AppPolicy) {
*out = *in
in.Properties.DeepCopyInto(&out.Properties)
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppPolicy.
@@ -154,108 +49,6 @@ func (in *AppPolicy) DeepCopy() *AppPolicy {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRevision) DeepCopyInto(out *AppRevision) {
*out = *in
if in.Placement != nil {
in, out := &in.Placement, &out.Placement
*out = make([]common.ClusterPlacement, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRevision.
func (in *AppRevision) DeepCopy() *AppRevision {
if in == nil {
return nil
}
out := new(AppRevision)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRollout) DeepCopyInto(out *AppRollout) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRollout.
func (in *AppRollout) DeepCopy() *AppRollout {
if in == nil {
return nil
}
out := new(AppRollout)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AppRollout) 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 *AppRolloutList) DeepCopyInto(out *AppRolloutList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]AppRollout, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutList.
func (in *AppRolloutList) DeepCopy() *AppRolloutList {
if in == nil {
return nil
}
out := new(AppRolloutList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AppRolloutList) 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 *AppRolloutSpec) DeepCopyInto(out *AppRolloutSpec) {
*out = *in
if in.ComponentList != nil {
in, out := &in.ComponentList, &out.ComponentList
*out = make([]string, len(*in))
copy(*out, *in)
}
in.RolloutPlan.DeepCopyInto(&out.RolloutPlan)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutSpec.
func (in *AppRolloutSpec) DeepCopy() *AppRolloutSpec {
if in == nil {
return nil
}
out := new(AppRolloutSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Application) DeepCopyInto(out *Application) {
*out = *in
@@ -321,6 +114,7 @@ func (in *ApplicationRevision) DeepCopyInto(out *ApplicationRevision) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevision.
@@ -426,15 +220,25 @@ func (in *ApplicationRevisionSpec) DeepCopyInto(out *ApplicationRevisionSpec) {
(*out)[key] = val
}
}
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]common.RawComponent, len(*in))
if in.Policies != nil {
in, out := &in.Policies, &out.Policies
*out = make(map[string]v1alpha1.Policy, len(*in))
for key, val := range *in {
(*out)[key] = *val.DeepCopy()
}
}
if in.Workflow != nil {
in, out := &in.Workflow, &out.Workflow
*out = new(v1alpha1.Workflow)
(*in).DeepCopyInto(*out)
}
if in.ReferredObjects != nil {
in, out := &in.ReferredObjects, &out.ReferredObjects
*out = make([]common.ReferredObject, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
in.ApplicationConfiguration.DeepCopyInto(&out.ApplicationConfiguration)
out.ResourcesConfigMap = in.ResourcesConfigMap
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevisionSpec.
@@ -447,6 +251,26 @@ func (in *ApplicationRevisionSpec) DeepCopy() *ApplicationRevisionSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationRevisionStatus) DeepCopyInto(out *ApplicationRevisionStatus) {
*out = *in
if in.Workflow != nil {
in, out := &in.Workflow, &out.Workflow
*out = new(common.WorkflowStatus)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevisionStatus.
func (in *ApplicationRevisionStatus) DeepCopy() *ApplicationRevisionStatus {
if in == nil {
return nil
}
out := new(ApplicationRevisionStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationSpec) DeepCopyInto(out *ApplicationSpec) {
*out = *in
@@ -469,11 +293,6 @@ func (in *ApplicationSpec) DeepCopyInto(out *ApplicationSpec) {
*out = new(Workflow)
(*in).DeepCopyInto(*out)
}
if in.RolloutPlan != nil {
in, out := &in.RolloutPlan, &out.RolloutPlan
*out = new(v1alpha1.RolloutPlan)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationSpec.
@@ -486,111 +305,6 @@ func (in *ApplicationSpec) DeepCopy() *ApplicationSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Cluster) DeepCopyInto(out *Cluster) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
out.Status = in.Status
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster.
func (in *Cluster) DeepCopy() *Cluster {
if in == nil {
return nil
}
out := new(Cluster)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Cluster) 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 *ClusterList) DeepCopyInto(out *ClusterList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Cluster, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList.
func (in *ClusterList) DeepCopy() *ClusterList {
if in == nil {
return nil
}
out := new(ClusterList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterList) 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 *ClusterPlacementStatus) DeepCopyInto(out *ClusterPlacementStatus) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPlacementStatus.
func (in *ClusterPlacementStatus) DeepCopy() *ClusterPlacementStatus {
if in == nil {
return nil
}
out := new(ClusterPlacementStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
*out = *in
out.KubeconfigSecretRef = in.KubeconfigSecretRef
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec.
func (in *ClusterSpec) DeepCopy() *ClusterSpec {
if in == nil {
return nil
}
out := new(ClusterSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus.
func (in *ClusterStatus) DeepCopy() *ClusterStatus {
if in == nil {
return nil
}
out := new(ClusterStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ComponentDefinition) DeepCopyInto(out *ComponentDefinition) {
*out = *in
@@ -787,199 +501,23 @@ func (in *DefinitionRevisionSpec) DeepCopy() *DefinitionRevisionSpec {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DependsOn) DeepCopyInto(out *DependsOn) {
func (in *ManagedResource) DeepCopyInto(out *ManagedResource) {
*out = *in
out.Ref = in.Ref
out.ClusterObjectReference = in.ClusterObjectReference
out.OAMObjectReference = in.OAMObjectReference
if in.Data != nil {
in, out := &in.Data, &out.Data
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DependsOn.
func (in *DependsOn) DeepCopy() *DependsOn {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedResource.
func (in *ManagedResource) DeepCopy() *ManagedResource {
if in == nil {
return nil
}
out := new(DependsOn)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HTTPMatchRequest) DeepCopyInto(out *HTTPMatchRequest) {
*out = *in
if in.URI != nil {
in, out := &in.URI, &out.URI
*out = new(URIMatch)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPMatchRequest.
func (in *HTTPMatchRequest) DeepCopy() *HTTPMatchRequest {
if in == nil {
return nil
}
out := new(HTTPMatchRequest)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HTTPRule) DeepCopyInto(out *HTTPRule) {
*out = *in
if in.Match != nil {
in, out := &in.Match, &out.Match
*out = make([]*HTTPMatchRequest, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(HTTPMatchRequest)
(*in).DeepCopyInto(*out)
}
}
}
if in.WeightedTargets != nil {
in, out := &in.WeightedTargets, &out.WeightedTargets
*out = make([]WeightedTarget, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRule.
func (in *HTTPRule) DeepCopy() *HTTPRule {
if in == nil {
return nil
}
out := new(HTTPRule)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Initializer) DeepCopyInto(out *Initializer) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Initializer.
func (in *Initializer) DeepCopy() *Initializer {
if in == nil {
return nil
}
out := new(Initializer)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Initializer) 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 *InitializerList) DeepCopyInto(out *InitializerList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Initializer, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InitializerList.
func (in *InitializerList) DeepCopy() *InitializerList {
if in == nil {
return nil
}
out := new(InitializerList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *InitializerList) 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 *InitializerSpec) DeepCopyInto(out *InitializerSpec) {
*out = *in
in.AppTemplate.DeepCopyInto(&out.AppTemplate)
if in.DependsOn != nil {
in, out := &in.DependsOn, &out.DependsOn
*out = make([]DependsOn, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InitializerSpec.
func (in *InitializerSpec) DeepCopy() *InitializerSpec {
if in == nil {
return nil
}
out := new(InitializerSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *InitializerStatus) DeepCopyInto(out *InitializerStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InitializerStatus.
func (in *InitializerStatus) DeepCopy() *InitializerStatus {
if in == nil {
return nil
}
out := new(InitializerStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LocalSecretReference) DeepCopyInto(out *LocalSecretReference) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalSecretReference.
func (in *LocalSecretReference) DeepCopy() *LocalSecretReference {
if in == nil {
return nil
}
out := new(LocalSecretReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PlacementStatus) DeepCopyInto(out *PlacementStatus) {
*out = *in
if in.Clusters != nil {
in, out := &in.Clusters, &out.Clusters
*out = make([]ClusterPlacementStatus, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementStatus.
func (in *PlacementStatus) DeepCopy() *PlacementStatus {
if in == nil {
return nil
}
out := new(PlacementStatus)
out := new(ManagedResource)
in.DeepCopyInto(out)
return out
}
@@ -1090,6 +628,7 @@ func (in *ResourceTracker) DeepCopyInto(out *ResourceTracker) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
@@ -1143,12 +682,34 @@ func (in *ResourceTrackerList) DeepCopyObject() runtime.Object {
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceTrackerSpec) DeepCopyInto(out *ResourceTrackerSpec) {
*out = *in
if in.ManagedResources != nil {
in, out := &in.ManagedResources, &out.ManagedResources
*out = make([]ManagedResource, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceTrackerSpec.
func (in *ResourceTrackerSpec) DeepCopy() *ResourceTrackerSpec {
if in == nil {
return nil
}
out := new(ResourceTrackerSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceTrackerStatus) DeepCopyInto(out *ResourceTrackerStatus) {
*out = *in
if in.TrackedResources != nil {
in, out := &in.TrackedResources, &out.TrackedResources
*out = make([]corev1.ObjectReference, len(*in))
*out = make([]common.ClusterObjectReference, len(*in))
copy(*out, *in)
}
}
@@ -1242,38 +803,6 @@ func (in *ScopeDefinitionSpec) DeepCopy() *ScopeDefinitionSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Traffic) DeepCopyInto(out *Traffic) {
*out = *in
if in.Hosts != nil {
in, out := &in.Hosts, &out.Hosts
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Gateways != nil {
in, out := &in.Gateways, &out.Gateways
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.HTTP != nil {
in, out := &in.HTTP, &out.HTTP
*out = make([]HTTPRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Traffic.
func (in *Traffic) DeepCopy() *Traffic {
if in == nil {
return nil
}
out := new(Traffic)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TraitDefinition) DeepCopyInto(out *TraitDefinition) {
*out = *in
@@ -1395,36 +924,6 @@ func (in *TraitDefinitionStatus) DeepCopy() *TraitDefinitionStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *URIMatch) DeepCopyInto(out *URIMatch) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new URIMatch.
func (in *URIMatch) DeepCopy() *URIMatch {
if in == nil {
return nil
}
out := new(URIMatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WeightedTarget) DeepCopyInto(out *WeightedTarget) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WeightedTarget.
func (in *WeightedTarget) DeepCopy() *WeightedTarget {
if in == nil {
return nil
}
out := new(WeightedTarget)
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
@@ -1450,7 +949,11 @@ func (in *Workflow) DeepCopy() *Workflow {
// 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
in.Properties.DeepCopyInto(&out.Properties)
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))

View File

@@ -1,3 +1,4 @@
//go:build generate
// +build generate
/*

View File

@@ -5,7 +5,7 @@ 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
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,
@@ -14,24 +14,22 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package clustermanager
package interfaces
import (
"k8s.io/client-go/tools/clientcmd"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/oam-dev/kubevela/pkg/utils/common"
)
// GetClient returns a kube client for given kubeConfigData
func GetClient(kubeConfigData []byte) (client.Client, error) {
clientConfig, err := clientcmd.NewClientConfigFromBytes(kubeConfigData)
if err != nil {
return nil, err
}
restConfig, err := clientConfig.ClientConfig()
if err != nil {
return nil, err
}
return client.New(restConfig, client.Options{Scheme: common.Scheme})
// ObjectOwner is the interface for get and set ownerReference
type ObjectOwner interface {
GetOwnerReferences() []metav1.OwnerReference
SetOwnerReferences([]metav1.OwnerReference)
}
// TrackableResource is the interface for resources to be tracked by resourcetracker
type TrackableResource interface {
client.Object
metav1.Type
ObjectOwner
}

View File

@@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*

View File

@@ -19,12 +19,11 @@ package types
import (
"encoding/json"
"cuelang.org/go/cue"
"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"cuelang.org/go/cue"
"github.com/spf13/pflag"
)
// Source record the source of Capability
@@ -79,6 +78,8 @@ const CapabilityConfigMapNamePrefix = "schema-"
const (
// OpenapiV3JSONSchema is the key to store OpenAPI v3 JSON schema in ConfigMap
OpenapiV3JSONSchema string = "openapi-v3-json-schema"
// UISchema is the key to store ui custom schema
UISchema string = "ui-schema"
)
// CapabilityCategory defines the category of a capability
@@ -178,6 +179,8 @@ type Capability struct {
// Terraform
TerraformConfiguration string `json:"terraformConfiguration,omitempty"`
ConfigurationType string `json:"configurationType,omitempty"`
Path string `json:"path,omitempty"`
// KubeTemplate
KubeTemplate runtime.RawExtension `json:"kubetemplate,omitempty"`

View File

@@ -18,13 +18,14 @@ package types
// reason for Application
const (
ReasonParsed = "Parsed"
ReasonRendered = "Rendered"
ReasonRevisoned = "Revisioned"
ReasonApplied = "Applied"
ReasonHealthCheck = "HealthChecked"
ReasonDeployed = "Deployed"
ReasonRollout = "Rollout"
ReasonParsed = "Parsed"
ReasonRendered = "Rendered"
ReasonPolicyGenerated = "PolicyGenerated"
ReasonRevisoned = "Revisioned"
ReasonApplied = "Applied"
ReasonHealthCheck = "HealthChecked"
ReasonDeployed = "Deployed"
ReasonRollout = "Rollout"
ReasonFailedParse = "FailedParse"
ReasonFailedRender = "FailedRender"
@@ -32,6 +33,7 @@ const (
ReasonFailedWorkflow = "FailedWorkflow"
ReasonFailedApply = "FailedApply"
ReasonFailedHealthCheck = "FailedHealthCheck"
ReasonFailedStateKeep = "FailedStateKeep"
ReasonFailedGC = "FailedGC"
ReasonFailedRollout = "FailedRollout"
)
@@ -40,6 +42,7 @@ const (
const (
MessageParsed = "Parsed successfully"
MessageRendered = "Rendered successfully"
MessagePolicyGenerated = "Policy generated successfully"
MessageRevisioned = "Revisioned successfully"
MessageApplied = "Applied successfully"
MessageWorkflowFinished = "Workflow finished"

View File

@@ -0,0 +1,42 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package types
import (
"github.com/oam-dev/cluster-gateway/pkg/apis/cluster/v1alpha1"
"github.com/oam-dev/cluster-gateway/pkg/config"
)
const (
// ClusterLocalName the name for the hub cluster
ClusterLocalName = "local"
// CredentialTypeInternal identifies the virtual cluster from internal kubevela system
CredentialTypeInternal v1alpha1.CredentialType = "Internal"
// CredentialTypeOCMManagedCluster identifies the virtual cluster from ocm
CredentialTypeOCMManagedCluster v1alpha1.CredentialType = "ManagedCluster"
// ClusterBlankEndpoint identifies the endpoint of a cluster as blank (not available)
ClusterBlankEndpoint = "-"
// ClustersArg indicates the argument for specific clusters to install addon
ClustersArg = "clusters"
)
var (
// AnnotationClusterAlias the annotation key for cluster alias
AnnotationClusterAlias = config.MetaApiGroupName + "/cluster-alias"
)

View File

@@ -19,8 +19,6 @@ package types
import "github.com/oam-dev/kubevela/pkg/oam"
const (
// DefaultKubeVelaNS defines the default KubeVela namespace in Kubernetes
DefaultKubeVelaNS = "vela-system"
// DefaultKubeVelaReleaseName defines the default name of KubeVela Release
DefaultKubeVelaReleaseName = "kubevela"
// DefaultKubeVelaChartName defines the default chart name of KubeVela, this variable MUST align to the chart name of this repo
@@ -33,11 +31,52 @@ const (
DefaultAppNamespace = "default"
// AutoDetectWorkloadDefinition defines the default workload type for ComponentDefinition which doesn't specify a workload
AutoDetectWorkloadDefinition = "autodetects.core.oam.dev"
// KubeVelaControllerDeployment defines the KubeVela controller's deployment name
KubeVelaControllerDeployment = "kubevela-vela-core"
)
// DefaultKubeVelaNS defines the default KubeVela namespace in Kubernetes
var DefaultKubeVelaNS = "vela-system"
const (
// AnnDescription is the annotation which describe what is the capability used for in a WorkloadDefinition/TraitDefinition Object
AnnDescription = "definition.oam.dev/description"
// AnnoDefinitionDescription is the annotation which describe what is the capability used for in a WorkloadDefinition/TraitDefinition Object
AnnoDefinitionDescription = "definition.oam.dev/description"
// AnnoDefinitionIcon is the annotation which describe the icon url
AnnoDefinitionIcon = "definition.oam.dev/icon"
// AnnoDefinitionAppliedWorkloads is the annotation which describe what is the workloads used for in a TraitDefinition Object
AnnoDefinitionAppliedWorkloads = "definition.oam.dev/appliedWorkloads"
// LabelDefinition is the label for definition
LabelDefinition = "definition.oam.dev"
// LabelDefinitionName is the label for definition name
LabelDefinitionName = "definition.oam.dev/name"
// LabelDefinitionDeprecated is the label which describe whether the capability is deprecated
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"
// LabelNodeRoleGateway gateway role of node
LabelNodeRoleGateway = "node-role.kubernetes.io/gateway"
// LabelNodeRoleWorker worker role of node
LabelNodeRoleWorker = "node-role.kubernetes.io/worker"
// AnnoIngressControllerHTTPSPort define ingress controller listen port for https
AnnoIngressControllerHTTPSPort = "ingress.controller/https-port"
// AnnoIngressControllerHTTPPort define ingress controller listen port for http
AnnoIngressControllerHTTPPort = "ingress.controller/http-port"
// LabelConfigType is the label for config type
LabelConfigType = "config.oam.dev/type"
// LabelConfigCatalog is the label for config catalog
LabelConfigCatalog = "config.oam.dev/catalog"
// LabelConfigSubType is the sub-type for a config type
LabelConfigSubType = "config.oam.dev/sub-type"
// LabelConfigProject is the label for config project
LabelConfigProject = "config.oam.dev/project"
// LabelConfigSyncToMultiCluster is the label to decide whether a config will be synchronized to multi-cluster
LabelConfigSyncToMultiCluster = "config.oam.dev/multi-cluster"
// LabelConfigIdentifier is the label for config identifier
LabelConfigIdentifier = "config.oam.dev/identifier"
// AnnotationConfigDescription is the annotation for config description
AnnotationConfigDescription = "config.oam.dev/description"
// AnnotationConfigAlias is the annotation for config alias
AnnotationConfigAlias = "config.oam.dev/alias"
)
const (
@@ -47,29 +86,38 @@ const (
StatusStaging = "Staging"
)
// EnvMeta stores the info for app environment
// Config contains key/value pairs
type Config map[string]string
// EnvMeta stores the namespace for app environment
type EnvMeta struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Email string `json:"email,omitempty"`
Domain string `json:"domain,omitempty"`
Current string `json:"current,omitempty"`
Current string `json:"current"`
}
const (
// TagCommandType used for tag cli category
TagCommandType = "commandType"
// TagCommandOrder defines the order
TagCommandOrder = "commandOrder"
// TypeStart defines one category
TypeStart = "Getting Started"
// TypeApp defines one category
TypeApp = "Managing Applications"
// TypeCap defines one category
TypeCap = "Managing Capabilities"
// TypeCD defines workflow Management operations
TypeCD = "Continuous Delivery"
// TypeExtension defines one category
TypeExtension = "Managing Extension"
// TypeSystem defines one category
TypeSystem = "System"
// TypeDefinition defines one category
TypeDefinition = "Managing Definitions"
TypeSystem = "Others"
// TypePlugin defines one category used in Kubectl Plugin
TypePlugin = "Plugin Command"
)
@@ -84,4 +132,31 @@ var DefaultFilterAnnots = []string{
oam.AnnotationInplaceUpgrade,
oam.AnnotationFilterLabelKeys,
oam.AnnotationFilterAnnotationKeys,
oam.AnnotationLastAppliedConfiguration,
}
// ConfigType is the type of config
type ConfigType string
const (
// TerraformProvider is the config type for terraform provider
TerraformProvider = "terraform-provider"
// DexConnector is the config type for dex connector
DexConnector = "config-dex-connector"
// ImageRegistry is the config type for image registry
ImageRegistry = "config-image-registry"
// HelmRepository is the config type for Helm chart repository
HelmRepository = "config-helm-repository"
)
const (
// TerraformComponentPrefix is the prefix of component type of terraform-xxx
TerraformComponentPrefix = "terraform-"
// ProviderAppPrefix is the prefix of the application to create a Terraform Provider
ProviderAppPrefix = "config-terraform-provider"
// ProviderNamespace is the namespace of Terraform Cloud Provider
ProviderNamespace = "default"
// VelaCoreConfig is to mark application, config and its secret or Terraform provider lelong to a KubeVela config
VelaCoreConfig = "velacore-config"
)

View File

@@ -1,593 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: containerizedworkloads.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: ContainerizedWorkload
listKind: ContainerizedWorkloadList
plural: containerizedworkloads
singular: containerizedworkload
scope: Namespaced
versions:
- name: v1alpha2
schema:
openAPIV3Schema:
description: A ContainerizedWorkload is a workload that runs OCI containers.
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 ContainerizedWorkloadSpec defines the desired state of
a ContainerizedWorkload.
properties:
arch:
description: CPUArchitecture required by this workload.
enum:
- i386
- amd64
- arm
- arm64
type: string
containers:
description: Containers of which this workload consists.
items:
description: A Container represents an Open Containers Initiative
(OCI) container.
properties:
args:
description: Arguments to be passed to the command run by this
container.
items:
type: string
type: array
command:
description: Command to be run by this container.
items:
type: string
type: array
config:
description: ConfigFiles that should be written within this
container.
items:
description: A ContainerConfigFile specifies a configuration
file that should be written within a container.
properties:
fromSecret:
description: FromSecret is a secret key reference which
can be used to assign a value to be written to the configuration
file at the given path in the container.
properties:
key:
description: The key to select.
type: string
name:
description: The name of the secret.
type: string
required:
- key
- name
type: object
path:
description: Path within the container at which the configuration
file should be written.
type: string
value:
description: Value that should be written to the configuration
file.
type: string
required:
- path
type: object
type: array
env:
description: Environment variables that should be set within
this container.
items:
description: A ContainerEnvVar specifies an environment variable
that should be set within a container.
properties:
fromSecret:
description: FromSecret is a secret key reference which
can be used to assign a value to the environment variable.
properties:
key:
description: The key to select.
type: string
name:
description: The name of the secret.
type: string
required:
- key
- name
type: object
name:
description: Name of the environment variable. Must be
composed of valid Unicode letter and number characters,
as well as _ and -.
pattern: ^[-_a-zA-Z0-9]+$
type: string
value:
description: Value of the environment variable.
type: string
required:
- name
type: object
type: array
image:
description: Image this container should run. Must be a path-like
or URI-like representation of an OCI image. May be prefixed
with a registry address and should be suffixed with a tag.
type: string
imagePullSecret:
description: ImagePullSecret specifies the name of a Secret
from which the credentials required to pull this container's
image can be loaded.
type: string
livenessProbe:
description: A LivenessProbe assesses whether this container
is alive. Containers that fail liveness probes will be restarted.
properties:
exec:
description: Exec probes a container's health by executing
a command.
properties:
command:
description: Command to be run by this probe.
items:
type: string
type: array
required:
- command
type: object
failureThreshold:
description: FailureThreshold specifies how many consecutive
probes must fail in order for the container to be considered
healthy.
format: int32
type: integer
httpGet:
description: HTTPGet probes a container's health by sending
an HTTP GET request.
properties:
httpHeaders:
description: HTTPHeaders to send with the GET request.
items:
description: A HTTPHeader to be passed when probing
a container.
properties:
name:
description: Name of this HTTP header. Must be
unique per probe.
type: string
value:
description: Value of this HTTP header.
type: string
required:
- name
- value
type: object
type: array
path:
description: Path to probe, e.g. '/healthz'.
type: string
port:
description: Port to probe.
format: int32
type: integer
required:
- path
- port
type: object
initialDelaySeconds:
description: InitialDelaySeconds after a container starts
before the first probe.
format: int32
type: integer
periodSeconds:
description: PeriodSeconds between probes.
format: int32
type: integer
successThreshold:
description: SuccessThreshold specifies how many consecutive
probes must success in order for the container to be considered
healthy.
format: int32
type: integer
tcpSocket:
description: TCPSocketProbe probes a container's health
by connecting to a TCP socket.
properties:
port:
description: Port this probe should connect to.
format: int32
type: integer
required:
- port
type: object
timeoutSeconds:
description: TimeoutSeconds after which the probe times
out.
format: int32
type: integer
type: object
name:
description: Name of this container. Must be unique within its
workload.
type: string
ports:
description: Ports exposed by this container.
items:
description: A ContainerPort specifies a port that is exposed
by a container.
properties:
containerPort:
description: Port number. Must be unique within its container.
format: int32
type: integer
name:
description: Name of this port. Must be unique within
its container. Must be lowercase alphabetical characters.
pattern: ^[a-z]+$
type: string
protocol:
description: Protocol used by the server listening on
this port.
enum:
- TCP
- UDP
type: string
required:
- containerPort
- name
type: object
type: array
readinessProbe:
description: A ReadinessProbe assesses whether this container
is ready to serve requests. Containers that fail readiness
probes will be withdrawn from service.
properties:
exec:
description: Exec probes a container's health by executing
a command.
properties:
command:
description: Command to be run by this probe.
items:
type: string
type: array
required:
- command
type: object
failureThreshold:
description: FailureThreshold specifies how many consecutive
probes must fail in order for the container to be considered
healthy.
format: int32
type: integer
httpGet:
description: HTTPGet probes a container's health by sending
an HTTP GET request.
properties:
httpHeaders:
description: HTTPHeaders to send with the GET request.
items:
description: A HTTPHeader to be passed when probing
a container.
properties:
name:
description: Name of this HTTP header. Must be
unique per probe.
type: string
value:
description: Value of this HTTP header.
type: string
required:
- name
- value
type: object
type: array
path:
description: Path to probe, e.g. '/healthz'.
type: string
port:
description: Port to probe.
format: int32
type: integer
required:
- path
- port
type: object
initialDelaySeconds:
description: InitialDelaySeconds after a container starts
before the first probe.
format: int32
type: integer
periodSeconds:
description: PeriodSeconds between probes.
format: int32
type: integer
successThreshold:
description: SuccessThreshold specifies how many consecutive
probes must success in order for the container to be considered
healthy.
format: int32
type: integer
tcpSocket:
description: TCPSocketProbe probes a container's health
by connecting to a TCP socket.
properties:
port:
description: Port this probe should connect to.
format: int32
type: integer
required:
- port
type: object
timeoutSeconds:
description: TimeoutSeconds after which the probe times
out.
format: int32
type: integer
type: object
resources:
description: Resources required by this container
properties:
cpu:
description: CPU required by this container.
properties:
required:
anyOf:
- type: integer
- type: string
description: Required CPU count. 1.0 represents one
CPU core.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- required
type: object
extended:
description: Extended resources required by this container.
items:
description: ExtendedResource required by a container.
properties:
name:
description: Name of the external resource. Resource
names are specified in kind.group/version format,
e.g. motionsensor.ext.example.com/v1.
type: string
required:
anyOf:
- type: integer
- type: string
description: Required extended resource(s), e.g. 8
or "very-cool-widget"
x-kubernetes-int-or-string: true
required:
- name
- required
type: object
type: array
gpu:
description: GPU required by this container.
properties:
required:
anyOf:
- type: integer
- type: string
description: Required GPU count.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- required
type: object
memory:
description: Memory required by this container.
properties:
required:
anyOf:
- type: integer
- type: string
description: Required memory.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- required
type: object
volumes:
description: Volumes required by this container.
items:
description: VolumeResource required by a container.
properties:
accessMode:
description: AccessMode of this volume; RO (read only)
or RW (read and write).
enum:
- RO
- RW
type: string
disk:
description: Disk requirements of this volume.
properties:
ephemeral:
description: Ephemeral specifies whether an external
disk needs to be mounted.
type: boolean
required:
anyOf:
- type: integer
- type: string
description: Required disk space.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- required
type: object
mountPath:
description: MountPath at which this volume will be
mounted within its container.
type: string
name:
description: Name of this volume. Must be unique within
its container.
type: string
sharingPolicy:
description: SharingPolicy of this volume; Exclusive
or Shared.
enum:
- Exclusive
- Shared
type: string
required:
- mountPath
- name
type: object
type: array
required:
- cpu
- memory
type: object
required:
- image
- name
type: object
type: array
osType:
description: OperatingSystem required by this workload.
enum:
- linux
- windows
type: string
required:
- containers
type: object
status:
description: A ContainerizedWorkloadStatus represents the observed state
of a ContainerizedWorkload.
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
resources:
description: Resources managed by this containerised workload.
items:
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
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
.'
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
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -188,6 +188,33 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -197,6 +224,22 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
@@ -454,6 +497,33 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -463,6 +533,22 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object

View File

@@ -193,6 +193,33 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -202,6 +229,22 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
@@ -440,6 +483,33 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -449,6 +519,22 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object

View File

@@ -24,7 +24,7 @@ spec:
spec:
containers:
- name: create
image: {{ .Values.admissionWebhooks.patch.image.repository }}:{{ .Values.admissionWebhooks.patch.image.tag }}
image: {{ .Values.imageRegistry }}{{ .Values.admissionWebhooks.patch.image.repository }}:{{ .Values.admissionWebhooks.patch.image.tag }}
imagePullPolicy: {{ .Values.admissionWebhooks.patch.image.pullPolicy }}
args:
- create
@@ -35,6 +35,10 @@ spec:
- --cert-name=tls.crt
restartPolicy: OnFailure
serviceAccountName: {{ template "oam-runtime.fullname" . }}-admission
{{- with .Values.admissionWebhooks.patch.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.admissionWebhooks.patch.affinity }}
affinity:
{{ toYaml . | indent 8 }}

View File

@@ -24,7 +24,7 @@ spec:
spec:
containers:
- name: patch
image: {{ .Values.admissionWebhooks.patch.image.repository }}:{{ .Values.admissionWebhooks.patch.image.tag }}
image: {{ .Values.imageRegistry }}{{ .Values.admissionWebhooks.patch.image.repository }}:{{ .Values.admissionWebhooks.patch.image.tag }}
imagePullPolicy: {{ .Values.admissionWebhooks.patch.image.pullPolicy }}
args:
- patch
@@ -34,13 +34,17 @@ spec:
- --patch-failure-policy={{ .Values.admissionWebhooks.failurePolicy }}
restartPolicy: OnFailure
serviceAccountName: {{ template "oam-runtime.fullname" . }}-admission
{{- with .Values.admissionWebhooks.patch.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.admissionWebhooks.patch.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.admissionWebhooks.patch.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{ toYaml . | indent 8 }}
{{- end }}
securityContext:
runAsGroup: 2000

View File

@@ -1,13 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: WorkloadDefinition
metadata:
name: containerizedworkloads.core.oam.dev
namespace: {{.Values.systemDefinitionNamespace}}
spec:
definitionRef:
name: containerizedworkloads.core.oam.dev
childResourceKinds:
- apiVersion: apps/v1
kind: Deployment
- apiVersion: v1
kind: Service

View File

@@ -126,7 +126,8 @@ spec:
{{ end }}
- "--system-definition-namespace={{ .Values.systemDefinitionNamespace }}"
- "--oam-spec-ver={{ .Values.OAMSpecVer }}"
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
- "--concurrent-reconciles={{ .Values.concurrentReconciles }}"
image: {{ .Values.imageRegistry }}{{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ quote .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}

View File

@@ -1,7 +1,7 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "oam-runtime.fullname" . }}-test-connection"
name: {{ include "oam-runtime.fullname" . }}-test-connection
labels:
{{- include "oam-runtime.labels" . | nindent 4 }}
annotations:
@@ -9,7 +9,7 @@ metadata:
spec:
containers:
- name: wget
image: busybox
image: {{ .Values.imageRegistry }}{{ .Values.test.app.repository }}:{{ .Values.test.app.tag }}
command: ['wget']
args: ['{{ include "oam-runtime.fullname" . }}:{{ .Values.healthCheck.port }}']
restartPolicy: Never

View File

@@ -7,6 +7,8 @@ replicaCount: 1
applyOnceOnly: "off"
disableCaps: "all"
imageRegistry: ""
image:
repository: oamdev/vela-core
tag: latest
@@ -68,9 +70,10 @@ admissionWebhooks:
patch:
enabled: true
image:
repository: wonderflow/kube-webhook-certgen
tag: v2.1
repository: oamdev/kube-webhook-certgen
tag: v2.3
pullPolicy: IfNotPresent
nodeSelector: {}
affinity: {}
tolerations: []
certManager:
@@ -98,4 +101,9 @@ concurrentReconciles: 4
dependCheckWait: 30s
# OAMSpecVer is the oam spec version controller want to setup
OAMSpecVer: "v0.2"
OAMSpecVer: "v0.2"
test:
app:
repository: oamdev/busybox
tag: v1

View File

@@ -19,3 +19,6 @@ version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 0.1.0
home: https://kubevela.io
icon: https://kubevela.io/img/logo.svg

173
charts/vela-core/README.md Normal file
View File

@@ -0,0 +1,173 @@
<div style="text-align: center">
<p align="center">
<img src="https://raw.githubusercontent.com/oam-dev/kubevela.io/main/docs/resources/KubeVela-03.png">
<br><br>
<i>Make shipping applications more enjoyable.</i>
</p>
</div>
![Build status](https://github.com/oam-dev/kubevela/workflows/E2E/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/oam-dev/kubevela)](https://goreportcard.com/report/github.com/oam-dev/kubevela)
![Docker Pulls](https://img.shields.io/docker/pulls/oamdev/vela-core)
[![codecov](https://codecov.io/gh/oam-dev/kubevela/branch/master/graph/badge.svg)](https://codecov.io/gh/oam-dev/kubevela)
[![LICENSE](https://img.shields.io/github/license/oam-dev/kubevela.svg?style=flat-square)](/LICENSE)
[![Releases](https://img.shields.io/github/release/oam-dev/kubevela/all.svg?style=flat-square)](https://github.com/oam-dev/kubevela/releases)
[![TODOs](https://img.shields.io/endpoint?url=https://api.tickgit.com/badge?repo=github.com/oam-dev/kubevela)](https://www.tickgit.com/browse?repo=github.com/oam-dev/kubevela)
[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2Foam_dev)](https://twitter.com/oam_dev)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kubevela)](https://artifacthub.io/packages/search?repo=kubevela)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4602/badge)](https://bestpractices.coreinfrastructure.org/projects/4602)
# KubeVela helm chart
KubeVela is a modern application platform that makes it easier and faster to deliver and manage applications across hybrid,
multi-cloud environments. At the mean time, it is highly extensible and programmable, which can adapt to your needs as they grow.
## TL;DR
```bash
helm repo add kubevela https://charts.kubevela.net/core
helm repo update
helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wait
```
## Prerequisites
- Kubernetes >= v1.19 && < v1.22
## Parameters
### KubeVela core parameters
| 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` |
| `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` |
### KubeVela workflow parameters
| Name | Description | Value |
| -------------------------------------- | ------------------------------------------------------ | ----- |
| `workflow.backoff.maxTime.waitState` | The max backoff time of workflow in a wait condition | `60` |
| `workflow.backoff.maxTime.failedState` | The max backoff time of workflow in a failed condition | `300` |
| `workflow.step.errorRetryTimes` | The max retry times of a failed workflow step | `10` |
### KubeVela controller parameters
| Name | Description | Value |
| --------------------------- | ------------------------------------ | ------------------ |
| `replicaCount` | KubeVela controller replica count | `1` |
| `imageRegistry` | Image registry | `""` |
| `image.repository` | Image repository | `oamdev/vela-core` |
| `image.tag` | Image tag | `latest` |
| `image.pullPolicy` | Image pull policy | `Always` |
| `resources.limits.cpu` | KubeVela controller's cpu limit | `500m` |
| `resources.limits.memory` | KubeVela controller's memory limit | `1Gi` |
| `resources.requests.cpu` | KubeVela controller's cpu request | `50m` |
| `resources.requests.memory` | KubeVela controller's memory request | `20Mi` |
| `webhookService.type` | KubeVela webhook service type | `ClusterIP` |
| `webhookService.port` | KubeVela webhook service port | `9443` |
| `healthCheck.port` | KubeVela health check port | `9440` |
### MultiCluster parameters
| Name | Description | Value |
| ----------------------------------------------------- | -------------------------------- | -------------------------------- |
| `multicluster.enabled` | Whether to enable multi-cluster | `true` |
| `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.3.2` |
| `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` |
| `multicluster.clusterGateway.secureTLS.enabled` | Whether to enable secure TLS | `true` |
| `multicluster.clusterGateway.secureTLS.certPath` | Path to the certificate file | `/etc/k8s-cluster-gateway-certs` |
### Test parameters
| Name | Description | Value |
| --------------------- | ------------------- | -------------------- |
| `test.app.repository` | Test app repository | `oamdev/hello-world` |
| `test.app.tag` | Test app tag | `v1` |
| `test.k8s.repository` | Test k8s repository | `oamdev/alpine-k8s` |
| `test.k8s.tag` | Test k8s tag | `1.18.2` |
### Common parameters
| Name | Description | Value |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ------- |
| `imagePullSecrets` | Image pull secrets | `[]` |
| `nameOverride` | Override name | `""` |
| `fullnameOverride` | Fullname override | `""` |
| `serviceAccount.create` | Specifies whether a service account should be created | `true` |
| `serviceAccount.annotations` | Annotations to add to the service account | `{}` |
| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | `nil` |
| `nodeSelector` | Node selector | `{}` |
| `tolerations` | Tolerations | `[]` |
| `affinity` | Affinity | `{}` |
| `rbac.create` | Specifies whether a RBAC role should be created | `true` |
| `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` |
## Uninstallation
### Vela CLI
To uninstall KubeVela, you can just run the following command by vela CLI:
```shell
vela uninstall --force
```
### Helm CLI
**Notice**: You must disable all the addons before uninstallation, this is a script for convenience.
```shell
#! /bin/sh
addon=$(vela addon list|grep enabled|awk {'print $1'})
fluxcd=false
for var in ${addon[*]}
do
if [ $var == "fluxcd" ]; then
fluxcd=true
continue
else
vela addon disable $var
fi
done
if [ $fluxcd ]; then
vela addon disable fluxcd
fi
```
To uninstall the KubeVela helm release:
```shell
$ helm uninstall -n vela-system kubevela
```
Finally, this command will remove all the Kubernetes resources associated with KubeVela and remove this chart release.

View File

@@ -1,246 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: appdeployments.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: AppDeployment
listKind: AppDeploymentList
plural: appdeployments
shortNames:
- appdeploy
singular: appdeployment
scope: Namespaced
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: AppDeployment is the Schema for the AppDeployment API
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: AppDeploymentSpec defines how to describe an upgrade between
different apps
properties:
appRevisions:
description: AppRevision specifies AppRevision resources to and the
rules to apply to them.
items:
description: AppRevision specifies an AppRevision resource to and
the rules to apply to it.
properties:
placement:
description: Placement defines the cluster placement rules for
an app revision.
items:
description: ClusterPlacement defines the cluster placement
rules for an app revision.
properties:
clusterSelector:
description: ClusterSelector selects the cluster to deploy
apps to. If not specified, it indicates the host cluster
per se.
properties:
labels:
additionalProperties:
type: string
description: Labels defines the label selector to
select the cluster.
type: object
name:
description: Name is the name of the cluster.
type: string
type: object
distribution:
description: Distribution defines the replica distribution
of an AppRevision to a cluster.
properties:
replicas:
description: Replicas is the replica number.
type: integer
type: object
type: object
type: array
revisionName:
description: RevisionName is the name of the AppRevision.
type: string
type: object
type: array
traffic:
description: Traffic defines the traffic rules to apply across revisions.
properties:
gateways:
description: Gateways specifies the names of gateways that should
apply these rules. Gateways in other namespaces may be referred
to by `<gateway namespace>/<gateway name>`; specifying a gateway
with no namespace qualifier is the same as specifying the AppDeployment's
namespace.
items:
type: string
type: array
hosts:
description: Hosts are the destination hosts to which traffic
is being sent. Could be a DNS name with wildcard prefix or an
IP address.
items:
type: string
type: array
http:
description: HTTP defines the rules to match and split http traffoc
across revisions.
items:
description: HTTPRule defines the rules to match and split http
traffic across revisions.
properties:
match:
description: Match defines the conditions to be satisfied
for the rule to be activated. All conditions inside a
single match block have AND semantics, while the list
of match blocks have OR semantics. The rule is matched
if any one of the match blocks succeed.
items:
description: HTTPMatchRequest specifies a set of criterion
to be met in order for the rule to be applied to the
HTTP request. For example, the following restricts the
rule to match only requests where the URL path starts
with /ratings/v2/ and the request contains a custom
`end-user` header with value `jason`.
properties:
uri:
description: URI defines how to match with an URI.
properties:
prefix:
type: string
type: object
type: object
type: array
weightedTargets:
description: WeightedTargets defines the revision targets
to select and route traffic to.
items:
description: WeightedTarget defines the revision target
to select and route traffic to.
properties:
componentName:
description: ComponentName is the name of the component.
Note that it is the original component name in the
Application. No need to append revision.
type: string
port:
description: Port is the port to route traffic towards.
type: integer
revisionName:
description: RevisionName is the name of the app revision.
type: string
weight:
description: Weight defines the proportion of traffic
to be forwarded to the service version. (0-100).
Sum of weights across destinations SHOULD BE ==
100. If there is only one destination in a rule,
the weight value is assumed to be 100.
type: integer
type: object
type: array
type: object
type: array
type: object
type: object
status:
description: AppDeploymentStatus defines the observed state of AppDeployment
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
phase:
description: Phase shows the phase that the AppDeployment is undergoing.
If Phase is Rolling, no update should be made to the spec.
type: string
placement:
description: Placement shows the cluster placement results of the
app revisions.
items:
description: PlacementStatus shows the cluster placement results
of an app revision.
properties:
clusters:
description: Clusters shows cluster placement results.
items:
description: ClusterPlacementStatus shows the placement results
of a cluster.
properties:
clusterName:
description: ClusterName indicates the name of the cluster
to deploy apps to. If empty, it indicates the host cluster
per se.
type: string
replicas:
description: Replicas indicates the replica number of
an app revision to deploy to a cluster.
type: integer
type: object
type: array
revisionName:
description: RevisionName is the name of the AppRevision.
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,954 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: approllouts.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: AppRollout
listKind: AppRolloutList
plural: approllouts
shortNames:
- approllout
singular: approllout
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.rolloutStatus.rolloutTargetSize
name: TARGET
type: string
- jsonPath: .status.rolloutStatus.upgradedReplicas
name: UPGRADED
type: string
- jsonPath: .status.rolloutStatus.upgradedReadyReplicas
name: READY
type: string
- jsonPath: .status.rolloutStatus.batchRollingState
name: BATCH-STATE
type: string
- jsonPath: .status.rolloutStatus.rollingState
name: ROLLING-STATE
type: string
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1alpha2
schema:
openAPIV3Schema:
description: AppRollout is the Schema for the AppRollout API
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: AppRolloutSpec defines how to describe an upgrade between
different apps
properties:
componentList:
description: 'The list of component to upgrade in the application.
We only support single component application so far TODO: (RZ) Support
multiple components in an application'
items:
type: string
type: array
revertOnDelete:
description: RevertOnDelete revert the rollout when the rollout CR
is deleted It will remove the target app from the kubernetes if
it's set to true
type: boolean
rolloutPlan:
description: RolloutPlan is the details on how to rollout the resources
properties:
batchPartition:
description: All pods in the batches up to the batchPartition
(included) will have the target resource specification while
the rest still have the source resource This is designed for
the operators to manually rollout Default is the the number
of batches which will rollout all the batches
format: int32
type: integer
canaryMetric:
description: CanaryMetric provides a way for the rollout process
to automatically check certain metrics before complete the process
items:
description: CanaryMetric holds the reference to metrics used
for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template object
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:
- name
type: object
type: array
numBatches:
description: The number of batches, default = 1
format: int32
type: integer
paused:
description: Paused the rollout, default is false
type: boolean
rolloutBatches:
description: The exact distribution among batches. its size has
to be exactly the same as the NumBatches (if set) The total
number cannot exceed the targetSize or the size of the source
resource We will IGNORE the last batch's replica field if it's
a percentage since round errors can lead to inaccurate sum We
highly recommend to leave the last batch's replica field empty
items:
description: RolloutBatch is used to describe how the each batch
rollout should be
properties:
batchRolloutWebhooks:
description: RolloutWebhooks provides a way for the batch
rollout to interact with an external process
items:
description: RolloutWebhook holds the reference to external
checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected
http status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default
is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
canaryMetric:
description: CanaryMetric provides a way for the batch rollout
process to automatically check certain metrics before
moving to the next batch
items:
description: CanaryMetric holds the reference to metrics
used for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template
object
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:
- name
type: object
type: array
instanceInterval:
description: The wait time, in seconds, between instances
upgrades, default = 0
format: int32
type: integer
maxUnavailable:
anyOf:
- type: integer
- type: string
description: MaxUnavailable is the max allowed number of
pods that is unavailable during the upgrade. We will mark
the batch as ready as long as there are less or equal
number of pods unavailable than this number. default =
0
x-kubernetes-int-or-string: true
podList:
description: The list of Pods to get upgraded it is mutually
exclusive with the Replicas field
items:
type: string
type: array
replicas:
anyOf:
- type: integer
- type: string
description: 'Replicas is the number of pods to upgrade
in this batch it can be an absolute number (ex: 5) or
a percentage of total pods we will ignore the percentage
of the last batch to just fill the gap it is mutually
exclusive with the PodList field'
x-kubernetes-int-or-string: true
type: object
type: array
rolloutStrategy:
description: RolloutStrategy defines strategies for the rollout
plan The default is IncreaseFirstRolloutStrategyType
type: string
rolloutWebhooks:
description: RolloutWebhooks provide a way for the rollout to
interact with an external process
items:
description: RolloutWebhook holds the reference to external
checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected http
status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
targetSize:
description: The size of the target resource. The default is the
same as the size of the source resource.
format: int32
type: integer
type: object
sourceAppRevisionName:
description: SourceAppRevisionName contains the name of the applicationRevision
that we need to upgrade from. it can be empty only when the rolling
is only a scale event
type: string
targetAppRevisionName:
description: TargetAppRevisionName contains the name of the applicationRevision
that we need to upgrade to.
type: string
required:
- rolloutPlan
- targetAppRevisionName
type: object
status:
description: AppRolloutStatus defines the observed state of AppRollout
properties:
LastSourceAppRevision:
description: LastSourceAppRevision contains the name of the app that
we need to upgrade from. We will restart the rollout if this is
not the same as the spec
type: string
batchRollingState:
description: BatchRollingState only meaningful when the Status is
rolling
type: string
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
currentBatch:
description: The current batch the rollout is working on/blocked it
starts from 0
format: int32
type: integer
lastAppliedPodTemplateIdentifier:
description: lastAppliedPodTemplateIdentifier is a string that uniquely
represent the last pod template each workload type could use different
ways to identify that so we cannot compare between resources We
update this field only after a successful rollout
type: string
lastTargetAppRevision:
description: LastUpgradedTargetAppRevision contains the name of the
app that we upgraded to We will restart the rollout if this is not
the same as the spec
type: string
rollingState:
description: RollingState is the Rollout State
type: string
rolloutOriginalSize:
description: RolloutTargetSize is the size of the target resources.
This is determined once the initial spec verification and does not
change until the rollout is restarted
format: int32
type: integer
rolloutTargetSize:
description: RolloutTargetSize is the size of the target resources.
This is determined once the initial spec verification and does not
change until the rollout is restarted
format: int32
type: integer
targetGeneration:
description: NewPodTemplateIdentifier is a string that uniquely represent
the new pod template each workload type could use different ways
to identify that so we cannot compare between resources
type: string
upgradedReadyReplicas:
description: UpgradedReadyReplicas is the number of Pods upgraded
by the rollout controller that have a Ready Condition.
format: int32
type: integer
upgradedReplicas:
description: UpgradedReplicas is the number of Pods upgraded by the
rollout controller
format: int32
type: integer
required:
- currentBatch
- lastTargetAppRevision
- rollingState
- upgradedReadyReplicas
- upgradedReplicas
type: object
type: object
served: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .status.rolloutTargetSize
name: TARGET
type: string
- jsonPath: .status.upgradedReplicas
name: UPGRADED
type: string
- jsonPath: .status.upgradedReadyReplicas
name: READY
type: string
- jsonPath: .status.batchRollingState
name: BATCH-STATE
type: string
- jsonPath: .status.rollingState
name: ROLLING-STATE
type: string
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: AppRollout is the Schema for the AppRollout API
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: AppRolloutSpec defines how to describe an upgrade between
different apps
properties:
componentList:
description: 'The list of component to upgrade in the application.
We only support single component application so far TODO: (RZ) Support
multiple components in an application'
items:
type: string
type: array
revertOnDelete:
description: RevertOnDelete revert the failed rollout when the rollout
CR is deleted It will revert the change back to the source version
at once (not in batches) Default is false
type: boolean
rolloutPlan:
description: RolloutPlan is the details on how to rollout the resources
properties:
batchPartition:
description: All pods in the batches up to the batchPartition
(included) will have the target resource specification while
the rest still have the source resource This is designed for
the operators to manually rollout Default is the the number
of batches which will rollout all the batches
format: int32
type: integer
canaryMetric:
description: CanaryMetric provides a way for the rollout process
to automatically check certain metrics before complete the process
items:
description: CanaryMetric holds the reference to metrics used
for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template object
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:
- name
type: object
type: array
numBatches:
description: The number of batches, default = 1
format: int32
type: integer
paused:
description: Paused the rollout, default is false
type: boolean
rolloutBatches:
description: The exact distribution among batches. its size has
to be exactly the same as the NumBatches (if set) The total
number cannot exceed the targetSize or the size of the source
resource We will IGNORE the last batch's replica field if it's
a percentage since round errors can lead to inaccurate sum We
highly recommend to leave the last batch's replica field empty
items:
description: RolloutBatch is used to describe how the each batch
rollout should be
properties:
batchRolloutWebhooks:
description: RolloutWebhooks provides a way for the batch
rollout to interact with an external process
items:
description: RolloutWebhook holds the reference to external
checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected
http status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default
is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
canaryMetric:
description: CanaryMetric provides a way for the batch rollout
process to automatically check certain metrics before
moving to the next batch
items:
description: CanaryMetric holds the reference to metrics
used for canary analysis
properties:
interval:
description: Interval represents the windows size
type: string
metricsRange:
description: Range value accepted for this metric
properties:
max:
anyOf:
- type: integer
- type: string
description: Maximum value
x-kubernetes-int-or-string: true
min:
anyOf:
- type: integer
- type: string
description: Minimum value
x-kubernetes-int-or-string: true
type: object
name:
description: Name of the metric
type: string
templateRef:
description: TemplateRef references a metric template
object
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:
- name
type: object
type: array
instanceInterval:
description: The wait time, in seconds, between instances
upgrades, default = 0
format: int32
type: integer
maxUnavailable:
anyOf:
- type: integer
- type: string
description: MaxUnavailable is the max allowed number of
pods that is unavailable during the upgrade. We will mark
the batch as ready as long as there are less or equal
number of pods unavailable than this number. default =
0
x-kubernetes-int-or-string: true
podList:
description: The list of Pods to get upgraded it is mutually
exclusive with the Replicas field
items:
type: string
type: array
replicas:
anyOf:
- type: integer
- type: string
description: 'Replicas is the number of pods to upgrade
in this batch it can be an absolute number (ex: 5) or
a percentage of total pods we will ignore the percentage
of the last batch to just fill the gap it is mutually
exclusive with the PodList field'
x-kubernetes-int-or-string: true
type: object
type: array
rolloutStrategy:
description: RolloutStrategy defines strategies for the rollout
plan The default is IncreaseFirstRolloutStrategyType
type: string
rolloutWebhooks:
description: RolloutWebhooks provide a way for the rollout to
interact with an external process
items:
description: RolloutWebhook holds the reference to external
checks used for canary analysis
properties:
expectedStatus:
description: ExpectedStatus contains all the expected http
status code that we will accept as success
items:
type: integer
type: array
metadata:
additionalProperties:
type: string
description: Metadata (key-value pairs) for this webhook
type: object
method:
description: Method the HTTP call method, default is POST
type: string
name:
description: Name of this webhook
type: string
type:
description: Type of this webhook
type: string
url:
description: URL address of this webhook
type: string
required:
- name
- type
- url
type: object
type: array
targetSize:
description: The size of the target resource. The default is the
same as the size of the source resource.
format: int32
type: integer
type: object
sourceAppRevisionName:
description: SourceAppRevisionName contains the name of the applicationConfiguration
that we need to upgrade from. it can be empty only when it's the
first time to deploy the application
type: string
targetAppRevisionName:
description: TargetAppRevisionName contains the name of the applicationConfiguration
that we need to upgrade to. Here we use an applicationConfiguration
as a revision of an application, thus the name alone is suffice
type: string
required:
- rolloutPlan
- targetAppRevisionName
type: object
status:
description: AppRolloutStatus defines the observed state of AppRollout
properties:
LastSourceAppRevision:
description: LastSourceAppRevision contains the name of the app that
we need to upgrade from. We will restart the rollout if this is
not the same as the spec
type: string
batchRollingState:
description: BatchRollingState only meaningful when the Status is
rolling
type: string
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
currentBatch:
description: The current batch the rollout is working on/blocked it
starts from 0
format: int32
type: integer
lastAppliedPodTemplateIdentifier:
description: lastAppliedPodTemplateIdentifier is a string that uniquely
represent the last pod template each workload type could use different
ways to identify that so we cannot compare between resources We
update this field only after a successful rollout
type: string
lastTargetAppRevision:
description: LastUpgradedTargetAppRevision contains the name of the
app that we upgraded to We will restart the rollout if this is not
the same as the spec
type: string
rollingState:
description: RollingState is the Rollout State
type: string
rolloutOriginalSize:
description: RolloutTargetSize is the size of the target resources.
This is determined once the initial spec verification and does not
change until the rollout is restarted
format: int32
type: integer
rolloutTargetSize:
description: RolloutTargetSize is the size of the target resources.
This is determined once the initial spec verification and does not
change until the rollout is restarted
format: int32
type: integer
targetGeneration:
description: NewPodTemplateIdentifier is a string that uniquely represent
the new pod template each workload type could use different ways
to identify that so we cannot compare between resources
type: string
upgradedReadyReplicas:
description: UpgradedReadyReplicas is the number of Pods upgraded
by the rollout controller that have a Ready Condition.
format: int32
type: integer
upgradedReplicas:
description: UpgradedReplicas is the number of Pods upgraded by the
rollout controller
format: int32
type: integer
required:
- currentBatch
- lastTargetAppRevision
- rollingState
- upgradedReadyReplicas
- upgradedReplicas
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -179,6 +179,33 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -188,6 +215,22 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
@@ -449,6 +492,33 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -458,6 +528,22 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object

View File

@@ -1,593 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: containerizedworkloads.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: ContainerizedWorkload
listKind: ContainerizedWorkloadList
plural: containerizedworkloads
singular: containerizedworkload
scope: Namespaced
versions:
- name: v1alpha2
schema:
openAPIV3Schema:
description: A ContainerizedWorkload is a workload that runs OCI containers.
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 ContainerizedWorkloadSpec defines the desired state of
a ContainerizedWorkload.
properties:
arch:
description: CPUArchitecture required by this workload.
enum:
- i386
- amd64
- arm
- arm64
type: string
containers:
description: Containers of which this workload consists.
items:
description: A Container represents an Open Containers Initiative
(OCI) container.
properties:
args:
description: Arguments to be passed to the command run by this
container.
items:
type: string
type: array
command:
description: Command to be run by this container.
items:
type: string
type: array
config:
description: ConfigFiles that should be written within this
container.
items:
description: A ContainerConfigFile specifies a configuration
file that should be written within a container.
properties:
fromSecret:
description: FromSecret is a secret key reference which
can be used to assign a value to be written to the configuration
file at the given path in the container.
properties:
key:
description: The key to select.
type: string
name:
description: The name of the secret.
type: string
required:
- key
- name
type: object
path:
description: Path within the container at which the configuration
file should be written.
type: string
value:
description: Value that should be written to the configuration
file.
type: string
required:
- path
type: object
type: array
env:
description: Environment variables that should be set within
this container.
items:
description: A ContainerEnvVar specifies an environment variable
that should be set within a container.
properties:
fromSecret:
description: FromSecret is a secret key reference which
can be used to assign a value to the environment variable.
properties:
key:
description: The key to select.
type: string
name:
description: The name of the secret.
type: string
required:
- key
- name
type: object
name:
description: Name of the environment variable. Must be
composed of valid Unicode letter and number characters,
as well as _ and -.
pattern: ^[-_a-zA-Z0-9]+$
type: string
value:
description: Value of the environment variable.
type: string
required:
- name
type: object
type: array
image:
description: Image this container should run. Must be a path-like
or URI-like representation of an OCI image. May be prefixed
with a registry address and should be suffixed with a tag.
type: string
imagePullSecret:
description: ImagePullSecret specifies the name of a Secret
from which the credentials required to pull this container's
image can be loaded.
type: string
livenessProbe:
description: A LivenessProbe assesses whether this container
is alive. Containers that fail liveness probes will be restarted.
properties:
exec:
description: Exec probes a container's health by executing
a command.
properties:
command:
description: Command to be run by this probe.
items:
type: string
type: array
required:
- command
type: object
failureThreshold:
description: FailureThreshold specifies how many consecutive
probes must fail in order for the container to be considered
healthy.
format: int32
type: integer
httpGet:
description: HTTPGet probes a container's health by sending
an HTTP GET request.
properties:
httpHeaders:
description: HTTPHeaders to send with the GET request.
items:
description: A HTTPHeader to be passed when probing
a container.
properties:
name:
description: Name of this HTTP header. Must be
unique per probe.
type: string
value:
description: Value of this HTTP header.
type: string
required:
- name
- value
type: object
type: array
path:
description: Path to probe, e.g. '/healthz'.
type: string
port:
description: Port to probe.
format: int32
type: integer
required:
- path
- port
type: object
initialDelaySeconds:
description: InitialDelaySeconds after a container starts
before the first probe.
format: int32
type: integer
periodSeconds:
description: PeriodSeconds between probes.
format: int32
type: integer
successThreshold:
description: SuccessThreshold specifies how many consecutive
probes must success in order for the container to be considered
healthy.
format: int32
type: integer
tcpSocket:
description: TCPSocketProbe probes a container's health
by connecting to a TCP socket.
properties:
port:
description: Port this probe should connect to.
format: int32
type: integer
required:
- port
type: object
timeoutSeconds:
description: TimeoutSeconds after which the probe times
out.
format: int32
type: integer
type: object
name:
description: Name of this container. Must be unique within its
workload.
type: string
ports:
description: Ports exposed by this container.
items:
description: A ContainerPort specifies a port that is exposed
by a container.
properties:
containerPort:
description: Port number. Must be unique within its container.
format: int32
type: integer
name:
description: Name of this port. Must be unique within
its container. Must be lowercase alphabetical characters.
pattern: ^[a-z]+$
type: string
protocol:
description: Protocol used by the server listening on
this port.
enum:
- TCP
- UDP
type: string
required:
- containerPort
- name
type: object
type: array
readinessProbe:
description: A ReadinessProbe assesses whether this container
is ready to serve requests. Containers that fail readiness
probes will be withdrawn from service.
properties:
exec:
description: Exec probes a container's health by executing
a command.
properties:
command:
description: Command to be run by this probe.
items:
type: string
type: array
required:
- command
type: object
failureThreshold:
description: FailureThreshold specifies how many consecutive
probes must fail in order for the container to be considered
healthy.
format: int32
type: integer
httpGet:
description: HTTPGet probes a container's health by sending
an HTTP GET request.
properties:
httpHeaders:
description: HTTPHeaders to send with the GET request.
items:
description: A HTTPHeader to be passed when probing
a container.
properties:
name:
description: Name of this HTTP header. Must be
unique per probe.
type: string
value:
description: Value of this HTTP header.
type: string
required:
- name
- value
type: object
type: array
path:
description: Path to probe, e.g. '/healthz'.
type: string
port:
description: Port to probe.
format: int32
type: integer
required:
- path
- port
type: object
initialDelaySeconds:
description: InitialDelaySeconds after a container starts
before the first probe.
format: int32
type: integer
periodSeconds:
description: PeriodSeconds between probes.
format: int32
type: integer
successThreshold:
description: SuccessThreshold specifies how many consecutive
probes must success in order for the container to be considered
healthy.
format: int32
type: integer
tcpSocket:
description: TCPSocketProbe probes a container's health
by connecting to a TCP socket.
properties:
port:
description: Port this probe should connect to.
format: int32
type: integer
required:
- port
type: object
timeoutSeconds:
description: TimeoutSeconds after which the probe times
out.
format: int32
type: integer
type: object
resources:
description: Resources required by this container
properties:
cpu:
description: CPU required by this container.
properties:
required:
anyOf:
- type: integer
- type: string
description: Required CPU count. 1.0 represents one
CPU core.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- required
type: object
extended:
description: Extended resources required by this container.
items:
description: ExtendedResource required by a container.
properties:
name:
description: Name of the external resource. Resource
names are specified in kind.group/version format,
e.g. motionsensor.ext.example.com/v1.
type: string
required:
anyOf:
- type: integer
- type: string
description: Required extended resource(s), e.g. 8
or "very-cool-widget"
x-kubernetes-int-or-string: true
required:
- name
- required
type: object
type: array
gpu:
description: GPU required by this container.
properties:
required:
anyOf:
- type: integer
- type: string
description: Required GPU count.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- required
type: object
memory:
description: Memory required by this container.
properties:
required:
anyOf:
- type: integer
- type: string
description: Required memory.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- required
type: object
volumes:
description: Volumes required by this container.
items:
description: VolumeResource required by a container.
properties:
accessMode:
description: AccessMode of this volume; RO (read only)
or RW (read and write).
enum:
- RO
- RW
type: string
disk:
description: Disk requirements of this volume.
properties:
ephemeral:
description: Ephemeral specifies whether an external
disk needs to be mounted.
type: boolean
required:
anyOf:
- type: integer
- type: string
description: Required disk space.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- required
type: object
mountPath:
description: MountPath at which this volume will be
mounted within its container.
type: string
name:
description: Name of this volume. Must be unique within
its container.
type: string
sharingPolicy:
description: SharingPolicy of this volume; Exclusive
or Shared.
enum:
- Exclusive
- Shared
type: string
required:
- mountPath
- name
type: object
type: array
required:
- cpu
- memory
type: object
required:
- image
- name
type: object
type: array
osType:
description: OperatingSystem required by this workload.
enum:
- linux
- windows
type: string
required:
- containers
type: object
status:
description: A ContainerizedWorkloadStatus represents the observed state
of a ContainerizedWorkload.
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
resources:
description: Resources managed by this containerised workload.
items:
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
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
.'
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
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -222,6 +222,35 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It
will override the region in the region field of
ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether
provisioned cloud resources will be deleted when
CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -231,6 +260,23 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies
the namespace and name of a Secret to which any
connection details for this managed resource should
be written. Connection details frequently include
the endpoint, username, and password required to
connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
@@ -492,6 +538,35 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It
will override the region in the region field of
ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether
provisioned cloud resources will be deleted when
CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -501,6 +576,23 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies
the namespace and name of a Secret to which any
connection details for this managed resource should
be written. Connection details frequently include
the endpoint, username, and password required to
connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
@@ -755,6 +847,35 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It
will override the region in the region field of
ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether
provisioned cloud resources will be deleted when
CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -764,6 +885,23 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies
the namespace and name of a Secret to which any
connection details for this managed resource should
be written. Connection details frequently include
the endpoint, username, and password required to
connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
@@ -999,6 +1137,35 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It
will override the region in the region field of
ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether
provisioned cloud resources will be deleted when
CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git
repository. It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference
to Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -1008,6 +1175,23 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies
the namespace and name of a Secret to which any
connection details for this managed resource should
be written. Connection details frequently include
the endpoint, username, and password required to
connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
@@ -1051,6 +1235,10 @@ spec:
- type
type: object
type: array
configMapRef:
description: ConfigMapRef refer to a ConfigMap which contains
OpenAPI V3 JSON schema of Component parameters.
type: string
latestRevision:
description: LatestRevision of the component definition
properties:

File diff suppressed because it is too large Load Diff

View File

@@ -5,20 +5,26 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: clusters.core.oam.dev
name: policies.core.oam.dev
spec:
group: core.oam.dev
names:
kind: Cluster
listKind: ClusterList
plural: clusters
singular: cluster
categories:
- oam
kind: Policy
listKind: PolicyList
plural: policies
singular: policy
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .type
name: TYPE
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: Cluster is the Schema for the clusters API
description: Policy is the Schema for the policy API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
@@ -32,26 +38,17 @@ spec:
type: string
metadata:
type: object
spec:
description: ClusterSpec defines the desired state of Cluster
properties:
kubeconfigSecretRef:
description: KubeconfigSecretRef specifies the reference to the secret
that contains the kubeconfig in field `config`.
properties:
name:
description: Name of a secret within the enclosing namespace.
type: string
required:
- name
type: object
type: object
status:
description: ClusterStatus defines the observed state of Cluster
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
type:
type: string
required:
- type
type: object
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""

View File

@@ -15,7 +15,7 @@ spec:
listKind: PolicyDefinitionList
plural: policydefinitions
shortNames:
- policy
- def-policy
singular: policydefinition
scope: Namespaced
versions:
@@ -151,6 +151,33 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -160,6 +187,22 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object

View File

@@ -15,11 +15,24 @@ spec:
listKind: ResourceTrackerList
plural: resourcetrackers
shortNames:
- tracker
- rt
singular: resourcetracker
scope: Cluster
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .spec.type
name: TYPE
type: string
- jsonPath: .metadata.labels['app\.oam\.dev\/name']
name: APP
type: string
- jsonPath: .metadata.labels['app\.oam\.dev\/namespace']
name: APP-NS
type: string
- jsonPath: .spec.applicationGeneration
name: APP-GEN
type: number
name: v1beta1
schema:
openAPIV3Schema:
description: An ResourceTracker represents a tracker for track cross namespace
@@ -37,40 +50,92 @@ spec:
type: string
metadata:
type: object
status:
description: ResourceTrackerStatus define the status of resourceTracker
spec:
description: ResourceTrackerSpec define the spec of resourceTracker
properties:
trackedResources:
applicationGeneration:
format: int64
type: integer
managedResources:
items:
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
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
.'
description: ManagedResource define the resource to be managed by
ResourceTracker
properties:
apiVersion:
description: API version of the referent.
type: string
cluster:
type: string
component:
type: string
creator:
description: ResourceCreatorRole defines the resource creator.
type: string
deleted:
description: Deleted marks the resource to be deleted
type: boolean
env:
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
raw:
type: object
x-kubernetes-preserve-unknown-fields: true
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
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
type: array
type:
description: ResourceTrackerType defines the type of resourceTracker
type: string
required:
- applicationGeneration
type: object
status:
description: ResourceTrackerStatus define the status of resourceTracker
For backward-compatibility
properties:
trackedResources:
description: Deprecated
items:
description: ClusterObjectReference defines the object reference
with cluster.
properties:
apiVersion:
description: API version of the referent.
type: string
cluster:
type: string
creator:
description: ResourceCreatorRole defines the resource creator.
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

View File

@@ -188,6 +188,33 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -197,6 +224,22 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
@@ -454,6 +497,33 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -463,6 +533,22 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object

View File

@@ -14,22 +14,13 @@ spec:
kind: Workflow
listKind: WorkflowList
plural: workflows
shortNames:
- workflow
singular: workflow
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.phase
name: PHASE
type: string
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1alpha1
- name: v1alpha1
schema:
openAPIV3Schema:
description: Workflow is the Schema for the Workflow API
description: Workflow is the Schema for the policy API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
@@ -43,257 +34,63 @@ spec:
type: string
metadata:
type: object
spec:
description: A WorkflowSpec defines the desired state of a Workflow.
properties:
steps:
items:
description: WorkflowStep defines how to execute a workflow step.
properties:
inputs:
description: StepInputs defines variable input of WorkflowStep
items:
properties:
from:
type: string
parameterKey:
type: string
required:
- from
- parameterKey
type: object
type: array
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
steps:
items:
description: WorkflowStep defines how to execute a workflow step.
properties:
dependsOn:
items:
type: string
type: array
inputs:
description: StepInputs defines variable input of WorkflowStep
items:
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
type:
type: string
required:
- name
- type
type: object
type: array
type: object
status:
description: A WorkflowStatus is the status of Workflow
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
contextBackend:
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 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
.'
from:
type: string
parameterKey:
type: string
required:
- from
- parameterKey
type: object
type: array
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:
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
observedGeneration:
format: int64
type: integer
stepIndex:
type: integer
steps:
items:
description: WorkflowStepStatus record the status of a workflow
step
properties:
message:
description: A human readable message indicating details about
why the workflowStep is in this state.
type: string
name:
type: string
phase:
description: WorkflowStepPhase describes the phase of a workflow
step.
type: string
reason:
description: A brief CamelCase message indicating details about
why the workflowStep is in this state.
type: string
resourceRef:
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 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
.'
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
type:
type: string
type: object
type: array
suspend:
type: boolean
terminated:
type: boolean
required:
- contextBackend
- suspend
- terminated
type: object
x-kubernetes-preserve-unknown-fields: true
type:
type: string
required:
- name
- type
type: object
type: array
type: object
served: true
storage: true
subresources:
status: {}
- name: v1beta1
schema:
openAPIV3Schema:
description: Workflow defines workflow steps and other attributes
properties:
ref:
type: string
steps:
items:
description: WorkflowStep defines how to execute a workflow step.

View File

@@ -148,6 +148,33 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -157,6 +184,22 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
@@ -198,6 +241,10 @@ spec:
- type
type: object
type: array
configMapRef:
description: ConfigMapRef refer to a ConfigMap which contains OpenAPI
V3 JSON schema of Component parameters.
type: string
latestRevision:
description: LatestRevision of the component definition
properties:

View File

@@ -193,6 +193,33 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -202,6 +229,22 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object
@@ -440,6 +483,33 @@ spec:
configuration:
description: Configuration is Terraform Configuration
type: string
customRegion:
description: Region is cloud provider's region. It will override
the region in the region field of ProviderReference
type: string
deleteResource:
default: true
description: DeleteResource will determine whether provisioned
cloud resources will be deleted when CR is deleted
type: boolean
path:
description: Path is the sub-directory of remote git repository.
It's valid when remote is set
type: string
providerRef:
description: ProviderReference specifies the reference to
Provider
properties:
name:
description: Name of the referenced object.
type: string
namespace:
default: default
description: Namespace of the referenced object.
type: string
required:
- name
type: object
type:
default: hcl
description: Type specifies which Terraform configuration
@@ -449,6 +519,22 @@ spec:
- json
- remote
type: string
writeConnectionSecretToRef:
description: WriteConnectionSecretToReference specifies the
namespace and name of a Secret to which any connection details
for this managed resource should be written. Connection
details frequently include the endpoint, username, and password
required to connect to the managed resource.
properties:
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- name
type: object
required:
- configuration
type: object

View File

@@ -1 +1,31 @@
Welcome to use the KubeVela! Enjoy your shipping application journey!
Welcome to use the KubeVela! Enjoy your shipping application journey!
,
//,
////
./ /////*
,/// ///////
.///// ////////
/////// /////////
//////// //////////
,///////// ///////////
,////////// ///////////.
./////////// ////////////
//////////// ////////////.
*//////////// ////////////*
#@@@@@@@@@@@* ..,,***/ /////////////
/@@@@@@@@@@@#
*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&
.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.&@@@* *@@@& ,@@@&.
_ __ _ __ __ _
| |/ /_ _ | |__ ___\ \ / /___ | | __ _
| ' /| | | || '_ \ / _ \\ \ / // _ \| | / _` |
| . \| |_| || |_) || __/ \ V /| __/| || (_| |
|_|\_\\__,_||_.__/ \___| \_/ \___||_| \__,_|
You can refer to https://kubevela.io for more details.

View File

@@ -51,11 +51,6 @@ app.kubernetes.io/name: {{ include "kubevela.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "kubevela-apiserver.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kubevela.name" . }}-apiserver
app.kubernetes.io/instance: {{ .Release.Name }}-apiserver
{{- end -}}
{{- define "kubevela-cluster-gateway.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kubevela.name" . }}-cluster-gateway
app.kubernetes.io/instance: {{ .Release.Name }}-cluster-gateway
@@ -71,3 +66,14 @@ Create the name of the service account to use
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
systemDefinitionNamespace value defaulter
*/}}
{{- define "systemDefinitionNamespace" -}}
{{- if .Values.systemDefinitionNamespace -}}
{{ .Values.systemDefinitionNamespace }}
{{- else -}}
{{ .Release.Namespace }}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,270 @@
{{- 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 }}

Some files were not shown because too many files have changed in this diff Show More