Compare commits

...

1411 Commits

Author SHA1 Message Date
Jianbo Sun
b596b70ebe Fix: addon function converted (#4411)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-19 19:54:44 +08:00
github-actions[bot]
0cd370e867 Fix: fix volumes duplicate in list (#4390)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 08fb73aa95)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-07-15 20:11:49 +08:00
github-actions[bot]
d9adc73e5c Fix: add usage comment for ref-objects (#4386)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 0418c83117)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-07-14 18:51:05 +08:00
github-actions[bot]
4a2d9807c8 [Backport release-1.4] Fix: fail directly when app terminated (#4385)
* fail directly when app terminated

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

* support suspend

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

fix typo

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-07-14 18:50:23 +08:00
github-actions[bot]
840cb8ce58 Fix: several minor bugs (#4381)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit c5f10a5723)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-07-14 11:22:41 +08:00
github-actions[bot]
5a64fec916 Fix: abuse timeout context in terraform provider (#4375)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit ab56b3c274)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-13 15:48:13 +08:00
Jianbo Sun
657a374ded Fix: add the job of independently publishing chart packages (#4360) (#4361)
* Fix: add the job of independently publishing chart packages

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

* Fix: add the job of independently publishing chart packages

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-12 12:31:05 +08:00
Tianxin Dong
dfe12cd9ca [Backport-1.4]: optimize imports packages to reduce 75% cpu with better performance (#4355)
* Feat: optimize imports packages

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

* fix test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-07-11 18:33:53 +08:00
github-actions[bot]
cd42f67848 Fix: init container bug (#4354)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 3f116c7f10)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-07-11 17:03:49 +08:00
github-actions[bot]
61d2c588e3 Fix: health check use original ns if no override and original exists (#4353)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit f7923b5ac9)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-07-11 16:49:24 +08:00
github-actions[bot]
b3dad698a5 Fix: enhance sidecar & init traits (#4343)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit dc9b18d119)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-07-08 19:09:55 +08:00
github-actions[bot]
ec5159c2ca Fix: disable apprev status update when apprev disabled (#4338)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit b4c8e3265a)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-07-07 15:51:35 +08:00
github-actions[bot]
a7b2b221e0 [Backport release-1.4] Fix: more cluster system info range. (#4333)
* more collect info

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

* fix comments

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-07-06 16:15:31 +08:00
github-actions[bot]
caa495a5d9 [Backport release-1.4] Fix: ref-objects parameter with invalid field definition (#4330)
* fix: ref-objects parameter with invalid field definition

which cause validating webhook failed when use ref-objects component

Signed-off-by: jiangshantao <jiangshantao-dbg@qq.com>
(cherry picked from commit 13f328f362)

* fix: run make reviewable

Signed-off-by: jiangshantao <jiangshantao-dbg@qq.com>
(cherry picked from commit e09410af90)

Co-authored-by: jst <jst@meitu.com>
2022-07-06 14:18:17 +08:00
github-actions[bot]
15bea4fb64 Fix: fail to query the application logs with the special characters (#4308)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 0101396a42)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-01 20:15:09 +08:00
github-actions[bot]
1a094a4eea Fix: Jfrog Webhook Handler Cannot Get Right Image (#4306)
Merge branch 'release-1.4'

Apply suggestions from code review

Co-authored-by: lqs429521992 <lqs429521992@qq.com>

Update webhook.go

Fix: format

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit b0d0a81731)

Co-authored-by: qingsliu <lqs429521992@qq.com>
2022-07-01 20:08:40 +08:00
github-actions[bot]
65b6f47330 Fix: fix the goroutine leak in http request (#4304)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 559ef83abd)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-07-01 17:57:34 +08:00
github-actions[bot]
3a4cd2dca6 Fix: kube apply ignore userinfo for rt (#4300)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 2a9e741d4c)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-07-01 17:32:52 +08:00
github-actions[bot]
9fabd950e5 Chore: avoid update version file when publish smaller version (#4287)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
(cherry picked from commit 696234e1aa)

Co-authored-by: qiaozp <chivalry.pp@gmail.com>
2022-06-30 15:51:17 +08:00
github-actions[bot]
0a012b4d34 Feat: enhance ServiceAccount trait to support privileges (#4278)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit f8d4aca499)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-06-29 15:00:32 +08:00
github-actions[bot]
7c231e6c48 Fix: support stdin and url for vela ql (#4277)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 235a4471c0)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-29 14:53:26 +08:00
github-actions[bot]
36b6c3e7b5 Fix: trim quot char for velaql output (#4269)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit fdd0c93dba)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-27 16:52:26 +08:00
github-actions[bot]
4cc019722c [Backport release-1.4] Feat: enhance velq ql and support cue file (#4266)
* Feat: enhance velq ql and support cue file

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 70ed417326)

* add statement

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 25260eb9ef)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-27 16:17:21 +08:00
github-actions[bot]
b040ae65da [Backport release-1.4] Fix: provider can't be added since 1.4 as context abused && Feat: add cache for remote terraform module in vela show (#4263)
* Fix: provider can't be added since 1.4 as context abused

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit b05fb26418)

* Feat: add cache for remote terraform module in vela show

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 4722028530)

* Fix: add message for terraform resource in error state

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 438145b12e)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-27 11:32:20 +08:00
github-actions[bot]
f0fb4ed099 Feat: omit service output if there's nothing (#4262)
Signed-off-by: Sumit Tembe <sumit.tembe@outlook.com>
(cherry picked from commit 8911143389)

Co-authored-by: Sumit Tembe <sumit.tembe@outlook.com>
2022-06-27 10:31:49 +08:00
github-actions[bot]
7f89d12059 environment from configmap or secret not mandatory in task and crontask componentdefinition (#4254)
Signed-off-by: Carmendelope <carmen@napptive.com>
(cherry picked from commit 35f130ea08)

Co-authored-by: Carmendelope <carmen@napptive.com>
2022-06-25 09:00:24 +08:00
github-actions[bot]
3c61bcb8f0 Fix: vela status print wrong STATUS (#4249)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
(cherry picked from commit 5f4616a453)

Co-authored-by: StevenLeiZhang <zhangleiic@163.com>
2022-06-24 17:16:58 +08:00
github-actions[bot]
a14b536fd1 [Backport release-1.4] Feat: skip validating version check (#4247)
* skip validating version check

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

* add comments

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

* fix comments

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

* fix test

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

* fix commments

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

* add compatible logic for old controller

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

* modify minimal

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-06-24 14:13:17 +08:00
github-actions[bot]
ba5a726854 [Backport release-1.4] Fix: fixed the problems of display definition in web and support displaying WorkflowStep and Policy (#4241)
* Fix: fixed the problems of display definition in web

Some ComponentDefinitions, TraitDefinitions, WorkflowDefinitions
failed to show the usage in web browser

Signed-off-by: Zheng Xi Zhou <zhengxi.zzx@alibaba-inc.com>
(cherry picked from commit c8985ccc3e)

* set printable type for {}

Signed-off-by: Zheng Xi Zhou <zhengxi.zzx@alibaba-inc.com>
(cherry picked from commit 87efb357b2)

* support WorkflowSteps and Policies

Signed-off-by: Zheng Xi Zhou <zhengxi.zzx@alibaba-inc.com>
(cherry picked from commit 8fb83152bc)

Co-authored-by: Zheng Xi Zhou <zhengxi.zzx@alibaba-inc.com>
2022-06-23 19:46:51 +08:00
github-actions[bot]
ffb9d06427 Fix: json-patch & json-merge-patch open result (#4229)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 4ea3ca8d5b)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-06-22 20:05:19 +08:00
barnettZQG
819dc26ace Chore: change the acr registry address (#4214) (#4216)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-06-22 14:46:13 +08:00
github-actions[bot]
5e3ab732df [Backport release-1.4] Feat: add the API for querying the image info (#4211)
* Feat: add the API for querying the image info

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

* Fix: the code style

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-06-21 15:05:15 +08:00
github-actions[bot]
62d5507499 Fix: cue patch remove temp var (#4208)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 660e89b3a0)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-06-20 17:38:34 +08:00
github-actions[bot]
c0daf688a6 Fix: clear namespace for cluster scoped resource for dispatching (#4195)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 7c9de1b071)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-06-16 14:50:44 +08:00
github-actions[bot]
48d19a2427 [Backport release-1.4] Feat: cli addon add registry add more git types (#4191)
* add more git types

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

* fix comments

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

fix comments

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-06-16 12:23:15 +08:00
github-actions[bot]
4da8d49e60 Fix: fix the annotation for APIService (#4190)
Make the annatation for cert-manger be the same as the new version
secret

Signed-off-by: Zheng Xi Zhou <zhengxi.zzx@alibaba-inc.com>
(cherry picked from commit 62ef7b7f99)

Co-authored-by: Zheng Xi Zhou <zhengxi.zzx@alibaba-inc.com>
2022-06-16 11:02:35 +08:00
github-actions[bot]
4db9e89816 Fix: enhance CLI for managing OCM clusters (#4178)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 0662e2a79d)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-06-15 11:23:12 +08:00
github-actions[bot]
667053409d Fix: fix trait customStatus error when controlPlanOnly=true (#4177)
Signed-off-by: fourierr <maxiangboo@qq.com>
(cherry picked from commit 38648fcf30)

Co-authored-by: fourierr <maxiangboo@qq.com>
2022-06-15 11:22:15 +08:00
github-actions[bot]
eb9ddaabd3 [Backport release-1.4] Feat: optimize the API that list and detail definition (#4160)
* Fix: ignore the error that the definition API schema is not exist

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

* Fix: disable the cache when listing the definitions

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-06-13 13:25:41 +08:00
github-actions[bot]
f11a94612f Feat: support insecure cluster (#4159)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 8abedf3005)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-06-13 13:15:34 +08:00
github-actions[bot]
56f9d7cb9c [Backport release-1.4] Fix: mongoDB datastore can't list special email user(#4104) (#4148)
* Add description column to vela trait and component command (#4107)

Signed-off-by: Holger Protzek <holger.protzek@springernature.com>
Signed-off-by: fengkang <fengkangb@digitalchina.com>
(cherry picked from commit 9c57ae2a15)

* Fix: mongoDB datastore can't list special email user(#4104)

Signed-off-by: fengkang <fengkangb@digitalchina.com>
(cherry picked from commit ec07790935)

* Fix: mongoDB datastore can't list special email user(#4104)
     change the function name from verifyUserValue to verifyValue
     add test case to test kubeapi.go:87

Signed-off-by: fengkang <fengkangb@digitalchina.com>
(cherry picked from commit 4c55e0688f)

* Fix: mongoDB datastore can't list special email user(#4104)
     change the function name from verifyUserValue to verifyValue
     add test case to test kubeapi.go:87
     add delete test case

Signed-off-by: fengkang <fengkangb@digitalchina.com>
(cherry picked from commit b2e76001c9)

* Fix: mongoDB datastore can't list special email user(#4104)
     optimize the test case

Signed-off-by: fengkang <fengkangb@digitalchina.com>
(cherry picked from commit a63c96fae1)

* Fix: mongoDB datastore can't list special email user(#4104)
     optimize the test case use user
     change all verify timing in kubeapi

Signed-off-by: fengkang <fengkangb@digitalchina.com>
(cherry picked from commit 2ede4f7b0c)

* Fix: mongoDB datastore can't list special email user(#4104)

Signed-off-by: fengkang <fengkangb@digitalchina.com>
(cherry picked from commit 356150642f)

* Fix: mongoDB datastore can't list special email user(#4104)

Signed-off-by: fengkang <fengkangb@digitalchina.com>
(cherry picked from commit 48a9e55937)

Co-authored-by: Holger Protzek <3481523+hprotzek@users.noreply.github.com>
Co-authored-by: fengkang01 <fengkangb@digitalchina.com>
2022-06-10 15:33:53 +08:00
github-actions[bot]
fbbc666019 [Backport release-1.4] Fix: api not exist don't break whole query process (#4137)
* make resource tree more

resourceTree more robust

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

* log the error

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-06-09 11:36:57 +08:00
github-actions[bot]
d0788254cb Fix: vela addon registry get panic (#4136)
Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
(cherry picked from commit 0d329e394e)

Co-authored-by: ZhongsJie <zhongsjie@gmail.com>
2022-06-09 10:19:28 +08:00
github-actions[bot]
c72a6aef87 Chore(deps): Bump github.com/containerd/containerd from 1.5.10 to 1.5.13 (#4125)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.5.10 to 1.5.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.5.10...v1.5.13)

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

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 9982c7ceaa)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-08 12:56:05 +08:00
github-actions[bot]
195b7fe0c7 [Backport release-1.4] Fix: bump oamdev/kube-webhook-certgen to v2.4.1 to support arm64 (#4117)
* Fix: split the image build process to make it faster

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 339977e874)

* Fix: bump oamdev/kube-webhook-certgen to v2.4.1 to support arm64

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit dc054e2ce2)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-05 15:10:48 +08:00
github-actions[bot]
33c9e3b170 Fix: change the image name in ghcr to align with docker image registry (#4111)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 71776c374b)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-04 14:19:21 +08:00
github-actions[bot]
ea0508a634 [Backport release-1.4] Fix: hold the force uninstalling process untill the last addon been deleted (#4103)
* hold the force uninstalling process untill the last addon been deleted

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

fix lint

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

fix comments

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

fix comments

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

* fix comments

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

fix lint

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

* add period

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-06-02 16:29:02 +08:00
github-actions[bot]
23e29aa62a Fix: vela provider delete command's example is wrong (#4099)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
(cherry picked from commit 9b66f90100)

Co-authored-by: StevenLeiZhang <zhangleiic@163.com>
2022-06-02 11:04:34 +08:00
github-actions[bot]
ed2cb80219 Fix: the new default values do not take effect when upgrading the vela core (#4097)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 0ccbbb2636)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-06-02 10:23:30 +08:00
github-actions[bot]
1a3d5debd5 Fix: show the default password (#4095)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit c3cfc4729e)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-06-02 10:14:43 +08:00
github-actions[bot]
d4a82fe292 Fix: load the provider subcommands on demand (#4090)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 52bbf937bb)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-06-01 16:32:53 +08:00
github-actions[bot]
963ae400fa Feat: use deferred config in CLI (#4085)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 478434003b)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-06-01 10:24:57 +08:00
github-actions[bot]
8f7a8258fe [Backport release-1.4] Fix(addon): more note info and filter prerelease addon version (#4082)
* more note info and filter prerelease addon version

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

* wrap the error optimize the show info

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

* fix golint

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-05-31 18:56:54 +08:00
github-actions[bot]
70bc306678 Chore: hide some definitions in VelaUX (#4080)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 68b8db1d00)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-31 16:41:54 +08:00
github-actions[bot]
57428bbc8d Fix: change the region to customRegion (#4079)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 9f0008f001)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-31 16:19:37 +08:00
github-actions[bot]
e08541ca5c Fix: Improve vela provider add response (#4078)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
(cherry picked from commit 39e96d287b)

Co-authored-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-31 16:16:54 +08:00
github-actions[bot]
521a4edc10 Feat: vela ql into vela-cli (#4077)
Signed-off-by: Shukun Zhang <2236407598@qq.com>
(cherry picked from commit 38886a0ee2)

Co-authored-by: Shukun Zhang <2236407598@qq.com>
2022-05-31 16:13:00 +08:00
github-actions[bot]
82b330710c Fix: upgrade from v1.3+ to v1.4+ with new secret for cluster-gateway (#4076)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 161588c64e)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-05-31 16:05:36 +08:00
github-actions[bot]
4a649f2cf1 Fix: Can not delete terraform provider (#4074)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
(cherry picked from commit de79442f53)

Co-authored-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-31 15:21:17 +08:00
github-actions[bot]
f6664106a2 Fix: remove the tcp protocol prefix in the endpoint string (#4068)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 8852ac691a)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-30 20:17:47 +08:00
github-actions[bot]
bbe2a2dec6 [Backport release-1.4] Fix: CI workflow for rollout acr image build and push (#4067)
* fix the rollout acr image

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

* fix

test

test

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

finish fix

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

* merge two sction

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-05-30 19:35:47 +08:00
github-actions[bot]
404c7f6975 Fix: set workflow to finish before record in controller revision (#4066)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 7042c63e90)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-30 19:30:03 +08:00
github-actions[bot]
2edfbabdab Fix: fix the dependency gc policy to reverse dependency (#4065)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 45cf38edb0)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-30 19:29:42 +08:00
github-actions[bot]
e7b304de3b Fix: the policies can not be deleted (#4062)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 0c11a69779)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-30 16:23:03 +08:00
github-actions[bot]
b8b54baf26 Fix: fail to get the endpoints via the velaql (#4058)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>
(cherry picked from commit a40d99f8d8)

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-05-30 15:52:38 +08:00
github-actions[bot]
87b6c9416e [Backport release-1.4] Feat: minimize controller privileges & enforce authentication in multicluster e2e test (#4044)
* Feat: enable auth in multicluster test & restrict controller privileges while enabling authentication

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit fc3fc39eb0)

* Feat: fix statekeep permission leak & comprev cleanup leak

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit eaa317316d)

* Fix: use user info in ref-object select

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 67463d13fe)

* Feat: set legacy-rt-gc to disabled by default

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 77f1fc4286)

* Fix: pending healthscope with authentication test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit c21ae8ac6a)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-05-28 01:27:35 +08:00
qiaozp
cd171d27db Fix: release script condition syntax (#4043)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-05-27 23:29:31 +08:00
github-actions[bot]
6d8be8b061 [Backport release-1.4] Feat: add if in workflow (#4041)
* Feat: add if in workflow struct

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

* Feat: implement the if in workflow

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

* Feat: support dependency and skip for suspend step

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

* Fix: fix the rebase from sub steps

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

* Fix: fix the lint

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

* Feat: support if in sub steps

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

* Feat: add tests in application controller

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

* Fix: fix the lint

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

* Test: add more tests in discover and custom

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

* Lint: fix lint

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

* Tests: add more tests in application controller

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

* Fix: change failed after retries into reason

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

* Fix: fix the terminate cli

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

* fix lint

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

* remove the terminate workflow to pkg and add feature gates

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

* resolve comments

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

* nit fix

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

* make finish condition more clear

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

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-27 22:02:02 +08:00
github-actions[bot]
e93912acff Fix: env trait error when existing env exists (#4040)
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:35 +08:00
github-actions[bot]
e48e39987f some small fixes (#4034)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
(cherry picked from commit 99af188f91)

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-05-27 18:38:12 +08:00
github-actions[bot]
6264a66021 Feat: add the creating and deleting permission APIs (#4032)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 193515dfaf)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-27 17:42:49 +08:00
github-actions[bot]
9191127e01 Feat: add affinity trait to merge node and pod affinity (#4030)
Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
(cherry picked from commit a4966310ae)

Co-authored-by: ZhongsJie <zhongsjie@gmail.com>
2022-05-27 17:39:10 +08:00
github-actions[bot]
1b047c10ba Fix: error message of vela init env is not clear (#4029)
Signed-off-by: fourierr <maxiangboo@qq.com>
(cherry picked from commit 378fdbdafb)

Co-authored-by: fourierr <maxiangboo@qq.com>
2022-05-27 17:35:23 +08:00
github-actions[bot]
02a1d390c4 Fix: vela port-forward not working for webservice component (#4028)
Signed-off-by: fourierr <maxiangboo@qq.com>
(cherry picked from commit 391532dd24)

Co-authored-by: fourierr <maxiangboo@qq.com>
2022-05-27 17:15:51 +08:00
github-actions[bot]
62866e19d8 Fix: unknown field ignoreTerraformComponent (#4027)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 0c27fe8199)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-27 17:15:23 +08:00
github-actions[bot]
3dc645ed52 Fix: velaql fail to parse query result to json format (#4025)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>
(cherry picked from commit 6c1576c5a6)

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-05-27 16:57:38 +08:00
github-actions[bot]
e20ef02a6a [Backport release-1.4] Feat: enhance controller auth by removing useless features & add authentication for componentrevision+healthcheck (#4023)
* Feat: use application identity in gc & componentrevision & collectHealthStatus

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 63fc4bcc69)

* Chore: remove useless features and roles

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit f4ef77b2b3)

* Fix: remove DELETE from mutating webhook

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 75f3d5dc35)

* Chore: enhance deploy error display

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit e69079bdae)

* Fix: e2e test vela cli output match & controllerrevision recycle for serviceaccount impersonation

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 05b85573a2)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-05-27 16:00:04 +08:00
github-actions[bot]
371affb389 Fix: step group documentation update and bug fix of firstExecuteTime not record (#4021)
Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Fix: step group documentation update and bug fix of firstExecuteTime not record

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>
(cherry picked from commit 751dd181be)

Co-authored-by: Qiang Zheng <zhengq20018@cmbchina.com>
2022-05-27 11:50:58 +08:00
github-actions[bot]
b35145be82 Fix: fail to query the count with mongodb (#4014)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit ee2b446b5c)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-27 10:56:13 +08:00
github-actions[bot]
d92c8844ba [Backport release-1.4] Feat: optimize some logic of topology resource-tree (#4010)
* format

finish tests

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

* add comments

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

no lint

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

* add pvc

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

* go mod tidy

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

* fix panic bug

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

fix panic

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-05-26 22:18:12 +08:00
github-actions[bot]
82aaf5098b Fix: optimized the version comparison (#4006)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 8bfab07f8f)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-26 19:34:47 +08:00
github-actions[bot]
7399666275 Fix: add some default permissions about the configuration (#4005)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 595ccea622)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-26 17:27:06 +08:00
github-actions[bot]
0b394e766b [Backport release-1.4] Feat: upgrade cluster-gateway version (#4004)
* Feat: upgrade cluster-gateway version

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit e677ef707a)

* Fix: multicluster test unstable

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 09d43391ef)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-05-26 17:26:34 +08:00
github-actions[bot]
eb386ce9f7 Feat: support impersonation for application in apiserver (#4000)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 10dc83b60a)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-05-26 16:55:09 +08:00
github-actions[bot]
e4fa5a5cf1 Fix: add Target fail by fetch terraform-provider error (#3999)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
(cherry picked from commit 4a44ba2550)

Co-authored-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-26 15:46:07 +08:00
github-actions[bot]
165e011bd0 Fix: delete Project fail (#3996)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
(cherry picked from commit 87347f128d)

Co-authored-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-26 11:31:40 +08:00
github-actions[bot]
9489b8d511 Fix: don't update version file when publish alpha/beta version (#3995)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
(cherry picked from commit 2c2809b975)

Co-authored-by: qiaozp <chivalry.pp@gmail.com>
2022-05-26 11:31:16 +08:00
github-actions[bot]
d95942c992 Feat: build docker image(oamdev/vela-cli) for vela-cli (#3991)
fixes #1392

One of the use case could be https://github.com/kubevela/kubevela/discussions/3821

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 1c46dec107)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-05-26 10:30:37 +08:00
github-actions[bot]
c6aa8ddbbc [Backport release-1.4] Fix: initialize kube config multiple times (#3990)
* Fix: initialize kube config multiple times

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

* Fix: e2e test case

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-26 10:21:16 +08:00
github-actions[bot]
c370ef04f3 [Backport release-1.4] Feat: mechanism to let user add relationship mapping rule by configmap (#3982)
* WIP add some code

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

small fix

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

fix all tests

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

* add comment

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

fix ci

delete useless code

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

go mod vendor

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

* fix failed test

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

* more test

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-05-25 16:45:42 +08:00
wyike
1d82378053 Fix: velaql appliedResource bug and add e2e-test (#3965)
* fix bug and add e2e-test

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

* fix comments

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-05-24 17:58:53 +08:00
barnettZQG
5daec5b017 Feat: support to configure the qps and burst (#3961)
* Feat: support to configure the qps and burst

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

* Fix: code style

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

* Fix: change the comment

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-24 16:36:07 +08:00
Somefive
cb5630af48 Fix: enhance grant privileges output (#3962)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-24 14:31:32 +08:00
Jianbo Sun
cdfdc7febd Deprecate: oam runtime is no longer maintained, users should use kubevela instead (#3958)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-05-24 10:24:22 +08:00
Diego Pinheiro
3f725cab01 Chore: Bump kubectl sdk (#3960)
* bump kubectl sdk version

Signed-off-by: diego-milhomes <diego.milhomes@stackspot.com>

* bump kubectl sdk version

Signed-off-by: s4rd1nh4 <diego.milhomes@gmail.com>

* bump kubectl sdk version

Signed-off-by: s4rd1nh4 <diego.milhomes@gmail.com>

Co-authored-by: diego-milhomes <diego.milhomes@stackspot.com>
2022-05-24 09:58:28 +08:00
Somefive
897f07fbec Feat: vela kube delete (#3952)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-24 09:38:22 +08:00
Tianxin Dong
a855eddedc Fix: refactor the step group in workflow (#3956)
* Fix: refactor the step group in workflow

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

* Feat: add tests for discover

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-23 20:17:13 +08:00
Somefive
7976b32ba4 Fix: grant privilege readonly incorrect binding (#3953)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-23 17:23:08 +08:00
wyike
ec0b12861b Feat: velaql provider for get application resource-tree (#3944)
* first commit

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

refactor code

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

finish all tests

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

resolve confilict

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

revert code

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

fix golint error

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

fix checkdiff

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

* add more test for pod status

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

* cue fmt

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

* add filter

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

* fix comments

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

fix comments

* fix

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

fix log error

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-05-23 16:41:19 +08:00
Somefive
2818f2ac4c Fix: listKubeCluster page=0 (#3951)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-23 14:06:55 +08:00
barnettZQG
09ce919b2b Feat: Refactoring the API Server module for better layering (#3945)
* Feat: Refactoring the API Server module for better layering

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

* Fix: code style

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

* Fix: code style

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

* Fix: fix the lint errors

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-23 12:17:28 +08:00
JarHMJ
02903cd1c4 Feat: support download kustomize in local folder (#3949)
Signed-off-by: huangminjie <minjie.huang@daocloud.io>
2022-05-23 10:58:08 +08:00
qiaozp
75700e7dc8 Feat: make gateway trait's host field optional (#3912)
* Feat: make gateway trait's host field optional

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

* modity hint

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

* revert

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-05-23 10:55:43 +08:00
Somefive
c5b28cb4b3 Feat: vela auth grant-privileges (#3943)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-23 10:47:13 +08:00
zq200618
7d9c647b1a Feat: support step group with substep in the workflow (#3772)
Signed-off-by: zhengq2006 <zhengq200618@cmbchina.com>

workflow substep develop

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

Feat: support step group with substep in the workflow

Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>
2022-05-23 10:26:21 +08:00
Jianbo Sun
493a609864 Chore: trim updated docs, make the source clean (#3946)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-05-22 15:13:41 +08:00
Noorain Panjwani
564cbaf5d4 Feat(cli): added the offline flag to the dry-run command (#3875)
* Feat(cli): Added an offline flag to the 'dry-run' command

Signed-off-by: Noorain Panjwani <noorain.panjwani@gmail.com>

* Using a fake client now for offline mode

Signed-off-by: Noorain Panjwani <noorain.panjwani@gmail.com>
2022-05-21 23:00:45 +08:00
Oiar
250f395109 Feat: gateway trait support https protocol (#3832) (#3925)
Signed-off-by: Oiar <643921472@qq.com>
2022-05-21 22:59:57 +08:00
JarHMJ
55f82781ce Feat: support chart value to disable conversation on application crd (#3890)
Signed-off-by: huangminjie <minjie.huang@daocloud.io>
2022-05-21 22:57:38 +08:00
StevenLeiZhang
ba7c22a37e Fix: addon compare vela version failure (#3928)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-21 00:25:46 +08:00
Will Li
fecdc23fd3 Fix(cli): try to get mapValue type name (#2474)
* Fix(cli): try to get mapValue type name

Signed-off-by: Cuichen Li <cuichli@cisco.com>

* Fix: update output format based on comment and fix typo

Signed-off-by: Cuichen Li <cuichli@cisco.com>

* Style: make the change reviewable

Signed-off-by: Cuichen Li <cuichli@cisco.com>

* Fix: test

Signed-off-by: Cuichen Li <cuichli@cisco.com>
2022-05-21 00:25:20 +08:00
Zheng Xi Zhou
334446c264 Feat: support force delete Terraform typed application (#3929)
* Feat: support force delete Terraform typed application

If a Terraform typed application hangs on deletion, it could be forced to
delete by command line `vela delete xxx --force`

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

* fix copyright

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

* Upgrade terraform controller api version

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

* add one more tests

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

* fix two unit-tests

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-05-20 18:17:10 +08:00
Jianbo Sun
6bef810dc3 Fix: remove last-applied-config annotation for configmap and secret (#3939)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-05-20 17:08:36 +08:00
Zheng Xi Zhou
8ab311f2ff Feat: API of retrieving image registry secrets by image and its tag (#3719)
* Feat: check existence of an image

Checked existence of an image in
- public docker hub
- private image registry

Add an API to retrieve image registry secrets by an image and or
its tag. In veluaUX, it will help auto-fill uesrs' imagePullSecrets
fields

Fix https://github.com/kubevela/velaux/issues/436

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

* replace the implementation with libary google/go-containerregistry

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

* address comments

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

* add more testcases

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

* fix UT

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-05-20 15:23:58 +08:00
Somefive
0cd1ae155c Feat: vela kube apply --cluster (#3931)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-20 12:11:58 +08:00
ivyilike
1657326c38 Feat: webservice support healthProbe With http (#3930)
Signed-off-by: ivyilike <pww123@cmbchina.com>
2022-05-19 20:54:21 +08:00
Siege Lion
9436e7ffa0 Fix: fix a spelling error of velaQL usage document (#3932) 2022-05-19 20:53:51 +08:00
Charlie Chiang
eb5f416e4e Feat: add more detailed output for vela addon status (#3876)
* Feat: show available versions and dependencies in `addon status`

Also prettify output

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Feat: show addon dependencies in `addon status`

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Style: adjust `addon status` output

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Style: remove spaces in `addon status` output

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Fix: truncate string if available versions too long

if a local addon has been installed, the AVAILABLE-VERSIONS column of the registry one will not truncate. this commit fixes that.

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Perf: avoid unnecessary network requests to improve performance

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Feat: do not display remote info for local addons

Limit Description length when using `addon list`

Use simpler method to get addon info

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Test: add tests for cli/addon limitStringLength, generateParameterString

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Fix: fix output being empty if the searched addon does not exist anywhere

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Test: add tests for generateAddonInfo

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Test: add tests for generateAddonInfo and FindWholeAddonPackagesFromRegistry

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Style: format code

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Test: correct unnecessarily focused tests

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Style: remove unused code blocks

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Refactor: remove unnecessary output to stdout

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Test: remove added registry after tests has been completed

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Test: new RegistryDataStore every test, to avoid panics

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Test: fix failing tests due to incorrect registry name

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Refactor: move logic to get addon package out of where it is supposed to get addon status

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Test: add test cases for secret-getting in TestGetAddonStatus

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Feat: return error if an addon is not installed, nor does it exist in the registry

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Refactor: rename GetAddonWholePackage to GetDetailedAddon as per wonderflow

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Feat: require --verbose option to show details in `vela addon status`

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Feat: require --verbose option to show details in `vela addon status`

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* chore: run make reviewable

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Test: fix configmap being already existed

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Fix: fix output show addon does not exist when verbose is off and an addon is not installed, but it does exist in the registry

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Style: fix golangci-lint issues

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-05-19 16:21:36 +08:00
Kethavath Siva Naik
1cc5c54d32 Fix: corrected minor typo in code (#3913)
Signed-off-by: Kethavath Siva Naik <sivanaikk0903@gmail.com>
2022-05-19 10:55:41 +08:00
Somefive
12ec62dd65 Feat: vela auth list-privileges (#3923)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-18 20:57:39 +08:00
barnettZQG
1822e03505 Feat: support filter the resource by kind or apiVersion (#3901)
* Feat: support filter the resource by kind or apiVersion

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

* Fix: update the env workflow after deleting a component

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-18 19:39:08 +08:00
Tianxin Dong
d9aa541f12 Feat: add the design of if condition in workflow (#3922)
* Feat: add the design of if condition in workflow

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

* make the if example more clear

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-18 17:43:53 +08:00
Somefive
9d6706d48e Feat: vela auth gen-kubeconfig (#3911)
* Feat: vela create kubeconfig

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

* Chore: refactor

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-18 16:14:00 +08:00
Xiangbo Ma
fc078bbd93 Feat: extend apply-once to allow specified path configuration to drift (#3899)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-05-17 16:29:16 +08:00
StevenLeiZhang
f7687e3506 Fix: update API document (#3915)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-17 11:53:29 +08:00
Somefive
4d73715422 Feat: controller auto-impersonation (#3906)
* Feat: add featrue flags for controller auto impersonation

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

* Feat: add auto-detect for kubeconfig identity

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-16 18:05:56 +08:00
barnettZQG
30308fa8a1 Feat: add the component name field for the trigger (#3884)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-16 13:10:46 +08:00
ZhongsJie
0442baf932 Feat: create the definition for built-in policies (#3894)
Signed-off-by: Shijie Zhong <zhongsjie@cmbchina.com>
2022-05-16 13:10:26 +08:00
barnettZQG
987b369bee Fix: fail to create the cloud service application (#3893)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-16 11:10:06 +08:00
Afzal Ansari
3aa16bb5d1 Refactor: Minor changes on shell script to support double quotes format and [ ] POSIX (#3889)
* refactors sync sh

Signed-off-by: afzal442 <afzal442@gmail.com>

* fixes POSIX sh, as [[ ]] is undefined.

Signed-off-by: afzal442 <afzal442@gmail.com>
2022-05-14 13:21:28 +08:00
barnettZQG
3fdf39c8e1 Feat: change the default workflow step with deploy type (#3878)
* Feat: change the default workflow step with deploy type

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

* Fix: format the cue script of the deploy step

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

* Fix: unit test case

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

* Fix: error words

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-13 14:24:14 +08:00
ZhongsJie
a19e90ea2c Fix: modify the template definition to solve the trait cli error Signed-off-by: Shijie Zhong <zhongsjie@cmbchina.com> (#3877)
Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
2022-05-13 10:52:23 +08:00
Tianxin Dong
f447e6c642 Fix: delete context when patch outputs in trait (#3854)
* Fix: delete context when patch outputs in trait

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

* use patchOutputs instead of outputs in patch

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

* fix typo

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-12 18:38:57 +08:00
Somefive
0d3d75f29a Fix: use vela prism for accessing clusters as alternative (#3866)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-12 17:12:58 +08:00
cnfatal
a8ad79b1f2 Feat(charts): add cert-manager support for "cluster-gateway" component in chart "vela-core" (#3848)
* fix(charts): remove a not built in cap "containerizedwokrload" from disableCaps

Signed-off-by: cnfatal <cnfatal@gmail.com>

* Perf(charts): mv cluster-gateway to a dir

Signed-off-by: cnfatal <cnfatal@gmail.com>

* Feat(charts): support cert-manager on "cluster-gateway"

changes:
1. replace flag "--cert-dir" with "--tls-cert-file" and "--tls-private-key-file" due to cert-manager Certificate only support "k8s" style tls secret(with files "tls.crt","tls.key","ca.crt").
2. add cert-manager cainject annotation for APIService "v1alpha1.cluster.core.oam.dev"
3. add cert-manager Certificate for secret  "<release>-cluster-gateway-tls"
4. fix a typo in `values.yaml` , "optimize.optimizeCachedGvks" -> "optimize.cachedGvks" withch cause helm template failed

Signed-off-by: cnfatal <cnfatal@gmail.com>
2022-05-12 13:10:41 +08:00
Somefive
967bc7786d Fix: use vela prism for accessing clusters as alternative (#3849)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-12 10:47:35 +08:00
barnettZQG
fc5bcc6c33 Fix: the endpoints is repeated and can not query the ingress with v1 version (#3862)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-11 14:27:38 +08:00
JarHMJ
02f5a96a72 Feat: run image scan CI for every pull request and fix CVEs in time (#3855)
Signed-off-by: huangminjie <minjie.huang@daocloud.io>
2022-05-11 14:09:10 +08:00
Xiangbo Ma
1989b2f4a8 Fix: whencontrolPlaneOnly=true, There are probability to report error "resource not found" (#3850)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-05-11 13:59:02 +08:00
Somefive
0529ad8581 Fix: ignore no kind match error in gc (#3861)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-11 12:41:14 +08:00
Carmen de Lope Contreras
f808827882 Fix(makefile): update kustomize version to be available for darwin-arm64 (#3846)
* Fix(makefile): update kustomize version to be available for darwin-arm64

Signed-off-by: Carmendelope <carmen@napptive.com>

* make reviewable changes

Signed-off-by: Carmendelope <carmen@napptive.com>
2022-05-11 10:03:16 +08:00
Tianxin Dong
20f1d54bf3 Fix: add parse comments in lookupScript to make patch work (#3839)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-10 13:36:44 +08:00
Afzal Ansari
e6d47d3758 refactors http write resp to use 'html/template' instead (#3829)
Signed-off-by: afzal442 <afzal442@gmail.com>
2022-05-10 13:36:00 +08:00
Charlie Chiang
a598272491 Fix: resolve locally installed addons not being displayed (#3827)
* 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>

* Style: revert incorrect auto-formatting

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Refactor: change original variable name to avoid confusions

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* 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>

* Refactor: use more concise method to check length

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

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

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Refactor: simplify testing logic by removing unneeded looping

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

* Style: add missing license header

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-05-10 13:35:12 +08:00
StevenLeiZhang
b260348f30 Fix: sensitive field of addon registry is exposed (#3837)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-10 10:08:28 +08:00
StevenLeiZhang
938fde9bba Fix: The new addon can not shown in the Addons page (#3835)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-10 10:02:13 +08:00
Zheng Xi Zhou
7bfcd6acc5 Fix: don't override user definied region (#3503)
* 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>

* fix check-diff

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>

* fix UT

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

* revert some changes

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-05-09 15:10:31 +08:00
Afzal Ansari
8d99a35f01 Fix: Refactors shell to have double quotes format (#3830)
* refactors double quote to prevent globbing and word splitting e2e sh

Signed-off-by: afzal442 <afzal442@gmail.com>

* refactors e2e_core sh

Signed-off-by: afzal442 <afzal442@gmail.com>

* refactors cleanup sh

Signed-off-by: afzal442 <afzal442@gmail.com>

* refactors header-chk sh

Signed-off-by: afzal442 <afzal442@gmail.com>

* refactors installdef sh

Signed-off-by: afzal442 <afzal442@gmail.com>
2022-05-09 11:23:45 +08:00
Tianxin Dong
d593b7ad9c Feat: support multi keys in patchKey (#3826)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-08 10:39:01 +08:00
StevenLeiZhang
88fb854a26 Feat: Support basic-auth or reuse chartmuseum as addon registry (#3787)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-07 23:39:34 +08:00
Somefive
d2cb1bfd4a Feat: add support for apprt (#3824)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-07 20:31:41 +08:00
Jianbo Sun
eefccfb565 Chore: seprate test into linux env which can't be execute in darwin (#3823)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-05-07 18:14:12 +08:00
JarHMJ
d25676a68e Feat: Add short name velaapp for application CRD (#3816)
Signed-off-by: huangminjie <minjie.huang@daocloud.io>
2022-05-07 16:52:51 +08:00
cezhang
877ab3909d Fix: update latest version Fix: 1.2 upgrade 1.3 workflowstep XXX not found (#3804)
* 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>

* 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>
2022-05-07 12:07:26 +08:00
Xiangbo Ma
93841b479a Feat: Add example doc for controlPlaneOnly (#3810)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-05-06 14:33:52 +08:00
dependabot[bot]
94a82ce18d Chore(deps): Bump github.com/containerd/containerd from 1.5.4 to 1.5.10 (#3815)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.5.4 to 1.5.10.
- [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.5.4...v1.5.10)

---
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-05-05 19:11:28 +08:00
Jianbo Sun
6f927d326b Chore: add governance file and refer to the community repo (#3814)
* Chore: update docs

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

* Chore: add governance file and refer to the community repo

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-05-05 18:08:54 +08:00
Tianxin Dong
6c151ebcf1 Fix: add some message to make debug more clear (#3812)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-05 17:51:45 +08:00
qiaozp
331a25186e Chore: bump helm to v3.7.0 (#3767)
* Chore: bump helm to v3.7.0

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

* tidy

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

* tidy

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

* tidy without compat

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-05-05 17:51:17 +08:00
Zhiyu Wang
7f23165ee5 Feat: deploy user info (#3744)
Signed-off-by: Zhiyu Wang <zhiyuwang.newbis@gmail.com>
2022-05-05 17:22:40 +08:00
Tianxin Dong
ba0c226925 Feat: add some links in readme (#3811)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-05 15:17:19 +08:00
Somefive
3cde2337c6 Feat: upgrade dependencies (#3776)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-05 14:37:50 +08:00
JarHMJ
c8ae44c7e1 Test: add some unittest to addon cache (#3801)
Signed-off-by: huangminjie <minjie.huang@daocloud.io>
2022-05-04 10:31:44 +08:00
barnettZQG
99bb76a3fd Fix: update latest version (#3794)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-29 17:49:47 +08:00
Kunshuai Zhu
b74d5011da Feat: vela-core helm chart supports configure multicluster metrics (#3788)
* vela-core helm charts support config multicluster metrics

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

* update comment

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

* update readme

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>
2022-04-29 16:57:53 +08:00
Jianbo Sun
755ccad654 Chore: update some docs to the new org url (#3792)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-04-29 15:59:29 +08:00
StevenLeiZhang
0e4a480a4e Fix: useless \n is printed in log message (#3791)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-04-29 15:44:10 +08:00
StevenLeiZhang
57dcab5f18 Fix: log message wraps wrong arguments (#3781)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-04-29 13:26:58 +08:00
Daniel Higuero
9642ed9d9e Fix: Add application name to the generated workload entities (#3786)
* Add application name to the generated workload

Signed-off-by: Daniel Higuero <daniel@napptive.com>

* Make the PR reviewable

Signed-off-by: Daniel Higuero <daniel@napptive.com>
2022-04-29 10:35:14 +08:00
barnettZQG
2cc32e6c62 Chore: sync the cli binaries to OSS (#3764)
* Feat: show the parsing capability error message

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

* Chore: sync the cli binaries to OSS

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-28 19:18:16 +08:00
Somefive
7f5b8ef957 Fix: env trait compatible with valueFrom (#3778)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-28 17:49:01 +08:00
Somefive
1bd9a0eca3 Fix: kubectl check err (#3759)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-28 16:32:38 +08:00
Somefive
512664b9b3 Feat: support dependsOn in deploy workflowstep (#3750)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-28 16:29:34 +08:00
wyike
7935447d44 Fix: addon cli parse any type (#3775)
* fix addon parse any type

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

* test int

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-28 15:58:23 +08:00
Xiangbo Ma
9238fc3edf Feat: Support trait with custom resource be dispatched to hubcluster. (#3774)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-04-28 13:44:52 +08:00
Tianxin Dong
6761b18229 Fix: fix up command add debug policy (#3770)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-27 21:31:07 +08:00
barnettZQG
7b2f4af610 Feat: add some APIs to manage the definitions (#3749)
* Feat: add a api for update the ui schema

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

* Fix: change the unit test case

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

* Fix: change the unit test case

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

* Feat: add an API to change the definition status

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

* Fix: change the e2e test case

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

* Fix: change cache key

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

* Fix: change the error words

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-27 14:23:05 +08:00
Tianxin Dong
a257c18e73 Fix: fix revision in webservice (#3758)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-27 14:17:48 +08:00
Tianxin Dong
a1ada2609e Feat: add default user in dex (#3753)
* Feat: add default user in dex

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

* fix e2e test

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

* remain log

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-27 10:21:10 +08:00
wyike
8f127ce715 Fix: fix the bug of vela cli enable addon by localDir on windows os (#3761)
* 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

* add more tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-26 20:52:19 +08:00
qiaozp
af53a58b8e Fix: velaux addon hint after enable (#3747)
* Fix: velaux addon hint after enable

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

* check if upgrade

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-04-26 15:27:43 +08:00
Zheng Xi Zhou
b4894cc284 Fix: use Terraform provider name as application in CLI (#3742)
* 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>

* fix

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

* add UTs

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-26 12:53:14 +08:00
Zheng Xi Zhou
75def656fb Fix: public image registry config could not be created (#3736)
Fix #3663

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-25 13:58:22 +08:00
wyike
fa75c1f4a5 use unical project filter func to list secret (#3741)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix pointer

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-25 10:05:31 +08:00
Zhiyu Wang
cdc1550e17 Feat: apiserver definition alias (#3721)
Signed-off-by: Zhiyu Wang <zhiyuwang.newbis@gmail.com>
2022-04-24 18:03:55 +08:00
qiaozp
b8b254e582 Chore: fix e2e test check tag exist and set matrix (#3743)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-04-24 18:03:36 +08:00
Somefive
2d28fb35eb Feat: multi-cluster authentication (#3713)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-24 14:48:26 +08:00
qiaozp
d7c6f6cc73 Chore: fix missing trigger for e2e tests (#3738)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-04-24 10:15:28 +08:00
StevenLeiZhang
4162c413b3 Fix: vela-cli does not print cluster name, if application installed in default cluster (#3691)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-04-24 09:16:34 +08:00
Ziqi Zhao
172d41583f enhance slack url (#3727)
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
2022-04-22 18:02:06 +08:00
Zheng Xi Zhou
58edb344f6 Feat: check whether a project matched a config's project (#3725)
* 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>

* fix CI

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

* fix CI

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

* change imports order

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

* change imported libraries order again

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

* fix CI

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-22 17:53:41 +08:00
qiaozp
1125f87fd7 Feat: run e2e test on several K8s version (#3714)
* Feat: run e2e test on several K8s version

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

* upgrade kind version

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

* rollback 1.22

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

* bump up kruise

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

* with sha

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

* try fix ci

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

* use 1.22

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

* remove sah

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

* revert kind

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-04-22 17:05:19 +08:00
Xiangbo Ma
520e67f63b Feat: Delete the annotation "kubernetes.io/last-applied-configuration" in applicationRevision. Signed-off-by: Xiangbo Ma <maxiangboo@cmbchina.com> (#3724)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-04-22 17:04:24 +08:00
Tianxin Dong
7eb0002692 Feat: add sequential in gc policy (#3701)
* Feat: add sequential in gc policy

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

* tidy the code

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

* add suite test

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

* add example docs and update the field

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

* fix lint

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

* change the name to dependency

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-22 16:34:07 +08:00
barnettZQG
1237f7350e Feat: change the webservice and config-image-registry definitions (#3732)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-22 16:33:23 +08:00
Basuotian
7907618a6a Feat: add env for sidecar and init-container trait (#3730)
Signed-off-by: tianshuai <tianshuai@huya.com>

Co-authored-by: tianshuai <tianshuai@huya.com>
2022-04-22 15:59:34 +08:00
fengkang01
54e333148f Feat(lang): The policy controller generate the OpenAPI schema (#3703)
* Fix: The policy controller generate the OpenAPI schema  (#3683)

Signed-off-by: DESKTOP-FV8IFEC\10690 <1069029381@qq.com>

* Feat(lang): The policy controller generate the OpenAPI schema  (#3683)

The policy controller does not generate the OpenAPI schema #3683
add CapabilityPolicyDefinition struct comment
add StoreOpenAPISchema of CapabilityPolicyDefinition comment

Signed-off-by: fengkang <fengkangb@digitalchina.com>

* Feat(lang): The policy controller generate the OpenAPI schema  (#3683)

The policy controller does not generate the OpenAPI schema #3683
fix unit-test

Signed-off-by: fengkang <fengkangb@digitalchina.com>

* Feat(lang): The policy controller generate the OpenAPI schema  (#3683)
fix unit-test about policydefinition_controller_test.go
The policy controller does not generate the OpenAPI schema #3683
fix unit-test

Signed-off-by: fengkang <fengkangb@digitalchina.com>

* Feat(lang): The policy controller generate the OpenAPI schema  (#3683)
fix unit-test about policydefinition_controller_test.go

Signed-off-by: fengkang <fengkangb@digitalchina.com>

* Feat(lang): The policy controller generate the OpenAPI schema  (#3683) gen crd

Signed-off-by: fengkang <fengkangb@digitalchina.com>

* Feat(lang): The policy controller generate the OpenAPI schema  (#3683) make reviewable

Signed-off-by: fengkang01 <fengkangb@digitalchina.com>

Co-authored-by: DESKTOP-FV8IFEC\10690 <1069029381@qq.com>
2022-04-22 15:53:20 +08:00
wyike
c126a5b272 fix several issues (#3729)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-22 15:47:08 +08:00
wyike
3eb1f53606 specify staticcheck version (#3726)
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>
2022-04-22 14:16:15 +08:00
Tianxin Dong
426b22d2e5 Feat: add log provider (#3711)
* Feat: add log provider

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

* fix lift

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

* fix vet

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

* fix rebase vet

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-22 13:14:51 +08:00
Arena.Su
007f13d2ee Feat(delay suspend): delayDuration in suspend step properties (#3644)
* Feat(delay suspend): add delayDuration in suspend step properties to support delay by certain time.Duration

Signed-off-by: suxiang <suxiang@asiainfo.com>
Signed-off-by: ArenaSu <704427617@qq.com>

* Feat(delay suspend): add delayDuration parameter to suspend cue

Signed-off-by: ArenaSu <704427617@qq.com>

* Feat(wait suspend): optimize wait suspend

Signed-off-by: ArenaSu <704427617@qq.com>

* Feat(wait suspend): change e2e test to local cluster env

Signed-off-by: ArenaSu <704427617@qq.com>

* Feat(wait suspend): fix WaitSuspend status modify bug

Signed-off-by: ArenaSu <704427617@qq.com>

* Feat(wait suspend): suspend cue parameter type error

Signed-off-by: ArenaSu <704427617@qq.com>

* Feat(wait suspend): set waitDuration optional param in suspend workflow step

Signed-off-by: ArenaSu <704427617@qq.com>

* Feat(wait suspend): add lost suspend.yaml

Signed-off-by: ArenaSu <704427617@qq.com>

* Feat(wait suspend): change solution to add suspendState

Signed-off-by: ArenaSu <704427617@qq.com>

* Feat(wait suspend): change durationWaiting to duration and add isPatch to gcResourceTrackers

Signed-off-by: ArenaSu <704427617@qq.com>
2022-04-22 11:40:13 +08:00
wyike
81d479aedf 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>
2022-04-22 10:18:28 +08:00
Lei Chu
25e33cdd6d Fix: embed.FS filepath that follow the unix style file path when running on windows (#3718)
* fix: "builtin-apply-component.cue: file does not exist"

Signed-off-by: lei.chu <1062186165@qq.com>

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

Signed-off-by: lei.chu <1062186165@qq.com>
2022-04-21 14:31:53 +08:00
qiaozp
900653a2da Feat: vela def gen-api command (#3699)
* Feat: vela def go-gen command

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

* reviewable

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

* Add unittest

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

* lint

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

* header

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

* Add test case

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

* more test

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

* fix

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

* add optional prefix, add omitempty in json tag

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

* lint

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

* lint

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-04-20 18:08:24 +08:00
StevenLeiZhang
e3612ac352 Fix: vela-core does not report error, when component depends on invalid component (#3636)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-04-20 13:37:34 +08:00
Diego Pinheiro
62fb10625d Fix: Addressing CVEs (#3708)
* fix - patching vuln go mod

Signed-off-by: Diego Milhomes Pinheiro <diego.milhomes@ORA-7869.local>
Signed-off-by: s4rd1nh4 <diego.milhomes@gmail.com>

* fix - addressing cves

Signed-off-by: Diego Milhomes Pinheiro <diego.milhomes@ORA-7869.local>
Signed-off-by: s4rd1nh4 <diego.milhomes@gmail.com>

* fix - cves

Signed-off-by: Diego Milhomes Pinheiro <diego.milhomes@ORA-7869.local>
Signed-off-by: s4rd1nh4 <diego.milhomes@gmail.com>

* fix - cves

Signed-off-by: Diego Milhomes Pinheiro <diego.milhomes@ORA-7869.local>
Signed-off-by: s4rd1nh4 <diego.milhomes@gmail.com>
2022-04-20 09:54:49 +08:00
Somefive
571e154af3 Fix: bind env to system namespace (#3706)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-19 20:55:59 +08:00
wyike
2ac4ddad03 Feat: calculate systemInfo everyday periodically and store them in datastore (#3689)
* add framework

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

add

finish the framework

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

finish test manually

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

add update time

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

adding test

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

finish test

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

abs

fix test

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

* move start func to leader election call back funcs

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

* resolve the recycle import problecm

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

fix issue

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

fix ci
2022-04-19 10:24:54 +08:00
Somefive
c5e1855a55 Feat: support disable legacy gc upgrade operation (#3694)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-18 17:05:47 +08:00
Zheng Xi Zhou
cb4a9ea1a8 Fix: set provider name as the config name (#3687)
- 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>
2022-04-18 16:47:51 +08:00
Tianxin Dong
21216055fb Feat: add vela debug command (#3580)
* Feat: add debug configmap if debug policy is specified

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

* Feat: add vela debug command

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

* make code reviewable

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

* fix sonartype lift

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

* fix cue string

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

* Feat: display better for debug

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

* tidy the go mod

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

* Feat: add debug test

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

* change uitable vendor

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

* add more tests

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

* pass resource keeper from handler

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

* fix lint

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

* fix rebase

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

* Pending test temporary

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-18 11:06:14 +08:00
Michiel Stigter
eb60d94a06 Feat: Expose optimizeDisableComponentRevision in helm chart (#3470)
* Feat: Expose optimizeDisableComponentRevision in helm chart

Signed-off-by: michiel <michiel.stigter@springer.com>

* Feat: Expose optimizeDisableComponentRevision in helm chart

Signed-off-by: michiel <michiel.stigter@springer.com>

* Feat: Expose optimizeDisableComponentRevision in helm chart

Signed-off-by: michiel <michiel.stigter@springer.com>

* Feat: Expose optimizeDisableComponentRevision in helm chart

Signed-off-by: michiel <michiel.stigter@springer.com>

* Feat: Add all the other possible optimization params to the helm-values.

Taken from: https://kubevela.io/docs/platform-engineers/system-operation/performance-finetuning#advanced-optimization

Signed-off-by: michiel <michiel.stigter@springer.com>
2022-04-15 17:48:14 +08:00
Somefive
8998537dc8 Fix: rt resource key compare mismatch local cluster (#3681)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-15 16:13:07 +08:00
barnettZQG
4ddfe32fc4 Fix: can not query the instance list for the app with apply once policy (#3670)
* Fix: can not query the instance list for the app with apply once policy

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

* Fix: change the test case about ListResourcesInApp

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-15 14:38:01 +08:00
wyike
28e2284284 mock an addon to fix flaky test (#3665)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-15 10:30:05 +08:00
Tianxin Dong
62ecc70ade Fix: fix token invalid after the server restarted (#3658)
* Fix: fix token invalid after the server restarted

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

* fix lint

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

* Pending test temporary

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

* Pending test temporary

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-14 22:25:43 +08:00
Somefive
5857aa8790 Fix: vela status tree show cluster alias & raw format (#3659)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-14 19:35:47 +08:00
ZhongsJie
49646ddc8e Feat: enhance storage trait to support multi-mountToEnv config Signed-off-by: Shijie Zhong <zhongsjie@cmbchina.com> (#3657)
Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
2022-04-14 19:34:12 +08:00
Jianbo Sun
707905d877 Fix: add label from inner system in CR can prevent sync (#3655)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-04-14 19:32:53 +08:00
barnettZQG
7d3ef0595a Fix: duplicately list pods in velaQL (#3650)
* Fix: duplicately list pods in velaQL

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

* Fix: the create time of synced app is empty

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-14 17:43:54 +08:00
Zheng Xi Zhou
af6dc4bda3 Fix: failed to deploy application when no there is no avaiable (#3652)
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>
2022-04-14 17:25:34 +08:00
Zheng Xi Zhou
f44bd7c6dd Fix: refine the config sync logic (#3602)
* Fix: refine config management

- Refine the config sync logics

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

* address comments

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-14 13:03:59 +08:00
wyike
eaec8348d9 Fix: try to fix CVE (#3641)
* try to fix cve

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

* add parse input func

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

fix lint

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

fix lint

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

* use santize

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-14 10:03:15 +08:00
wyike
2849dfc1fb Fix: clear info when addon version cannot meet require (#3642)
* 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

* add test for this

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

small fix
2022-04-14 10:02:47 +08:00
Somefive
d657ea4daf 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>
2022-04-13 22:20:07 +08:00
Zhiyu Wang
68500b3f17 Fix: verify password valid (#3545)
Signed-off-by: Zhiyu Wang <zhiyuwang.newbis@gmail.com>
2022-04-13 19:39:00 +08:00
Somefive
c33eaa0609 Fix: enhance vela status tree print (#3639)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-13 17:46:55 +08:00
Somefive
7a0d2b552b 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>
2022-04-13 13:58:35 +08:00
Zheng Xi Zhou
385b2462e9 Feat: refine config creation and provide config list (#3637)
- 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>
2022-04-13 13:45:41 +08:00
Kunshuai Zhu
0c35753530 Feat: allow select resource by resource type for gc policy (#3598)
* Feat: allow select resource by resource type for gc policy

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

* Modify match label key

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

* Unified label key

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>
2022-04-12 18:51:07 +08:00
Somefive
0e97aa2291 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>
2022-04-12 17:58:45 +08:00
Tianxin Dong
7fcb89906c Fix: fix dex login with existed email (#3623)
* Fix: fix dex login with existed email

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

* add dex connector check

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

* unset users' alias

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

* fix ut

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

* fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-12 16:29:21 +08:00
Somefive
86ef2d68e0 Fix: flags for controller (#3627)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-12 16:12:50 +08:00
wyike
2e57be1022 Feat: support basic auth private helm repo (#3595)
* support auth

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

* 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

* add tests

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

fix

add more test

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

* add more test

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

* extract set auth info as a global func

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

* return bcode

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-12 14:33:44 +08:00
Gallardot
ad01f3062a Feat: add HealthProbe for sidecar (#3629)
* Feat: add HealthProbe for sidecar

Signed-off-by: Gallardot <tttick@163.com>

* Feat: add HealthProbe for sidecar

Signed-off-by: Gallardot <tttick@163.com>
2022-04-12 13:21:51 +08:00
Somefive
b6fac3f4d5 Fix: cli default switch on feature flags (#3625)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-11 20:40:13 +08:00
Min Kim
2eb7826070 bump cluster-gateway to 1.3.2 (#3619)
Signed-off-by: yue9944882 <291271447@qq.com>
2022-04-11 19:31:51 +08:00
Zheng Xi Zhou
5f7371815c Feat: add api of listing configs for project when creating a target (#3581)
* 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>

* address comments

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

* fix ci

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

* add query parameter definition

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

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-11 19:05:18 +08:00
wyike
d6b96fee5a Fix: add e2e apiserver test for addon (#3607)
* add e2e apiserver test for addon

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

delete comment

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

fix

* fix test

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

* close the reponse body

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

* cover list enabled addon

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

fix e2e test

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

fix test

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

fix test

* fix test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-11 17:46:46 +08:00
Jianbo Sun
85c673a574 Fix: reuse chart values in vela install (#3616)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-04-11 09:50:18 +08:00
qiaozp
7e6d9ccc73 Fix: vela logs without specified resource name (#3605)
* Fix: vela logs without specified resource name

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

* add unittest

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

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-04-08 17:22:05 +08:00
Avery
e65dcf12db add sorting for properties, outputs, writeSecretRefParameters in vela def doc-gen (#3593)
Signed-off-by: Nicola115 <2225992901@qq.com>
2022-04-08 15:27:35 +08:00
Diego Pinheiro
fd5faed71a Chore: Nominate s4rd1nh4 as a Reviewer member (#3603)
Signed-off-by: GitHub <noreply@github.com>
2022-04-08 13:21:45 +08:00
Zheng Xi Zhou
b1823084af Fix: add terraform aws provider without AWS_SESSION_TOKEN (#3590)
* 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>
2022-04-07 13:41:29 +08:00
namo
83fe4a160e Feat(lang): add addons gitlab support (#3543)
* add addons gitlab support

Signed-off-by: Namo <lgj112113@163.com>

* add addons gitlab support

Signed-off-by: Namo <lgj112113@163.com>

* test file edit

Signed-off-by: Namo <lgj112113@163.com>

* typo edit

Signed-off-by: Namo <lgj112113@163.com>

* notes edit

Signed-off-by: Namo <lgj112113@163.com>

* move third party imports block

Signed-off-by: Namo <lgj112113@163.com>

* code format edit

Signed-off-by: Namo <lgj112113@163.com>

* notes edit

Signed-off-by: Namo <lgj112113@163.com>

* create addon registry bug fix

Signed-off-by: Namo <lgj112113@163.com>

* add gitlab addon registry bug fix

Signed-off-by: Namo <lgj112113@163.com>

* add addon gitlab support test file

Signed-off-by: Namo <lgj112113@163.com>

* add addon gitlab support test note edit

Signed-off-by: Namo <lgj112113@163.com>

* add addon gitlab branch support and fix bug

Signed-off-by: Namo <lgj112113@163.com>

* addon gitlab registry repo name invalid

Signed-off-by: Namo <lgj112113@163.com>

Co-authored-by: Namo <lgj112113@163.com>
2022-04-07 11:05:14 +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
Jian.Li
a865c85d05 Fix: Applied Resources Statistics Error (#2398)
* Fix: isSameObjReference

* Fix: healthScope
2021-09-30 14:24:09 +08:00
Tianxin Dong
ab2d2750f2 Fix: revision GC in workflow mode (#2355)
* Fix: revision GC in workflow mode

* Test: add revision cleanup test

* Fix: e2e test
2021-09-30 14:16:16 +08:00
Zheng Xi Zhou
99411a7f01 Fix: make the name of Terraform credential secret same to component name (#2399)
To make the secret name of Terraform credential more clear and avoid the
impact on the feature of #2336
2021-09-30 13:53:49 +08:00
Tianxin Dong
f9b218919a Feat(workflow): add depends on in workflow (#2387)
* Feat: add depens on in charts

* Feat(workflow): add depends on in workflow
2021-09-30 10:30:44 +08:00
Somefive
83b26349c7 Feat: bootstrap multicluster testing (#2368)
* Feat: bootstrap multicluster testing

* Fix: update action step name in .github/workflows/e2e-multicluster-test:yml

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

* Fix: update setup-core wait condition

* Fix: add apply envbinding app test & upgrade gomega

* Fix: remove end_e2e duplicate script

Co-authored-by: Jianbo Sun <wonderflow@icloud.com>
2021-09-30 10:19:39 +08:00
wyike
2c64d04417 Feat: pass owner to workload if rollout failed (#2397)
delete useless file
2021-09-30 09:52:20 +08:00
Jian.Li
ef653ebeb4 Feat: add inputs test cases and optimize code (#2388)
* Feat: add test case & optimize code

* Fix: e2e test
2021-09-29 15:08:00 +08:00
Zheng Xi Zhou
305403ff8b Support remote git repo for Terraform configuration (#2337)
* Fix: support remote git repo for Terraform configuration

Besides inline HCL Configuration, supprted remote git repo Configuration

* Fix: add unit-tests

* Fix: update all manifests in vela-minimal
2021-09-29 14:58:27 +08:00
wyike
eebcc6c6ae Fix: use aliyun oss istio chart (#2392) 2021-09-29 14:42:50 +08:00
Jianbo Sun
298ce69593 Chore(deps): bump go.mongodb.org/mongo-driver from 1.3.2 to 1.5.1 (#2391)
Co-authored-by: barnettZQG <yiyun.pro>
2021-09-29 13:14:48 +08:00
Tianxin Dong
1e21a01320 Feat: add vela minimal in make manifests (#2389) 2021-09-29 13:09:57 +08:00
Tianxin Dong
042485124a Fix: fix built in workflow steps (#2378) 2021-09-29 10:05:13 +08:00
Hongchao Deng
49a91ca4c5 Feat: add Addon REST API (#2369) 2021-09-28 18:45:32 +08:00
Jianbo Sun
a2ad91f2f5 Fix: try fix CI unit test (#2376) 2021-09-28 18:44:50 +08:00
Tianxin Dong
5364e53e50 Fix: delete deprecated vela dashboard in e2e setup (#2379)
* Fix: delete deprecated vela dashboard in e2e setup

* Fix: fix helm lint in 3.7.0
2021-09-28 17:01:10 +08:00
whichxjy
811c783a00 Feat: support rollout controller for StatefulSet (#1969)
* Feat: support rollout controller for StatefulSet

* Feat: support one statefulset in rollout

* Feat: add tests for StatefulSet rollout controller

* Fix: correct workload-deleting error

* Feat: remove advanced sts
2021-09-28 11:46:30 +08:00
Jian.Li
22bf2e4c3a Feat: inputs support setting value in array (#2358)
* Feat: input support array

* Feat: add test cases

* Feat: add comment
2021-09-28 09:18:07 +08:00
Somefive
ee0a73b5b7 Fix: dockerfile e2e test command lack environment configuration (#2231) 2021-09-27 20:29:58 +08:00
yangsoon
ddb6285b19 Fix(helm chart): fix startup args for apiserver (#2362) 2021-09-27 14:20:58 +08:00
barnettZQG
3a310f0402 Feat: Initialize api for vela dashboard and CLI (#2339)
* Change the web framework to go-restful.
* Some API specifications are defined.
* Some sample code is provided.
2021-09-26 23:09:23 +08:00
barnettZQG
6771c688dd Docs: add a WeChat QR code (#2351)
* Docs: add wechat QR code

* Update README.md

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>

Co-authored-by: barnettZQG <yiyun.pro>
Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
2021-09-26 13:41:20 +08:00
Somefive
61a12b0916 Fix: runc security issue (#2350) 2021-09-24 21:54:12 +08:00
Tianxin Dong
360c19cf2d Feat: add vela minimal chart (#2340)
* Feat: add vela minimal chart

* Feat: add README in minimal chart
2021-09-24 17:02:43 +08:00
wyike
11103b31bb Docs: rollout demo (#2348)
delete useless file
2021-09-24 16:31:39 +08:00
qiaozp
a8adaefc78 Chore: remove e2e-api-test in rollout test to speed up (#2345) 2021-09-24 15:44:59 +08:00
qiaozp
b4c7ed1773 Chore: deprecate 'vela dashboard' apiserver (#2341)
* Chore: deprecate
'vela dashboard' apiserver

* Chore: fix import

* Fix: preparation

* Fix: test
2021-09-24 13:00:07 +08:00
Geir Haugom
2e12ea9bd8 Feat: add revisionHistoryLimit to helm chart (#2343) 2021-09-24 10:42:04 +08:00
Jianbo Sun
0a9518f583 Fix: remove appcontext CRD and controller (#2270) 2021-09-23 15:05:47 +08:00
Tianxin Dong
e6668ac390 Fix: do not override the workload name if its specified (#2336)
* Fix: do not override the workload name if its specified

* Fix: resolve comments
2021-09-23 15:05:25 +08:00
qiaozp
2be5b20c6d Chore(cli): remove useless deploy.yaml (#2335)
* Chore: remove useless deploy.yaml

* Chore: remove useless deploy.yaml
2021-09-23 11:48:14 +08:00
Somefive
4f2ed4f59e Fix: remove ocm addon enable in Makefile (#2327) 2021-09-23 11:38:28 +08:00
Gallardot
2d8c8efe08 Feat: add args for init-contianer and sidecar (#2331) 2021-09-22 15:54:27 +08:00
Somefive
89c697ca87 Fix: fix multicluster template bug (#2333) 2021-09-22 14:56:58 +08:00
Zheng Xi Zhou
4379a46a79 Fix: add comments and adjust helm typed component's spec (#2332)
Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
2021-09-22 10:05:11 +08:00
Zheng Xi Zhou
d933af022c Fix: move charts from github repo to Alibaba Cloud OSS repo (#2324)
* Fix: move charts from github repo to Alibaba Cloud OSS repo

Charts in Github repo is not always avaialable for some users, so
moved them to OSS repo

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>

* Update charts/vela-core/templates/addons/observability-asset.yaml

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>

* Update vela-templates/addons/observability-asset/definitions/trait-import-grafana-dashboard.yaml

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>

* Update vela-templates/addons/auto-gen/observability-asset.yaml

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
2021-09-20 15:52:52 +08:00
yangsoon
60435e42a5 Fix(addon): don't install fluxcd and terraform by default (#2328) 2021-09-19 09:47:02 +08:00
Somefive
55e746cc7a Fix: fix multicluster values bug (#2326) 2021-09-19 09:26:05 +08:00
Jian.Li
48002641b9 Fix: workflow example (#2323) 2021-09-18 14:40:08 +08:00
Somefive
c1e6ded23d Fix: fix cluster-gateway image tag in chart (#2318) 2021-09-18 00:24:50 +08:00
hughXia
cafb55256f Fix: fix typo (#2317)
Co-authored-by: shengmiao.xia <shengmiao.xia@easystack.cn>
2021-09-17 22:09:29 +08:00
Hongchao Deng
b60c16a4be Fix(rollout): improve rollback experience (#2294) 2021-09-17 19:09:41 +08:00
Somefive
8407c0bf4d Style: rename multi-env to deploy2env (#2309) 2021-09-15 15:03:44 +08:00
yangsoon
76527421d7 Fix(helm chart): change initialDelaySeconds of readinessProbe to 30s (#2308) 2021-09-15 14:29:58 +08:00
wyike
a151d17fde Fix: generate service in canary-traffic trait (#2307)
fix ci

Fix: apply remaing bug

fix ci
2021-09-15 14:25:55 +08:00
Jian.Li
4ff4afde51 Feat: Make applicationComponent can be modified in step (#2304)
* Feat: component properties can be modfiled in step

* Fix: op.#ApplyRemaining
2021-09-15 13:25:22 +08:00
Zheng Xi Zhou
fbac93665d Fix: add application logging dashboard (#2301)
Added a Grafana dashboard for application logging
2021-09-15 13:21:38 +08:00
Tianxin Dong
36c7b9ec5b Fix: imagePullSecrets error from cloneset (#2305)
* Fix: imagePullSecrets error from cloneset

* Fix: generate yaml file

Co-authored-by: withlin <withlin@apache.org>
2021-09-15 13:21:17 +08:00
Hongchao Deng
d0e8418c4a Fix: don't increment count in status (#2306) 2021-09-15 13:20:58 +08:00
Somefive
291f9d139e Fix: fix cli logging (#2298) 2021-09-15 13:18:50 +08:00
wyike
9a766467a3 Fix: generate service in canary-traffic trait (#2300)
fix ci
2021-09-15 11:50:40 +08:00
Zheng Xi Zhou
c9b2c99dbf Revert "Fix: fix alibaba cloud rds module (#2293)" (#2302)
This reverts commit c590853f37.
2021-09-15 11:36:08 +08:00
qiaozp
0a3244f590 Feat: allow user specify alibaba provider addon's region (#2297) 2021-09-14 23:05:28 +08:00
Tianxin Dong
12361c133e Feat: add commit msg in kustomize (#2296) 2021-09-14 22:03:56 +08:00
Zheng Xi Zhou
c590853f37 Fix: fix alibaba cloud rds module (#2293)
Enable users to set `db_instance_storage_type`. This can fix the issue
happended since Sept. 14, 2021.
{"Code":"InvalidNetworkTypeClassicWhenCloudStorage","HostId":
"rds.aliyuncs.com","Message":"The Specified InstanceNetworkType
value Classic is not valid when choose cloud storage type."
2021-09-14 21:57:46 +08:00
Tianxin Dong
17c17fcfc6 Fix: fix apply application (#2288)
* Fix: fix apply application

* Fix: fix apply remaining
2021-09-14 21:49:09 +08:00
Jian.Li
0e8ffd717f Fix: apply-component bug (#2292)
* Fix: apply-component bug

* Feat: uniform apply-component input/output format
2021-09-14 21:37:46 +08:00
Jianbo Sun
8d8447ad94 Fix: filter kubectl apply annotation in vela live-diff (#2290) 2021-09-14 20:36:53 +08:00
Somefive
e8d051a532 Support MultiCluster EnvBinding with cluster-gateway (#2247)
* Feat: init multicluster

* Feat: add secret namespace auto-detect

* Style: format

* Style: split gc codes

* Feat: add cluster cli

* Fix: rebase workflow on master

* Feat: add component selector for env binding

* Fix: selector & patch conflict

* Feat: add local cluster support & fix unit test

* Fix: fix omitempty bug

* Feat(health-scope): support multi-cluster's healthcheck

* Fix: resourcetracker gc bug & rename

* Feat: add multicluster to op.Read

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-09-14 20:35:10 +08:00
qiaozp
c1ebe9db24 Feat: alibaba provider addon (#2243)
bump up terraform version

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-09-14 19:35:21 +08:00
wyike
3d29df3a52 Fix: fix in middler of test (#2275)
add test

delete uesless

add comments

fix small issue

fix error

add charts back
2021-09-14 18:05:21 +08:00
yangsoon
324bbe5e57 Fix(helm): enable apiserver by default (#2249)
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-09-14 14:15:47 +08:00
Tianxin Dong
8e172091f6 Test: fix resource tracker e2e (#2281) 2021-09-14 10:26:57 +08:00
Tianxin Dong
e73655a8b2 Refactor: change field exportKey to valueFrom (#2284) 2021-09-14 10:23:39 +08:00
Hongchao Deng
ce70f9f57f Fix: add exponential backoff wait time for workflow reconciling (#2279) 2021-09-13 22:34:25 +08:00
Hongchao Deng
215c4e0752 Fix: patch any key using retainKeys strategy (#2280) 2021-09-13 20:19:16 +08:00
wyike
d93d8626c0 Feat: istio addon and use case demo (#2276)
fix all error and finish readme

small change

fix CI check

add canary trait back
2021-09-13 20:10:32 +08:00
Jian.Li
b66f2995a5 Fix: Bugs (as follows) (#2278)
* Fix: suspend step id

* Feat: add test cases

* Fix: reslove conflict

* Fix: reduce reconclie duration for test
2021-09-13 20:03:49 +08:00
Jianbo Sun
cad21c5138 Fix: refactor workflow and fix some e2e tests (#2272)
* Fix: add e2e plugin test back

* Fix: e2e rollout test and try change port to 37081

* Fix: add rollout plan test back

* Refactor: change the workflow state machine and add workflow succeed state

* Refactor: refine definition controller and fix e2e of app revision

* Refactor: unlock all the normal cases

* Fix: add helm schematic logic back into workflow
2021-09-13 14:17:12 +08:00
Tianxin Dong
af01349f28 Test: fix rollout e2e test (#2277) 2021-09-13 11:13:03 +08:00
Jian.Li
445db3b276 Fix: E2E Test (#2274)
* Fix: value.lookUpByScript bug

* Fix: apply-component patch trait resource
2021-09-12 22:45:14 +08:00
Yuhui Liu
7ed34b675d Feat: add more options for leader election configuration to avoid pressure on kube-apiserver (#2271) 2021-09-12 18:30:59 +08:00
Jianbo Sun
537f19f06b Fix: remove podspecworkload controller and CRD (#2269) 2021-09-12 10:17:09 +08:00
Jian.Li
6cbdbe84b2 Refactor application code to make it run as Dag workflow (#2236)
* Refactor: remove use of AppConfig in AppRevision

* Refactor: remove insert secret and configmap

* Feat(workflow): upgrade

* Fix(conflict): workflow cherry

* Feat(workflow): support DAG mode

* Feat(workflow): prepare steps in step

* Feat(tools): random string

* Fix(rand): gosec weak random

* Fix(ci): test passing

* Feat(workflow): generate steps

* Fix: fix rebase from master

* Fix: fix workflow ut

* Feat(test): add test cases

* Fix: fix lint and rebase from master

* Refactor: application code

* Fix: fix ci lint

* Fix: make code reviewable

* Fix: workflow_test.go

* Feat: collect services

* Fix(ci): unit tests

* Feat: make one

* Test: application with input/output and workflow

* Fix: trace test

* Fix: update step index falied

* Feat: refactor op.#Load

* Fix: delete dead code

* Refactor: op.xxx

* Fix: patch component

* Test: add generator test

* Fix: add license

* Fix: pending e2e plugin test

* Fix: disable test/e2e-test

* Fix: patch by script

Co-authored-by: 天元 <jianbo.sjb@alibaba-inc.com>
Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-09-12 10:12:46 +08:00
Zheng Xi Zhou
2ba7480a41 Fix: add ComponentDefinition alibaba-eip (#2268)
Added another ComponentDefinition alibaba-eip, which will be applied
with vela-core installation
2021-09-11 18:46:00 +08:00
Zheng Xi Zhou
7d827182e6 Fix: fix the output DB_PASSWORD for rds definition (#2267)
Fixed the output `DB_PASSWORD` for ComponentDefinition alibaba-rds
2021-09-11 18:02:57 +08:00
wyike
da5b32f1a8 Fix: delete useless rollouttrait (#2264) 2021-09-10 22:43:40 +08:00
wyike
8b1ce6937f Fix: remove matchlabels in webservice template (#2255) 2021-09-10 12:44:38 +08:00
Jianbo Sun
a79c96fa46 Fix: pending the flaky rollout test (#2253) 2021-09-09 21:06:03 +08:00
Tianxin Dong
faa445255d Feat: add image auto update for gitops (#2251) 2021-09-09 19:53:01 +08:00
Jianbo Sun
f270c5901b Chore: add backup for code owners (#2252) 2021-09-09 17:56:47 +08:00
Zheng Xi Zhou
19bcfdd8df Fix: bump version of Terraform Controller (#2250)
Bumped the version of Terraform controller to change the filed of
Configuration's status.

Related issue: https://github.com/oam-dev/terraform-controller/pull/104
2021-09-09 17:19:57 +08:00
majian
e0eded58e5 Feat: support code-generator and sync to kubevela-core-api (#2174) 2021-09-09 09:28:31 +08:00
A Ismaili
873a19e9e0 Fix: Updated broken Getting Started links (#2248) 2021-09-08 18:13:27 +08:00
Reeta Singh
579f7427fa Feat: vela show annotations display undefined should be refined (#2244)
* 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

* Feat: vela show annotations display undefined should be refined

Co-authored-by: Reeta Singh <reetas@twitter.com>
2021-09-08 15:02:50 +08:00
Jianbo Sun
65402bd926 Fix: remove some unused flaky tests (#2242) 2021-09-08 09:30:04 +08:00
wyike
ae724b2a9a Docs: canary rollout demo (rollout part only) (#2177)
Feat: component definition support context.revision
2021-09-07 17:08:56 +08:00
Zheng Xi Zhou
5730d08396 Fix: lower title level to make definition docs generation adapt to kubevela.io (#2240)
Lower two levels of the title of workloads/traits docs to adapt to
Kubevela.io
2021-09-07 16:03:33 +08:00
qiaozp
c451d74cfd Fix: kustomize json patch trait definition (#2239) 2021-09-07 11:30:41 +08:00
Yue Wang
4ed40bebe3 Feat(app): show health status from HealthScope in application status (#2228)
Signed-off-by: Yue Wang <seiwy2010@gmail.com>

Co-authored-by: roywang <royyuewang@tencent.com>
2021-09-07 11:27:29 +08:00
Reeta Singh
e29f22a7b3 Feat(trait): annotation and labels trait should also affect the workload object along with pod (#2237)
* 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

Co-authored-by: Reeta Singh <reetas@twitter.com>
2021-09-07 10:57:32 +08:00
Eng Zer Jun
426aa7af34 Refactor: move from io/ioutil to io and os package (#2234)
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <zerjun@beatchain.co>
2021-09-06 18:33:42 +08:00
yangsoon
f8ac24db27 Feat(workflow): add status check for workflow mutil-env (#2229) 2021-09-06 14:48:34 +08:00
yangsoon
493e255d78 Fix: align the envbind-app name with the original application name (#2232) 2021-09-05 14:45:44 +08:00
Somefive
32b6502e74 Feat: add pressure-test parameter optimize (#2230) 2021-09-03 17:29:54 +08:00
yangsoon
02f79a5cd9 Fix(addons): remove kruise addon (#2226) 2021-09-03 11:44:52 +08:00
Zheng Xi Zhou
ecef32a7f3 Fix: add flag --label to filer components and traits (#2217)
Added flag `--flag` to filter when executing `vela componnets` and
`vela traits`

Fix https://github.com/oam-dev/kubevela.io/pull/222#discussion_r699214816
2021-09-02 20:51:34 +08:00
yangsoon
e59374bb7d Feat(apiserver): add apiserver service to helm chart (#2225) 2021-09-02 17:16:09 +08:00
yangsoon
cec16cc1a4 Fix(webhook): only check the uniqueness of component names under the same namespace (#2222) 2021-09-02 14:09:45 +08:00
Jian.Li
1776859631 Feat(workflow): Add op.#Task action (#2220)
* Feat(workflow): tekton task

* Feat(tools): random string

* Fix(example): defintion fmt

* Fix(rand): gosec weak random
2021-09-02 13:40:10 +08:00
wyike
f5c2c85381 Fix(addon): rename clonset-service to clonse (#2219)
fix test
2021-09-02 12:05:51 +08:00
Jian.Li
7a42c743d7 Feat(workflow): outputs support script notation (#2218)
* Feat(workflow): output support script notation

* Feat(cue): add test case
2021-09-01 19:19:01 +08:00
yangsoon
d4277f644e Fix(app): When only the policy is specified, the resources in the app need to be rendered and created (#2197)
* Fix(app): apply app when policy is specified

* Fix(policy): update env-binding policy

* Test(policy): add test
2021-09-01 17:27:47 +08:00
Yue Wang
f130d1d922 Fix(upgrade): upgrade controller-tools from 0.2 to 0.6.2 (#2215)
Signed-off-by: Yue Wang <seiwy2010@gmail.com>

Co-authored-by: roywang <royyuewang@tencent.com>
2021-09-01 15:08:24 +08:00
Jian.Li
1a6d2be6d0 Feat(workflow): input.ParameterKey described like paths notation (#2214)
* Feat(workflow): input.ParameterKey path notation

* Feat(workflow): add test case

* Fix(lint): format code
2021-09-01 11:34:16 +08:00
Tianxin Dong
2d1edbb16d Feat(workflow): add apply application workflow step definition (#2186) 2021-08-31 20:21:29 +08:00
Tianxin Dong
7a139b554f Feat(workflow): support dingding and slack in webhook notification (#2213) 2021-08-31 20:20:26 +08:00
Yue Wang
6bf4a2c1f7 Feat(healthscope): add health-scope-binding policy and e2e test for health scope (#2205)
Signed-off-by: roywang <seiwy2010@gmail.com>

Co-authored-by: roywang <royyuewang@tencent.com>
2021-08-31 15:59:17 +08:00
Jianbo Sun
9f6812414d Fix: modify service-binding with more accurate type (#2209) 2021-08-31 13:47:16 +08:00
Hongchao Deng
7310cc1363 Docs: update environment design (#2199) 2021-08-31 13:43:00 +08:00
Penthaa Patel
161bab7d62 Refactor(#2185): remove unused config options in Makefile (#2200)
Fixes issue #2185
2021-08-31 10:06:21 +08:00
Jianbo Sun
332fd4753e Fix: update help message of ingress trait (#2198) 2021-08-31 08:40:19 +08:00
Zheng Xi Zhou
4e010d7bae Fix: support more Terraform variable types (#2194)
Including null, list(...), map(...) Terraform types
2021-08-30 20:16:24 +08:00
Jianbo Sun
1ce8722e25 Feat: add more registry traits as internal ones (#2184) 2021-08-30 19:47:54 +08:00
arcosx
cd153e8ce5 Fix: error doc link (#2195) 2021-08-30 19:29:13 +08:00
Somefive
2cea51e5e9 Feat: add pprof (#2192) 2021-08-30 17:19:46 +08:00
yangsoon
75a972516d Feat(workflow): add depends-on workflow step definition (#2190) 2021-08-30 17:19:32 +08:00
Somefive
25bc43ae39 Fix: add patchkey to volumes (#2191) 2021-08-30 15:54:43 +08:00
Zheng Xi Zhou
068e9d97c4 Fix: move Terraform defintions charts/vela-core/templates/definitions (#2176)
Make all Terraform definitions to install when vela-core is installing
2021-08-30 14:49:57 +08:00
Jianbo Sun
e9981b6e20 Feat: add vela live-diff , dry-run, cue-packages into vela commands (#2182) 2021-08-30 12:01:24 +08:00
Jianbo Sun
0781937100 Fix: align all CUE template keyword to use parameter (#2181) 2021-08-30 11:43:20 +08:00
Tianxin Dong
75eab7bdde Docs: remove the commit convention doc (#2187) 2021-08-30 11:41:01 +08:00
yangsoon
d24e282e67 Feat(envbinding): add resourceTracker for envBinding (#2179)
* Feat(envbinding): add resourceTracker for envBinding

* Test: add test for envbinding
2021-08-29 13:29:30 +08:00
qiaozp
0c7048b2a0 Feat(addon): add default enable addon (#2172) 2021-08-29 11:24:40 +08:00
Yue Wang
9780ce3bef Feat(cue): support access components artifacts in cue template context (#2161)
Signed-off-by: roywang <seiwy2010@gmail.com>

Co-authored-by: roywang <royyuewang@tencent.com>
2021-08-29 09:11:10 +08:00
Jianbo Sun
cb790bfc13 initilize KubeVela codeowner file (#2178)
* Chore(maintainer): initilize KubeVela codeowner file

* Update .github/CODEOWNERS

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update .github/CODEOWNERS

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update .github/CODEOWNERS

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-08-28 08:26:41 +08:00
yangsoon
73be37b73b Fix(envbinding): fix the way that envbinding stores resources after configuration (#2175)
* Refactor: replace #op.ApplyEnvBindComponnet with #op.ApplyEnvBindApp

* Fix: fix patch strategy for envbinding
2021-08-27 21:38:57 +08:00
Reeta Singh
950411dbe8 Trait: Add TraitDefinition for PVC (#2158)
* Feat(trait): add trait definition for persistent volume claim

* Feat(trait): add trait definition for persistent volume claim
2021-08-27 18:45:22 +08:00
Zheng Xi Zhou
5fcc2ad9f7 Fix: fix EOF event when describing an application (#2134)
Fixed the issue: When component properties don't meet the parameter
of the ComponentDefinition, it will hit 'EOF' event

Co-authored-by: Jian.Li <74582607+leejanee@users.noreply.github.com>

Fix #2132
2021-08-27 18:45:05 +08:00
wyike
cc8a1d3bde Feat: modify apply component cue action to support skipWorkload trait (#2167)
fix lint

fix comments
2021-08-27 13:12:00 +08:00
Zheng Xi Zhou
1f6d4d2345 Fix: add fluxcd dashbaords (#2130)
Added two fluxcd dashboards and also install its dependencies

just keep the ready Dashboard
2021-08-26 20:31:49 +08:00
wyike
6719e8af3a Feat: add health check status (#2166)
check len(status.contitions) not empty
2021-08-26 20:05:01 +08:00
yangsoon
5d17fb3a7f Refactor: change the ownerReference of configMap which store the parameter for each revision to definitionRevision (#2164)
* Refactor: change the ownerReference of cm store the parameter for each revision to defRevision

* Feat: check whether its needed before status update
2021-08-26 19:56:46 +08:00
Zheng Xi Zhou
08f1ff99cf Fix: traitdefinition controller reconcile in a infinite loop (#2157)
Check whether its needed before status update, add log before
each reconcile returns, and also correct Klog.InfoS to klog.ErrorS
when trying to log err information

Fix #2153
2021-08-25 21:35:33 +08:00
Shaowen Chen
44262f03de Docs: fix typo about workflow rollout (#2163)
Signed-off-by: shaowenchen <mail@chenshaowen.com>
2021-08-25 19:32:56 +08:00
Tianxin Dong
2145afe4e1 Feat(ci): add commit lint ci (#2160) 2021-08-25 17:00:50 +08:00
Tianxin Dong
60cd8ef7de Feat(workflow): add workflow CRD (#2098) 2021-08-25 09:55:12 +08:00
Tianxin Dong
8fb64fcb19 Fix(dryrun): add default name and namespace in dry run (#2150) 2021-08-24 17:54:55 +08:00
Tianxin Dong
8fc192bfac Feat(definition): add built-in dingtalk workflow step definition (#2152) 2021-08-23 19:07:07 +08:00
Young-Zen
c4380dbe06 fix helm test failed (#2149)
Co-authored-by: yanghaojia <yanghaojia@coding.net>
2021-08-23 16:48:37 +08:00
wyike
01f7357525 change IncreaseFirst to DecreaseFirst (#2142)
don't merge, only for test

request cpu to 0

revert
2021-08-23 16:24:51 +08:00
Jian.Li
9311c22c16 Feat(workflow): support to send dingDing message (#2141)
* Feat(workflow): send dingding message

* Bug(e2e): upgrade golang version
2021-08-21 07:18:04 +08:00
Tianxin Dong
7254bb67a3 Feat(vela): add vela workflow terminate and restart command (#2131)
* Feat(vela): add vela workflow terminate and restart command

* Fix(restart): fix restart command
2021-08-20 20:45:09 +08:00
wangyuan249
8a334d7e82 Feat: add get and delete method for app and test (#2127) 2021-08-20 20:41:19 +08:00
qiaozp
af04ca37a5 Feat(addon): Add source and patch to kustomize definition (#2138)
* add more source to kustomize

* add patch to kustomize

* fix

* add patch trait

* remove param
2021-08-20 20:40:15 +08:00
Tianxin Dong
37bd10d762 Feat(contributing): add commit message convention (#2140) 2021-08-20 16:08:08 +08:00
Yue Wang
324fc1ac7c add CUE-based health check in HealthScope controller (#1956)
add e2e test

Signed-off-by: Yue Wang <seiwy2010@gmail.com>
2021-08-20 15:55:47 +08:00
yangsoon
850fc704a1 add new parameter type for internal trait expose (#2122)
* expand internal trait expose

* fix(demo) fix resource in workflow-with-ocm

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-08-20 15:50:22 +08:00
wyike
4941a3e9c2 fix external revision bug (#2126)
* fix external revision bug

* add test

* try to fix flaky-test
2021-08-20 15:43:50 +08:00
Tianxin Dong
bd91cf762d Fix(workflow): set the namespace to app's ns if it's not specified (#2133)
* Fix(workflow): set the namespace to app's ns if it's not specified

* fix dryrun test
2021-08-20 13:43:04 +08:00
qiaozp
0906d1b602 fix cloneset (#2129) 2021-08-20 10:55:59 +08:00
yangsoon
fa283ee695 fix(cli) fix bug when vela show componetdefinition's workload type is AutoDetectWorkloadDefinition (#2125) 2021-08-19 23:44:31 +08:00
Hongchao Deng
bec6c89389 examples: fix typo (#2128)
* examples: fix typo

* update yaml
2021-08-19 21:19:53 +08:00
Jian.Li
96a8b24a64 Make the WorkflowStepDefinition to be Universal (#2124)
* support script

* add comment
2021-08-19 19:15:41 +08:00
wyike
0c0b9d0774 rollout OCM demo and defer rollout pass owner to handleSucceed (#2121)
* finish test

fix demo

finish test

finish docs

fix rollout template

add more test

add comment

* impove test coverage and wrap error

fix checkdiff

add more time
2021-08-19 15:33:40 +08:00
Jianbo Sun
f033768dd2 fix(CI): use buildkit as docker build engine to avoid 401 unauthorized error (#2120) 2021-08-18 22:36:02 +08:00
qiaozp
65217c0a44 helm add bucket support (#2104)
* helm add bucket support

* fix def

* add bucket support ,support ak/sk

* typo

* bucket -> oss

* bucket -> oss

* repoUrl -> url

* rfc helm param

* rfc helm param

* fix helm type usage

* fix test
2021-08-18 20:10:42 +08:00
Tianxin Dong
8ac5d2276e Fix(workflow): set workload name in configmap if the name is not specified (#2119)
* Fix(workflow): set workload name in configmap if the name is not specified

* fix ut
2021-08-18 20:04:34 +08:00
Concurrensee
9b7c4562ca modified openkruise version to v0.9.0 (#2076)
Co-authored-by: 314785 <wuyida.wuyida@alibaba-inc.com>
2021-08-18 17:37:52 +08:00
Tianxin Dong
a6753737b3 Feat(vela): add vela workflow resume command and ut (#2114)
* Feat(vela): add vela workflow resume command and ut

* fix ut
2021-08-18 17:04:21 +08:00
Jianbo Sun
8e4a0c8306 try fix github action push to image hub (#2115) 2021-08-18 14:35:43 +08:00
Tianxin Dong
601510e43c feat(def): add built-in workflow definitions (#2094)
* use_vela_bin

* Update gen_definitions.sh

add version print

* Update gen_definitions.sh

* Update gen_definitions.sh

* update crossplatform build check

* test

* feat(def): add built-in workflow definitions

* delete pod disruptive in workflow step def

* make cue files reviewable

* fix workflow step definition

* fix ci

* add clean up step

* add build clean up

Co-authored-by: Yin Da <yd219913@alibaba-inc.com>
Co-authored-by: Somefive <Somefive@foxmail.com>
2021-08-18 13:22:57 +08:00
Tianxin Dong
2854c4204c Feat(vela): add vela workflow suspend command (#2108)
* Feat(vela): add vela workflow suspend command

* Feat(vela): add vela workflow suspend ut
2021-08-18 11:37:46 +08:00
Zheng Xi Zhou
09c85191ba Replace gcr.io image in chart kube-metrics-server (#2113)
As it's difficult to pull gcr.io iamge, so replace the image
k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.1.0 to the one
hosted in dockerhub.io
2021-08-18 09:11:38 +08:00
Zheng Xi Zhou
b11d0c69d6 Fix the issue to set the latest nighty build chart name (#2109)
This is a patch for https://github.com/oam-dev/kubevela/pull/2103
2021-08-17 20:40:41 +08:00
Jianbo Sun
cc4b55983f update kubevela helm chart repo (#2110) 2021-08-17 18:56:49 +08:00
Zheng Xi Zhou
a9ab04dfe3 Store OSS bucket and endpoint to Github Action secret (#2111)
Storing OSS bucket and endpoint to Github Action secret will help
a developer to test the function without needing to changing code,
revert code. Instead, he/she just need to configure the secret contect
2021-08-17 18:54:14 +08:00
Zheng Xi Zhou
3ccaf04354 Refine the lastest chart name build on master branch (#2103)
Rename the latest master chart name to x.y.z-nighty-build
2021-08-17 15:13:59 +08:00
qiaozp
050afca7a6 Add obsevability addon (#2091)
* Support Obsevability

- Support displaying and filter logs
- Support metrics and traces

* register datasource

* install prometheus

* install prometheus and register datasource

* Also install and register Prometheus

* remove unneeded file

* register datasource with clusterip

* register prometheus

* Support importing Grafana Dashboard

Added a trait to import Grafana Dashboard on component Grafana

* tmp

* 1. make observability as addon
2. make it more esay to gen addon

* use [[]] as gen addon delim

* url->urls

* add 2 url

* fix template

* fix args

* remove doc

* move url,fix test

* last modify!

* change arg name to grafana-domain

Co-authored-by: zzxwill <zzxwill@gmail.com>
2021-08-17 14:46:07 +08:00
yangsoon
a599a6a88b add more test for envbinding (#2100)
* add test

* fix example
2021-08-17 11:30:52 +08:00
wyike
b6a2ab804e add batch partition (#2097) 2021-08-16 20:30:56 +08:00
Jianbo Sun
309e71a60f add create or update app apiserver (#2087)
* add create or update app

* add apiserver test
2021-08-16 20:28:03 +08:00
yangsoon
d3f264273f enhance envbinding: support apply resources to cluster (#2093)
* enbinding support apply resources directly

* adjust the directory struct

* set placement as an optional field

* support namespace selector
2021-08-16 19:08:18 +08:00
Zhizhen He
1e294b3164 chore: replace github.com/ghodss/yaml with sigs.k8s.io/yaml (#2089) 2021-08-15 10:53:05 +08:00
Somefive
51669f0e41 enable vela def to use import decl (#2084)
* enable vela def to use import decl

* fix def_test

* add comment

* add more test
2021-08-13 18:44:01 +08:00
wangyuan249
11524bf591 update cert image (#2083) 2021-08-13 08:23:48 +08:00
wyike
682385dea9 runtime rollout chart (#2075)
* first commit

WIP

finish all tests

finish github  workflow

only for test

only for test

revert test code

minimize rbac

neats imports

fix tests

* reorg

small change

* rename
2021-08-12 21:33:00 +08:00
Concurrensee
63341e8f6e imagePullJob added with demo (#2069)
Co-authored-by: 314785 <wuyida.wuyida@alibaba-inc.com>
2021-08-12 19:12:53 +08:00
Somefive
d7a31c4cb3 fix configmap patchkey bug (#2080) 2021-08-12 19:10:51 +08:00
Hongchao Deng
223bcd3770 remove k8sutil 2021-08-12 11:13:41 +08:00
wangyuan249
f2868305ff fix ci 2021-08-12 11:13:41 +08:00
wangyuan249
9e2f406ee0 fix ci and refactor common util 2021-08-12 11:13:41 +08:00
Hongchao Deng
3c5fae12b3 fix ci 2021-08-12 11:13:41 +08:00
Hongchao Deng
201c3c466d add test for catalog service 2021-08-12 11:13:41 +08:00
Hongchao Deng
638957a333 leave only catalog code 2021-08-12 11:13:41 +08:00
Hongchao Deng
9620fbbfca add helm chart 2021-08-12 11:13:41 +08:00
Hongchao Deng
bf93bf5004 add apiserver to Dockerfile 2021-08-12 11:13:41 +08:00
wangyuan249
fa57fcf66e Merge velacp to apiserver branch in oam repo (#2039)
* move velacp into vela core as apiserver

* fix lint

* add license

* fix err lint

* fix err

* rm vela install service

* add makefile
2021-08-12 11:13:41 +08:00
yangsoon
8d298ecfdd clean docker image every hour (#2070) 2021-08-11 20:29:20 +08:00
tux
d7c179b91d fix workflow example (#2064) 2021-08-11 16:30:16 +08:00
Tianxin Dong
63cfc2b68a Fix(example): fix workflow example (#2060) 2021-08-11 14:00:30 +08:00
Somefive
873c8299d8 fix definition controller log error cause by openapi schema generation error (#2063)
* fix definition controller log error cause by openapi schema generation failed

* fix definition controller log error cause by openapi schema generation failed

* add test
2021-08-11 13:59:46 +08:00
qiaozp
356db2dc97 Add add-on input go-template implementation (#2049)
* add addon parameter template implementation

* add test

* fix test

* fix helm version parameter
2021-08-11 11:49:44 +08:00
yangsoon
abbec2c36b definitions support specify the revision name (#2044)
* support named defRev

* add test
2021-08-10 20:03:45 +08:00
tux
120e6fcc5c fix metadata.name to lower case (#2059) 2021-08-10 20:03:04 +08:00
Somefive
072e6b0aa7 fix def init bug (#2056) 2021-08-10 12:48:32 +08:00
qiaozp
ea64b1db3b Add cloneset as kruise addon's componentDefinition (#2050)
* add cloneset as kruise addon's componentDefinition

* add SAE demo field

* trim field

* make reviewable
2021-08-10 10:21:49 +08:00
Tianxin Dong
a874aa3f71 Chore(docs): fix typos in design docs (#2053) 2021-08-09 19:59:38 +08:00
Jian.Li
e12a9303eb Li-Auto-Inc (#2042) 2021-08-09 10:27:18 +08:00
LeoLiuYan
a715564147 Feat allow users to specify component revision name (#1929)
* Feat allow users to specify component revision name

* Add unit tests

Signed-off-by: LeoLiuYan <929908264@qq.com>

* Add ExternalRevision field to ComponentManifest

* Add handleComponentRevisionNameUnspecified func

* Add unit tests for webhook

Signed-off-by: LeoLiuYan <929908264@qq.com>

* Add more unit tests

* Feat allow users to specify component revision name

* Add unit tests

Signed-off-by: LeoLiuYan <929908264@qq.com>

* Add ExternalRevision field to ComponentManifest

* Add handleComponentRevisionNameUnspecified func

* Add unit tests for webhook

Signed-off-by: LeoLiuYan <929908264@qq.com>

* Add more unit tests

* Try to fix webhook unit tests

* fix race (#2040)

* fix test bug

* More unit tst

* More unit test and trigger ci

Co-authored-by: yangsoon <yangsoonlx@gmail.com>
Co-authored-by: Yin Da <yd219913@alibaba-inc.com>
2021-08-08 12:11:24 +08:00
Jian.Li
94dab9f2a5 workflow support http provider (#2029)
* provider http

* method

* add license header

* test cases

* test cases

* test cases

* test cases

* generate

* lint

* upgrade apply component

* cover

* test install
2021-08-06 19:26:50 +08:00
Somefive
97d2715b87 update klog surpress (#2038) 2021-08-06 19:09:21 +08:00
Somefive
6168537f56 add vela-def design documents (#2041) 2021-08-06 17:55:06 +08:00
yangsoon
d5abd6fd77 fix race (#2040) 2021-08-06 17:13:12 +08:00
Somefive
ee0282af18 [Vela CLI] Vela def enhancement & replace mergedef.sh (#2031)
* draft vela def enhancement

* add format and amend test

* fix generation bugs

* force CI

* work around lifecycle definition in avoid of vela show --web crash

* fix data race in envbinding
2021-08-06 17:10:52 +08:00
Zheng Xi Zhou
116e78e66a Add more properties for trait helm (#2033)
* Add more properties for trait helm

Added `version`, `targetNamespace` and `value` for trait helm

co-authored-by:  qiaozp <47812250+chivalryq@users.noreply.github.com>

* fix make check-diff issue

Co-authored-by: qiaozp <47812250+chivalryq@users.noreply.github.com>
2021-08-06 16:20:37 +08:00
Gesa Stupperich
2ee3256b20 Store component parameters in context (#2030) 2021-08-06 10:48:00 +08:00
yangsoon
0eed21987a add more test for envbinding (#2032) 2021-08-06 10:46:31 +08:00
wyike
3f326f06e4 application skip gc resource and rollout set workload ownerReference (#2024)
* finish main logic and test

* fix import order

* rollout isn't created by applciation

* fix comments

* fix compatility test

* mock error test
2021-08-05 17:15:57 +08:00
wangyuan249
db0b7b6ea3 add userlist (#2025) 2021-08-05 14:42:48 +08:00
Tianxin Dong
c6c03d823b Fix(volume): seperate volume to trait (#2027) 2021-08-05 11:06:13 +08:00
Hongchao Deng
566cd8cbc8 design: add scenarios of ML Platform Building 2021-08-05 10:28:28 +08:00
yangsoon
1a7db89fbd add ocm demo (#1992) 2021-08-04 20:23:56 +08:00
yangsoon
0752244d0b enable policy (#2011) 2021-08-04 18:58:57 +08:00
Jian.Li
5f1d07bfc6 Order Steps by Field Tag (#2022)
* sort by tag

* add test cases for order tag

* parse comments

* fix atrr conflict

* fix bug
2021-08-04 16:30:11 +08:00
junqi.zhai
6405603970 ApplicationContext status patch nothing (#2019)
* applicationcontext_controller.go status deepcopy

* put a space between `//` and comment text

Co-authored-by: 69055 <fuwangZJQ1991>
2021-08-04 15:15:37 +08:00
wyike
13fc4e2b25 rollout controller find sourceRevision (#1989)
* rollout controller use last target as source and add whole process e2e-test

* modify makefile use regex include all rollout related test

* add example

* fix golint

* more wait time

* pending pod may let rollout stock in rollingBatches

* fix docs and tests comments

modify docs example

modify cue and yaml

* less pod in test avoid pod pending
2021-08-03 20:27:11 +08:00
Tianxin Dong
478eb69b31 Fix(lint): fix lint and typo in oam testutil (#2017) 2021-08-03 20:01:43 +08:00
Somefive
2aa31a9f2b [Vela CLI Tool] Add vela def (#1949)
* add vela edit

* vela def group commands

* 1. change scheme of definition cue
2. add vela def tests
3. reformat

* fix render template bugs

* add definition examples (migrated from serverless iac)

* retrigger github ci

Co-authored-by: Yin Da <yinda@B-2943Q05P-1738.local>
2021-08-03 18:00:49 +08:00
Jianbo Sun
e3edde44af disable metrics server port in tests and add log for rollout (#2012) 2021-08-03 14:53:38 +08:00
Shaowen Chen
af1e9dc195 bugfix: workload namespace is empty while sync appdeployment (#2009)
Signed-off-by: shaowenchen <mail@chenshaowen.com>
2021-08-03 13:23:38 +08:00
Jianbo Sun
5ddeabb6af fix resource tracker ownerRef override (#2002) 2021-08-03 12:47:59 +08:00
Jianbo Sun
aa87d3da24 upgrade K8s dependency lib to v0.21 (#1985)
* upgrade K8s dependency to v0.21

* update CRD for new version of controller-runtime

* fix ci component revision create must fill Raw in runtime.RawExtension

* try fix test

* start control plane timeout set to 1min and fix tests

* add timeout for env test start and stop

* longer timeout time for BeforeSuit function

* upgrade kubebuilder and k8s cluster version to match with v1.21.2 in github action

* fix test

* fix resource tracker ownerRef override

* update developer guides
2021-08-03 11:30:02 +08:00
Somefive
7a1f95773d Add timeout context for controllers (#1990) 2021-08-02 19:31:00 +08:00
Shaw Ho
d9cd048d79 Fix addRevisionLabel to selector (#1983)
Signed-off-by: Xiaoxi He <tossmilestone@gmail.com>
2021-08-02 16:36:54 +08:00
Somefive
2c2fe4dc66 Bump github.com/containerd/containerd from 1.3.2 to 1.4.8 (#2001)
* Bump github.com/containerd/containerd from 1.3.2 to 1.4.8

Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.3.2 to 1.4.8.
- [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.3.2...v1.4.8)

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

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

* adapt to new containerd version

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yin Da <yd219913@alibaba-inc.com>
2021-08-02 13:05:29 +08:00
yangsoon
66644de597 fix func fixOpenAPISchema (#2003) 2021-08-02 13:04:46 +08:00
Yue Wang
b4ebdac5bb quick fix tests (#1999)
Signed-off-by: Yue Wang <seiwy2010@gmail.com>
2021-08-02 10:29:31 +08:00
Jian.Li
9d6aaa6044 Workflow Support op.# ApplyComponent and op.#ApplyRemaining (#1993)
* add cap

* workflow

* add docs

* upgrade op.#ApplyComponent

* lint

* bytes to string
2021-07-31 07:14:00 +08:00
Jianbo Sun
b88ac35779 don't filter not found error in load template to avoid panic (#1994)
* should return error if type not found to avoid panic

* don't filter not found error in load template to avoid panic
2021-07-31 07:11:07 +08:00
Jianbo Sun
0a16175523 fix rollout test (#1996) 2021-07-31 00:12:41 +08:00
Jian.Li
53855019d0 fix workflow bug (#1986)
* fix bug

* add test case
2021-07-30 19:40:25 +08:00
Somefive
4eb8f1a0ee suppress dirty logs during import libraries (#1991)
Co-authored-by: Yin Da <yd219913@alibaba-inc.com>
2021-07-30 18:39:34 +08:00
yangsoon
7161959aca add EnvBinding Controller for Multi cluster deploy and Configuration Management (#1968)
* patch env configuration

* add e2e-test
2021-07-30 10:02:51 +08:00
Jian.Li
4481e7637d Optimize Workflow (#1978)
* open op.#Steps

* export

* fmt code

* fix bug & upgrade workflow doc

* fmt

* upgrade test coverage

* upgrade test coverage
2021-07-29 11:35:22 +08:00
wyike
2b1946ee7b already exist is fine (#1979) 2021-07-29 11:16:40 +08:00
wyike
a8c4d5f01e add filter func and related tests (#1976)
trigger CI
2021-07-28 18:50:13 +08:00
qiaozp
de1b84724c add namespace initializer for fluxcd (#1977) 2021-07-28 18:46:06 +08:00
Jianbo Sun
e71d71c6b7 use corev1.ObjectReference insteadof crossplane-runtime TypedReference (#1974)
* refactor crossplane-runtime TypedReference to ObjectReference and make condtion locally

* fix test
2021-07-28 13:59:13 +08:00
Jian.Li
e7041f913f open op.#Steps (#1975) 2021-07-28 13:58:33 +08:00
wyike
3199fd7577 support context.componentRevName in cue template of traitDefinition (#1973)
* add logic and test for component context replace

* add more test

* add comments

* fix comments

* rename context revision name

* add bad revision name test
2021-07-28 10:28:02 +08:00
Jian.Li
a736b1f7b0 Workflow Support Resource GC (#1970)
* gc

* add test cases

* test case
2021-07-27 19:22:05 +08:00
dependabot[bot]
804024599b Bump github.com/gin-gonic/gin from 1.6.3 to 1.7.0 (#1971)
Bumps [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin) from 1.6.3 to 1.7.0.
- [Release notes](https://github.com/gin-gonic/gin/releases)
- [Changelog](https://github.com/gin-gonic/gin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gin-gonic/gin/compare/v1.6.3...v1.7.0)

---
updated-dependencies:
- dependency-name: github.com/gin-gonic/gin
  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-07-27 15:09:45 +08:00
Yue Wang
c0144865d2 fix app finalizer bug (#1962)
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-07-26 14:20:22 +08:00
wyike
5d6ce83174 mechanism let application skip apply the workload (#1963)
* add manageby trait option

* add comments

* fix comments

* fix dryrun test

* add checkfunc in assemble phase

fix lint
2021-07-25 10:18:33 +08:00
chival
6b804acbf5 Fix Initializer bugs & Enhance addon command (#1955)
* enhance `addon enable` command

* fix: initializer requeue twice
fix: initializer won't update status while checking dependency

* not delete ns while disable addon

* add init delete webhook and test

* use poll func

* fix get init logic

* fix get init logic

* fix CI

* fix CI

* unfocus

* check diff

* CI
2021-07-25 10:16:43 +08:00
Zheng Xi Zhou
e62d5d23e7 Update Terraform typed Componentdefinition (#1938)
As Terraform alicloud provider has upgrade to 1.26.0, some
HCL synatx have to been updated
2021-07-23 14:48:32 +08:00
Jian.Li
9d7d2eb262 docs (#1961) 2021-07-23 11:21:48 +08:00
c508cd45c6 allow create application with empty components (#1936) 2021-07-22 19:47:34 +08:00
Hongchao Deng
ed0039e1ee [Feature] CUE Based Workflow Step (#1935)
* Workflow WIP (#1934)

* interface

* add model value

* walk fields

* provider

* stdlin

* tasks

* add stdlib

* Adjust TaskGenerator

* Unified configmap format

* development completed

* fix import cycle

* demo passing

* upgrade action

* add value test cases

* format

* apis

* add context test cases

* fmt

* fmt

* add context to taskGenerator (#1942)

* fix configmap test

* add workflow integration test

* upgrade code

* initial workflow commit

* interface

* add model value

* walk fields

* provider

* stdlin

* tasks

* add stdlib

* Adjust TaskGenerator

* Unified configmap format

* development completed

* fix import cycle

* demo passing

* upgrade action

* add value test cases

* format

* apis

* add context test cases

* fmt

* fmt

* add context to taskGenerator (#1942)

* fix configmap test

* add workflow integration test

* lint code

* improve pkg[value、context] testing coverage

* Improve testing coverage(#1957)

* add license

* add test cases

Co-authored-by: Jian.Li <74582607+leejanee@users.noreply.github.com>
Co-authored-by: Jian.Li <lj176172@alibaba-inc.com>
2021-07-22 18:53:30 +08:00
chival
0b46895211 support helm repo secret (#1943) 2021-07-21 14:52:43 +08:00
yangsoon
5e064219e7 Enhance Initializer: export the phase of Initializer and help install build-in Initializer (#1932)
* add phase for initilaizer

* help install build-in initializer

* add test
2021-07-20 20:40:01 +08:00
wyike
ff6fcd9f10 support component revision based rollout (#1919)
* WIP almost finish main logic

WIP make reviewable

finish manual test

fix rollout plan related test

WIP refactro some logic

WIP finish e2e-test

* fix failed e2e-test

* fix failed interagtion test

* move rollout to trait packege

* modify e2e-test testdata change apiVersion

* add v1alpha1 to scheme in test

* more wait time

* fix comment

* split rollout test

fix makefile

* rename test name

delete equal quata

try to fix

fix

* add more test
2021-07-20 16:53:39 +08:00
Yue Wang
10073df98a fix legacy resource tracker issue (#1931)
Signed-off-by: Yue Wang <seiwy2010@gmail.com>
2021-07-20 14:07:08 +08:00
wangyuan249
d77969b52e Help developer install build-in necessary definitions. (#1907)
* fix

* add install def shell

* change to make command

* fix shell

* fix bak
2021-07-20 14:05:39 +08:00
chival
21cde39c50 Add helm release component definition as part of fluxcd Intializer (#1928)
* 1. change all init namespace to vela-system(make sure depend ref)
2. move componentDef into init
3. remove ns object in auto-gen file
4. remove componentDef from autogen file(already in init)

validate helm chart as componentDef

temp

* rfc: keda/prometheus/terraform-controller using helm-release comp

* fix name style

* rename

* check diff
2021-07-19 17:04:15 +08:00
yangsoon
40a09e5468 skip pkg discover when workload type is autodetect (#1930) 2021-07-19 13:14:23 +08:00
yangsoon
644cafe0a1 fix bug: application can not create component which contains namespace resource (#1920)
* align initializer's namespace to vela-system

* fix makefile

* fix terraform namespace

* add test
2021-07-15 19:53:41 +08:00
Hongchao Deng
ead859b717 design: update workflow implementation details (#1917) 2021-07-14 18:08:56 +08:00
Jian.Li
fcecd0cc8d patchKey support x.y (#1916) 2021-07-14 17:03:50 +08:00
chival
e91deaa4cc Add Prometheus/KEDA as addon (#1915)
* add keda addon

* add promethus addon

* rebase

* add generate namespace.
add prometheus as addon
add keda as addon

* rebase
2021-07-14 16:48:11 +08:00
whichxjy
40171f08bb Support scale controller for StatefulSet (#1901) 2021-07-14 15:45:07 +08:00
chival
07ebca4376 Add open-kruise as addon (#1910)
* verify git repo as source

* Add open-kruise as addon
2021-07-14 15:44:14 +08:00
chival
38cf4c8195 Add terraform controller as built-in addon (#1905)
* add terraform controller as addon

* change addon name to terraform

* fix init controller depends logic

* rebase

* fix CI

* unfocus
2021-07-14 14:38:32 +08:00
wangyuan249
7d711c2f39 self-assign (#1911) 2021-07-13 21:02:55 +08:00
whichxjy
1d76964ca0 Fix the way to ignore errors in shell script (#1902) 2021-07-13 17:15:31 +08:00
yangsoon
af50f32826 add ocm-hub (#1906) 2021-07-13 16:58:46 +08:00
Jian.Li
e972535e49 upgrade workflow design (#1900)
* upgrade workflow design

* Revert "upgrade workflow design"

This reverts commit 95937c94dd.

* revert & upgrade Diagram
2021-07-13 16:55:17 +08:00
chival
87576cc67e Implement addon mechanism (#1867)
* - add: list/enable/disable an addon.

- add: test addon

- add: full flux addon

- fix: flaky test

* try again

* 1. add readme
2. gen demo file

* fix ci

* change name

* try again
2021-07-13 13:03:25 +08:00
Lei Zhang (Harry)
d7950063c3 Align with doc (#1899) 2021-07-12 17:21:14 +08:00
LeoLiuYan
5b6f248152 Feat: no need create appRevision if it already presents in histories (#1896)
* Feat no need create appRevision if it already presents

Signed-off-by: LeoLiuYan <929908264@qq.com>

* Remove some logic

* Fix golint

* Feat add unit test and fix e2e

* Fix unit-test

Signed-off-by: LeoLiuYan <929908264@qq.com>
2021-07-08 23:03:29 +08:00
Chwetion
3016fd1e91 add add observedGeneration field in status of Application to perceive the version difference between status and spec (#1878)
Co-authored-by: chwetion <chwetion@foxmail.com>
2021-07-08 22:31:45 +08:00
wyike
9a3c63a843 override initial replicas of workload in first scale operation (#1891)
* clean up some logic

rebase and reorder phase

add log and modify e2e-test

fix reviwable

fix comment

* fix condition relate comments

finish test func

fix formate error
2021-07-08 19:45:18 +08:00
Hongchao Deng
9e1189c4df Add back workflow design diagram and update doc (#1894)
* update workflow design

* add back diagram

* separate folder

* rebase
2021-07-08 16:42:01 +08:00
Jianbo Sun
e72f5b8d2a fix error links (#1893) 2021-07-08 16:07:21 +08:00
yangsoon
0611c0a79a fix bug: failed to aggregate status if application use a kube/helm type component (#1866)
* fix aggregate status

* add test
2021-07-08 15:16:55 +08:00
LeoLiuYan
3c05232de8 Feat change appHandler scope to package (#1892)
Signed-off-by: LeoLiuYan <929908264@qq.com>
2021-07-08 14:30:52 +08:00
yangsoon
572f7b47bd add image pull policy and pull secrets for worker and webservice (#1887)
* add image pull policy and pull secrets

* fix test
2021-07-08 13:08:54 +08:00
Lei Zhang (Harry)
3d464b6461 Update with workflow inforamtion (#1890) 2021-07-08 10:22:26 +08:00
wyike
14a2f8a7bd dont't template source in rollout and rollout first component (#1888)
* fix rollout and only rollout the first component

* determine rollout component before render

* let other resources apply when target worklaod not ready

* immutable resource only update ownerRef

* add annotation

* fix unit test

add handle sourceWorkload

add anotation

add comment

add more e2e-test

Co-authored-by: 天元 <jianbo.sjb@alibaba-inc.com>
2021-07-06 23:45:52 +08:00
chival
d489cc4b37 fix-logo (#1883) 2021-07-06 20:39:50 +08:00
wangyuan249
cd1fdc8ade Bot add assign ability (#1876)
* add vela robot for issue triage

* fix url for document redirect

* assign description
2021-07-06 20:31:19 +08:00
chival
016becf2be add more test error info (#1886)
fix kustomize registry yaml, fix testdata yaml
2021-07-06 18:58:29 +08:00
Yue Wang
fba53cfbf3 handle ending reconcile with conditions (#1859)
Signed-off-by: roywang <seiwy2010@gmail.com>
2021-07-06 13:54:23 +08:00
Jianbo Sun
4930c2c71f add ingress trait for the new ingress API (#1882) 2021-07-06 13:54:00 +08:00
Jianbo Sun
700b1aa951 remove docs and refer to kubevela.io for docs (#1877)
* remove docs and refer to kubevela.io for docs

* update contirbute docs

* remove unneed github action workflow
2021-07-05 23:36:09 +08:00
Hongchao Deng
fb1eb51e92 Merge pull request #1875 from hongchaodeng/wf-design
workflow design update: CUE based workflow task
2021-07-05 14:56:19 +08:00
Hongchao Deng
071476a04f workflow design update: CUE based workflow task 2021-07-05 14:44:16 +08:00
yangsoon
01ed9a647c TraitDefinition support use insertSecretTo in template to consumer cloud resource (#1849)
* traitdef support insertSecretTo

* add test
2021-07-04 21:40:43 +08:00
Yue Wang
9adf269869 support helm repo secret (#1872)
Signed-off-by: roywang <seiwy2010@gmail.com>
2021-07-04 21:39:48 +08:00
Hongchao Deng
227052f51e Merge pull request #1870 from wonderflow/workflow
improve workflow docs and update API for flexible
2021-07-02 07:45:36 -07:00
天元
facd56fd4f improve workflow docs and update workflow API 2021-07-02 18:06:37 +08:00
yangsoon
c53cebef0a add Fluxcd addon (#1863)
* add fluxcd addon

* fix apiserver
2021-07-02 17:34:02 +08:00
wyike
6d446e13f6 add revision listmit (#1871) 2021-07-02 16:05:00 +08:00
wangyuan249
fc5043c543 add vela robot for issue triage (#1840) 2021-07-02 15:14:51 +08:00
Jianbo Sun
bd41d49311 allow component to defer insert secret and config (#1869) 2021-07-02 15:09:45 +08:00
wyike
4eb33e9239 split out oam-spec v0.2 charts (#1842)
* WIP disable oam related controller and webhok

change velue

fix spell error

change namespace

add e2e for oam-runtime

fix charts hack

fix e2e definition namespace

fix diasble contains list

fix e2e-test

* disable components handler

* fix flaky ac test

add every definition in oam-runtime-system namespace

* upload ac e2e-test

replace files

fix upload reports

* more wait time
2021-07-01 16:32:01 +08:00
Jianbo Sun
75bbd63f9e delete vela restful API (#1864) 2021-07-01 10:16:01 +08:00
whichxjy
be0563a8ea Add deploymentController struct (#1845)
* Init deployment controller

* Support deployment-claiming

* Nitpicking

* Support deployment-scaling

* Support deployment-releasing

* Handle scale errors

* Fix lint

* Log target size

* Fix texts
2021-06-30 21:11:11 +08:00
wyike
9c70edeb77 delet rollout (#1856) 2021-06-30 17:45:32 +08:00
yangsoon
aec9913557 fix invalid metadata.labels error when specify the version of the trait in the app (#1855)
* fix trait name

* add test
2021-06-29 15:53:57 +08:00
chival
22d014d91a Align vela cli and kubectl vela client tools (#1827)
* allow vela CLI to specify NS

* vela up support application yaml

* fix

* add default cap center to vela CLI

* add alias for `vela components`(`vela comp`,or `vela component`) and `vela traits`(`vela trait`)

* fix cap ls STATUS fields are always "uninstalled"

* fix vela up process

* Revert "allow vela CLI to specify NS"

This reverts commit 33f27362

will refactor to use Initializer

* add --discover for vela CLI

* * rfc capcenter to reuse registry type
* change default cap center to oss

* judge if application file in advance

* fix CI

* try CI

* fix error check
2021-06-29 15:52:43 +08:00
chival
2b4d12fbdd Machanism for filter annotation&label passed from Application to workload and trait (#1843)
* Add two filter

* only filter in app->ac and ac->other

* move filter logic to assemble phase

* simplify, add indication

* simplify trim

* add unit test

* clean up testdata
2021-06-28 15:12:03 +08:00
veraicon
b2adf5b472 Create a guide of test level maintainance (#1852)
* Create testcode-guidance.md

* Update contribute/testcode-guidance.md

* Update testcode-guidance.md

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-06-28 15:07:16 +08:00
Anycodes
88933d07d6 Update README.md (#1850) 2021-06-28 13:52:38 +08:00
yangsoon
e176fcfc56 Add the basic ability to initialize a single-cluster environment for the initializer (#1829)
* init Initializer

* update spec

* add status check

* add e2e-test

* fix Initializer version
2021-06-25 18:54:26 +08:00
wyike
93234e8290 fix flaky test (#1841) 2021-06-25 10:32:47 +08:00
Chwetion
b582ccc060 add application component name duplication check in webhook (#1811)
* add application component name duplication check in webhook

* Helm test will not clean up the test data, and the application test of the component with the same name created failed during e2e.

* fix the problems encountered during the test:

* ignore the parsing failure caused by the existing application without definition when checking;

* after the addition is successful, the resources left by the helm test are automatically cleaned up;

Co-authored-by: chwetion <chwetion@foxmail.com>
2021-06-24 16:47:17 +08:00
Yue Wang
5a778b4732 add API v1beta1.ComponentManifest (#1814)
rfc appfile pkg: remove appConfig&component

fix unit test

rfc vela cli dryrun & livediff

fix unit test & e2e test

rfc app controller: remove appConfig&component

fix unit test & e2e test

fix rollout and webhook

fix use AppRevision as others' owner

move ComponentManifest to oam.types

add a util to make conversion between AppConfig and ComponentManifest

complete Component revision mechanism in app controller

add test for component revision

rename

fix unit tests

add clean up for component revision

fix unit test

Signed-off-by: roywang <seiwy2010@gmail.com>
2021-06-24 15:06:58 +08:00
Scaat Feng
8bc63a431f Fix incorrect pod disruptive annotation traits (#1838)
* [FIX]incorrect pod-disruptive defalut configuration in label of traits

* [FIX]incorrect pod-disruptive defalut configuration in annotation of traits

* [FIX]incorrect pod-disruptive defalut configuration in annotation of traits
2021-06-23 19:17:12 +08:00
Scaat Feng
4b120546f0 [FIX]incorrect pod-disruptive defalut configuration in sidecar of traits (#1839) 2021-06-23 18:02:05 +08:00
Scaat Feng
94bc87d03e [FIX]incorrect pod-disruptive defalut configuration in label of traits (#1837) 2021-06-23 18:01:37 +08:00
whichxjy
20ceca4c99 Rename deployment-rollout-controller constructor (#1800)
* Rename deployment-rollout-controller constructor

* Polish test descriptions
2021-06-23 14:03:40 +08:00
Lei Zhang (Harry)
e07c95fa26 Update arch pic (#1828) 2021-06-22 17:38:36 +08:00
Hongchao Deng
c1b5203009 Merge pull request #1824 from wonderflow/prt
add PULL_REQUEST_TEMPLATE.md
2021-06-21 23:11:44 -07:00
wyike
4040c8e67c fix rt flaky test (#1825) 2021-06-22 12:13:35 +08:00
Zheng Xi Zhou
d2a2a9ac07 Bump k8s.io/client-go to v0.18.12 (#1826)
Due to the vulnerability of CVE-2019-11250, bumping version of
client-go to fix it.
2021-06-22 10:59:25 +08:00
天元
5cb5491bc8 add PULL_REQUEST_TEMPLATE.md 2021-06-21 17:12:22 +08:00
chival
f94cf51543 fix some yaml in registry and link to file (#1823)
* fix some yaml in registry and link to file

* try e2e
2021-06-21 14:53:41 +08:00
yangsoon
61d7aff01c fix release website (#1819) 2021-06-19 14:01:01 +08:00
yangsoon
e217e9e0df add autoGenWorkloadDefinition option (#1804)
add autoGenWorkloadDefinition option to choose whether to create workloaddef via webhook
2021-06-18 23:40:12 +08:00
Hongchao Deng
5b332c24d8 add initializer design (#1794)
* add environment design

* update

* update

* update

* add environment impl plan

* rename env -> initializer

* add finalizer logic

* update
2021-06-18 19:11:07 +08:00
wyike
b752511e74 skip finalizer validation (#1815)
add some time to check cloneset replicas

fix flaky test
2021-06-18 14:36:40 +08:00
wyike
70eeec4c89 support restart scale operation by modify targetSize of AppRollout (#1812)
* WIP first commit

fix

* more wait time

* fix flaky test
2021-06-17 22:30:07 +08:00
wyike
d7e1d90585 add specify for rollout and add scale demo (#1813)
fix-formate

fix small issue

small fix

samll fix

small fix
2021-06-17 16:14:44 +08:00
cuiyeshuai
003ab91f51 fix several typos (#1808) 2021-06-16 21:02:37 +08:00
Jianbo Sun
046376aa1a refine our contributing guides (#1807)
* refine our contribute guides

* Update CONTRIBUTING.md

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
2021-06-16 20:56:19 +08:00
wyike
649e0376cc fix status completed bug (#1802)
refactor to helper and add unit-test

neat imports
2021-06-16 17:24:18 +08:00
Mason Kwok
ed4844d518 remove implementation of vela install (#1798) 2021-06-16 10:03:20 +08:00
wyike
8970c95875 fix missed logic (#1799) 2021-06-15 18:52:37 +08:00
wyike
72bdb04f94 fix deployment example (#1797) 2021-06-15 16:27:39 +08:00
Hongchao Deng
e5c8f259f3 app controller: reconcile workflow and create res configmap (#1788) 2021-06-15 13:40:12 +08:00
Kinso
e494516593 fix(openapi): only parse the parameter field (#1790)
Co-authored-by: kinsolee <lijingzhao@forchange.tech>
2021-06-15 13:36:23 +08:00
whichxjy
9972911510 Fix a typo (#1793) 2021-06-15 11:44:47 +08:00
Yue Wang
fbb0cddb30 fix flaky e2e test (#1791)
Signed-off-by: Yue Wang <seiwy2010@gmail.com>
2021-06-13 15:20:01 +08:00
Yue Wang
889e38e984 remove appContext from app/appRollout controller (#1774)
* refine  assemble and dispatch

Signed-off-by: roy wang <seiwy2010@gmail.com>

* remove app context in app controller

modify clean up app revision

remove old resource tracker related logic

fix unit tests

Signed-off-by: roy wang <seiwy2010@gmail.com>

* fix e2e-test

- get rid of appCtx in test cases
- fix test cases according other logic changes in app controller

remove whole appcontext_test.go file

disable rollout related e2e test provisionally

disable resource tracker related e2e test provisionally

Signed-off-by: roy wang <seiwy2010@gmail.com>

* add finalizer logic for app controller

Signed-off-by: roywang <seiwy2010@gmail.com>

* add new apply option MustBeControllableByAny

make dispatch idempotent

Signed-off-by: roywang <seiwy2010@gmail.com>

* refactor rollout

* fix rollout finalize succeed

Signed-off-by: roywang <seiwy2010@gmail.com>

* add update trait and gc test

fix lint

* fix flaky e2e test

Signed-off-by: roywang <seiwy2010@gmail.com>

* fix comment

* fix comments and add sourceRevision dispatch

delete useless

Signed-off-by: Yue Wang <seiwy2010@gmail.com>

* fix app finalizer backward compatible

Signed-off-by: roywang <seiwy2010@gmail.com>

* fix backward compatability for deprecation of appContext

add unit test for apply option

add e2e test

Signed-off-by: Yue Wang <seiwy2010@gmail.com>

* fix app controller unit test

Signed-off-by: Yue Wang <seiwy2010@gmail.com>

* refine app controller apply logic

Signed-off-by: Yue Wang <seiwy2010@gmail.com>

* fix e2e test of resource tracker

fix e2e test of rollout plan

fix flaky e2e tests

Signed-off-by: Yue Wang <seiwy2010@gmail.com>

* refine comments and remove useless codes

Signed-off-by: Yue Wang <seiwy2010@gmail.com>

* disable appCtx controller

add Component handler into app controller

Signed-off-by: Yue Wang <seiwy2010@gmail.com>

Co-authored-by: wangyike <wangyike.wyk@alibaba-inc.com>
2021-06-12 14:46:32 +08:00
Zheng Xi Zhou
9de6aea5ab Split workflow to enable re-run single jobs (#1782)
* Split workflow to enable re-run single jobs

Fix #1781

* rename workflow name
2021-06-10 15:27:20 +08:00
wangyuan249
f4cbe1b98b Add ignore feature for cue parameter (#1756)
* add ignore feature for cue parameter

* add test

* fix diff

* fix test

* fix test 2

* fix interact init
2021-06-10 10:29:35 +08:00
yangsoon
2c9cf94817 add options (#1775)
1. add ConcurrentReconciles for setting the concurrent reconcile number of the controller
2. add DependCheckWait for setting the time to wait for ApplicationConfiguration's dependent-resource ready
2021-06-08 10:38:30 +08:00
Jianbo Sun
54a828863b remove restful API docs from website (#1771) 2021-06-07 19:25:26 +08:00
Kinso
f4f72708a5 fix(log): debug level flag (#1768)
Co-authored-by: kinsolee <lijingzhao@forchange.tech>
2021-06-07 15:22:42 +08:00
yangsoon
b224230b9c Add Logging Convention in CONTRIBUTING.md (#1762)
* add logging convention in contributing

* fix log
2021-06-07 12:02:54 +08:00
yangsoon
b6a6982a57 add test (#1761) 2021-06-04 19:05:59 +08:00
yangsoon
570eaf6077 improve log system in appconfig (#1758) 2021-06-04 17:40:02 +08:00
Yue Wang
5a6feb3a19 don't use appRevision as resource tracker's owner (#1759)
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-06-04 14:46:10 +08:00
chival
d42e0e3162 Add more optional paramters to built-in component (#1748)
* add probe to worker and webservice, add memory limit to webservice

* add interacitve answer

* make generate

* move Probe def outside the parameter.

* make all PodSpec alternative param done

* add doc, gen yaml

* fix docs
2021-06-03 19:13:43 +08:00
Yue Wang
72ba2162e9 implement dispatch pkg (#1741)
add unit test

add log

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-06-03 19:01:49 +08:00
Yue Wang
c7e46e49ca fix flaxy e2e-test (#1752)
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-06-03 15:31:18 +08:00
Scaat Feng
aafd4fdd2f [IMP]easy for users to copy command (#1661)
Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-06-03 15:30:50 +08:00
Hongchao Deng
c463b147a1 add PolicyDefinition and WorkflowStepDefinition controller (#1751) 2021-06-03 13:21:32 +08:00
yangsoon
447ab4a35a Improve the logging system (#1735)
* change to klog/v2

* add logfilepath opt in helm chart

* replace klog.InfoF with klog.InfoS and improve messages

Remove string formatting from log message, improve messages in klog.InfoS and use lowerCamelCase to fmt Name arguments in klog.InfoS

* fix klog.Error

for expected errors (errors that can happen during routine operations) use klog.InfoS and pass error in err key instead.

* use klog.KObj and klog.KRef for Kubernetes objects

ensure that kubernetes objects references are consistent within the codebase

* enable set logdebug level

* add log-file-max-size
2021-06-03 12:07:30 +08:00
Zheng Xi Zhou
8dcbb61cb8 Generate OpenAPI JSON schema for Terraform Component (#1738)
Fix #1736
2021-06-03 11:23:20 +08:00
Hongchao Deng
75d35ecdf8 Merge pull request #1750 from hongchaodeng/workflow
add workflow package
2021-06-02 09:52:07 -07:00
Hongchao Deng
fd13fb4441 add const CondStatusTrue 2021-06-02 08:58:59 -07:00
Zheng Xi Zhou
dd682919a8 Fix wrong cue directory (#1749)
Fixed the wrong directory of cue files when formating
2021-06-02 22:37:39 +08:00
Hongchao Deng
b93460cbb4 add workflow package 2021-06-02 07:34:54 -07:00
chival
f4feb1af9c Add oss registry support (#1715)
* Add oss registry support

* fix test

* refactor and clean up URL parse logic

* add:design docs

* change default registry to oss
2021-06-02 18:32:54 +08:00
Lian Bai
6dab3fb985 fix the fmt command of the makefile (#1745) 2021-06-02 18:31:44 +08:00
wangyuan249
fb23e0ebd2 fix show annotations (#1711)
* fix show annotations

* only fix map value
2021-06-02 17:27:28 +08:00
Jian.Li
4f47bec238 refactor cue related packages in vela (#1734)
* refactor-cue

* import group

* readme

* fmt
2021-06-02 15:37:06 +08:00
chival
8c864f33b9 organize registry directory (#1733)
* organize registry directory

* fix cue not found

* install cue

* move definitions to and to-be-generated cue&yaml to root directory

* fix publish registry dir

* fix duplication of cue install

* try again

* try again
2021-06-02 13:34:01 +08:00
Yue Wang
21fe5fab9e realted to refactor application (#1712)
implement app/assemble pkg

add unit test

add log

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-06-01 16:34:25 +08:00
yangsoon
931ca3ea3e fix bug: When the Component contains multiple traits of the same type, the status of the trait in the Application is reported incorrectly (#1731)
* fix status

* add test

* fix webhook

* add paramter context for customStatus
2021-05-31 18:44:15 +08:00
Hongchao Deng
fa8b3ef763 refactor appfile pkg for adding workflow (#1732) 2021-05-30 22:57:03 +08:00
Hongchao Deng
4c7c954357 Merge pull request #1723 from hongchaodeng/wf2
update APIs and docs for workflow design
2021-05-29 05:44:24 -07:00
chival
a52367eced arrange docs for kubectl plugin,fix #1721 (#1729)
* arrange docs for kubectl plugin,fix #1721

* remove redundant install doc
2021-05-29 16:40:28 +08:00
Emanuel Russo
fd9e99f19f Fix Documentation for Terraform Controller (#1724)
* Update terraform.md

Update Documentation. Fix Terraform controller version to avoid mistake.

* Update terraform.md

Change version to the latest one.

* Update terraform.md

Rollback modification on example.
2021-05-29 11:52:39 +08:00
Hongchao Deng
9a10e967ee update APIs and docs for workflow design 2021-05-28 20:44:50 -04:00
Zheng Xi Zhou
181bcda66a Sync definitions to oss bucket, which acts as a capability center (#1720)
* Sync definitions to oss bucket, which acts as a capability center

Fix #1702

* address comments
2021-05-28 15:51:48 +08:00
wangyuan249
0753734372 vela show support show the parameters of KUBE model ComponentDefinition (#1693)
* vela show support show the paramters of KUBE model ComponentDefinition

* fix

* fix

fix

* enchance test case and add function in show -web

fmt and vet

fix

fix522

* add resolve for kubedef type trait in  reconcil process

* fix StoreOpenAPISchema args para and ret para

* fix GetCapabilityObject uncover
2021-05-26 21:16:40 +08:00
沧海
8380e66b1e add chart debug value (#1714)
* add chart debug value

* add chart debug value
2021-05-26 19:25:21 +08:00
chival
de9b06e716 optimize goimports (#1716) 2021-05-26 18:41:50 +08:00
Jianbo Sun
abfb2ae6ef fix roadmap docs (#1710) 2021-05-26 15:07:55 +08:00
chival
0c7706d442 show&install caps in default center (#1621)
* add:show & install caps in default center and docs

other things:
* fix #1601 (.md) error
* adjust clean-md.py
* refactor capability install part to reuse code

* fix typo/bug, make get retrieve single file

* try again

* add:registry interface

* add local registry

* modify e2e test

* add copyright

* add unittest, fix docs

* add copyright

* fix e2e test

* clean up testdata

* clean up usage of fmt, rename

* fix docs, rename func

* fix docs
2021-05-25 17:22:02 +08:00
白联
30662d632b Support patch data-pass object in CUE (#1704)
* Support patch data-pass object in CUE

* Add some unit tests
2021-05-25 11:20:09 +08:00
Jianbo Sun
cd93196aef update roadmap for 2021-6 and 2021-9 (#1707)
* update roadmap for 2021-6 and 2021-9

* update roadmap and minor changes
2021-05-25 10:22:12 +08:00
yangsoon
fed40a1060 fix webhook: set a default workload.type for componentdefinition which doesn't refer to a workload (#1686)
* fix webhook

* fix controller

* fix error message
2021-05-24 23:32:02 +08:00
wyike
76744ad26e fix cloneset rollout docs (#1660) 2021-05-24 17:23:02 +08:00
Jianbo Sun
c93db6494a use custom domain for vela charts (#1701) 2021-05-24 16:30:09 +08:00
Zheng Xi Zhou
27c1eda2a6 Add service-binding trait to chart (#1692)
* Add service-binding trait to chart

Also add docs for the trait.

* Update charts/vela-core/templates/defwithtemplate/service-binding.yaml

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

* address comments

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-05-24 00:41:21 +08:00
yangsoon
59a8765aa1 refactor the way of get OpenAPISchema in trait/component definition controller (#1691)
* refactor trait/componet definition controller

* fix test
2021-05-23 14:16:06 +08:00
yangsoon
845ce1bbf4 fix clean-md (#1700) 2021-05-23 14:08:41 +08:00
Yue Wang
ef1cd50a1a fix flaky e2e test (#1698)
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-05-22 16:03:22 +08:00
Jianbo Sun
b124873fd7 fix docs link (#1695) 2021-05-20 19:52:31 +08:00
Yue Wang
0556f03f28 fix traitDef appliesToWorkloads (#1667)
update docs

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-05-20 19:06:38 +08:00
yangsoon
7929f9fe09 fix store openapi (#1689) 2021-05-19 20:08:51 +08:00
Lei Zhang (Harry)
f73236a617 Minor fix on wording (#1687) 2021-05-19 20:06:59 +08:00
wangyuan249
98a31f68ae Add new label for configmap which store the parameter json schema of the Definition (#1652)
* fix

* add description for newlabel

fix

* fix description
2021-05-18 21:10:47 +08:00
chival
aa720f3c67 Add expose (#1678)
* add expose.cue

* add expose.yaml

* add usage comment

* gen yaml

* fix issue

Co-authored-by: qiaozp <qiaozp@B-MAA4ML7H-2021.local>
2021-05-18 18:45:25 +08:00
yangsoon
512a87466e update docker image (#1677) 2021-05-18 17:23:46 +08:00
名白
cc8bf15962 add kubebuilder prerequisites in contributing.md (#1675)
Co-authored-by: liushengjie9506 <liushengjie9506@ipalfish.com>
2021-05-18 15:45:27 +08:00
yangsoon
d3fcbf4d45 fix bug: remove unneeded workload definitions (#1656)
* fix controller

* fix test
2021-05-17 22:47:57 +08:00
yangsoon
8f67454396 Explain vela next (#1671)
* Explain vela next

* fix def

Co-authored-by: Lei Zhang <resouer@gmail.com>
2021-05-17 22:42:29 +08:00
yangsoon
2fa02bc1c0 Preview and Build website in docker container (#1668)
* start/build docs in docker

* restore old fashion

* fix release ci
2021-05-17 19:09:37 +08:00
Hongchao Deng
e63ec032b2 Merge pull request #1624 from hongchaodeng/api
api: add policy and workflow
2021-05-16 20:52:34 -07:00
Hongchao Deng
ef021c5d2d api: add policy and workflow 2021-05-16 23:07:05 -04:00
yangsoon
a11ae2f95d Add Dynamic Admission Control for ComponentDefinition (#1648)
* add webhook

* add test

* fix package discover
2021-05-15 11:43:33 +08:00
Hongchao Deng
87ff9c9f84 design: Application-Level Policies and Customized Control-Logic Workflow (#1642)
* design: Application-Level Policies and Customized Control-Logic Workflow

* update

* use condition
2021-05-15 11:35:43 +08:00
Yue Wang
d2f471df3f make ResourceTracker to own cluster-scope resource (#1634)
add e2e tests and unit tests

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-05-15 11:34:33 +08:00
Yue Wang
80b2c3713b fix staticcheck lint (#1657)
make CI work consistently with Makefile/staticcheck

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-05-14 18:49:07 +08:00
Scaat Feng
37d9adbc6c [IMP]easy for users to copy (#1655) 2021-05-14 14:51:31 +08:00
Zheng Xi Zhou
b4ae473dae Fix Terraform application status issue (#1611)
* Fix Terraform application status issue

Fix #1599

* add unit tests

* fix import issue
2021-05-13 21:46:45 +08:00
yangsoon
4ef8cb3f12 fix bug: Use stricter syntax check for CUE (#1643)
* fix cue render

* fix e2e-api-test

* add test
2021-05-13 21:44:08 +08:00
Lei Zhang (Harry)
138676315f Update introduction (#1651) 2021-05-13 21:43:18 +08:00
Lei Zhang (Harry)
9772907d66 update the revision doc (#1650) 2021-05-13 10:25:09 +08:00
Jianbo Sun
884648a010 Create SECURITY.md (#1649) 2021-05-13 10:03:26 +08:00
Wei (段少)
eefc8c13ce Add Security Reporting (#1647)
* Add Security Reporting

* Update README.md

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-05-12 21:38:39 +08:00
wyike
0a4c20c999 fix empty rolloutBatch will panic whole controller bug (#1646)
* add webhook for app and avoid controller panic

neat imports

* add test for rollout verify
2021-05-12 19:00:55 +08:00
Jian.Li
58b3fffa36 Implement retainKeys patchStrategy in CUE based patch trait (#1627)
* strategyPatch retainKeys

* merge rewrite

* rewrite strategyPatch

* Improve test coverage

* upgrade docs

* Update docs/en/platform-engineers/cue/patch-trait.md

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

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-05-12 15:28:36 +08:00
yangsoon
c4cb69120e fix docs (#1636) 2021-05-12 13:43:15 +08:00
wangyuan249
ba8c6c020a upgrade Go version to 1.16 latest (#1577)
* bump go version to 1.16

* fix gox

* fix

* fix

* del sleep

* del

* gosum fix conflict 0511

* rm stop fix

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
2021-05-11 21:27:33 +08:00
wyike
83c9c17cc7 fix application rollout annotation false issue (#1633)
* fix annotation false issue

neat imports

* rewrite judge logic

* add webhook

* add webhook verify annotation

* fix test

fix bug

* modify error message
2021-05-11 19:12:25 +08:00
chival
2a5573015e update cap center example (#1630) 2021-05-10 18:51:54 +08:00
wyike
4b897baae8 add app embed rollout pause test (#1626)
* add pause test

* verify update plan shouldn't generate new revision

fix error test
2021-05-10 18:49:26 +08:00
Zheng Xi Zhou
f137a9adf3 Update samples for "vela show xxx --web" (#1616)
* Update samples for "vela show xxx --web"

Also stop generating components/traits docs under
docs/en/end-user and remove the command from Makefile

Fix #1602

* fix doc build issue

* Update references/plugins/references.go

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

* Enhance --web feature for "vela show"

- Find the capability in "vela-system" if notfound in the current ns
- Don't depend on local capabilities

* add ut for GetCapabilityByName in references/plugins/cluster.go

* add ut for GetNamespacedCapabilitiesFromCluster in references/plugins/cluster.go

* add ut for GenerateTerraformCapabilityProperties in references/plugins/references.go

* fix import issue

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-05-09 08:50:31 +08:00
wyike
d90e78af97 fix error test and add middle state test (#1622) 2021-05-08 21:00:50 +08:00
yangsoon
1866753769 Enable Dynamic Admission Control for Application (#1619)
* add webhook

* fix test

* fix validating_handler
2021-05-08 21:00:33 +08:00
yangsoon
1660930ed3 applicaiton supports specifying different versions of Definition (#1597)
* app support specify the version of definition

* add e2e-test

* add docs

* add helm related test

* fix doc

* add more test

* fix docs
2021-05-07 17:52:44 +08:00
Zheng Xi Zhou
5cc92e5420 Rename file name for trait "cpusclaer" and "scaler" (#1617)
As the file name (.cue/.yaml) of trait "cpusclaer" and "scaler"
are "cpuhpa" and "manaualscale" respectively, renmae them in
order to avoid confustions
2021-05-07 17:33:37 +08:00
woshicai
18bf1189a3 check yarn docusaurus (#1604)
Co-authored-by: kubevela-bot <kubevela.bot@aliyun.com>
2021-05-07 14:24:29 +08:00
Zheng Xi Zhou
c9d21e6707 Renaming the name of function "SyncDefinitionToLocal" (#1607)
As we don't need to sync the defintiion .yaml and .cue to local and
then extract it, besides, there is a simliar function "SyncDefinitionsToLocal"
just besides it, rename function "SyncDefinitionToLocal" in order
not to cause confustions
2021-05-07 10:40:42 +08:00
yangsoon
1f73020c4d fix ci (#1610) 2021-05-07 10:39:30 +08:00
chival
1e08b3a037 update cap center example (#1612) 2021-05-06 22:49:59 +08:00
Zheng Xi Zhou
5d22e868eb Fix unstability of ApplicationContext UT (#1609)
* Fix unstablity of ApplicationContext UT

* fix import order

* fix compatibility issue
2021-05-06 22:48:19 +08:00
Lei Zhang (Harry)
ee69d761f9 Merge pull request #1601 from resouer/doc
Fix docs
2021-05-04 12:00:29 -07:00
Lei Zhang
2ca7ce5c8b Fix docs 2021-05-04 11:28:11 -07:00
Zheng Xi Zhou
675b0e24db Refine Terraform doc (#1590)
Added applying Terraform Provider introduction, and removed `.md`
to make it work in official site
2021-04-30 19:33:55 +08:00
wyike
7ed1c66578 fix appRollout docs small issue (#1592)
* fix docs targetSize

* add comment

* delete comment
2021-04-30 19:33:30 +08:00
Jianbo Sun
5079659404 fix sync website shell (#1591) 2021-04-30 18:23:17 +08:00
Zheng Xi Zhou
b3302b318c Support server-side Terraform as cloud resource provider (#1519)
* Support server-side Terraform as cloud resource provider

Provide another schematic `Terraform` to provision cloud
resource.

Fix #698

* make namespace optional
add unit-tests

* support vela show to generate componentdefinition usage

* add unit-tests

* tidy go mod

* clean go mod and updated go sum

* Remove `variable` from `properties` of Terraform compoent

* don't literally set component catagory

* refine error message when a capability could not be found

* fix ut

* Code refactor and add unittests

* fix ci issues

* Update references/plugins/references.go

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

* add test cases

* fix ci issue

* revert lowercase of "Properties"

* fix ci issue

* add ut for appfile

* fix e2e issue

* add docs

* fix official site build

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-04-30 16:28:00 +08:00
wangyuan249
e1dfe40794 Resolve the problem : When updating the kubevela.io website , the version field in config file do not match. (#1587)
* fix webversion

* fix webversion

Co-authored-by: kubevela-bot <kubevela.bot@aliyun.com>
2021-04-30 16:13:59 +08:00
Zheng Xi Zhou
0571ae3a54 Add unittests for ApplicationContext (#1586)
* Add unittests for ApplicationContext

* fix compatibility-test issue
2021-04-30 15:32:05 +08:00
wyike
29744a6f18 [Feature] embed rollout in an application (#1568)
* WIP refactor rollout reconcile

add construct func for reconcile

refactor application  event

WIP fix failed test

fix event reason

delete useless yaml

fix samll issue

add more test

fix more test

add e2e test and extract rollout plan from appRevision

extract inline appRollout status from appStatus

* fix-plugin-test

* debug e2e

* fix comments and rename app-embed-test

* delete empty line

* fix docs

* update rollout docs

fix appRollout docs

* update docs and delete useless debug info

* fix deployment plugin bug and algin with rollout related workload to deployment

* fix docs comment

* rename package crossplane-runtime v1alpha2

* copy from https://github.com/wangyikewxgm/kubevela/pull/1

* fix some comments issue and add todo

* fix error test
2021-04-30 15:17:43 +08:00
Jianbo Sun
fbd4565115 use accelerate domain for global users (#1585) 2021-04-29 21:10:22 -07:00
yangsoon
3543cb9b23 fix controller: fix controller cannot start due to the format error of the third-party CRD (#1584)
* fix controller

* add cue parse error
2021-04-29 20:09:27 +08:00
chival
1d731b808a add pr code coverage requirement: (#1583)
* relative cov >= 70%
* total cov drop <=1%
2021-04-29 11:58:14 +08:00
guoxudong
bba6e056a5 Add krew auto release and docs (#1582)
* add krew auto release and docs

* fix
2021-04-29 11:16:05 +08:00
Zheng Xi Zhou
7787fe8e6a Fix "nil pointer" issue in UT (#1579)
When "metav1.Time" type "DeletionTimestamp" variable is nil, it cloud
not be printed while "fmt.Printf("%+v")"

Fix #1578
2021-04-28 19:25:23 +08:00
chival
6a956f9343 calculate e2e-test into coverage (#1553) 2021-04-28 15:29:08 +08:00
白联
b76a3f3f42 Check whether parameter.cmd is nill for sidecar trait (#1575) 2021-04-28 14:48:25 +08:00
yangsoon
fd44069a21 fix unit-tests (#1569) 2021-04-27 14:02:10 +08:00
wyike
cd8f31c4d8 delete duplate key in webhook yaml (#1571) 2021-04-27 12:12:37 +08:00
wyike
f625877eb1 fix componentDefinition ignore error bug (#1567) 2021-04-26 19:20:04 +08:00
Yue Wang
396f244af1 add deployment scale controller (#1557)
add unit test

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-04-26 10:12:11 +08:00
yangsoon
ed3e8d384a add DefinitionRevison and make Componet/TraitDefinition revisionable && fix legacy CRD (#1531)
* add definitionrevison type

* fix controller

* add test

* fix legacy

* fix unit-tests
2021-04-26 10:07:55 +08:00
wyike
5f34a0c658 delete useless yaml (#1565) 2021-04-25 19:45:38 +08:00
Lei Zhang (Harry)
c40108f413 Update arch (#1561) 2021-04-24 09:15:48 +08:00
yangsoon
63855abed9 fix cli: vela show support list the parameter of ComponentDefinition which use helm charts (#1543)
* vela show support helm

* show helm parameter in web

* add test

* support link jump

* add test
2021-04-23 16:50:44 +08:00
SataQiu
4dd00ac536 docs: remove the command prompt to support fast copy/paste (#1558)
Signed-off-by: SataQiu <1527062125@qq.com>
2021-04-23 11:49:38 +08:00
Lei Zhang (Harry)
55b6ef1846 Update concept doc (#1556) 2021-04-23 10:47:36 +08:00
Lei Zhang (Harry)
737b4dc2e4 Revise readme for better structure (#1554)
* Update pictures

* Revisit readme
2021-04-22 12:11:52 +08:00
wyike
60b8ec3ff2 Set scpoe reference in application status.Service (#1540)
* WIP add new type

* add code and test

* WIP finish docs

* add sidbar for docs
2021-04-22 12:11:04 +08:00
Zheng Xi Zhou
fed2d13d98 Redirect to Discussions if users want to open Question issue (#1550) 2021-04-22 10:59:07 +08:00
Lei Zhang (Harry)
85d6c77fad Update pictures (#1548) 2021-04-22 10:29:12 +08:00
Zheng Xi Zhou
a488a24af4 Enable "vela show" to support namespaced capability (#1521)
* Enable "vela show" to support namespaced capability

Provide option `-namespace`, if not set, the default namespace
is default. If not found, as by default, capabilities are located in
vela-system, it will continue to retrieve the capability in
vela-system directory.

Fix #1520

* add e2e tests

* Address comments: Revert env context back

Get namespace from env, instead of adding option "-namespace"

* fix unittest issue

* Address comments

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

* fix e2e

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-04-21 19:33:23 +08:00
Lei Zhang (Harry)
00a4e4ca01 Align with doc site (#1545) 2021-04-21 15:49:10 +08:00
SeanLy
ef0888f256 [fix] improve k8s libs compatibility (#1542)
* [fix] improve k8s libs compatibility

* trigger tests
2021-04-21 15:29:49 +08:00
Jianbo Sun
0519c1ea8c add DingTalk group number in Readme (#1541) 2021-04-21 14:45:19 +08:00
Ryan Zhang
467506c498 Finalize deployment rollout (#1539)
* finalize deployment rollout

* refactor workload controllers to base on the same parent
2021-04-21 13:42:49 +08:00
Ryan Zhang
0ac7f02fc9 Continue to add rollout integration test (#1535)
* refine the workload controllers with test

* refine deployment rollout that supports rollback
2021-04-20 11:47:29 -07:00
Zheng Xi Zhou
662a791e71 Change "AWS OSS bucket" to "AWS S3 bucket" (#1538) 2021-04-20 21:31:06 +08:00
Herman Zhu
b726c5291f feat(app) add k8s event for Application (#1463)
add k8s event for Application

fixed #1424

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>

fix

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>
2021-04-20 12:05:36 +08:00
Mason Kwok
7377e17f8f remove applicationdeployments.core.oam.dev from the advanced-install.md (#1533) 2021-04-20 11:27:56 +08:00
Yue Wang
1867436174 fix cue tmpl of worker and ingress (#1532)
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-04-19 16:02:12 +08:00
yangsoon
a3c97ecf31 add action: sync vela api code to the repo(kubevela-core-api) (#1523)
* add action sync-api

* add tag for repo
2021-04-19 13:40:47 +08:00
Jianbo Sun
ee7dac354d update github token (#1526) 2021-04-19 11:54:39 +08:00
Yue Wang
21c631ac26 add docs for volumes (#1524)
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-04-19 11:36:32 +08:00
yangsoon
90f7d11787 fix image url (#1525) 2021-04-19 11:24:45 +08:00
Hongchao Deng
b1ad5574b8 Merge pull request #1514 from wonderflow/addvideo
add video from DevOps Toolkit
2021-04-17 08:31:28 -07:00
yangsoon
b9a56aeb17 fix url (#1517) 2021-04-16 23:23:45 +08:00
Zheng Xi Zhou
3800a700b0 Add parameters comments for crossplane definitions (#1515)
* Add parameters commetns for crossplane definitions

Added parameter comments for ComponentDefinition alibaba-oss
alibaba-rds and TraitDefinition service-binding

* add the result of vela show
2021-04-16 22:24:50 +08:00
Jianbo Sun
75f081f248 Add More End User Docs (#1511)
* update docs

* update docs

* refine cloud resource docs

* update install guidegst
2021-04-16 21:46:44 +08:00
天元
ba68e33e23 add video from DevOps Toolkit 2021-04-16 21:14:00 +08:00
yangsoon
fb6d505e6e fix kubectl vela -h (#1512) 2021-04-16 20:43:26 +08:00
yangsoon
1a267bc6d1 add end-user/sidecar (#1513) 2021-04-16 20:42:41 +08:00
Zheng Xi Zhou
8643558f6b Add cloud service docs for end-users (#1510)
* Add cloud service docs for end-users

Split cloud service into two section, one for platform engineers,
and the other for end-users

* correct titles

* adjust componentdefinition and traitdefinition order

* address comments
2021-04-16 18:13:54 +08:00
yangsoon
d063cd3b78 rm printcolumn AGE in crd (#1509) 2021-04-16 17:35:08 +08:00
yangsoon
c4fa81b703 add kubectl vela show in docs (#1508) 2021-04-16 17:27:05 +08:00
wyike
ebc8476a31 garbage collection mechanism for AppRevision (#1501)
* WIP refactor gc func

WIP write gc code

WIP update chart,cmd args

add cleanupRevison func into garbageCollection

add more test

finish unit-test

refactor use func implements

Complete e2e test

WIP rewrite some logic

add func test and rewirte context pointing to func

fix cilint

refactor some function

fix typo

fix ci error

change gc logic

after change gc number, fix all test

add check appRevision collection

WIP finish most code

* add rollout batch to fix rollout e2e-tet

* fix component name in rollout

* ignore gc error, just log the error
2021-04-16 16:46:41 +08:00
Zheng Xi Zhou
0333b9e891 Refactor template_test.go to make it readable (#1507)
Some tests are not named which make it difficult to
read test cases and add more
2021-04-16 15:39:05 +08:00
yangsoon
3be63bba91 add end-user/labels.md (#1505) 2021-04-16 13:58:42 +08:00
woshicai
f9f2c3b119 update: try to add workloadDefinitionRef to application status (#1471)
* add workloadDef in application status' services

* Update pkg/controller/core.oam.dev/v1alpha2/application/apply.go

* fix: go fmt

Co-authored-by: charles <charles.cai@sap.com>
Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-04-16 13:21:52 +08:00
xiqiu618
34684650c3 fix appContext update failed error (#1500)
* fix appContext update failed error

* Update pkg/controller/core.oam.dev/v1alpha2/applicationcontext/applicationcontext_controller.go

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

* gofmt comments

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-04-16 13:05:09 +08:00
Ryan Zhang
e76992df87 randomize port to listen to separate tests (#1497)
* randomize the port

* make all tests sequential
2021-04-16 10:16:20 +08:00
yangsoon
3a68ec77fd fix CI: add action to release kubectl-vela binary file (#1503)
* add kubectl-vela release

* add docs
2021-04-15 22:54:31 +08:00
yangsoon
199e747865 Introduce vela as a kubectl plugin (#1485)
* add kubectl plugin

* add vela show

* add test
2021-04-15 18:25:46 +08:00
Jianbo Sun
c6b65cbd5b fix flaky test (#1498)
* fix flaky test

* fix flaky check apprevision created more than one

* remove unused annottaion
2021-04-15 18:25:17 +08:00
xiqiu618
9fa237721e add app name as label for AppRevision (#1488) 2021-04-15 15:41:53 +08:00
yangsoon
b90fffad43 fix action (#1496) 2021-04-15 10:06:29 +08:00
Lei Zhang (Harry)
1ad6dcc1a7 Modify doc title of keda trait (#1494) 2021-04-15 08:54:27 +08:00
yangsoon
1659528015 fix-resources-url (#1492) 2021-04-14 23:50:07 +08:00
Jianbo Sun
ce20f55382 add an overview for end user guide (#1469)
* add an overview for end user guide

end user guide

* add explore section

* finish scale section

* add expose section

* remove trait already contains as built-in feature

* try fix flaky test
2021-04-14 21:38:04 +08:00
Zheng Xi Zhou
384c5ab6a9 Remove trait-injector from controller options (#1490)
As trait injector isn't used, so removed it.
2021-04-14 18:54:02 +08:00
wyike
a7bfb2fb6f refactor appRevison extract func to utils (#1481)
* refactor appRevison extract func to utils

* add some corener case check

* add more checks
2021-04-14 15:48:23 +08:00
C.YAO
8703950da6 Fix helm install error when disable webhook patch (#1483) 2021-04-14 12:51:16 +08:00
Ryan Zhang
f7cfe6fbae improve cloneset integration test suite (#1482) 2021-04-14 12:29:28 +08:00
Shiwen Cheng
e8ed4d78cf Keep docker binary command due to the issue #416 (#1478) 2021-04-14 11:26:35 +08:00
Gallardot
0c8e22ef4d fix tiny typo (#1480)
Signed-off-by: Gallardot <tttick@163.com>
2021-04-14 10:56:33 +08:00
Lei Zhang (Harry)
e9004d7478 Fix introduction (#1479) 2021-04-14 10:55:31 +08:00
Serhat Şevki Dinçer
282efa2893 Create codeql-analysis.yml (#1470)
* Create codeql-analysis.yml

* rm schedule from codeql

* codeql: master & release branches only on push

* codeql: use release-* pattern

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

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2021-04-14 10:54:08 +08:00
yangsoon
580157df6a refactor vela cli (#1475) 2021-04-13 20:13:07 +08:00
yangsoon
6ecb0567f5 change email (#1477) 2021-04-13 20:11:41 +08:00
Yue Wang
dcf79a9b57 fix falky unit test (#1474)
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-04-13 20:01:47 +08:00
Yue Wang
b411d79ed0 add webhook validation on CUE template outputs name (#1460)
add hooks for process.Context to do validation

add unit test

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-04-13 19:18:15 +08:00
Lei Zhang (Harry)
d8eb7d687c Add user docs (#1472) 2021-04-13 15:20:39 +08:00
Yue Wang
63b348f4d8 implement cli vela system live-diff (#1419)
move dry-run and live-diff into an independent pkg

WIP add sample and doc

WIP unit test for live-diff

add unit test

Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-04-13 12:29:25 +08:00
Ryan Zhang
2e43a6dc78 make sure we don't create more pods (#1452) 2021-04-12 15:48:20 -07:00
Jianbo Sun
26163aacdc fix flaky test (#1467) 2021-04-12 16:51:06 +08:00
yangsoon
5164efeb4a add context.appRevisionNum (#1466) 2021-04-12 15:36:19 +08:00
wyike
2254777523 ignore error not found when deleting resourceTracker (#1462)
* ingore error not found when delete resourceTracker

* ignore error not found
2021-04-12 10:57:16 +08:00
LeoLiuYan
389722a94e Remove duplicated logic (#1465)
Signed-off-by: LeoLiuYan <929908264@qq.com>
2021-04-12 10:24:34 +08:00
Shiwen Cheng
4b86689d63 Update copyright year (#1464)
* Update copyright year to 2021 for The KubeVela Authors

* Update copyright year to 2021 for other project authors
2021-04-11 21:00:14 +08:00
Shiwen Cheng
2b07ec49d4 [Improvement-1457] Use kind cmd code to load docker image instead of local kind binary (#1458)
* [Improvement-1457] Use kind cmd code to load docker image instead of local kind binary

* [Improvement-1457] Update copyright year and kind repo declaration
2021-04-11 20:59:21 +08:00
Yue Wang
7edfbde2f5 skip applying helm-release if app spec not change (#1461)
Signed-off-by: roywang <seiwy2010@gmail.com>
2021-04-11 15:47:00 +08:00
Yue Wang
bc6a60dde2 add volumes definition in worker/webservice (#1459)
Signed-off-by: roywang <seiwy2010@gmail.com>
2021-04-11 14:18:48 +08:00
Lei Zhang (Harry)
1407fc5125 Update readme for 1.0 (#1453) 2021-04-11 14:11:03 +08:00
Yue Wang
2d6f2083db refactor pkg/appfile (#1447)
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-04-11 14:10:16 +08:00
yangsoon
c619b7b290 fix bug which Component/TraitDefinition won't work when contains "_|_" in value (#1450) 2021-04-09 21:46:04 +08:00
wyike
bc6000f794 fix flaky appcontext e2e-test (#1449) 2021-04-09 21:42:17 +08:00
yangsoon
2e92a66fa5 fix data race (#1446) 2021-04-09 20:15:02 +08:00
Shiwen Cheng
e5a9be8de9 Improve makefile and dockerfile (#1445)
* Improve makefile and dockerfile

* Add entrypoint.sh to support entrypoint and debugging

* Add docker base image discussion issue #1448 in dockerfile
2021-04-09 20:12:57 +08:00
Jianbo Sun
5d40f121ea add release docs when have tag (#1444) 2021-04-09 16:50:59 +08:00
woshicai
58c3283411 update: run helm lint & test after e2e-setup (#1415)
Co-authored-by: charles <charles.cai@sap.com>
2021-04-09 14:13:59 +08:00
Ryan Zhang
6d65169449 fix webhooks and try to fix e2e (#1441)
* fix webhooks and try to fix e2e

* address comments
2021-04-09 13:27:16 +08:00
yangsoon
9bf6cc2659 update version (#1442) 2021-04-09 12:28:04 +08:00
Lei Zhang (Harry)
ecbb5f56ca Update doc (#1440) 2021-04-09 11:10:03 +08:00
yangsoon
7ede0746c1 add clean-image action (#1436) 2021-04-09 10:17:21 +08:00
Zheng Xi Zhou
e8e45dd7d3 Add unit-tests for ApplicationRollout related packages (#1413)
* Add unit-tests for ApplicationRollout related packages

Part I: pkg/controller/common/rollout

* Add more unittets

* add unit tests for cloneset controller

* fix test issue

* add more unit-tests for cloneset_controller and deployment_controller

* fix rebase issues
2021-04-08 14:08:48 -07:00
yangsoon
08a1dc5a22 Add package discover refresh when component/trait definition are registered (#1402)
* add discover refresh

* add test

* fix store openapi schema

* fix discovermapper
2021-04-08 20:35:21 +08:00
Jianbo Sun
d2a46322c0 Merge pull request #1434 from chengshiwen/add-short-name
Add short name for crds
2021-04-08 20:15:22 +08:00
chengshiwen
7d31d84ec3 Remove redundant and ambiguous short names 2021-04-08 19:49:28 +08:00
chengshiwen
f59341f667 Add short name for crds 2021-04-08 19:49:23 +08:00
Jian.Li
a446aab46b Fix Bug: strategyUnify not work with close call (#1430) 2021-04-08 18:41:04 +08:00
Shiming Zhang
f2de6de6f8 Remove useless code (#1433)
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2021-04-08 18:39:42 +08:00
guoxudong
0f23f6eb09 stop zh-CN docs sync (#1431)
Co-authored-by: guoxudong <guoxudong.dev@gmial.com>
2021-04-08 17:23:45 +08:00
Lei Zhang (Harry)
473164efbd Finalize the message (#1426) 2021-04-08 15:54:40 +08:00
yangsoon
7dec0afc16 vela-cli support use "vela system cue-packages" to list cue-package (#1417)
* support list cue-package

* add test kube package doc

* refine words

* fix workflow

* fix the docs

Co-authored-by: 天元 <jianbo.sjb@alibaba-inc.com>
2021-04-08 15:54:25 +08:00
Jianbo Sun
a44257e153 fix flaky test (#1427) 2021-04-08 14:34:36 +08:00
yangsoon
1261e2678f add podDisruptive to traitdefinition (#1192)
* add podDisruptive to traitdefinition

* fix docs & example

* fix diff and add docs

* use bool type for podDisruptive

Co-authored-by: 天元 <jianbo.sjb@alibaba-inc.com>
2021-04-08 13:39:03 +08:00
Ryan Zhang
325a4cdb0e Add a new cloneset scale controller (#1301)
* add scale implementation

* fine tune the logic and adjust e2e test

* fix tests and fine tune logic

* try to fix flaky verification

* allow zero size step

* fix scale down check
2021-04-07 11:14:46 -07:00
wyike
b33b6fbead garbage collection for cross-namespace workloads and traits in application layer (#1421)
* add logic for gc cross ns resources

WIP regenerate api and charts

rewrite handle resourceTracker logic

WIP add e2e test logic

add more e2e  test

* WIP refactor sevral funs name and add comments for code

* WIP add more corener case e2e test

* add unit test and fix bug

* WIP refactor handleResouceTracker  logic

* refactor func name aglin with others and add comments

* make generate to fix check-diff ci error

* change resourceTracker status as a subresource
2021-04-07 21:34:48 +08:00
Jian.Li
15b1bd2660 Fix the bug that the registered k8s built-in gvk does not exist (#1414)
* fix bug for method exist(gvk)

* check that all built-in k8s resource are registered
2021-04-07 13:06:19 +08:00
yangsoon
8c73ea5d8a fix keda.md (#1420) 2021-04-06 16:07:22 +08:00
Jian.Li
4b25ed4ba1 fix import inner package in the format of third party package path and split test cases (#1412)
* test third party path in cue

* fix typo

* fix pkg mount bug

Co-authored-by: 天元 <jianbo.sjb@alibaba-inc.com>
2021-04-02 13:04:52 +08:00
Jianbo Sun
f47ca0f4da remove no used ingress notes in charts (#1405)
* remove no used ingress notes in charts

* remove helm repo update
2021-04-02 10:58:07 +08:00
Herman Zhu
5b1b054cca refactor(workload) remove all the duplicate fields (#1410)
remove all the duplicate fields in parser above as template contains

fix #1388

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>
2021-04-02 10:24:27 +08:00
Lei Zhang (Harry)
35376bd396 Reword readme for clearer message (#1408)
Rewording the readme
2021-04-02 09:41:23 +08:00
Lei Zhang (Harry)
06069d3580 Update docs to reflect app delivery idea (#1401) 2021-04-01 15:26:25 +08:00
yangsoon
43057161bf update contributing guide (#1398) 2021-04-01 13:54:56 +08:00
woshicai
50ded65805 Fix: update homebrew before install kubevela client (#1395)
Co-authored-by: charles <charles.cai@sap.com>
2021-04-01 12:45:40 +08:00
Stupig
1444376b0c newline is missing for BaseContextFile (#1396) 2021-04-01 12:07:27 +08:00
yangsoon
04486f89bb fix crd: add additional print column and short Name for CRD (#1377)
* add additional print column

* add shortname

* fix printcolumn & test
2021-04-01 11:51:43 +08:00
Zheng Xi Zhou
d6d19a7c5a Remove outputSecretName in cloud service provisoing and consuming (#1393)
Refer to the reason https://github.com/oam-dev/kubevela/issues/1128#issuecomment-811590631
2021-04-01 11:13:19 +08:00
Jianbo Sun
6b8875012d use shell instead action to sync website && don't sync index.js and config.js (#1386)
* use shell instead action to sync website && don't sync index.js and config.js

* update test website build

* use bash instead sh
2021-04-01 10:06:34 +08:00
joelhy
7ae6a148a0 Fix grammar error: changed "an success story" to "a success story" (#1385) 2021-03-31 23:33:00 +08:00
Jianbo Sun
bbea29c8e5 fix kube-webhook-certgen to patch CRD conversation && remove cert-manager in CI e2e test && remove issuer create from CLI env (#1267)
* remove cert-manager in CI e2e test and remove issuer create from CLI env

* update job patch image(https://github.com/wonderflow/kube-webhook-certgen)
2021-03-31 21:21:28 +08:00
Robin Brämer
6e6c4c76a6 fix docs typo (#1384) 2021-03-31 19:56:36 +08:00
wyike
1bf673c3c1 upgrade webhook configuration to v1 (#1383) 2021-03-31 19:56:09 +08:00
yangsoon
352fe1ba5b remove useless script & update install.mdx (#1382) 2021-03-31 18:40:34 +08:00
Yue Wang
3bdf7a044f fix generate schema for helm values (#1375)
Signed-off-by: roy wang <seiwy2010@gmail.com>
2021-03-31 17:31:54 +08:00
yangsoon
3cb9fa79bf fix index.js (#1380) 2021-03-31 16:01:53 +08:00
wyike
20f6e0ab02 skip check cross ns resource owner, add tests (#1374) 2021-03-31 15:00:16 +08:00
Kinso
438ab96f95 fix: add "system-definition-namespace" flag to container args (#1371)
Co-authored-by: kinsolee <lijingzhao@forchange.tech>
2021-03-31 14:41:07 +08:00
yangsoon
b5bf7a4f62 fix siderbar (#1373) 2021-03-31 14:39:09 +08:00
Lei Zhang (Harry)
d473e41f20 Update readme and doc (#1376) 2021-03-31 14:38:46 +08:00
Jianbo Sun
96c1d0786a the application context should not own application object (#1370)
* the application context should not own application object

* add time for flaky test
2021-03-31 13:55:57 +08:00
yangsoon
f7196e10ca fix upgrade in install.mdx (#1364) 2021-03-30 21:37:48 +08:00
yangsoon
a2997a070d fix vela show (#1366) 2021-03-30 21:36:28 +08:00
Ryan Zhang
0629049e1f add initial finalizer and abandon support (#1362)
* add initial finalizer and abandon support

* fix lint
2021-03-30 02:04:38 -07:00
yangsoon
553b5d19eb add docs readme (#1359) 2021-03-30 16:37:46 +08:00
1910 changed files with 270108 additions and 61350 deletions

36
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,36 @@
# This file is a github code protect rule follow the codeowners https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners#example-of-a-codeowners-file
* @barnettZQG @wonderflow @leejanee
design/ @barnettZQG @leejanee @wonderflow
# Owner of CUE
pkg/cue @leejanee @FogDong
pkg/stdlib @leejanee @FogDong
# Owner of Workflow
pkg/workflow @leejanee @FogDong
# Owner of rollout
pkg/controller/common/rollout/ @wangyikewxgm @wonderflow
pkg/controller/core.oam.dev/v1alpha2/applicationrollout @wangyikewxgm @wonderflow
pkg/controller/standard.oam.dev/v1alpha1/rollout @wangyikewxgm @wonderflow
runtime/rollout @wangyikewxgm @wonderflow
# Owner of definition controller
pkg/controller/core.oam.dev/v1alpha2/core/workflow/workflowstepdefinition @yangsoon @Somefive
pkg/controller/core.oam.dev/v1alpha2/core/policies/policydefinition @yangsoon @Somefive
pkg/controller/core.oam.dev/v1alpha2/core/components/componentdefinition @yangsoon @zzxwill
pkg/controller/core.oam.dev/v1alpha2/core/traits/traitdefinition @yangsoon @zzxwill
# Owner of health scope controller
pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope @captainroy-hy @zzxwill
# Owner of vela templates
vela-templates/ @Somefive @barnettZQG @wonderflow
# Owner of vela CLI
references/cli/ @Somefive @zzxwill
# Owner of vela APIServer
pkg/apiserver/ @barnettZQG @yangsoon

View File

@@ -15,9 +15,9 @@ A clear and concise description of what the bug is.
**To Reproduce**
<!--
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
1. The YAML files of Component/Trait I used.
2. The YAML file of Application I applied.
3. Other operations I have done.
4. See error
-->
@@ -31,6 +31,12 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
-->
**KubeVela Version**
<!--
Describe your KubeVela controller or CLI version information.
-->
**Cluster information**
<!--
Describe your kubernetes cluster information.

View File

@@ -1 +0,0 @@
blank_issues_enabled: true

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Questions & Help
url: https://github.com/oam-dev/kubevela/discussions
about: Please ask and answer questions here.

37
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,37 @@
### Description of your changes
<!--
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 #
I have:
- [ ] Read and followed KubeVela's [contribution process](https://github.com/kubevela/kubevela/blob/master/contribute/create-pull-request.md).
- [ ] [Related Docs](https://github.com/kubevela/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.
-->

31
.github/bot.md vendored Normal file
View File

@@ -0,0 +1,31 @@
### GitHub & kubevela automation
The bot is configured via [issue-commands.json](https://github.com/kubevela/kubevela/blob/master/.github/workflows/issue-commands.json)
and some other GitHub [workflows](https://github.com/kubevela/kubevela/blob/master/.github/workflows).
By default, users with write access to the repo is allowed to use the comments,
the [userlist](https://github.com/kubevela/kubevela/blob/master/.github/comment.userlist)
file is for adding additional members who do not have access and want to contribute to the issue triage.
Comment commands:
* Write the word `/needsInvestigation` in a comment, and the bot will add the corresponding label.
* Write the word `/needsMoreInfo` in a comment, and the bot will add the correct label and standard message.
* Write the word `/duplicate #<number>` to have `type/duplicate` label, the issue number is required for remind where is the other issue.
* Write the word `/type/*` in a comment, and the bot will add the corresponding label `/type/*`.
* Write the word `/area/*` in a comment, and the bot will add the corresponding label `/area/*`.
* Write the word `/priority/*` in a comment, and the bot will add the corresponding label `/priority/*`.
The `*` mention above represent a specific word. Please read the details about label category in [ISSUE_TRIAGE.md](https://github.com/kubevela/kubevela/blob/master/ISSUE_TRIAGE.md)
Label commands:
* Add label `bot/question` the bot will close with standard question message and add label `type/question`
* Add label `bot/needs more info` for bot to request more info (or use comment command mentioned above)
* Add label `bot/no new info` for bot to close an issue where we asked for more info but has not received any updates in at least 14 days.
* Add label `bot/duplicate` to have `type/duplicate` label & the bot will close issue with an appropriate message.
* Add label `bot/close feature request` for bot to close a feature request with standard message.
Assign:
When you participating in an issue area, and you want to assign to others
to distribute this task or self-assign to give a solution. You can use the comment bellow.
* Write the word `/assign githubname` in a comment, the robot will automatically assign to the corresponding person.
* Specially, write the word `/assign` in a comment, you can assgin this task to yourself.

14
.github/comment.userlist vendored Normal file
View File

@@ -0,0 +1,14 @@
resouer
wonderflow
hongchaodeng
zzxwill
ryanzhang-oss
captainroy-hy
wangyikewxgm
BinaryHB0916
yangsoon
wangyuan249
chivalryq
FogDong
leejanee
barnettZQG

153
.github/issue-commands.json vendored Normal file
View File

@@ -0,0 +1,153 @@
[
{
"type": "comment",
"name": "needsMoreInfo",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "needs more info"
},
{
"type": "comment",
"name": "needsInvestigation",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "needs investigation"
},
{
"type": "comment",
"name": "assign",
"allowUsers": ["*"]
},
{
"type": "comment",
"name": "type/bug",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "type/bug"
},
{
"type": "comment",
"name": "type/docs",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "type/docs"
},
{
"type": "comment",
"name": "type/enhancement",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "type/enhancement"
},
{
"type": "comment",
"name": "priority/critical",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "priority/critical"
},
{
"type": "comment",
"name": "priority/important-soon",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "priority/important-soon"
},
{
"type": "comment",
"name": "priority/important-longterm",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "priority/important-longterm"
},
{
"type": "comment",
"name": "priority/nice-to-have",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "priority/nice-to-have"
},
{
"type": "comment",
"name": "priority/awaiting-more-evidence",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "priority/awaiting-more-evidence"
},
{
"type": "comment",
"name": "priority/unscheduled",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "priority/unscheduled"
},
{
"type": "comment",
"name": "area/appconfig",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "area/appconfig"
},
{
"type": "comment",
"name": "area/application",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "area/application"
},
{
"type": "comment",
"name": "area/component",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "area/component"
},
{
"type": "comment",
"name": "area/controller",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "area/controller"
},
{
"type": "comment",
"name": "area/cue",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "area/cue"
},
{
"type": "comment",
"name": "area/trait",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "area/trait"
},
{
"type": "comment",
"name": "duplicate",
"allowUsers": [],
"action": "updateLabels",
"addLabel": "type/duplicate"
},
{
"type": "label",
"name": "bot/duplicate",
"addLabel": "type/duplicate",
"removeLabel": "bot/duplicate",
"action": "close",
"comment": "Thanks for creating this issue! It looks like this has already been reported by another user. Weve closed this in favor of the existing one. Please consider adding any details you think is missing to that issue.\n\nTo avoid having your issue closed in the future, please read our [CONTRIBUTING](https://github.com/oam-dev/kubevela/blob/master/CONTRIBUTING.md) guidelines.\n\nHappy graphing!"
},
{
"type": "label",
"name": "bot/no new info",
"action": "close",
"comment": "We've closed this issue since it needs more information and hasn't had any activity recently. We can re-open it after you you add more information. To avoid having your issue closed in the future, please read our [CONTRIBUTING](https://github.com/oam-dev/kubevela/blob/master/CONTRIBUTING.md) guidelines.\n\nHappy graphing!"
},
{
"type": "label",
"name": "bot/close feature request",
"action": "close",
"comment": "This feature request has been open for a long time with few received upvotes or comments, so we are closing it. We're trying to limit open GitHub issues in order to better track planned work and features. \r\n\r\nThis doesn't mean that we'll never ever implement it or that we will never accept a PR for it. A closed issue can still attract upvotes and act as a ticket to track feature demand\/interest. \r\n\r\nThank You to you for taking the time to create this issue!"
}
]

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"]
}
}

143
.github/workflows/apiserver-test.yaml vendored Normal file
View File

@@ -0,0 +1,143 @@
name: APIServer Unit Test & E2E Test
on:
push:
branches:
- master
- release-*
- apiserver
tags:
- v*
workflow_dispatch: { }
pull_request:
branches:
- master
- release-*
- apiserver
env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
KIND_IMAGE_VERSION: '[\"v1.20.7\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.7\",\"v1.22.7\"]'
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
set-k8s-matrix:
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.set-k8s-matrix.outputs.matrix }}
steps:
- id: set-k8s-matrix
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "pushing tag: ${{ github.ref_name }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
else
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
fi
apiserver-unit-tests:
runs-on: aliyun
needs: [ detect-noop,set-k8s-matrix ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ${{ fromJson(needs.set-k8s-matrix.outputs.matrix) }}
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:${{ matrix.k8s-version }} --name worker
kubectl version
kubectl cluster-info
kind get kubeconfig --name worker --internal > /tmp/worker.kubeconfig
kind get kubeconfig --name worker > /tmp/worker.client.kubeconfig
- name: Setup Kind Cluster (Hub)
run: |
kind delete cluster
kind create cluster --image kindest/node:${{ matrix.k8s-version }}
kubectl version
kubectl cluster-info
- name: Run api server unit test
run: make unit-test-apiserver
- 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 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 }}

89
.github/workflows/chart.yaml vendored Normal file
View File

@@ -0,0 +1,89 @@
name: Publish Chart
on:
push:
tags:
- "v*"
workflow_dispatch: { }
env:
BUCKET: ${{ secrets.OSS_BUCKET }}
ENDPOINT: ${{ secrets.OSS_ENDPOINT }}
ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
ARTIFACT_HUB_REPOSITORY_ID: ${{ secrets.ARTIFACT_HUB_REPOSITORY_ID }}
jobs:
publish-charts:
env:
HELM_CHARTS_DIR: charts
HELM_CHART: charts/vela-core
MINIMAL_HELM_CHART: charts/vela-minimal
LEGACY_HELM_CHART: legacy/charts/vela-core-legacy
VELA_ROLLOUT_HELM_CHART: runtime/rollout/charts
LOCAL_OSS_DIRECTORY: .oss/
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- name: Get git revision
id: vars
shell: bash
run: |
echo "::set-output name=git_revision::$(git rev-parse --short HEAD)"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0
- name: 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
rsync -r $HELM_CHART/* $LEGACY_HELM_CHART --exclude=Chart.yaml --exclude=crds
- name: Prepare vela chart
run: |
rsync -r $VELA_ROLLOUT_HELM_CHART $HELM_CHARTS_DIR
- name: Get the version
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo ::set-output name=VERSION::${VERSION}
- name: Tag helm chart image
run: |
image_tag=${{ steps.get_version.outputs.VERSION }}
chart_version=${{ steps.get_version.outputs.VERSION }}
sed -i "s/latest/${image_tag}/g" $HELM_CHART/values.yaml
sed -i "s/latest/${image_tag}/g" $MINIMAL_HELM_CHART/values.yaml
sed -i "s/latest/${image_tag}/g" $LEGACY_HELM_CHART/values.yaml
sed -i "s/latest/${image_tag}/g" $VELA_ROLLOUT_HELM_CHART/values.yaml
chart_smever=${chart_version#"v"}
sed -i "s/0.1.0/$chart_smever/g" $HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $MINIMAL_HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $LEGACY_HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $VELA_ROLLOUT_HELM_CHART/Chart.yaml
- name: Install ossutil
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
- name: Configure Alibaba Cloud OSSUTIL
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT} -c .ossutilconfig
- name: sync cloud to local
run: ./ossutil --config-file .ossutilconfig sync oss://$BUCKET/core $LOCAL_OSS_DIRECTORY
- name: add artifacthub stuff to the repo
run: |
rsync $HELM_CHART/README.md $LEGACY_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
run: |
helm package $HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $MINIMAL_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $LEGACY_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $VELA_ROLLOUT_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm repo index --url https://$BUCKET.$ENDPOINT/core $LOCAL_OSS_DIRECTORY
- name: sync local to cloud
run: ./ossutil --config-file .ossutilconfig sync $LOCAL_OSS_DIRECTORY oss://$BUCKET/core -f

View File

@@ -1,19 +0,0 @@
name: check-docs
on:
pull_request:
paths:
- 'docs/**'
branches:
- master
- release-*
jobs:
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Test Build
run: |
sh ./hack/website/test-build.sh

30
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: "CodeQL"
on:
push:
branches: [ master, release-* ]
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

19
.github/workflows/commit-lint.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: PR Title Checker
on:
pull_request:
types:
- opened
- edited
- synchronize
- labeled
- unlabeled
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: thehanimo/pr-title-checker@v1.3.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pass_on_octokit_error: true
configuration_path: ".github/pr-title-checker-config.json"

View File

@@ -0,0 +1,131 @@
name: E2E MultiCluster Test
on:
push:
branches:
- master
- release-*
tags:
- v*
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
KIND_IMAGE_VERSION: '[\"v1.20.7\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.7\",\"v1.22.7\"]'
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
set-k8s-matrix:
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.set-k8s-matrix.outputs.matrix }}
steps:
- id: set-k8s-matrix
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "pushing tag: ${{ github.ref_name }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
else
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
fi
e2e-multi-cluster-tests:
runs-on: aliyun
needs: [ detect-noop,set-k8s-matrix ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ${{ fromJson(needs.set-k8s-matrix.outputs.matrix) }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
- name: Setup Kind Cluster (Worker)
run: |
kind delete cluster --name worker
kind create cluster --image kindest/node:${{ matrix.k8s-version }} --name worker
kubectl version
kubectl cluster-info
kind get kubeconfig --name worker --internal > /tmp/worker.kubeconfig
kind get kubeconfig --name worker > /tmp/worker.client.kubeconfig
- name: Setup Kind Cluster (Hub)
run: |
kind delete cluster
kind create cluster --image kindest/node:${{ matrix.k8s-version }}
kubectl version
kubectl cluster-info
- name: Load Image to kind cluster (Hub)
run: make kind-load
- name: Cleanup for e2e tests
run: |
make e2e-cleanup
make vela-cli
make e2e-setup-core-auth
make
make setup-runtime-e2e-cluster
- name: Run e2e multicluster tests
run: |
export PATH=$(pwd)/bin:$PATH
make e2e-multicluster-test
- name: Stop kubevela, get profile
run: make end-e2e-core
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/e2e-profile.out,/tmp/e2e_multicluster_test.out
flags: e2e-multicluster-test
name: codecov-umbrella
- name: Clean e2e profile
run: rm /tmp/e2e-profile.out
- name: Cleanup image
if: ${{ always() }}
run: make image-cleanup

123
.github/workflows/e2e-rollout-test.yml vendored Normal file
View File

@@ -0,0 +1,123 @@
name: E2E Rollout Test
on:
push:
branches:
- master
- release-*
tags:
- v*
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
KIND_IMAGE_VERSION: '[\"v1.20.7\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.7\",\"v1.22.7\"]'
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
set-k8s-matrix:
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.set-k8s-matrix.outputs.matrix }}
steps:
- id: set-k8s-matrix
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "pushing tag: ${{ github.ref_name }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
else
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
fi
e2e-rollout-tests:
runs-on: aliyun
needs: [ detect-noop,set-k8s-matrix ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ${{ fromJson(needs.set-k8s-matrix.outputs.matrix) }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
- name: Setup Kind Cluster
run: |
kind delete cluster
kind create cluster --image kindest/node:${{ matrix.k8s-version }}
kubectl version
kubectl cluster-info
- name: Load Image to kind cluster
run: make kind-load
- name: Run Make
run: make
- name: Run Make Manager
run: make manager
- name: Prepare for e2e tests
run: |
make e2e-cleanup
make e2e-setup
helm lint ./charts/vela-core
helm test -n vela-system kubevela --timeout 5m
- name: Run e2e tests
run: make e2e-rollout-test
- name: Stop kubevela, get profile
run: make end-e2e
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/e2e-profile.out
flags: e2e-rollout-tests
name: codecov-umbrella
- name: Clean e2e profile
run: rm /tmp/e2e-profile.out
- name: Cleanup image
if: ${{ always() }}
run: make image-cleanup

129
.github/workflows/e2e-test.yml vendored Normal file
View File

@@ -0,0 +1,129 @@
name: E2E Test
on:
push:
branches:
- master
- release-*
tags:
- v*
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
KIND_IMAGE_VERSION: '[\"v1.20.7\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.7\",\"v1.22.7\"]'
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
set-k8s-matrix:
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.set-k8s-matrix.outputs.matrix }}
steps:
- id: set-k8s-matrix
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "pushing tag: ${{ github.ref_name }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
else
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
fi
e2e-tests:
runs-on: aliyun
needs: [ detect-noop,set-k8s-matrix ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ${{ fromJson(needs.set-k8s-matrix.outputs.matrix) }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
- name: Setup Kind Cluster
run: |
kind delete cluster
kind create cluster --image kindest/node:${{ matrix.k8s-version }}
kubectl version
kubectl cluster-info
- name: Load Image to kind cluster
run: make kind-load
- name: Run Make
run: make
- name: Run Make Manager
run: make manager
- name: Prepare for e2e tests
run: |
make e2e-cleanup
make e2e-setup
helm lint ./charts/vela-core
helm test -n vela-system kubevela --timeout 5m
- name: Run api e2e tests
run: make e2e-api-test
- name: Run addons e2e tests
run: make e2e-addon-test
- name: Run e2e tests
run: make e2e-test
- name: Stop kubevela, get profile
run: make end-e2e
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/e2e-profile.out
flags: e2etests
name: codecov-umbrella
- name: Clean e2e profile
run: rm /tmp/e2e-profile.out
- name: Cleanup image
if: ${{ always() }}
run: make image-cleanup

View File

@@ -13,9 +13,8 @@ on:
env:
# Common versions
GO_VERSION: '1.14'
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
DOCKER_BUILDX_VERSION: 'v0.4.2'
KIND_VERSION: 'v0.7.0'
jobs:
@@ -30,164 +29,21 @@ jobs:
uses: fkirc/skip-duplicate-actions@v3.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.png", "**.jpg"]'
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
unit-tests:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go 1.14
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: wonderflow/kubebuilder-action@v1.1
- name: Run Make test
run: make test
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unittests
name: codecov-umbrella
compatibility-test:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go 1.14
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: wonderflow/kubebuilder-action@v1.1
- name: Run Make compatibility-test
run: make compatibility-test
- name: Clean up testdata
run: make compatibility-testdata-cleanup
e2e-tests:
runs-on: aliyun
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
- name: Setup Kind Cluster
run: |
kind delete cluster
kind create cluster
kubectl version
kubectl cluster-info
- name: Load Image to kind cluster
run: make kind-load
- name: Run Make
run: make
- name: Run Make Manager
run: make manager
- name: Prepare for e2e tests
run: |
make e2e-cleanup
make e2e-setup
- name: Wait for e2e preparation ready
run: |
timeout 60 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:38081/api/components)" != "200" ]]; do sleep 5; done' || false
- name: Run api e2e tests
run: make e2e-api-test
- name: Run e2e tests
run: make e2e-test
- name: Cleanup image
if: ${{ always() }}
run: make image-cleanup
staticcheck:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout
uses: actions/checkout@v2
with:
@@ -200,8 +56,11 @@ jobs:
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Install StaticCheck
run: GO111MODULE=on go get honnef.co/go/tools/cmd/staticcheck@v0.3.0
- name: Static Check
run: go run honnef.co/go/tools/cmd/staticcheck -- ./...
run: staticcheck ./...
- name: License Header Check
run: make check-license-header
@@ -212,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:
@@ -229,12 +93,12 @@ 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 }}
check-diff:
runs-on: ubuntu-20.04
runs-on: aliyun
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
@@ -249,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:
@@ -259,23 +128,11 @@ jobs:
- name: Check code formatting
run: go install golang.org/x/tools/cmd/goimports && make fmt
- name: Check Diff
run: make check-diff
build-cli:
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Run cross-build
run: make cross-build
- name: Run compress binary
run: make compress
- name: Check Diff
run: make check-diff
- name: Cleanup binary
run: make build-cleanup

69
.github/workflows/issue-commands.yml vendored Normal file
View File

@@ -0,0 +1,69 @@
name: Run commands when issues are labeled or comments added
on:
issues:
types: [labeled, opened]
issue_comment:
types: [created]
jobs:
bot:
runs-on: ubuntu-latest
steps:
- name: Checkout Actions
uses: actions/checkout@v2
with:
repository: "oam-dev/kubevela-github-actions"
path: ./actions
ref: v0.4.2
- name: Install 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

@@ -8,14 +8,11 @@ on:
workflow_dispatch: {}
env:
BUCKET: kubevelacharts
ENDPOINT: oss-cn-hangzhou.aliyuncs.com
ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
ARTIFACT_HUB_REPOSITORY_ID: ${{ secrets.ARTIFACT_HUB_REPOSITORY_ID }}
jobs:
publish-images:
publish-core-images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
@@ -36,18 +33,27 @@ jobs:
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login docker.io
uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login Alibaba Cloud ACR
uses: docker/login-action@v1
with:
registry: ${{ secrets.ACR_DOMAIN }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
with:
driver-opts: image=moby/buildkit:master
- uses: docker/build-push-action@v2
name: Build & Pushing
name: Build & Pushing vela-core for Dockerhub, GHCR and ACR
with:
context: .
file: Dockerfile
@@ -59,72 +65,124 @@ 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_owner }}/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
publish-charts:
env:
HELM_CHARTS_DIR: charts
HELM_CHART: charts/vela-core
LEGACY_HELM_CHART: legacy/charts/vela-core-legacy
LOCAL_OSS_DIRECTORY: .oss/
runs-on: ubuntu-20.04
- uses: docker/build-push-action@v2
name: Build & Pushing CLI for Dockerhub, GHCR and ACR
with:
context: .
file: Dockerfile.cli
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-cli:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository_owner }}/oamdev/vela-cli:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/vela-cli:${{ steps.get_version.outputs.VERSION }}
publish-addon-images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Get the version
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
VERSION=latest
fi
echo ::set-output name=VERSION::${VERSION}
- name: Get git revision
id: vars
shell: bash
run: |
echo "::set-output name=git_revision::$(git rev-parse --short HEAD)"
- name: Install Helm
uses: azure/setup-helm@v1
- name: Login ghcr.io
uses: docker/login-action@v1
with:
version: v3.4.0
- name: Prepare legacy chart
run: |
rsync -r $LEGACY_HELM_CHART $HELM_CHARTS_DIR
rsync -r $HELM_CHART/* $LEGACY_HELM_CHART --exclude=Chart.yaml --exclude=crds
- uses: oprypin/find-latest-tag@v1
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login docker.io
uses: docker/login-action@v1
with:
repository: oam-dev/kubevela
releases-only: true
id: latest_tag
- name: Tag helm chart image
run: |
latest_repo_tag=${{ steps.latest_tag.outputs.tag }}
sub="."
major="$(cut -d"$sub" -f1 <<<"$latest_repo_tag")"
minor="$(cut -d"$sub" -f2 <<<"$latest_repo_tag")"
patch="0"
next_repo_tag="$major.$(($minor + 1)).$patch"
image_tag=${GITHUB_REF#refs/tags/}
chart_version=$latest_repo_tag
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
image_tag=latest
chart_version=${next_repo_tag}-rc-master
fi
sed -i "s/latest/${image_tag}/g" $HELM_CHART/values.yaml
sed -i "s/latest/image_tag/g" $LEGACY_HELM_CHART/values.yaml
chart_smever=${chart_version#"v"}
sed -i "s/0.1.0/$chart_smever/g" $HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $LEGACY_HELM_CHART/Chart.yaml
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login Alibaba Cloud ACR
uses: docker/login-action@v1
with:
registry: ${{ secrets.ACR_DOMAIN }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
with:
driver-opts: image=moby/buildkit:master
- uses: docker/build-push-action@v2
name: Build & Pushing vela-apiserver for Dockerhub, GHCR and ACR
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_owner }}/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }}
- uses: docker/build-push-action@v2
name: Build & Pushing runtime rollout Dockerhub, GHCR and ACR
with:
context: .
file: runtime/rollout/Dockerfile
labels: |-
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
build-args: |
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
GOPROXY=https://proxy.golang.org
tags: |-
docker.io/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository_owner }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
publish-capabilities:
env:
CAPABILITY_BUCKET: kubevela-registry
CAPABILITY_DIR: capabilities
CAPABILITY_ENDPOINT: oss-cn-beijing.aliyuncs.com
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- name: Install ossutil
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
- name: Configure Alibaba Cloud OSSUTIL
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT} -c .ossutilconfig
- name: sync cloud to local
run: ./ossutil --config-file .ossutilconfig sync oss://$BUCKET/core $LOCAL_OSS_DIRECTORY
- name: add artifacthub stuff to the repo
run: |
rsync README.md $HELM_CHART/README.md
rsync README.md $LEGACY_HELM_CHART/README.md
sed -i "s/ARTIFACT_HUB_REPOSITORY_ID/$ARTIFACT_HUB_REPOSITORY_ID/g" hack/artifacthub/artifacthub-repo.yml
rsync hack/artifacthub/artifacthub-repo.yml $LOCAL_OSS_DIRECTORY
- name: Package helm charts
run: |
helm package $HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $LEGACY_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm repo index --url https://$BUCKET.$ENDPOINT/core $LOCAL_OSS_DIRECTORY
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${CAPABILITY_ENDPOINT} -c .ossutilconfig
- name: sync capabilities bucket to local
run: ./ossutil --config-file .ossutilconfig sync oss://$CAPABILITY_BUCKET $CAPABILITY_DIR
- name: rsync all capabilites
run: rsync vela-templates/registry/auto-gen/* $CAPABILITY_DIR
- name: sync local to cloud
run: ./ossutil --config-file .ossutilconfig sync $LOCAL_OSS_DIRECTORY oss://$BUCKET/core -f
run: ./ossutil --config-file .ossutilconfig sync $CAPABILITY_DIR oss://$CAPABILITY_BUCKET -f

View File

@@ -1,21 +0,0 @@
name: docs
on:
push:
paths:
- 'docs/**'
branches:
- master
- release-*
jobs:
release-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Sync to kubevela.io Repo
uses: wonderflow/auto-docs-action@v0.2.3
env:
SSH_PRIVATE_KEY: ${{ secrets.GH_PAGES_DEPLOY }}
VERSION: ${{ github.ref }}
COMMIT_ID: ${{ github.sha }}
with:
gh-page: git@github.com:oam-dev/kubevela.io.git

View File

@@ -4,82 +4,173 @@ 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 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
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 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-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 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-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 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-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 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-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 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-windows-amd64.tar.gz
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Windows zip
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
if: ${{ !contains(env.VELA_VERSION,'alpha') && !contains(env.VELA_VERSION,'beta') }}
run: |
LATEST_VERSION=$(curl -fsSl https://static.kubevela.net/binary/vela/latest_version)
verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
verlte ${{ env.VELA_VERSION }} $LATEST_VERSION && echo "${{ env.VELA_VERSION }} <= $LATEST_VERSION, skip update" && exit 0
echo ${{ env.VELA_VERSION }} > ./latest_version
./ossutil --config-file .ossutilconfig cp -u ./latest_version oss://$BUCKET/binary/vela/latest_version
upload-plugin-homebrew:
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-windows-amd64.zip
asset_name: 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
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

37
.github/workflows/sync-api.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: sync-api
on:
push:
paths:
- 'apis/**'
- 'pkg/oam/**'
tags:
- "v*"
jobs:
sync-core-api:
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.17
uses: actions/setup-go@v1
env:
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Sync to kubevela-core-api Repo
env:
SSH_DEPLOY_KEY: ${{ secrets.VELA_API_DEPLOY }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
COMMIT_ID: ${{ github.sha }}
run: |
bash ./hack/apis/clientgen.sh
bash ./hack/apis/sync.sh

10
.github/workflows/timed-task.yml vendored Normal file
View File

@@ -0,0 +1,10 @@
name: Timed Task
on:
schedule:
- cron: '* * * * *'
jobs:
clean-image:
runs-on: aliyun
steps:
- name: Cleanup image
run: docker image prune -f

30
.github/workflows/trivy-scan.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: "Trivy Scan"
on:
pull_request:
branches: [ master ]
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'

85
.github/workflows/unit-test.yml vendored Normal file
View File

@@ -0,0 +1,85 @@
name: Unit-Test
on:
push:
branches:
- master
- release-*
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
env:
# Common versions
GO_VERSION: '1.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
unit-tests:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
submodules: true
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Install ginkgo
run: |
sudo apt-get install -y golang-ginkgo-dev
- name: Setup Kind Cluster
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ env.KIND_VERSION }}
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@v1.2
with:
version: 3.1.0
kubebuilderOnly: false
kubernetesVersion: v1.21.2
- name: Run Make test
run: make test
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: core-unittests
name: codecov-umbrella

15
.gitignore vendored
View File

@@ -41,17 +41,12 @@ references/cmd/cli/fake/source.go
references/cmd/cli/fake/chart_source.go
charts/vela-core/crds/_.yaml
.test_vela
tmp/
.vela/
# Dashboard
node_modules/
.eslintcache
references/dashboard/dist/
references/dashboard/package-lock.json
references/dashboard/src/.umi/
package-lock.json
references/dashboard/src/.umi-production/
# check docs
git-page/
# Swagger: generate Restful API
references/apiserver/docs/index.html
# e2e rollout runtime image build
runtime/rollout/e2e/tmp

47
.krew.yaml Normal file
View File

@@ -0,0 +1,47 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: vela
spec:
version: "{{ .TagName }}"
platforms:
- selector:
matchLabels:
os: linux
arch: amd64
{{addURIAndSha "https://github.com/oam-dev/kubevela/releases/download/{{ .TagName }}/kubectl-vela-{{ .TagName }}-linux-amd64.tar.gz" .TagName }}
files:
- from: "*/kubectl-vela"
to: "."
- from: "*/LICENSE"
to: "."
bin: "kubectl-vela"
- selector:
matchLabels:
os: darwin
arch: amd64
{{addURIAndSha "https://github.com/oam-dev/kubevela/releases/download/{{ .TagName }}/kubectl-vela-{{ .TagName }}-darwin-amd64.tar.gz" .TagName }}
files:
- from: "*/kubectl-vela"
to: "."
- from: "*/LICENSE"
to: "."
bin: "kubectl-vela"
- selector:
matchLabels:
os: windows
arch: amd64
{{addURIAndSha "https://github.com/oam-dev/kubevela/releases/download/{{ .TagName }}/kubectl-vela-{{ .TagName }}-windows-amd64.zip" .TagName }}
files:
- from: "*/kubectl-vela"
to: "kubectl-vela.exe"
- from: "*/LICENSE"
to: "."
bin: "kubectl-vela.exe"
shortDescription: Easily interact with KubeVela
homepage: https://kubevela.io
description: |
kubectl vela is a kubectl plugin from the KubeVela project. KubeVela is
a modern application platform that is fully self-service, and adapts to
your needs when you grow. This plugin allows you to better view, manage
and maintain KubeVela applications.

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/kubevela/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,133 +1,3 @@
# CONTRIBUTING Guide
## About KubeVela
KubeVela project is initialized and maintained by the cloud native community since day 0 with [bootstrapping contributors from 8+ different organizations](https://github.com/oam-dev/kubevela/graphs/contributors).
We intend for KubeVela to have an open governance since the very beginning and donate the project to neutral foundation as soon as it's released.
This doc explains how to set up a development environment, so you can get started
contributing to `kubevela` or build a PoC (Proof of Concept).
## Development
### Prerequisites
1. Golang version 1.13+
2. Kubernetes version v1.16+ with `~/.kube/config` configured.
3. ginkgo 1.14.0+ (just for [E2E test](./CONTRIBUTING.md#e2e-test))
4. golangci-lint 1.31.0+, it will install automatically if you run `make`, you can [install it manually](https://golangci-lint.run/usage/install/#local-installation) if the installation is too slow.
We also recommend you to learn about KubeVela's [design](https://kubevela.io/#/en/concepts) before dive into its code.
### Build
* Clone this project
```shell script
git clone git@github.com:oam-dev/kubevela.git
```
KubeVela includes two parts, `vela core` and `vela cli`.
- The `vela core` is actually a K8s controller, it will watch OAM Spec CRD and deploy resources.
- The `vela cli` is a command line tool that can build, run apps(with the help of `vela core`).
For local development, we probably need to build both of them.
* Build Vela CLI
```shell script
make
```
After the vela cli built successfully, `make` command will create `vela` binary to `bin/` under the project.
* Configure `vela` binary to System PATH
```shell script
export PATH=$PATH:/your/path/to/project/kubevela/bin
```
Then you can use `vela` command directly.
* Build Vela Core
```shell script
make manager
```
* Run Vela Core
Firstly make sure your cluster has CRDs, below is the command that can help install all CRDs.
```shell script
make core-install
```
Run locally:
```shell script
make core-run
```
This command will run controller locally, it will use your local KubeConfig which means you need to have a k8s cluster
locally. If you don't have a one, we suggest that you could setup up a cluster with [kind](https://kind.sigs.k8s.io/).
When you're developing `vela-core`, make sure the controller installed by helm chart is not running.
Otherwise, it will conflict with your local running controller.
You can check and uninstall it by using helm.
```shell script
helm list -A
helm uninstall -n vela-system kubevela
```
### Use
You can try use your local built binaries follow [the documentation](https://kubevela.io/#/en/quick-start).
## Testing
### Unit test
```shell script
make test
```
### E2E test
**Before e2e test start, make sure you have vela-core running.**
```shell script
make core-run
```
Start to test.
```
make e2e-test
```
## Make a pull request
Remember to write unit-test and e2e-test after you have finished your code.
Run following checks before making a pull request.
```shell script
make reviewable
```
The command will do some lint checks and clean code.
After that, check in all changes and send a pull request.
## Merge Regulations
Before merging, the pull request should obey the following rules:
- The commit title and message should be clear about what this PR does.
- All test CI should pass green.
- The `codecov/project` should pass. This means the coverage should not drop. See [Codecov commit status](https://docs.codecov.io/docs/commit-status#project-status).
Please refer to https://kubevela.io/docs/contributor/overview for details.

View File

@@ -1,42 +1,51 @@
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.14 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
# 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 CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on \
go build -a -ldflags "-X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
-o manager-${TARGETARCH} main.go
# Use ubuntu as base image for convenience.
# 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
# Could use `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot` to overwrite
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-ubuntu:latest}
# This is required by daemon connnecting with cri
RUN ln -s /usr/bin/* /usr/sbin/ && apt-get update -y \
&& apt-get install --no-install-recommends -y ca-certificates \
&& apt-get clean && rm -rf /var/log/*log /var/lib/apt/lists/* /var/log/apt/* /var/lib/dpkg/*-old /var/cache/debconf/*-old
# 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 connecting with cri
RUN apk add --no-cache ca-certificates bash expat
WORKDIR /
ARG TARGETARCH
COPY --from=builder /workspace/manager-${TARGETARCH} /manager
COPY --from=builder /workspace/manager-${TARGETARCH} /usr/local/bin/manager
ENTRYPOINT ["/manager"]
COPY entrypoint.sh /usr/local/bin/
ENTRYPOINT ["entrypoint.sh"]
CMD ["manager"]

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 connecting 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"]

43
Dockerfile.cli Normal file
View File

@@ -0,0 +1,43 @@
ARG BASE_IMAGE
# Build the cli binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
ARG GOPROXY
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
COPY apis/ apis/
COPY pkg/ pkg/
COPY version/ version/
COPY references/ references/
# Build
ARG TARGETARCH
ARG VERSION
ARG GITVERSION
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH:-amd64} \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
-o vela-${TARGETARCH} ./references/cmd/cli/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 connecting with cri
RUN apk add --no-cache ca-certificates bash expat
WORKDIR /
ARG TARGETARCH
COPY --from=builder /workspace/vela-${TARGETARCH} /vela
ENTRYPOINT ["/vela"]

57
Dockerfile.e2e Normal file
View File

@@ -0,0 +1,57 @@
ARG BASE_IMAGE
# Build the manager binary
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
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
COPY cmd/core/main.go main.go
COPY cmd/core/main_e2e_test.go main_e2e_test.go
COPY cmd/apiserver/main.go cmd/apiserver/main.go
COPY cmd/ cmd/
COPY apis/ apis/
COPY pkg/ pkg/
COPY version/ version/
COPY references/ references/
# Build
ARG TARGETARCH
ARG VERSION
ARG GITVERSION
RUN apk add gcc musl-dev libc-dev ;\
GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go test -c -o manager-${TARGETARCH} -cover -covermode=atomic -coverpkg ./... .
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
-o apiserver-${TARGETARCH} cmd/apiserver/main.go
# Use alpine as base image due to the discussion in issue #1448
# You can replace distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
FROM ${BASE_IMAGE:-alpine:3.15}
# This is required by daemon connecting with cri
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/
VOLUME ["/workspace/data"]
ENTRYPOINT ["entrypoint.sh"]
CMD ["manager"]

16
GOVERNANCE.md Normal file
View File

@@ -0,0 +1,16 @@
# Governance
[Project maintainers](https://github.com/kubevela/community/blob/main/OWNERS.md#maintainers) are responsible for activities around maintaining and updating KubeVela.
Final decisions on the project reside with the project maintainers.
Maintainers **MUST** remain active. If they are unresponsive for >6 months,
they will be automatically removed unless a [super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) of the other project maintainers agrees to extend the period to be greater than 6 months.
New maintainers can be added to the project by a [super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) vote of the existing maintainers.
A potential maintainer may be nominated by an existing maintainer.
A vote is conducted in private between the current maintainers over the course of a one week voting period.
At the end of the week, votes are counted and a pull request is made on the repo adding the new maintainer to the [CODEOWNERS](https://github.com/kubevela/kubevela/blob/master/.github/CODEOWNERS) file.
A maintainer may step down by submitting an [issue](https://github.com/kubevela/kubevela/issues/new/choose) stating their intent.
Changes to this governance document require a pull request with approval from a [super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) of the current maintainers.

323
ISSUE_TRIAGE.md Normal file
View File

@@ -0,0 +1,323 @@
# Triage issues
The main goal of issue triage is to categorize all incoming KubeVela issues and make sure each issue has all basic
information needed for anyone else to understand and be able to start working on it.
> **Note:** This information is for OAM/KubeVela project Maintainers, Owners, and Admins.
> If you are a Contributor, then you will not be able to perform most of the tasks in this topic.
The core maintainers of the OAM/KubeVela project are responsible for categorizing all incoming issues and delegating
any critical or important issue to other maintainers. Currently one maintainer each week is responsible.
Besides that part, triage provides an important way to contribute to an open source project.
Triage helps ensure issues resolve quickly by:
- Ensuring the issue's intent and purpose is conveyed precisely. This is necessary because it can be difficult for
an issue to explain how an end user experiences a problem and what actions they took.
- Giving a contributor the information they need before they commit to resolving an issue.
- Lowering the issue count by preventing duplicate issues.
- Streamlining the development process by preventing duplicate discussions.
If you don't have the knowledge or time to code, consider helping with triage.
The community will thank you for saving them time by spending some of yours.
## Simplified flowchart diagram of the issue triage process
<!-- https://textik.com/#908a27a44c590528 -->
```
+-----------------------------+
| |
| New Issues Opened |
+-----------------+ |
| | Or More information needed |
| | |
| +--------------+--------------+
| Ask for more info |
| |
| +--------------+------------+
| | | Yes
| | All informatio needed |
| +-----------+ to categorize the issue +---------------+
| | No | | |
| | +---------------------------+ |
| | +-----------+-----------+ +---------------------------+
+------------+-----+-----+ | | Yes | |
| | | Needs investigation +---------+ label: needs investigation|
| label: needs more info | | | | |
| | +----------+------------+ +-------------+-------------+
+------------------------+ | |
| No |
| |
+----------+----------+ investigate |
| label: type/* | |
| label: area/* +--------------------------+
| |
+--|-------------|----+
| | Yes
| +-------|-------------+ +-------------------+
| | needs priority +----+ label: priority/* |
| +-------|-------------+ +----------|--------+
| | No |
| | |
+----- ------|---+ +--|----- --+ |
| close issue + ---- + done +---------------------+
+----------------+ +-----------+
```
## 1. Find uncategorized issues
To get started with issue triage and finding issues that haven't been triaged you have two alternatives.
### Browse unlabeled issues
The easiest and straight forward way of getting started and finding issues that haven't been triaged is to browse
[unlabeled issues](https://github.com/kubevela/kubevela/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and starting from
the bottom and working yourself to the top.
### Subscribe to all notifications
The more advanced, but recommended way is to subscribe to all notifications from this repository which means that
all new issues, pull requests, comments and important status changes are sent to your configured email address.
Read this [guide](https://help.github.com/en/articles/watching-and-unwatching-repositories#watching-a-single-repository)
for help with setting this up.
It's highly recommended that you setup filters to automatically remove emails from the inbox and label/categorize
them accordingly to make it easy for you to understand when you need to act upon a notification or where to look for
finding issues that haven't been triaged etc.
## 2. Ensure the issue contains basic information
Before triaging an issue very far, make sure that the issue's author provided the standard issue information.
This will help you make an educated recommendation on how to categorize the issue.
The KubeVela project utilizes [GitHub issue templates](https://help.github.com/en/articles/creating-issue-templates-for-your-repository)
to guide contributors to provide standard information that must be included for each type of template or type of issue.
### Standard issue information that must be included
Given a certain [issue template]([template](https://github.com/kubevela/kubevela/issues/new/choose)) have been used
by the issue author or depending how the issue is perceived by the issue triage responsible, the following should
help you understand what standard issue information that must be included.
#### Bug reports
Should explain what happened, what was expected and how to reproduce it together with any additional information that
may help giving a complete picture of what happened such as screenshots, application related YAMLs, and any environment
related information that's applicable and/or maybe related to the reported problem:
- KubeVela version
- K8s cluster version KubeVela is installed on
- Which other K8s CRD controllers used
- Development environment like Go versions, if applicable
#### Enhancement requests
Should explain what enhancement or feature that the author wants to be added and why that is needed.
### Good practices
To make it easier for everyone to understand and find issues they're searching for it's suggested as a general rule of thumbs to:
- Make sure that issue titles are named to explain the subject of the issue, has a correct spelling and doesn't include irrelevant information and/or sensitive information.
- Make sure that issue descriptions doesn't include irrelevant information, information from template that haven't been filled out and/or sensitive information.
- Do your best effort to change title and description or request suggested changes by adding a comment.
> **Note:** Above rules is applicable to both new and existing issues of the KubeVela project.
### Do you have all the information needed to categorize an issue?
Depending on the issue, you might not feel all this information is needed. Use your best judgement.
If you cannot triage an issue using what its author provided, explain kindly to the author that they must provide the
above information to clarify the problem. Label issue with `needs more info` and add any related `area/*` or `type/*` labels.
If the author provides the standard information but you are still unable to triage the issue, request additional information.
Do this kindly and politely because you are asking for more of the author's time.
If the author does not respond to the requested information within the timespan of a week,
close the issue with a kind note stating that the author can request for the issue to be reopened when the necessary information is provided.
When you feel you have all the information needed you're ready to [categorizing the issue](#3-categorizing-an-issue).
If you receive a notification with additional information provided but you are not anymore on issue triage and
you feel you do not have time to handle it, you should delegate it to the current person on issue triage.
## 3. Categorizing an issue
An issue can have multiple of the following labels. Typically, a properly categorized issue should at least have:
- One label identifying its type (`type/*`).
- One or multiple labels identifying the functional areas of interest or component (`area/*`), if applicable.
| Label | Description |
| ------------------------ | ------------------------------------------------------------------------- |
| `type/bug` | A feature isn't working as expected given design or documentation. |
| `type/enhancement` | Request for a new feature or enhancement. |
| `type/docs` | Documentation problem or enhancement. |
| `type/question` | Issue is a question or is perceived as such. |
| `type/duplicate` | An existing issue of the same subject/request have already been reported. |
| `type/wontfix` | A reported bug works as intended/by design. |
| `type/invalid` | A reported bug with invalid usage. |
| `area/*` | Subject is related to a functional area of interest or component. |
### Duplicate issues
Make sure it's not a duplicate by searching existing issues using related terms from the issue title and description.
If you think you know there is an existing issue, but can't find it, please reach out to one of the maintainers and ask for help.
If you identify that the issue is a duplicate of an existing issue:
1. Add a comment `/duplicate of #<issue number>`. GitHub will recognize this and add some additional context to the issue activity.
2. The KubeVela bot will do the rest, adding the correct label and closing comment
3. Optionally add any related `area/*` labels.
### Bug reports
If it's not perfectly clear that it's an actual bug, quickly try to reproduce it.
**It's a bug/it can be reproduced:**
1. Add a comment describing detailed steps for how to reproduce it, if applicable.
2. Label the issue `type/bug` and at least one `area/*` label.
3. If you know that maintainers won't be able to put any resources into it for some time then label the issue
with `help wanted` and optionally `good first issue` together with pointers on which code to update to fix the bug.
This should signal to the community that we would appreciate any help we can get to resolve this.
4. Move on to [prioritizing the issue](#4-prioritization-of-issues).
**It can't be reproduced:**
1. Either [ask for more information](#2-ensure-the-issue-contains-basic-information) needed to investigate it more thoroughly.
2. Either [delegate further investigations](#investigation-of-issues) to someone else.
**It works as intended/by design:**
1. Kindly and politely add a comment explaining briefly why we think it works as intended and close the issue.
2. Label the issue `type/wontfix`.
### Enhancement/feature?
1. Label the issue `type/enhancement` and at least one `area/*` label.
2. Move on to [prioritizing the issue](#4-prioritization-of-issues).
### Documentation issue?
First, evaluate if the documentation makes sense to be included in the KubeVela project:
- Is this something we want/can maintain as a project?
- Is this referring to usage of some specific integration/tool and in that case is that a popular use case in combination with KubeVela?
- If unsure, kindly and politely add a comment explaining that we would need [upvotes](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments)
to identify that lots of other users want/need this.
Second, label the issue `type/docs` and at least one `area/*` label.
**Minor typo/error/lack of information:**
There's a minor typo/error/lack of information that adds a lot of confusion for users and given the amount of work is a big win to make sure fixing it:
1. Either update the documentation yourself and open a pull request.
2. Either delegate the work to someone else by assigning that person to the issue and add the issue to next major/minor milestone.
**Major error/lack of information:**
1. Label the issue with `help wanted` and `good first issue`, if applicable, to signal that we find this important to
fix and we would appreciate any help we can get from the community.
2. Move on to [prioritizing the issue](#4-prioritization-of-issues).
### Support requests and questions
1. Kindly and politely direct the issue author to the [github discussion](https://github.com/kubevela/kubevela/discussions)
and explain that issue is mainly used for tracking bugs and feature requests.
If possible, it's usually a good idea to add some pointers to the issue author's question.
2. Close the issue and label it with `type/question`.
## 4. Prioritization of issues
In general bugs and enhancement issues should be labeled with a priority.
This is the most difficult thing with triaging issues since it requires a lot of knowledge, context and experience
before being able to think of and start feel comfortable adding a certain priority label.
The key here is asking for help and discuss issues to understand how more experienced project members think and reason.
By doing that you learn more and eventually be more and more comfortable with prioritizing issues.
In case there is an uncertainty around the prioritization of an issue, please ask the maintainers for help.
| Label | Description |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `priority/critical` | Highest priority. Must be actively worked on as someone's top priority right now. |
| `priority/important-soon` | Must be staffed and worked on either currently, or very soon, ideally in time for the next release. |
| `priority/important-longterm` | Important over the long term, but may not be staffed and/or may need multiple releases to complete. |
| `priority/nice-to-have` | It's a good idea, but not scheduled for any release. |
| `priority/awaiting-more-evidence` | Lowest priority. Possibly useful, but not yet enough interest in it. |
| `priority/unscheduled` | Something to look into before and to be discussed during the planning of the next (upcoming) major/minor stable release. |
**Critical bugs**
1. If a bug has been categorized and any of the following criteria apply, the bug should be labeled as critical and
must be actively worked on as someone's top priority right now.
- Results in any crash or data loss.
- Critical security or performance issues
- Problem that makes a feature unusable
- Multiple users experience a severe problem affecting their business, users etc.
2. Label the issue `priority/critical`.
3. Add the issue to the next upcoming patch release milestone. Create a new milestone if there are none.
4. Escalate the problem to the maintainers.
5. Assign or ask a maintainer for help assigning someone to make this issue their top priority right now.
**Important short-term**
1. Label the issue `priority/important-soon`.
2. Add the issue to the next upcoming patch or major/minor stable release milestone. Ask maintainers for help if unsure if it's a patch or not.
Create a new milestone if there are none.
3. Make sure to add the issue to a suitable backlog of a GitHub project and prioritize it or assign someone to work on it now or very soon.
4. Consider requesting [help from the community](#5-requesting-help-from-the-community), even though it may be problematic given a short amount of time until it should be released.
**Important long-term**
1. Label the issue `priority/important-longterm`.
2. Consider requesting [help from the community](#5-requesting-help-from-the-community).
**Nice to have**
1. Label the issue `priority/nice-to-have`.
2. Consider requesting [help from the community](#5-requesting-help-from-the-community).
**Not critical, but unsure?**
1. Label the issue `priority/unscheduled`.
2. Consider requesting [help from the community](#5-requesting-help-from-the-community).
## 5. Requesting help from the community
Depending on the issue and/or priority, it's always a good idea to consider signalling to the community that help from community
is appreciated and needed in case an issue is not prioritized to be worked on by maintainers. Use your best judgement.
In general, requesting help from the community means that a contribution has a good chance of getting accepted and merged.
1. Kindly and politely add a comment to signal to users subscribed to updates of the issue.
- Explain that the issue would be nice to get resolved, but it isn't prioritized to work on by maintainers for an unforeseen future.
- If possible or applicable, try to help contributors getting starting by adding pointers and references to
what code/files need to be changed and/or ideas of a good way to solve/implement the issue.
2. Label the issue with `help wanted`.
3. If applicable, label the issue with `good first issue` to denote that the issue is suitable for a beginner to work on.
4. If possible, try to estimate the amount of work by adding `effort/small`, `effort/medium` or `effort/large`.
## Investigation of issues
When an issue has all basic information provided, but the triage responsible haven't been able to reproduce the reported
problem at a first glance, the issue is labeled [Needs investigation](https://github.com/oam-dev/kubevela/labels/needs%20investigation).
Depending on the perceived severity and/or number of [upvotes](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments),
the investigation will either be delegated to another maintainer for further investigation or put on hold until someone else (maintainer or contributor)
picks it up and eventually starts investigating it.
Investigating issues can be a very time consuming task, especially for the maintainers, provide as much related info will
make it easier for maintainers to investigate.
Even if you don't have the time or knowledge to investigate an issue we highly recommend that you [upvote](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments)
the issue if you happen to have the same problem. If you have further details that may help investigating the issue
please provide as much information as possible.
## Automation
We have some automation that triggers on comments or labels being added to issues.
Many of these automated behaviors are defined in [issue-commands.json](https://github.com/oam-dev/kubevela/blob/master/.github/issue-commands.json).
* Add comment `/duplicate #<number>` to have `type/duplicate` label, the issue number is required for remind where is the other issue.
* Add label `bot/no new info` for bot to close an issue where we asked for more info but has not received any updates in at least 14 days.
Read more bot actions on [bot.md](https://github.com/oam-dev/kubevela/blob/master/.github/bot.md)

308
Makefile
View File

@@ -1,101 +1,43 @@
# 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_VAR := github.com/oam-dev/kubevela/version.VelaVersion
VELA_GITVERSION_VAR := github.com/oam-dev/kubevela/version.GitRevision
LDFLAGS ?= "-X $(VELA_VERSION_VAR)=$(VELA_VERSION) -X $(VELA_GITVERSION_VAR)=$(GIT_COMMIT)"
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
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 -race -coverprofile=coverage.txt -covermode=atomic ./pkg/... ./cmd/...
go test -race -covermode=atomic ./references/apiserver/... ./references/appfile/... ./references/cli/... ./references/common/... ./references/plugins/...
test: vet lint staticcheck unit-test-core test-cli-gen
@$(OK) unit-tests pass
# Build manager binary
build: fmt vet lint staticcheck
go run hack/chart/generate.go
go build -o bin/vela -ldflags ${LDFLAGS} references/cmd/cli/main.go
git checkout references/cmd/cli/fake/chart_source.go
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 | grep -v applicationconfiguration)
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:
go run hack/chart/generate.go
go build -o bin/vela -ldflags ${LDFLAGS} references/cmd/cli/main.go
git checkout references/cmd/cli/fake/chart_source.go
dashboard-build:
cd references/dashboard && npm install && cd ..
doc-gen:
rm -r docs/en/cli/*
go run hack/docgen/gen.go
go run hack/references/generate.go
api-gen:
swag init -g references/apiserver/route.go --output references/apiserver/docs
swagger-codegen generate -l html2 -i references/apiserver/docs/swagger.yaml -o references/apiserver/docs
mv references/apiserver/docs/index.html docs/en/developers/references/restful-api/
generate-source:
go run hack/frontend/source.go
cross-build:
go run hack/chart/generate.go
GO111MODULE=on CGO_ENABLED=0 $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/{{.OS}}-{{.Arch}}/vela" -osarch='$(TARGETS)' ./references/cmd/cli/
compress:
( \
echo "\n## Release Info\nVERSION: $(VELA_VERSION)" >> README.md && \
echo "GIT_COMMIT: $(GIT_COMMIT_LONG)\n" >> README.md && \
cd _bin && \
$(DIST_DIRS) cp ../LICENSE {} \; && \
$(DIST_DIRS) cp ../README.md {} \; && \
$(DIST_DIRS) tar -zcf vela-{}.tar.gz {} \; && \
$(DIST_DIRS) zip -r vela-{}.zip {} \; && \
sha256sum vela-* > sha256sums.txt \
)
# Run against the configured Kubernetes cluster in ~/.kube/config
run: fmt vet
go run ./cmd/core/main.go
build-cleanup:
rm -rf _bin
# Run go fmt against code
fmt: goimports installcue
go fmt ./...
$(GOIMPORTS) -local github.com/oam-dev/kubevela -w ./pkg ./cmd
$(CUE) fmt ./hack/vela-templates/cue/*
$(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
$(CUE) fmt ./pkg/workflow/tasks/template/static/*
# Run go vet against code
vet:
go vet ./...
@@ -104,9 +46,9 @@ staticcheck: staticchecktool
$(STATICCHECK) ./...
lint: golangci
$(GOLANGCILINT) run ./...
$(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.
@@ -115,183 +57,79 @@ 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 ${IMG}
# Push the docker image
docker-push:
docker push ${IMG}
docker push $(VELA_CORE_IMAGE)
e2e-setup:
helm install --create-namespace -n flux-system helm-flux http://oam.dev/catalog/helm-flux2-0.1.0.tgz
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.7.0/kruise-chart.tgz
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm upgrade --install --create-namespace --namespace cert-manager cert-manager jetstack/cert-manager --version v1.2.0 --set installCRDs=true --wait
helm upgrade --install --create-namespace --namespace vela-system --set image.pullPolicy=IfNotPresent --set admissionWebhooks.certManager.enabled=true --set image.repository=vela-core-test --set image.tag=$(GIT_COMMIT) --wait kubevela ./charts/vela-core
ginkgo version
ginkgo -v -r e2e/setup
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
bin/vela dashboard &
build-swagger:
go run ./cmd/apiserver/main.go build-swagger ./docs/apidoc/swagger.json
e2e-api-test:
# Run e2e test
ginkgo -v -skipPackage capability,setup,apiserver,application -r e2e
ginkgo -v -r e2e/apiserver
ginkgo -v -r e2e/application
e2e-test:
# Run e2e test
ginkgo -v ./test/e2e-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 docker images -q vela-core-test:$(GIT_COMMIT)),)
docker image rm -f vela-core-test:$(GIT_COMMIT)
ifneq (, $(shell which docker))
# Delete Docker images
ifneq ($(shell docker images -q $(VELA_CORE_TEST_IMAGE)),)
docker rmi -f $(VELA_CORE_TEST_IMAGE)
endif
# load docker image to the kind cluster
kind-load:
docker build -t vela-core-test:$(GIT_COMMIT) .
kind load docker-image vela-core-test:$(GIT_COMMIT) || { echo >&2 "kind not installed or error loading image: $(IMAGE)"; exit 1; }
ifneq ($(shell docker images -q $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE)),)
docker rmi -f $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE)
endif
# Image URL to use all building/pushing image targets
IMG ?= vela-core:latest
endif
# load docker image to the kind cluster
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
# Build manager binary
# Build vela core manager and apiserver binary
manager: fmt vet lint manifests
go build -o bin/manager ./cmd/core/main.go
$(GOBUILD_ENV) go build -o bin/manager -a -ldflags $(LDFLAGS) ./cmd/core/main.go
$(GOBUILD_ENV) go build -o bin/apiserver -a -ldflags $(LDFLAGS) ./cmd/apiserver/main.go
# 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/
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
# Generate manifests e.g. CRD, RBAC etc.
manifests: kustomize
manifests: installcue kustomize
go generate $(foreach t,pkg apis,./$(t)/...)
# TODO(yangsoon): kustomize will merge all CRD into a whole file, it may not work if we want patch more than one CRD in this way
$(KUSTOMIZE) build config/crd -o config/crd/base/core.oam.dev_applications.yaml
mv config/crd/base/* charts/vela-core/crds
./hack/vela-templates/gen_definitions.sh
./hack/crd/cleanup.sh
go run ./hack/crd/dispatch/dispatch.go config/crd/base charts/vela-core/crds runtime/ charts/vela-minimal/crds
rm -f config/crd/base/*
./vela-templates/gen_definitions.sh
GOLANGCILINT_VERSION ?= v1.31.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
start-dashboard:
go run references/cmd/apiserver/main.go &
cd references/dashboard && npm install && npm start && cd ..
swagger-gen:
$(GOBIN)/swag init -g apiserver/route.go -d pkg/ -o references/apiserver/docs/
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

12
OWNERS
View File

@@ -1,12 +0,0 @@
approvers:
- kubevela-controller
- kubevela-devex
- kubevela-dashboard-approver
reviewers:
- kubevela-controller
- oam-spec
- kubevela-dashboard-reviewer
members:
- community-collaborators

View File

@@ -1,44 +1 @@
aliases:
kubevela-devex:
- hongchaodeng
- wonderflow
kubevela-dashboard-approver:
- zzxwill
- hongchaodeng
kubevela-dashboard-reviewer:
- sunny0826
- hanxie-crypto
kubevela-controller:
- resouer
- wonderflow
- hongchaodeng
- zzxwill
- ryanzhang-oss
- captainroy-hy
oam-spec: # inherit from https://github.com/oam-dev/spec/blob/master/OWNERS.md
- hongchaodeng
- resouer
community-collaborators:
- Fei-Guo
- szihai
bootstrap-contributors: # thank you for bootstrapping KubeVela at the very early stage!
- xiaoyuaiheshui
- Ghostbaby
- wenxinnnnn
- silenceper
- erdun
- sunny0826
- mosesyou
- artursouza
- wonderflow
- hongchaodeng
- ryanzhang-oss
- woshilanren11
- hanxie-crypto
- zzxwill
The owner file has been migrated to the community repo, please refer to https://github.com/kubevela/community/blob/main/OWNERS.md

View File

@@ -1,53 +1,77 @@
![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)
<div style="text-align: center">
<p align="center">
<img src="https://raw.githubusercontent.com/kubevela/kubevela.io/main/docs/resources/KubeVela-03.png">
<br><br>
<i>Make shipping applications more enjoyable.</i>
</p>
</div>
![Build status](https://github.com/kubevela/kubevela/workflows/E2E/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/kubevela/kubevela)](https://goreportcard.com/report/github.com/kubevela/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)
[![codecov](https://codecov.io/gh/kubevela/kubevela/branch/master/graph/badge.svg)](https://codecov.io/gh/kubevela/kubevela)
[![LICENSE](https://img.shields.io/github/license/kubevela/kubevela.svg?style=flat-square)](/LICENSE)
[![Releases](https://img.shields.io/github/release/kubevela/kubevela/all.svg?style=flat-square)](https://github.com/kubevela/kubevela/releases)
[![TODOs](https://img.shields.io/endpoint?url=https://api.tickgit.com/badge?repo=github.com/kubevela/kubevela)](https://www.tickgit.com/browse?repo=github.com/kubevela/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)
![alt](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 the platform engine to create *PaaS-like* experience on Kubernetes, in a scalable approach.
## Highlights
## Community
KubeVela practices the "render, orchestrate, deploy" workflow with below highlighted values added to existing ecosystem:
- Slack: [CNCF Slack](https://slack.cncf.io/) #kubevela channel
- Gitter: [Discussion](https://gitter.im/oam-dev/community)
- Bi-weekly Community Call: [Meeting Notes](https://docs.google.com/document/d/1nqdFEyULekyksFHtFvgvFAYE-0AMHKoS3RMnaKsarjs)
- *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.
> NOTE: KubeVela is still iterating quickly. It's currently under pre-beta release.
- *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.
## What problems does it solve?
Building **developer-centric platforms** with Kubernetes requires higher level primitives which is out-of-scope of Kubernetes itself. Hence, we platform teams build abstractions.
However, great in flexibility and extensibility, the existing solutions such as IaC (Infrastructure-as-Code) and client-side templating tools all lead to ***Configuration Drift*** (i.e. the generated instances are not in line with the expected configuration) which is a nightmare in production.
KubeVela allows platform teams to create developer-centric abstractions with IaC but maintain them with the battle tested [Kubernetes Control Loop](https://kubernetes.io/docs/concepts/architecture/controller/). Think about a plug-in that turns your Kubernetes cluster into a *"PaaS"* via abstractions designed by yourself.
- *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
- [Installation](https://kubevela.io/#/en/install)
- [Quick start](https://kubevela.io/#/en/quick-start)
- [How it works](https://kubevela.io/#/en/concepts)
## Features
- **Robust, repeatable and extensible approach to create and maintain abstractions** - design your abstractions with [CUE](https://cuelang.org/) or [Helm](https://helm.sh), ship them to end users by `kubectl apply -f`, automatically generating GUI forms, upgrade your abstractions at runtime, and let Kubernetes controller guarantee determinism of the abstractions, no configuration drift.
- **Generic progressive rollout framework** - built-in rollout framework and strategies to upgrade your microservice regardless of its workload type (e.g. stateless, stateful, or even custom operators etc), seamless integration with observability systems.
- **Multi-enviroment app delievry model (WIP)** - built-in model to deliver or rollout your apps across multiple enviroments and/or clusters, seamless integration with Service Mesh for traffic management.
- **Simple and Kubernetes native** - KubeVela is just a simple custom controller, all its app delivery abstractions and features are defined as [Kubernetes Custom Resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) so they naturally work with any CI/CD or GitOps tools.
- [Introduction](https://kubevela.io/docs)
- [Installation](https://kubevela.io/docs/install)
- [Design Your First Deployment Plan](https://kubevela.io/docs/quick-start)
## Documentation
Visit the [KubeVela documentation site](https://kubevela.io/) to find *Installation Instruction*, *Platform Builder Guide* and *Developer Experience Guide*.
Full documentation is available on the [KubeVela website](https://kubevela.io/).
## Blog
Official blog is available on [KubeVela blog](https://kubevela.io/blog).
## Community
We want your contributions and suggestions!
One of the easiest ways to contribute is to participate in discussions on the Github Issues/Discussion, chat on IM or the bi-weekly community calls.
For more information on the community engagement, developer and contributing guidelines and more, head over to the [KubeVela community repo](https://github.com/kubevela/community).
### Contact Us
Reach out with any questions you may have and we'll make sure to answer them as soon as possible!
- Slack: [CNCF Slack kubevela channel](https://cloud-native.slack.com/archives/C01BLQ3HTJA) (*English*)
- [DingTalk Group](https://page.dingtalk.com/wow/dingtalk/act/en-home): `23310022` (*Chinese*)
- Wechat Group (*Chinese*): Broker wechat to add you into the user group.
<img src="https://static.kubevela.net/images/barnett-wechat.jpg" width="200" />
### Community Call
Every two weeks we host a community call to showcase new features, review upcoming milestones, and engage in a Q&A. All are welcome!
- Bi-weekly Community Call:
- [Meeting Notes](https://docs.google.com/document/d/1nqdFEyULekyksFHtFvgvFAYE-0AMHKoS3RMnaKsarjs).
- [Video Records](https://kubevela.io/videos/meetings/en/meetings).
- Bi-weekly Chinese Community Call:
- [Video Records](https://kubevela.io/videos/meetings/cn/v1.3).
## Talks and Conferences
@@ -57,8 +81,16 @@ Visit the [KubeVela documentation site](https://kubevela.io/) to find *Installat
| 🌎 KubeCon | - [ [NA 2020] Standardizing Cloud Native Application Delivery Across Different Clouds](https://www.youtube.com/watch?v=0yhVuBIbHcI) <br> - [ [EU 2021] Zero Pain Microservice Development and Deployment with Dapr and KubeVela](https://sched.co/iE4S) |
| 📺 Conferences | - [Dapr, Rudr, OAM: Mark Russinovich presents next gen app development & deployment](https://www.youtube.com/watch?v=eJCu6a-x9uo) <br> - [Mark Russinovich presents "The Future of Cloud Native Applications with OAM and Dapr"](https://myignite.techcommunity.microsoft.com/sessions/82059)|
For more talks, please checkout [KubeVela Talks](https://kubevela.io/videos/talks/en/standardizing-app).
## Contributing
Check out [CONTRIBUTING](./CONTRIBUTING.md) to see how to develop with KubeVela.
## Report Vulnerability
Security is a first priority thing for us at KubeVela. If you come across a related issue, please send email to security@mail.kubevela.io .
## Code of Conduct
KubeVela adopts [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).

20
SECURITY.md Normal file
View File

@@ -0,0 +1,20 @@
# Security Policy
## Reporting a Vulnerability
If you've found a security issue that you'd like to disclose confidentially please send email to security@mail.kubevela.io .
### Who Reads Email Sent to security@mail.kubevela.io?
Only a restricted and carefully chosen group of KubeVela maintainers will have access to material sent to the security@mail.kubevela.io address.
No outside users can subscribe to this list.
### What to Send to security@mail.kubevela.io
Please provide as much information about your system and the issue as possible when contacting the list.
## How We Respond
Email sent to security@mail.kubevela.io is read and acknowledged with a non-automated response within three working days.
For issues that are complicated and require significant attention,
we will open an investigation and will provide you with a mechanism to check the status of our progress at any time.

View File

@@ -0,0 +1,22 @@
/*
Copyright 2022 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package common
const (
// Group api group name
Group = "core.oam.dev"
)

View File

@@ -17,10 +17,18 @@ limitations under the License.
package common
import (
v1alpha12 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
"k8s.io/apimachinery/pkg/runtime"
"encoding/json"
"errors"
types "github.com/oam-dev/terraform-controller/api/types/crossplane-runtime"
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
@@ -84,7 +92,7 @@ type Schematic struct {
HELM *Helm `json:"helm,omitempty"`
// TODO(wonderflow): support HCL(terraform)here.
Terraform *Terraform `json:"terraform,omitempty"`
}
// A Helm represents resources used by a Helm module
@@ -98,6 +106,37 @@ type Helm struct {
Repository runtime.RawExtension `json:"repository"`
}
// Terraform is the struct to describe cloud resources managed by Hashicorp Terraform
type Terraform struct {
// Configuration is Terraform Configuration
Configuration string `json:"configuration"`
// Type specifies which Terraform configuration it is, HCL or JSON syntax
// +kubebuilder:default:=hcl
// +kubebuilder:validation:Enum:=hcl;json;remote
Type string `json:"type,omitempty"`
// Path is the sub-directory of remote git repository. It's valid when remote is set
Path string `json:"path,omitempty"`
// 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.
// +optional
WriteConnectionSecretToReference *types.SecretReference `json:"writeConnectionSecretToRef,omitempty"`
// ProviderReference specifies the reference to Provider
ProviderReference *types.Reference `json:"providerRef,omitempty"`
// DeleteResource will determine whether provisioned cloud resources will be deleted when CR is deleted
// +kubebuilder:default:=true
DeleteResource bool `json:"deleteResource,omitempty"`
// Region is cloud provider's region. It will override the region in the region field of ProviderReference
Region string `json:"customRegion,omitempty"`
}
// A WorkloadTypeDescriptor refer to a Workload Type
type WorkloadTypeDescriptor struct {
// Type ref to a WorkloadDefinition via name
@@ -144,26 +183,66 @@ 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 (
// ApplicationRollingOut means the app is in the middle of rolling out
ApplicationRollingOut ApplicationPhase = "rollingOut"
// ApplicationStarting means the app is preparing for reconcile
ApplicationStarting ApplicationPhase = "starting"
// ApplicationRendering means the app is rendering
ApplicationRendering ApplicationPhase = "rendering"
// ApplicationPolicyGenerating means the app is generating policies
ApplicationPolicyGenerating ApplicationPhase = "generatingPolicy"
// ApplicationRunningWorkflow means the app is running workflow
ApplicationRunningWorkflow ApplicationPhase = "runningWorkflow"
// ApplicationWorkflowSuspending means the app's workflow is suspending
ApplicationWorkflowSuspending ApplicationPhase = "workflowSuspending"
// ApplicationWorkflowTerminated means the app's workflow is terminated
ApplicationWorkflowTerminated ApplicationPhase = "workflowTerminated"
// ApplicationWorkflowFinished means the app's workflow is finished
ApplicationWorkflowFinished ApplicationPhase = "workflowFinished"
// ApplicationRunning means the app finished rendering and applied result to the cluster
ApplicationRunning ApplicationPhase = "running"
// ApplicationHealthChecking means the app finished rendering and applied result to the cluster, but still unhealthy
ApplicationHealthChecking ApplicationPhase = "healthChecking"
// 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"
// 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"`
Healthy bool `json:"healthy"`
Message string `json:"message,omitempty"`
Traits []ApplicationTraitStatus `json:"traits,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"`
Message string `json:"message,omitempty"`
Traits []ApplicationTraitStatus `json:"traits,omitempty"`
Scopes []corev1.ObjectReference `json:"scopes,omitempty"`
}
// ApplicationTraitStatus records the trait health status
@@ -189,24 +268,406 @@ type RawComponent struct {
Raw runtime.RawExtension `json:"raw"`
}
// StepStatus record the base status of workflow step, which could be workflow step or subStep
type StepStatus struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Phase WorkflowStepPhase `json:"phase,omitempty"`
// A human readable message indicating details about why the workflowStep is in this state.
Message string `json:"message,omitempty"`
// A brief CamelCase message indicating details about why the workflowStep is in this state.
Reason string `json:"reason,omitempty"`
// FirstExecuteTime is the first time this step execution.
FirstExecuteTime metav1.Time `json:"firstExecuteTime,omitempty"`
// LastExecuteTime is the last time this step execution.
LastExecuteTime metav1.Time `json:"lastExecuteTime,omitempty"`
}
// WorkflowStepStatus record the status of a workflow step, include step status and subStep status
type WorkflowStepStatus struct {
StepStatus `json:",inline"`
SubStepsStatus []WorkflowSubStepStatus `json:"subSteps,omitempty"`
}
// WorkflowSubStepStatus record the status of a workflow subStep
type WorkflowSubStepStatus struct {
StepStatus `json:",inline"`
}
// AppStatus defines the observed state of Application
type AppStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
v1alpha1.RolloutStatus `json:",inline"`
condition.ConditionedStatus `json:",inline"`
// The generation observed by the application controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
Phase ApplicationPhase `json:"status,omitempty"`
// Components record the related Components created by Application Controller
Components []v1alpha12.TypedReference `json:"components,omitempty"`
Components []corev1.ObjectReference `json:"components,omitempty"`
// Services record the status of the application services
Services []ApplicationComponentStatus `json:"services,omitempty"`
// ResourceTracker record the status of the ResourceTracker
ResourceTracker *v1alpha12.TypedReference `json:"resourceTracker,omitempty"`
// Workflow record the status of workflow
Workflow *WorkflowStatus `json:"workflow,omitempty"`
// LatestRevision of the application configuration it generates
// +optional
LatestRevision *Revision `json:"latestRevision,omitempty"`
// AppliedResources record the resources that the workflow step apply.
AppliedResources []ClusterObjectReference `json:"appliedResources,omitempty"`
// 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"`
SubSteps []WorkflowSubStep `json:"subSteps,omitempty"`
If string `json:"if,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs StepInputs `json:"inputs,omitempty"`
Outputs StepOutputs `json:"outputs,omitempty"`
}
// WorkflowSubStep defines how to execute a workflow subStep.
type WorkflowSubStep struct {
// Name is the unique name of the workflow step.
Name string `json:"name"`
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties *runtime.RawExtension `json:"properties,omitempty"`
If string `json:"if,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"`
SuspendState string `json:"suspendState,omitempty"`
Suspend bool `json:"suspend"`
Terminated bool `json:"terminated"`
Finished bool `json:"finished"`
ContextBackend *corev1.ObjectReference `json:"contextBackend,omitempty"`
Steps []WorkflowStepStatus `json:"steps,omitempty"`
StartTime metav1.Time `json:"startTime,omitempty"`
}
// WorkflowStepPhase describes the phase of a workflow step.
type WorkflowStepPhase string
const (
// WorkflowStepPhaseSucceeded will make the controller run the next step.
WorkflowStepPhaseSucceeded WorkflowStepPhase = "succeeded"
// WorkflowStepPhaseFailed will report error in `message`.
WorkflowStepPhaseFailed WorkflowStepPhase = "failed"
// WorkflowStepPhaseSkipped will make the controller skip the step.
WorkflowStepPhaseSkipped WorkflowStepPhase = "skipped"
// WorkflowStepPhaseStopped will make the controller stop the workflow.
WorkflowStepPhaseStopped WorkflowStepPhase = "stopped"
// WorkflowStepPhaseRunning will make the controller continue the workflow.
WorkflowStepPhaseRunning WorkflowStepPhase = "running"
)
// DefinitionType describes the type of DefinitionRevision.
// +kubebuilder:validation:Enum=Component;Trait;Policy;WorkflowStep
type DefinitionType string
const (
// ComponentType represents DefinitionRevision refer to type ComponentDefinition
ComponentType DefinitionType = "Component"
// TraitType represents DefinitionRevision refer to type TraitDefinition
TraitType DefinitionType = "Trait"
// PolicyType represents DefinitionRevision refer to type PolicyDefinition
PolicyType DefinitionType = "Policy"
// WorkflowStepType represents DefinitionRevision refer to type WorkflowStepDefinition
WorkflowStepType DefinitionType = "WorkflowStep"
)
// WorkflowMode describes the mode of workflow
type WorkflowMode string
const (
// WorkflowModeDAG describes the DAG mode of workflow
WorkflowModeDAG WorkflowMode = "DAG"
// WorkflowModeStep describes the step by step mode of workflow
WorkflowModeStep WorkflowMode = "StepByStep"
)
// AppRolloutStatus defines the observed state of AppRollout
type AppRolloutStatus struct {
v1alpha1.RolloutStatus `json:",inline"`
// LastUpgradedTargetAppRevision contains the name of the app that we upgraded to
// We will restart the rollout if this is not the same as the spec
LastUpgradedTargetAppRevision string `json:"lastTargetAppRevision"`
// LastSourceAppRevision contains the name of the app that we need to upgrade from.
// We will restart the rollout if this is not the same as the spec
LastSourceAppRevision string `json:"LastSourceAppRevision,omitempty"`
}
// ApplicationTrait defines the trait of application
type ApplicationTrait struct {
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties *runtime.RawExtension `json:"properties,omitempty"`
}
// ApplicationComponent describe the component of application
type ApplicationComponent struct {
Name string `json:"name"`
Type string `json:"type"`
// ExternalRevision specified the component revisionName
ExternalRevision string `json:"externalRevision,omitempty"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties *runtime.RawExtension `json:"properties,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs StepInputs `json:"inputs,omitempty"`
Outputs StepOutputs `json:"outputs,omitempty"`
// Traits define the trait of one component, the type must be array to keep the order.
Traits []ApplicationTrait `json:"traits,omitempty"`
// +kubebuilder:pruning:PreserveUnknownFields
// scopes in ApplicationComponent defines the component-level scopes
// the format is <scope-type:scope-instance-name> pairs, the key represents type of `ScopeDefinition` while the value represent the name of scope instance.
Scopes map[string]string `json:"scopes,omitempty"`
}
// StepOutputs defines output variable of WorkflowStep
type StepOutputs []outputItem
// StepInputs defines variable input of WorkflowStep
type StepInputs []inputItem
type inputItem struct {
ParameterKey string `json:"parameterKey"`
From string `json:"from"`
}
type outputItem struct {
ValueFrom string `json:"valueFrom"`
Name string `json:"name"`
}
// ClusterSelector defines the rules to select a Cluster resource.
// Either name or labels is needed.
type ClusterSelector struct {
// Name is the name of the cluster.
Name string `json:"name,omitempty"`
// Labels defines the label selector to select the cluster.
Labels map[string]string `json:"labels,omitempty"`
}
// Distribution defines the replica distribution of an AppRevision to a cluster.
type Distribution struct {
// Replicas is the replica number.
Replicas int `json:"replicas,omitempty"`
}
// ClusterPlacement defines the cluster placement rules for an app revision.
type ClusterPlacement struct {
// ClusterSelector selects the cluster to deploy apps to.
// If not specified, it indicates the host cluster per se.
ClusterSelector *ClusterSelector `json:"clusterSelector,omitempty"`
// Distribution defines the replica distribution of an AppRevision to a cluster.
Distribution Distribution `json:"distribution,omitempty"`
}
// ResourceCreatorRole defines the resource creator.
type ResourceCreatorRole string
const (
// PolicyResourceCreator create the policy resource.
PolicyResourceCreator ResourceCreatorRole = "policy"
// WorkflowResourceCreator create the resource in workflow.
WorkflowResourceCreator ResourceCreatorRole = "workflow"
// DebugResourceCreator create the debug resource.
DebugResourceCreator ResourceCreatorRole = "debug"
)
// 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
/*
@@ -21,16 +22,34 @@ limitations under the License.
package common
import (
"github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
crossplane_runtime "github.com/oam-dev/terraform-controller/api/types/crossplane-runtime"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRolloutStatus) DeepCopyInto(out *AppRolloutStatus) {
*out = *in
in.RolloutStatus.DeepCopyInto(&out.RolloutStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutStatus.
func (in *AppRolloutStatus) DeepCopy() *AppRolloutStatus {
if in == nil {
return nil
}
out := new(AppRolloutStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppStatus) DeepCopyInto(out *AppStatus) {
*out = *in
in.RolloutStatus.DeepCopyInto(&out.RolloutStatus)
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]v1alpha1.TypedReference, len(*in))
*out = make([]v1.ObjectReference, len(*in))
copy(*out, *in)
}
if in.Services != nil {
@@ -40,16 +59,28 @@ func (in *AppStatus) DeepCopyInto(out *AppStatus) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.ResourceTracker != nil {
in, out := &in.ResourceTracker, &out.ResourceTracker
*out = new(v1alpha1.TypedReference)
**out = **in
if in.Workflow != nil {
in, out := &in.Workflow, &out.Workflow
*out = new(WorkflowStatus)
(*in).DeepCopyInto(*out)
}
if in.LatestRevision != nil {
in, out := &in.LatestRevision, &out.LatestRevision
*out = new(Revision)
**out = **in
}
if in.AppliedResources != nil {
in, out := &in.AppliedResources, &out.AppliedResources
*out = make([]ClusterObjectReference, len(*in))
copy(*out, *in)
}
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.
@@ -62,14 +93,69 @@ func (in *AppStatus) DeepCopy() *AppStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationComponent) DeepCopyInto(out *ApplicationComponent) {
*out = *in
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
if in.DependsOn != nil {
in, out := &in.DependsOn, &out.DependsOn
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Inputs != nil {
in, out := &in.Inputs, &out.Inputs
*out = make(StepInputs, len(*in))
copy(*out, *in)
}
if in.Outputs != nil {
in, out := &in.Outputs, &out.Outputs
*out = make(StepOutputs, len(*in))
copy(*out, *in)
}
if in.Traits != nil {
in, out := &in.Traits, &out.Traits
*out = make([]ApplicationTrait, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Scopes != nil {
in, out := &in.Scopes, &out.Scopes
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationComponent.
func (in *ApplicationComponent) DeepCopy() *ApplicationComponent {
if in == nil {
return nil
}
out := new(ApplicationComponent)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationComponentStatus) DeepCopyInto(out *ApplicationComponentStatus) {
*out = *in
out.WorkloadDefinition = in.WorkloadDefinition
if in.Traits != nil {
in, out := &in.Traits, &out.Traits
*out = make([]ApplicationTraitStatus, len(*in))
copy(*out, *in)
}
if in.Scopes != nil {
in, out := &in.Scopes, &out.Scopes
*out = make([]v1.ObjectReference, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationComponentStatus.
@@ -82,6 +168,26 @@ func (in *ApplicationComponentStatus) DeepCopy() *ApplicationComponentStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationTrait) DeepCopyInto(out *ApplicationTrait) {
*out = *in
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationTrait.
func (in *ApplicationTrait) DeepCopy() *ApplicationTrait {
if in == nil {
return nil
}
out := new(ApplicationTrait)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationTraitStatus) DeepCopyInto(out *ApplicationTraitStatus) {
*out = *in
@@ -134,6 +240,65 @@ func (in *ChildResourceKind) DeepCopy() *ChildResourceKind {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterObjectReference) DeepCopyInto(out *ClusterObjectReference) {
*out = *in
out.ObjectReference = in.ObjectReference
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterObjectReference.
func (in *ClusterObjectReference) DeepCopy() *ClusterObjectReference {
if in == nil {
return nil
}
out := new(ClusterObjectReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterPlacement) DeepCopyInto(out *ClusterPlacement) {
*out = *in
if in.ClusterSelector != nil {
in, out := &in.ClusterSelector, &out.ClusterSelector
*out = new(ClusterSelector)
(*in).DeepCopyInto(*out)
}
out.Distribution = in.Distribution
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPlacement.
func (in *ClusterPlacement) DeepCopy() *ClusterPlacement {
if in == nil {
return nil
}
out := new(ClusterPlacement)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterSelector) DeepCopyInto(out *ClusterSelector) {
*out = *in
if in.Labels != nil {
in, out := &in.Labels, &out.Labels
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSelector.
func (in *ClusterSelector) DeepCopy() *ClusterSelector {
if in == nil {
return nil
}
out := new(ClusterSelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DefinitionReference) DeepCopyInto(out *DefinitionReference) {
*out = *in
@@ -149,6 +314,21 @@ func (in *DefinitionReference) DeepCopy() *DefinitionReference {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Distribution) DeepCopyInto(out *Distribution) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Distribution.
func (in *Distribution) DeepCopy() *Distribution {
if in == nil {
return nil
}
out := new(Distribution)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Helm) DeepCopyInto(out *Helm) {
*out = *in
@@ -219,6 +399,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
@@ -235,6 +450,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
@@ -268,6 +541,11 @@ func (in *Schematic) DeepCopyInto(out *Schematic) {
*out = new(Helm)
(*in).DeepCopyInto(*out)
}
if in.Terraform != nil {
in, out := &in.Terraform, &out.Terraform
*out = new(Terraform)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Schematic.
@@ -295,6 +573,230 @@ func (in *Status) DeepCopy() *Status {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in StepInputs) DeepCopyInto(out *StepInputs) {
{
in := &in
*out = make(StepInputs, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepInputs.
func (in StepInputs) DeepCopy() StepInputs {
if in == nil {
return nil
}
out := new(StepInputs)
in.DeepCopyInto(out)
return *out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in StepOutputs) DeepCopyInto(out *StepOutputs) {
{
in := &in
*out = make(StepOutputs, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepOutputs.
func (in StepOutputs) DeepCopy() StepOutputs {
if in == nil {
return nil
}
out := new(StepOutputs)
in.DeepCopyInto(out)
return *out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StepStatus) DeepCopyInto(out *StepStatus) {
*out = *in
in.FirstExecuteTime.DeepCopyInto(&out.FirstExecuteTime)
in.LastExecuteTime.DeepCopyInto(&out.LastExecuteTime)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepStatus.
func (in *StepStatus) DeepCopy() *StepStatus {
if in == nil {
return nil
}
out := new(StepStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Terraform) DeepCopyInto(out *Terraform) {
*out = *in
if in.WriteConnectionSecretToReference != nil {
in, out := &in.WriteConnectionSecretToReference, &out.WriteConnectionSecretToReference
*out = new(crossplane_runtime.SecretReference)
**out = **in
}
if in.ProviderReference != nil {
in, out := &in.ProviderReference, &out.ProviderReference
*out = new(crossplane_runtime.Reference)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Terraform.
func (in *Terraform) DeepCopy() *Terraform {
if in == nil {
return nil
}
out := new(Terraform)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowStatus) DeepCopyInto(out *WorkflowStatus) {
*out = *in
if in.ContextBackend != nil {
in, out := &in.ContextBackend, &out.ContextBackend
*out = new(v1.ObjectReference)
**out = **in
}
if in.Steps != nil {
in, out := &in.Steps, &out.Steps
*out = make([]WorkflowStepStatus, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
in.StartTime.DeepCopyInto(&out.StartTime)
}
// 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
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
if in.SubSteps != nil {
in, out := &in.SubSteps, &out.SubSteps
*out = make([]WorkflowSubStep, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.DependsOn != nil {
in, out := &in.DependsOn, &out.DependsOn
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Inputs != nil {
in, out := &in.Inputs, &out.Inputs
*out = make(StepInputs, len(*in))
copy(*out, *in)
}
if in.Outputs != nil {
in, out := &in.Outputs, &out.Outputs
*out = make(StepOutputs, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStep.
func (in *WorkflowStep) DeepCopy() *WorkflowStep {
if in == nil {
return nil
}
out := new(WorkflowStep)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowStepStatus) DeepCopyInto(out *WorkflowStepStatus) {
*out = *in
in.StepStatus.DeepCopyInto(&out.StepStatus)
if in.SubStepsStatus != nil {
in, out := &in.SubStepsStatus, &out.SubStepsStatus
*out = make([]WorkflowSubStepStatus, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStepStatus.
func (in *WorkflowStepStatus) DeepCopy() *WorkflowStepStatus {
if in == nil {
return nil
}
out := new(WorkflowStepStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowSubStep) DeepCopyInto(out *WorkflowSubStep) {
*out = *in
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
if in.DependsOn != nil {
in, out := &in.DependsOn, &out.DependsOn
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Inputs != nil {
in, out := &in.Inputs, &out.Inputs
*out = make(StepInputs, len(*in))
copy(*out, *in)
}
if in.Outputs != nil {
in, out := &in.Outputs, &out.Outputs
*out = make(StepOutputs, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowSubStep.
func (in *WorkflowSubStep) DeepCopy() *WorkflowSubStep {
if in == nil {
return nil
}
out := new(WorkflowSubStep)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowSubStepStatus) DeepCopyInto(out *WorkflowSubStepStatus) {
*out = *in
in.StepStatus.DeepCopyInto(&out.StepStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowSubStepStatus.
func (in *WorkflowSubStepStatus) DeepCopy() *WorkflowSubStepStatus {
if in == nil {
return nil
}
out := new(WorkflowSubStepStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkloadGVK) DeepCopyInto(out *WorkloadGVK) {
*out = *in

View File

@@ -0,0 +1,282 @@
/*
// This file is originally from https://github.com/crossplane/crossplane-runtime/blob/master/apis/common/v1/condition.go
// We copy it here to reduce dependency and add more
Copyright 2021 The KubeVela Authors.
Copyright 2019 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package condition
import (
"sort"
"time"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// A ConditionType represents a condition a resource could be in.
// nolint:golint
type ConditionType string
// Condition types.
const (
// TypeReady resources are believed to be ready to handle work.
TypeReady ConditionType = "Ready"
// TypeSynced resources are believed to be in sync with the
// Kubernetes resources that manage their lifecycle.
TypeSynced ConditionType = "Synced"
)
// A ConditionReason represents the reason a resource is in a condition.
// nolint:golint
type ConditionReason string
// Reasons a resource is or is not ready.
const (
ReasonAvailable ConditionReason = "Available"
ReasonUnavailable ConditionReason = "Unavailable"
ReasonCreating ConditionReason = "Creating"
ReasonDeleting ConditionReason = "Deleting"
)
// Reasons a resource is or is not synced.
const (
ReasonReconcileSuccess ConditionReason = "ReconcileSuccess"
ReasonReconcileError ConditionReason = "ReconcileError"
)
// A Condition that may apply to a resource.
type Condition struct {
// Type of this condition. At most one of each condition type may apply to
// a resource at any point in time.
Type ConditionType `json:"type"`
// Status of this condition; is it currently True, False, or Unknown?
Status corev1.ConditionStatus `json:"status"`
// LastTransitionTime is the last time this condition transitioned from one
// status to another.
LastTransitionTime metav1.Time `json:"lastTransitionTime"`
// A Reason for this condition's last transition from one status to another.
Reason ConditionReason `json:"reason"`
// A Message containing details about this condition's last transition from
// one status to another, if any.
// +optional
Message string `json:"message,omitempty"`
}
// Equal returns true if the condition is identical to the supplied condition,
// ignoring the LastTransitionTime.
func (c Condition) Equal(other Condition) bool {
return c.Type == other.Type &&
c.Status == other.Status &&
c.Reason == other.Reason &&
c.Message == other.Message
}
// WithMessage returns a condition by adding the provided message to existing
// condition.
func (c Condition) WithMessage(msg string) Condition {
c.Message = msg
return c
}
// NOTE(negz): Conditions are implemented as a slice rather than a map to comply
// with Kubernetes API conventions. Ideally we'd comply by using a map that
// marshalled to a JSON array, but doing so confuses the CRD schema generator.
// https://github.com/kubernetes/community/blob/9bf8cd/contributors/devel/sig-architecture/api-conventions.md#lists-of-named-subobjects-preferred-over-maps
// NOTE(negz): Do not manipulate Conditions directly. Use the Set method.
// A ConditionedStatus reflects the observed status of a resource. Only
// one condition of each type may exist.
type ConditionedStatus struct {
// Conditions of the resource.
// +optional
Conditions []Condition `json:"conditions,omitempty"`
}
// NewConditionedStatus returns a stat with the supplied conditions set.
func NewConditionedStatus(c ...Condition) *ConditionedStatus {
s := &ConditionedStatus{}
s.SetConditions(c...)
return s
}
// GetCondition returns the condition for the given ConditionType if exists,
// otherwise returns nil
func (s *ConditionedStatus) GetCondition(ct ConditionType) Condition {
for _, c := range s.Conditions {
if c.Type == ct {
return c
}
}
return Condition{Type: ct, Status: corev1.ConditionUnknown}
}
// SetConditions sets the supplied conditions, replacing any existing conditions
// of the same type. This is a no-op if all supplied conditions are identical,
// ignoring the last transition time, to those already set.
func (s *ConditionedStatus) SetConditions(c ...Condition) {
for _, new := range c {
exists := false
for i, existing := range s.Conditions {
if existing.Type != new.Type {
continue
}
if existing.Equal(new) {
exists = true
continue
}
s.Conditions[i] = new
exists = true
}
if !exists {
s.Conditions = append(s.Conditions, new)
}
}
}
// Equal returns true if the status is identical to the supplied status,
// ignoring the LastTransitionTimes and order of statuses.
func (s *ConditionedStatus) Equal(other *ConditionedStatus) bool {
if s == nil || other == nil {
return s == nil && other == nil
}
if len(other.Conditions) != len(s.Conditions) {
return false
}
sc := make([]Condition, len(s.Conditions))
copy(sc, s.Conditions)
oc := make([]Condition, len(other.Conditions))
copy(oc, other.Conditions)
// We should not have more than one condition of each type.
sort.Slice(sc, func(i, j int) bool { return sc[i].Type < sc[j].Type })
sort.Slice(oc, func(i, j int) bool { return oc[i].Type < oc[j].Type })
for i := range sc {
if !sc[i].Equal(oc[i]) {
return false
}
}
return true
}
// Creating returns a condition that indicates the resource is currently
// being created.
func Creating() Condition {
return Condition{
Type: TypeReady,
Status: corev1.ConditionFalse,
LastTransitionTime: metav1.Now(),
Reason: ReasonCreating,
}
}
// Deleting returns a condition that indicates the resource is currently
// being deleted.
func Deleting() Condition {
return Condition{
Type: TypeReady,
Status: corev1.ConditionFalse,
LastTransitionTime: metav1.Now(),
Reason: ReasonDeleting,
}
}
// Available returns a condition that indicates the resource is
// currently observed to be available for use.
func Available() Condition {
return Condition{
Type: TypeReady,
Status: corev1.ConditionTrue,
LastTransitionTime: metav1.Now(),
Reason: ReasonAvailable,
}
}
// Unavailable returns a condition that indicates the resource is not
// currently available for use. Unavailable should be set only when Crossplane
// expects the resource to be available but knows it is not, for example
// because its API reports it is unhealthy.
func Unavailable() Condition {
return Condition{
Type: TypeReady,
Status: corev1.ConditionFalse,
LastTransitionTime: metav1.Now(),
Reason: ReasonUnavailable,
}
}
// ReconcileSuccess returns a condition indicating that Crossplane successfully
// completed the most recent reconciliation of the resource.
func ReconcileSuccess() Condition {
return Condition{
Type: TypeSynced,
Status: corev1.ConditionTrue,
LastTransitionTime: metav1.Now(),
Reason: ReasonReconcileSuccess,
}
}
// ReconcileError returns a condition indicating that Crossplane encountered an
// error while reconciling the resource. This could mean Crossplane was
// unable to update the resource to reflect its desired state, or that
// Crossplane was unable to determine the current actual state of the resource.
func ReconcileError(err error) Condition {
return Condition{
Type: TypeSynced,
Status: corev1.ConditionFalse,
LastTransitionTime: metav1.Now(),
Reason: ReasonReconcileError,
Message: err.Error(),
}
}
// ReadyCondition generate ready condition for conditionType
func ReadyCondition(tpy string) Condition {
return Condition{
Type: ConditionType(tpy),
Status: corev1.ConditionTrue,
Reason: ReasonAvailable,
LastTransitionTime: metav1.NewTime(time.Now()),
}
}
// ErrorCondition generate error condition for conditionType and error
func ErrorCondition(tpy string, err error) Condition {
return Condition{
Type: ConditionType(tpy),
Status: corev1.ConditionFalse,
LastTransitionTime: metav1.NewTime(time.Now()),
Reason: ReasonReconcileError,
Message: err.Error(),
}
}

View File

@@ -0,0 +1,221 @@
// This file is originally from https://github.com/crossplane/crossplane-runtime/blob/master/apis/common/v1/condition_test.go
// We copy it here to reduce dependency
/*
Copyright 2019 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package condition
import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestConditionEqual(t *testing.T) {
cases := map[string]struct {
a Condition
b Condition
want bool
}{
"IdenticalIgnoringTimestamp": {
a: Condition{Type: TypeReady, LastTransitionTime: metav1.Now()},
b: Condition{Type: TypeReady, LastTransitionTime: metav1.Now()},
want: true,
},
"DifferentType": {
a: Condition{Type: TypeReady},
b: Condition{Type: TypeSynced},
want: false,
},
"DifferentStatus": {
a: Condition{Status: corev1.ConditionTrue},
b: Condition{Status: corev1.ConditionFalse},
want: false,
},
"DifferentReason": {
a: Condition{Reason: ReasonCreating},
b: Condition{Reason: ReasonDeleting},
want: false,
},
"DifferentMessage": {
a: Condition{Message: "cool"},
b: Condition{Message: "uncool"},
want: false,
},
}
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
got := tc.a.Equal(tc.b)
if diff := cmp.Diff(tc.want, got); diff != "" {
t.Errorf("a.Equal(b): -want, +got:\n%s", diff)
}
})
}
}
func TestConditionedStatusEqual(t *testing.T) {
cases := map[string]struct {
a *ConditionedStatus
b *ConditionedStatus
want bool
}{
"Identical": {
a: NewConditionedStatus(Available(), ReconcileSuccess()),
b: NewConditionedStatus(Available(), ReconcileSuccess()),
want: true,
},
"IdenticalExceptOrder": {
a: NewConditionedStatus(Unavailable(), ReconcileSuccess()),
b: NewConditionedStatus(ReconcileSuccess(), Unavailable()),
want: true,
},
"DifferentLength": {
a: NewConditionedStatus(Available(), ReconcileSuccess()),
b: NewConditionedStatus(ReconcileSuccess()),
want: false,
},
"DifferentCondition": {
a: NewConditionedStatus(Creating(), ReconcileSuccess()),
b: NewConditionedStatus(Creating(), ReconcileError(errors.New("boom"))),
want: false,
},
"AIsNil": {
a: nil,
b: NewConditionedStatus(Deleting(), ReconcileSuccess()),
want: false,
},
"BIsNil": {
a: NewConditionedStatus(Available(), ReconcileSuccess()),
b: nil,
want: false,
},
}
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
got := tc.a.Equal(tc.b)
if diff := cmp.Diff(tc.want, got); diff != "" {
t.Errorf("a.Equal(b): -want, +got:\n%s", diff)
}
})
}
}
func TestSetConditions(t *testing.T) {
cases := map[string]struct {
cs *ConditionedStatus
c []Condition
want *ConditionedStatus
}{
"TypeIsIdentical": {
cs: NewConditionedStatus(Available()),
c: []Condition{Available()},
want: NewConditionedStatus(Available()),
},
"TypeIsDifferent": {
cs: NewConditionedStatus(Creating()),
c: []Condition{Available()},
want: NewConditionedStatus(Available()),
},
"TypeDoesNotExist": {
cs: NewConditionedStatus(ReconcileSuccess()),
c: []Condition{Available()},
want: NewConditionedStatus(ReconcileSuccess(), Available()),
},
}
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
tc.cs.SetConditions(tc.c...)
got := tc.cs
if diff := cmp.Diff(tc.want, got); diff != "" {
t.Errorf("tc.cs.SetConditions(...): -want, +got:\n%s", diff)
}
})
}
}
func TestGetCondition(t *testing.T) {
cases := map[string]struct {
cs *ConditionedStatus
t ConditionType
want Condition
}{
"ConditionExists": {
cs: NewConditionedStatus(Available()),
t: TypeReady,
want: Available(),
},
"ConditionDoesNotExist": {
cs: NewConditionedStatus(Available()),
t: TypeSynced,
want: Condition{
Type: TypeSynced,
Status: corev1.ConditionUnknown,
},
},
}
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
got := tc.cs.GetCondition(tc.t)
if diff := cmp.Diff(tc.want, got); diff != "" {
t.Errorf("tc.cs.GetConditions(...): -want, +got:\n%s", diff)
}
})
}
}
func TestConditionWithMessage(t *testing.T) {
testMsg := "Something went wrong on cloud side"
cases := map[string]struct {
c Condition
msg string
want Condition
}{
"MessageAdded": {
c: Condition{Type: TypeReady, Reason: ReasonUnavailable},
msg: testMsg,
want: Condition{Type: TypeReady, Reason: ReasonUnavailable, Message: testMsg},
},
"MessageChanged": {
c: Condition{Type: TypeReady, Reason: ReasonUnavailable, Message: "Some other message"},
msg: testMsg,
want: Condition{Type: TypeReady, Reason: ReasonUnavailable, Message: testMsg},
},
"MessageCleared": {
c: Condition{Type: TypeReady, Reason: ReasonUnavailable, Message: testMsg},
msg: "",
want: Condition{Type: TypeReady, Reason: ReasonUnavailable},
},
}
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
got := tc.c.WithMessage(tc.msg)
if diff := cmp.Diff(tc.want, got); diff != "" {
t.Errorf("a.Equal(b): -want, +got:\n%s", diff)
}
})
}
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2019 The Crossplane Authors.
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.
@@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package workloads provides workloads related controllers.
package workloads
// Package condition contains condition types
// +kubebuilder:object:generate=true
package condition

View File

@@ -0,0 +1,60 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by controller-gen. DO NOT EDIT.
package condition
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Condition) DeepCopyInto(out *Condition) {
*out = *in
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (in *Condition) DeepCopy() *Condition {
if in == nil {
return nil
}
out := new(Condition)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConditionedStatus) DeepCopyInto(out *ConditionedStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]Condition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionedStatus.
func (in *ConditionedStatus) DeepCopy() *ConditionedStatus {
if in == nil {
return nil
}
out := new(ConditionedStatus)
in.DeepCopyInto(out)
return out
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2020 The KubeVela Authors.
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.
@@ -20,13 +20,14 @@ package core_oam_dev
import (
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1"
)
func init() {
// Register the types with the Scheme so the resources can map objects to GroupVersionKinds and back
AddToSchemes = append(AddToSchemes, v1alpha2.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme)
AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme, v1alpha2.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme)
}
// AddToSchemes may be used to add all resources defined in the project to a Scheme

View File

@@ -0,0 +1,69 @@
/*
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"
)
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"`
// +optional
Rules []ApplyOncePolicyRule `json:"rules,omitempty"`
}
// ApplyOncePolicyRule defines a single apply-once policy rule
type ApplyOncePolicyRule struct {
// +optional
Selector ResourcePolicyRuleSelector `json:"selector,omitempty"`
// +optional
Strategy *ApplyOnceStrategy `json:"strategy,omitempty"`
}
// ApplyOnceStrategy the strategy for resource path to allow configuration drift
type ApplyOnceStrategy struct {
// Path the specified path that allow configuration drift
// like 'spec.template.spec.containers[0].resources' and '*' means the whole target allow configuration drift
Path []string `json:"path"`
}
// FindStrategy find apply-once strategy for target resource
func (in ApplyOncePolicySpec) FindStrategy(manifest *unstructured.Unstructured) *ApplyOnceStrategy {
if !in.Enable {
return nil
}
for _, rule := range in.Rules {
match := func(src []string, val string) (found bool) {
for _, _val := range src {
found = found || _val == val
}
return val != "" && found
}
if (match(rule.Selector.CompNames, manifest.GetName()) && match(rule.Selector.ResourceTypes, manifest.GetKind())) ||
(rule.Selector.CompNames == nil && match(rule.Selector.ResourceTypes, manifest.GetKind()) ||
(rule.Selector.ResourceTypes == nil && match(rule.Selector.CompNames, manifest.GetName()))) {
return rule.Strategy
}
}
return nil
}

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

@@ -0,0 +1,22 @@
/*
Copyright 2021. The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1alpha1 contains resources relating to the Open Application Model.
// See https://github.com/oam-dev/spec for more details.
// +kubebuilder:object:generate=true
// +groupName=core.oam.dev
// +versionName=v1alpha1
package v1alpha1

View File

@@ -0,0 +1,142 @@
/*
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/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
const (
// EnvBindingPolicyType refers to the type of EnvBinding
EnvBindingPolicyType = "env-binding"
)
// EnvTraitPatch is the patch to trait
type EnvTraitPatch struct {
Type string `json:"type"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
Disable bool `json:"disable,omitempty"`
}
// 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
}
// 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"`
}
// 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 []EnvComponentPatch `json:"components,omitempty"`
}
// NamespaceSelector defines the rules to select a Namespace resource.
// Either name or labels is needed.
type NamespaceSelector struct {
// Name is the name of the namespace.
Name string `json:"name,omitempty"`
// Labels defines the label selector to select the namespace.
Labels map[string]string `json:"labels,omitempty"`
}
// EnvPlacement defines the placement rules for an app.
type EnvPlacement struct {
ClusterSelector *common.ClusterSelector `json:"clusterSelector,omitempty"`
NamespaceSelector *NamespaceSelector `json:"namespaceSelector,omitempty"`
}
// EnvSelector defines which components should this env contains
type EnvSelector struct {
Components []string `json:"components,omitempty"`
}
// EnvConfig is the configuration for different environments.
type EnvConfig struct {
Name string `json:"name"`
Placement EnvPlacement `json:"placement,omitempty"`
Selector *EnvSelector `json:"selector,omitempty"`
Patch EnvPatch `json:"patch,omitempty"`
}
// EnvBindingSpec defines a list of envs
type EnvBindingSpec struct {
Envs []EnvConfig `json:"envs"`
}
// 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 {
if in.Namespace == "" {
return in.Cluster
}
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 {
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,108 @@
/*
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"`
// Order defines the order of garbage collect
Order GarbageCollectOrder `json:"order,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"`
}
// GarbageCollectOrder is the order of garbage collect
type GarbageCollectOrder string
const (
// OrderDependency is the order of dependency
OrderDependency GarbageCollectOrder = "dependency"
)
// GarbageCollectPolicyRule defines a single garbage-collect policy rule
type GarbageCollectPolicyRule struct {
Selector ResourcePolicyRuleSelector `json:"selector"`
Strategy GarbageCollectStrategy `json:"strategy"`
}
// ResourcePolicyRuleSelector select the targets of the rule
// 1) for GarbageCollectPolicyRule
// if both traitTypes, oamTypes and componentTypes are specified, combination logic is OR
// if one resource is specified with conflict strategies, strategy as component go first.
// 2) for ApplyOncePolicyRule only CompNames and ResourceTypes are used
type ResourcePolicyRuleSelector struct {
CompNames []string `json:"componentNames"`
CompTypes []string `json:"componentTypes"`
OAMResourceTypes []string `json:"oamTypes"`
TraitTypes []string `json:"traitTypes"`
ResourceTypes []string `json:"resourceTypes"`
}
// 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, oamType, traitType string
if labels := manifest.GetLabels(); labels != nil {
compName = labels[oam.LabelAppComponent]
compType = labels[oam.WorkloadTypeLabel]
oamType = labels[oam.LabelOAMResourceType]
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.OAMResourceTypes, oamType) ||
match(rule.Selector.TraitTypes, traitType) {
return &rule.Strategy
}
}
return nil
}

View File

@@ -0,0 +1,137 @@
/*
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: ResourcePolicyRuleSelector{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: ResourcePolicyRuleSelector{TraitTypes: []string{"a"}},
Strategy: GarbageCollectStrategyNever,
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{}},
notFound: true,
},
"trait type rule multiple match": {
rules: []GarbageCollectPolicyRule{{
Selector: ResourcePolicyRuleSelector{TraitTypes: []string{"a"}},
Strategy: GarbageCollectStrategyOnAppDelete,
}, {
Selector: ResourcePolicyRuleSelector{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: ResourcePolicyRuleSelector{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: ResourcePolicyRuleSelector{CompTypes: []string{"comp"}},
Strategy: GarbageCollectStrategyNever,
},
{
Selector: ResourcePolicyRuleSelector{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: ResourcePolicyRuleSelector{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,
},
"resource type rule match": {
rules: []GarbageCollectPolicyRule{{
Selector: ResourcePolicyRuleSelector{OAMResourceTypes: []string{"TRAIT"}},
Strategy: GarbageCollectStrategyNever,
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{oam.LabelOAMResourceType: "TRAIT"},
},
}},
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,55 @@
/*
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"
// DebugPolicyType refers to the type of debug policy
DebugPolicyType = "debug"
)
// 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

@@ -0,0 +1,58 @@
/*
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/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// Package type metadata.
const (
Group = common.Group
Version = "v1alpha1"
)
var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
// AddToScheme is a global function that registers this API group & version to a scheme
AddToScheme = SchemeBuilder.AddToScheme
)
// Policy meta
var (
PolicyKind = "Policy"
PolicyGroupVersionKind = SchemeGroupVersion.WithKind(PolicyKind)
)
// Workflow meta
var (
WorkflowKind = "Workflow"
WorkflowGroupVersionKind = SchemeGroupVersion.WithKind(WorkflowKind)
)
func init() {
SchemeBuilder.Register(&Policy{}, &PolicyList{})
SchemeBuilder.Register(&Workflow{}, &WorkflowList{})
}

View File

@@ -0,0 +1,728 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha1
import (
"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 *ApplyOncePolicyRule) DeepCopyInto(out *ApplyOncePolicyRule) {
*out = *in
in.Selector.DeepCopyInto(&out.Selector)
if in.Strategy != nil {
in, out := &in.Strategy, &out.Strategy
*out = new(ApplyOnceStrategy)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplyOncePolicyRule.
func (in *ApplyOncePolicyRule) DeepCopy() *ApplyOncePolicyRule {
if in == nil {
return nil
}
out := new(ApplyOncePolicyRule)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplyOncePolicySpec) DeepCopyInto(out *ApplyOncePolicySpec) {
*out = *in
if in.Rules != nil {
in, out := &in.Rules, &out.Rules
*out = make([]ApplyOncePolicyRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// 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(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 *ApplyOnceStrategy) DeepCopyInto(out *ApplyOnceStrategy) {
*out = *in
if in.Path != nil {
in, out := &in.Path, &out.Path
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplyOnceStrategy.
func (in *ApplyOnceStrategy) DeepCopy() *ApplyOnceStrategy {
if in == nil {
return nil
}
out := new(ApplyOnceStrategy)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterConnection) DeepCopyInto(out *ClusterConnection) {
*out = *in
}
// 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(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 *EnvBindingSpec) DeepCopyInto(out *EnvBindingSpec) {
*out = *in
if in.Envs != nil {
in, out := &in.Envs, &out.Envs
*out = make([]EnvConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvBindingSpec.
func (in *EnvBindingSpec) DeepCopy() *EnvBindingSpec {
if in == nil {
return nil
}
out := new(EnvBindingSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvBindingStatus) DeepCopyInto(out *EnvBindingStatus) {
*out = *in
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.ClusterConnections != nil {
in, out := &in.ClusterConnections, &out.ClusterConnections
*out = make([]ClusterConnection, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvBindingStatus.
func (in *EnvBindingStatus) DeepCopy() *EnvBindingStatus {
if in == nil {
return nil
}
out := new(EnvBindingStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *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
in.Placement.DeepCopyInto(&out.Placement)
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = new(EnvSelector)
(*in).DeepCopyInto(*out)
}
in.Patch.DeepCopyInto(&out.Patch)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvConfig.
func (in *EnvConfig) DeepCopy() *EnvConfig {
if in == nil {
return nil
}
out := new(EnvConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvPatch) DeepCopyInto(out *EnvPatch) {
*out = *in
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]EnvComponentPatch, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvPatch.
func (in *EnvPatch) DeepCopy() *EnvPatch {
if in == nil {
return nil
}
out := new(EnvPatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvPlacement) DeepCopyInto(out *EnvPlacement) {
*out = *in
if in.ClusterSelector != nil {
in, out := &in.ClusterSelector, &out.ClusterSelector
*out = new(common.ClusterSelector)
(*in).DeepCopyInto(*out)
}
if in.NamespaceSelector != nil {
in, out := &in.NamespaceSelector, &out.NamespaceSelector
*out = new(NamespaceSelector)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvPlacement.
func (in *EnvPlacement) DeepCopy() *EnvPlacement {
if in == nil {
return nil
}
out := new(EnvPlacement)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvSelector) DeepCopyInto(out *EnvSelector) {
*out = *in
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvSelector.
func (in *EnvSelector) DeepCopy() *EnvSelector {
if in == nil {
return nil
}
out := new(EnvSelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *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 *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
if in.Labels != nil {
in, out := &in.Labels, &out.Labels
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceSelector.
func (in *NamespaceSelector) DeepCopy() *NamespaceSelector {
if in == nil {
return nil
}
out := new(NamespaceSelector)
in.DeepCopyInto(out)
return out
}
// 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 *ResourcePolicyRuleSelector) DeepCopyInto(out *ResourcePolicyRuleSelector) {
*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.OAMResourceTypes != nil {
in, out := &in.OAMResourceTypes, &out.OAMResourceTypes
*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)
}
if in.ResourceTypes != nil {
in, out := &in.ResourceTypes, &out.ResourceTypes
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePolicyRuleSelector.
func (in *ResourcePolicyRuleSelector) DeepCopy() *ResourcePolicyRuleSelector {
if in == nil {
return nil
}
out := new(ResourcePolicyRuleSelector)
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)
if in.Steps != nil {
in, out := &in.Steps, &out.Steps
*out = make([]common.WorkflowStep, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workflow.
func (in *Workflow) DeepCopy() *Workflow {
if in == nil {
return nil
}
out := new(Workflow)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Workflow) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowList) DeepCopyInto(out *WorkflowList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Workflow, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowList.
func (in *WorkflowList) DeepCopy() *WorkflowList {
if in == nil {
return nil
}
out := new(WorkflowList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *WorkflowList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

View File

@@ -17,10 +17,9 @@ limitations under the License.
package v1alpha2
import (
"k8s.io/apimachinery/pkg/runtime"
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
@@ -38,13 +37,13 @@ type AppStatus struct {
Phase common.ApplicationPhase `json:"status,omitempty"`
// Components record the related Components created by Application Controller
Components []runtimev1alpha1.TypedReference `json:"components,omitempty"`
Components []corev1.ObjectReference `json:"components,omitempty"`
// Services record the status of the application services
Services []common.ApplicationComponentStatus `json:"services,omitempty"`
// ResourceTracker record the status of the ResourceTracker
ResourceTracker *runtimev1alpha1.TypedReference `json:"resourceTracker,omitempty"`
ResourceTracker *corev1.ObjectReference `json:"resourceTracker,omitempty"`
// LatestRevision of the application configuration it generates
// +optional
@@ -55,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
@@ -88,8 +87,14 @@ type ApplicationSpec struct {
// Application is the Schema for the applications API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam}
// +kubebuilder:resource:categories={oam},shortName={app,velaapp}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="COMPONENT",type=string,JSONPath=`.spec.components[*].name`
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.spec.components[*].type`
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.status`
// +kubebuilder:printcolumn:name="HEALTHY",type=boolean,JSONPath=`.status.services[*].healthy`
// +kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.services[*].message`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type Application struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

View File

@@ -1,48 +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"
)
// ApplicationContextSpec is the spec of ApplicationContext
type ApplicationContextSpec struct {
// ApplicationRevisionName points to the snapshot of an Application with all its closure
ApplicationRevisionName string `json:"applicationRevisionName"`
}
// ApplicationContext is the Schema for the ApplicationContext API
// +kubebuilder:object:root=true
// +kubebuilder:resource:shortName=appcontext,categories={oam}
// +kubebuilder:subresource:status
type ApplicationContext struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ApplicationContextSpec `json:"spec,omitempty"`
// we need to reuse the AC status
Status ApplicationConfigurationStatus `json:"status,omitempty"`
}
// ApplicationContextList contains a list of ApplicationContext
// +kubebuilder:object:root=true
type ApplicationContextList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ApplicationContext `json:"items"`
}

View File

@@ -55,7 +55,8 @@ type ApplicationRevisionSpec struct {
// ApplicationRevision is the Schema for the ApplicationRevision API
// +kubebuilder:object:root=true
// +kubebuilder:shortName=apprev,resource:categories={oam}
// +kubebuilder:resource:categories={oam},shortName=apprev
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type ApplicationRevision struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

View File

@@ -1,80 +0,0 @@
/*
Copyright 2020 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}
// +kubebuilder:subresource:status
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

@@ -17,10 +17,11 @@ limitations under the License.
package v1alpha2
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
@@ -59,16 +60,21 @@ type ComponentDefinitionSpec struct {
// ComponentDefinitionStatus is the status of ComponentDefinition
type ComponentDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
runtimev1alpha1.ConditionedStatus `json:",inline"`
condition.ConditionedStatus `json:",inline"`
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
ConfigMapRef string `json:"configMapRef,omitempty"`
// LatestRevision of the component definition
// +optional
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
}
// +kubebuilder:object:root=true
// ComponentDefinition is the Schema for the componentdefinitions API
// +kubebuilder:resource:scope=Namespaced,categories={oam}
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=comp
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="WORKLOAD-KIND",type=string,JSONPath=".spec.workload.definition.kind"
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
type ComponentDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -78,12 +84,12 @@ type ComponentDefinition struct {
}
// SetConditions set condition for WorkloadDefinition
func (cd *ComponentDefinition) SetConditions(c ...runtimev1alpha1.Condition) {
func (cd *ComponentDefinition) SetConditions(c ...condition.Condition) {
cd.Status.SetConditions(c...)
}
// GetCondition gets condition from WorkloadDefinition
func (cd *ComponentDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
func (cd *ComponentDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
return cd.Status.GetCondition(conditionType)
}

View File

@@ -20,9 +20,11 @@ import (
"fmt"
"reflect"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/conversion"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1"
)
@@ -39,11 +41,11 @@ func ApplicationV1alpha2ToV1beta1(v1a2 *Application, v1b1 *v1beta1.Application)
for _, comp := range v1a2.Spec.Components {
// convert trait, especially for `.name` -> `.type`
var traits = make([]v1beta1.ApplicationTrait, len(comp.Traits))
var traits = make([]common.ApplicationTrait, len(comp.Traits))
for j, trait := range comp.Traits {
traits[j] = v1beta1.ApplicationTrait{
traits[j] = common.ApplicationTrait{
Type: trait.Name,
Properties: *trait.Properties.DeepCopy(),
Properties: trait.Properties.DeepCopy(),
}
}
@@ -54,16 +56,14 @@ func ApplicationV1alpha2ToV1beta1(v1a2 *Application, v1b1 *v1beta1.Application)
}
// convert component
// `.settings` -> `.properties`
v1b1.Spec.Components = append(v1b1.Spec.Components, v1beta1.ApplicationComponent{
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()
@@ -103,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(),
}
}
@@ -114,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

@@ -1,5 +1,5 @@
/*
Copyright 2020 The KubeVela Authors.
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.
@@ -17,9 +17,11 @@ limitations under the License.
package v1alpha2
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/pkg/oam"
)
@@ -45,21 +47,50 @@ type HealthScopeSpec struct {
// ProbeInterval is the amount of time in seconds between probing tries.
ProbeInterval *int32 `json:"probe-interval,omitempty"`
// AppRefs records references of applications' components
AppRefs []AppReference `json:"appReferences,omitempty"`
// WorkloadReferences to the workloads that are in this scope.
WorkloadReferences []runtimev1alpha1.TypedReference `json:"workloadRefs"`
// +deprecated
WorkloadReferences []corev1.ObjectReference `json:"workloadRefs"`
}
// AppReference records references of an application's components
type AppReference struct {
AppName string `json:"appName,omitempty"`
CompReferences []CompReference `json:"compReferences,omitempty"`
}
// CompReference records references of a component's resources
type CompReference struct {
CompName string `json:"compName,omitempty"`
Workload corev1.ObjectReference `json:"workload,omitempty"`
Traits []corev1.ObjectReference `json:"traits,omitempty"`
}
// A HealthScopeStatus represents the observed state of a HealthScope.
type HealthScopeStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
condition.ConditionedStatus `json:",inline"`
// ScopeHealthCondition represents health condition summary of the scope
ScopeHealthCondition ScopeHealthCondition `json:"scopeHealthCondition"`
// AppHealthConditions represents health condition of applications in the scope
AppHealthConditions []*AppHealthCondition `json:"appHealthConditions,omitempty"`
// WorkloadHealthConditions represents health condition of workloads in the scope
// Use AppHealthConditions to provide app level status
// +deprecated
WorkloadHealthConditions []*WorkloadHealthCondition `json:"healthConditions,omitempty"`
}
// AppHealthCondition represents health condition of an application
type AppHealthCondition struct {
AppName string `json:"appName"`
EnvName string `json:"envName,omitempty"`
Components []*WorkloadHealthCondition `json:"components,omitempty"`
}
// ScopeHealthCondition represents health condition summary of a scope.
type ScopeHealthCondition struct {
HealthStatus HealthStatus `json:"healthStatus"`
@@ -69,15 +100,26 @@ type ScopeHealthCondition struct {
UnknownWorkloads int64 `json:"unknownWorkloads,omitempty"`
}
// WorkloadHealthCondition represents informative health condition.
// WorkloadHealthCondition represents informative health condition of a workload.
type WorkloadHealthCondition struct {
// ComponentName represents the component name if target is a workload
ComponentName string `json:"componentName,omitempty"`
TargetWorkload runtimev1alpha1.TypedReference `json:"targetWorkload,omitempty"`
HealthStatus HealthStatus `json:"healthStatus"`
Diagnosis string `json:"diagnosis,omitempty"`
ComponentName string `json:"componentName,omitempty"`
TargetWorkload corev1.ObjectReference `json:"targetWorkload,omitempty"`
HealthStatus HealthStatus `json:"healthStatus"`
Diagnosis string `json:"diagnosis,omitempty"`
// WorkloadStatus represents status of workloads whose HealthStatus is UNKNOWN.
WorkloadStatus string `json:"workloadStatus,omitempty"`
WorkloadStatus string `json:"workloadStatus,omitempty"`
CustomStatusMsg string `json:"customStatusMsg,omitempty"`
Traits []*TraitHealthCondition `json:"traits,omitempty"`
}
// TraitHealthCondition represents informative health condition of a trait.
type TraitHealthCondition struct {
Type string `json:"type"`
Resource string `json:"resource"`
HealthStatus HealthStatus `json:"healthStatus"`
Diagnosis string `json:"diagnosis,omitempty"`
CustomStatusMsg string `json:"customStatusMsg,omitempty"`
}
// +kubebuilder:object:root=true

View File

@@ -1,5 +1,5 @@
/*
Copyright 2020 The KubeVela Authors.
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.
@@ -17,9 +17,11 @@ limitations under the License.
package v1alpha2
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/pkg/oam"
)
@@ -31,13 +33,13 @@ type ManualScalerTraitSpec struct {
ReplicaCount int32 `json:"replicaCount"`
// WorkloadReference to the workload this trait applies to.
WorkloadReference runtimev1alpha1.TypedReference `json:"workloadRef"`
WorkloadReference corev1.ObjectReference `json:"workloadRef"`
}
// A ManualScalerTraitStatus represents the observed state of a
// ManualScalerTrait.
type ManualScalerTraitStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
condition.ConditionedStatus `json:",inline"`
}
// +kubebuilder:object:root=true

View File

@@ -1,5 +1,5 @@
/*
Copyright 2020 The KubeVela Authors.
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.
@@ -17,11 +17,13 @@ limitations under the License.
package v1alpha2
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/types"
)
@@ -60,7 +62,7 @@ type WorkloadDefinitionSpec struct {
// WorkloadDefinitionStatus is the status of WorkloadDefinition
type WorkloadDefinitionStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
condition.ConditionedStatus `json:",inline"`
}
// +kubebuilder:object:root=true
@@ -69,8 +71,8 @@ type WorkloadDefinitionStatus struct {
// valid OAM workload kind by referencing its CustomResourceDefinition. The CRD
// is used to validate the schema of the workload when it is embedded in an OAM
// Component.
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
// +kubebuilder:resource:scope=Namespaced,categories={oam}
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=workload
// +kubebuilder:printcolumn:name="DEFINITION-NAME",type=string,JSONPath=".spec.definitionRef.name"
type WorkloadDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -80,12 +82,12 @@ type WorkloadDefinition struct {
}
// SetConditions set condition for WorkloadDefinition
func (wd *WorkloadDefinition) SetConditions(c ...runtimev1alpha1.Condition) {
func (wd *WorkloadDefinition) SetConditions(c ...condition.Condition) {
wd.Status.SetConditions(c...)
}
// GetCondition gets condition from WorkloadDefinition
func (wd *WorkloadDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
func (wd *WorkloadDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
return wd.Status.GetCondition(conditionType)
}
@@ -111,6 +113,10 @@ type TraitDefinitionSpec struct {
// +optional
WorkloadRefPath string `json:"workloadRefPath,omitempty"`
// PodDisruptive specifies whether using the trait will cause the pod to restart or not.
// +optional
PodDisruptive bool `json:"podDisruptive,omitempty"`
// AppliesToWorkloads specifies the list of workload kinds this trait
// applies to. Workload kinds are specified in kind.group/version format,
// e.g. server.core.oam.dev/v1alpha2. Traits that omit this field apply to
@@ -147,9 +153,12 @@ type TraitDefinitionSpec struct {
// TraitDefinitionStatus is the status of TraitDefinition
type TraitDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
runtimev1alpha1.ConditionedStatus `json:",inline"`
condition.ConditionedStatus `json:",inline"`
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
ConfigMapRef string `json:"configMapRef,omitempty"`
// LatestRevision of the trait definition
// +optional
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
}
// +kubebuilder:object:root=true
@@ -158,9 +167,10 @@ type TraitDefinitionStatus struct {
// OAM trait kind by referencing its CustomResourceDefinition. The CRD is used
// to validate the schema of the trait when it is embedded in an OAM
// ApplicationConfiguration.
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
// +kubebuilder:resource:scope=Namespaced,categories={oam}
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=trait
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="APPLIES-TO",type=string,JSONPath=".spec.appliesToWorkloads"
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
type TraitDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -170,12 +180,12 @@ type TraitDefinition struct {
}
// SetConditions set condition for TraitDefinition
func (td *TraitDefinition) SetConditions(c ...runtimev1alpha1.Condition) {
func (td *TraitDefinition) SetConditions(c ...condition.Condition) {
td.Status.SetConditions(c...)
}
// GetCondition gets condition from TraitDefinition
func (td *TraitDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
func (td *TraitDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
return td.Status.GetCondition(conditionType)
}
@@ -213,7 +223,7 @@ type ScopeDefinitionSpec struct {
// to validate the schema of the scope when it is embedded in an OAM
// ApplicationConfiguration.
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
// +kubebuilder:resource:scope=Namespaced,categories={oam}
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=scope
type ScopeDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -281,7 +291,7 @@ type ComponentStatus struct {
// +optional
ObservedGeneration int64 `json:"observedGeneration"`
runtimev1alpha1.ConditionedStatus `json:",inline"`
condition.ConditionedStatus `json:",inline"`
// LatestRevision of component
// +optional
@@ -343,7 +353,7 @@ type ComponentTrait struct {
// A ComponentScope specifies a scope in which a component should exist.
type ComponentScope struct {
// A ScopeReference must refer to an OAM scope resource.
ScopeReference runtimev1alpha1.TypedReference `json:"scopeRef"`
ScopeReference corev1.ObjectReference `json:"scopeRef"`
}
// An ApplicationConfigurationComponent specifies a component of an
@@ -400,7 +410,7 @@ type WorkloadTrait struct {
Status TraitStatus `json:"status,omitempty"`
// Reference to a trait created by an ApplicationConfiguration.
Reference runtimev1alpha1.TypedReference `json:"traitRef"`
Reference corev1.ObjectReference `json:"traitRef"`
// Message will allow controller to leave some additional information for this trait
Message string `json:"message,omitempty"`
@@ -426,7 +436,7 @@ type WorkloadScope struct {
Status ScopeStatus `json:"status,omitempty"`
// Reference to a scope created by an ApplicationConfiguration.
Reference runtimev1alpha1.TypedReference `json:"scopeRef"`
Reference corev1.ObjectReference `json:"scopeRef"`
}
// A WorkloadStatus represents the status of a workload.
@@ -448,7 +458,7 @@ type WorkloadStatus struct {
AppliedComponentRevision string `json:"appliedComponentRevision,omitempty"`
// Reference to a workload created by an ApplicationConfiguration.
Reference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"`
Reference corev1.ObjectReference `json:"workloadRef,omitempty"`
// Traits associated with this workload.
Traits []WorkloadTrait `json:"traits,omitempty"`
@@ -463,7 +473,7 @@ type HistoryWorkload struct {
Revision string `json:"revision,omitempty"`
// Reference to running workload.
Reference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"`
Reference corev1.ObjectReference `json:"workloadRef,omitempty"`
}
// A ApplicationStatus represents the state of the entire application.
@@ -472,7 +482,7 @@ type ApplicationStatus string
// An ApplicationConfigurationStatus represents the observed state of a
// ApplicationConfiguration.
type ApplicationConfigurationStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
condition.ConditionedStatus `json:",inline"`
// Status is a place holder for a customized controller to fill
// if it needs a single place to summarize the status of the entire application
@@ -510,14 +520,14 @@ type UnstaifiedDependency struct {
// DependencyFromObject represents the object that dependency data comes from.
type DependencyFromObject struct {
runtimev1alpha1.TypedReference `json:",inline"`
FieldPath string `json:"fieldPath,omitempty"`
corev1.ObjectReference `json:",inline"`
FieldPath string `json:"fieldPath,omitempty"`
}
// DependencyToObject represents the object that dependency data goes to.
type DependencyToObject struct {
runtimev1alpha1.TypedReference `json:",inline"`
FieldPaths []string `json:"fieldPaths,omitempty"`
corev1.ObjectReference `json:",inline"`
FieldPaths []string `json:"fieldPaths,omitempty"`
}
// +kubebuilder:object:root=true
@@ -561,7 +571,7 @@ type DataOutput struct {
// StoreReference specifies the referenced object in DataOutput or DataInput
type StoreReference struct {
runtimev1alpha1.TypedReference `json:",inline"`
corev1.ObjectReference `json:",inline"`
// Operations specify the data processing operations
Operations []DataOperation `json:"operations,omitempty"`
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2020 The KubeVela Authors.
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.
@@ -19,12 +19,8 @@ limitations under the License.
package v1alpha2
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
"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/pkg/oam"
)
// An OperatingSystem required by a containerised workload.
@@ -357,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 {
runtimev1alpha1.ConditionedStatus `json:",inline"`
// Resources managed by this containerised workload.
Resources []runtimev1alpha1.TypedReference `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

@@ -1,5 +1,5 @@
/*
Copyright 2020 The KubeVela Authors.
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.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2020 The KubeVela Authors.
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.
@@ -19,75 +19,67 @@ limitations under the License.
package v1alpha2
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
corev1 "k8s.io/api/core/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// GetCondition of this ManualScalerTrait.
func (tr *ManualScalerTrait) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
func (tr *ManualScalerTrait) GetCondition(ct condition.ConditionType) condition.Condition {
return tr.Status.GetCondition(ct)
}
// SetConditions of this ManualScalerTrait.
func (tr *ManualScalerTrait) SetConditions(c ...runtimev1alpha1.Condition) {
func (tr *ManualScalerTrait) SetConditions(c ...condition.Condition) {
tr.Status.SetConditions(c...)
}
// GetWorkloadReference of this ManualScalerTrait.
func (tr *ManualScalerTrait) GetWorkloadReference() runtimev1alpha1.TypedReference {
func (tr *ManualScalerTrait) GetWorkloadReference() corev1.ObjectReference {
return tr.Spec.WorkloadReference
}
// SetWorkloadReference of this ManualScalerTrait.
func (tr *ManualScalerTrait) SetWorkloadReference(r runtimev1alpha1.TypedReference) {
func (tr *ManualScalerTrait) SetWorkloadReference(r corev1.ObjectReference) {
tr.Spec.WorkloadReference = r
}
// GetCondition of this ApplicationConfiguration.
func (ac *ApplicationConfiguration) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
func (ac *ApplicationConfiguration) GetCondition(ct condition.ConditionType) condition.Condition {
return ac.Status.GetCondition(ct)
}
// SetConditions of this ApplicationConfiguration.
func (ac *ApplicationConfiguration) SetConditions(c ...runtimev1alpha1.Condition) {
func (ac *ApplicationConfiguration) SetConditions(c ...condition.Condition) {
ac.Status.SetConditions(c...)
}
// GetCondition of this Component.
func (cm *Component) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
func (cm *Component) GetCondition(ct condition.ConditionType) condition.Condition {
return cm.Status.GetCondition(ct)
}
// SetConditions of this Component.
func (cm *Component) SetConditions(c ...runtimev1alpha1.Condition) {
func (cm *Component) SetConditions(c ...condition.Condition) {
cm.Status.SetConditions(c...)
}
// GetCondition of this ContainerizedWorkload.
func (wl *ContainerizedWorkload) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return wl.Status.GetCondition(ct)
}
// SetConditions of this ContainerizedWorkload.
func (wl *ContainerizedWorkload) SetConditions(c ...runtimev1alpha1.Condition) {
wl.Status.SetConditions(c...)
}
// GetCondition of this HealthScope.
func (hs *HealthScope) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
func (hs *HealthScope) GetCondition(ct condition.ConditionType) condition.Condition {
return hs.Status.GetCondition(ct)
}
// SetConditions of this HealthScope.
func (hs *HealthScope) SetConditions(c ...runtimev1alpha1.Condition) {
func (hs *HealthScope) SetConditions(c ...condition.Condition) {
hs.Status.SetConditions(c...)
}
// GetWorkloadReferences to get all workload references for scope.
func (hs *HealthScope) GetWorkloadReferences() []runtimev1alpha1.TypedReference {
func (hs *HealthScope) GetWorkloadReferences() []corev1.ObjectReference {
return hs.Spec.WorkloadReferences
}
// AddWorkloadReference to add a workload reference to this scope.
func (hs *HealthScope) AddWorkloadReference(r runtimev1alpha1.TypedReference) {
func (hs *HealthScope) AddWorkloadReference(r corev1.ObjectReference) {
hs.Spec.WorkloadReferences = append(hs.Spec.WorkloadReferences, r)
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2020 The KubeVela Authors.
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.
@@ -21,11 +21,13 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// Package type metadata.
const (
Group = "core.oam.dev"
Group = common.Group
Version = "v1alpha2"
)
@@ -85,22 +87,6 @@ var (
ApplicationConfigurationGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationConfigurationKind)
)
// ApplicationContext type metadata.
var (
ApplicationContextKind = reflect.TypeOf(ApplicationContext{}).Name()
ApplicationContextGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationContextKind}.String()
ApplicationContextKindAPIVersion = ApplicationContextKind + "." + SchemeGroupVersion.String()
ApplicationContextGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationContextKind)
)
// 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()
@@ -125,14 +111,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()
@@ -148,11 +126,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{})
SchemeBuilder.Register(&ApplicationContext{}, &ApplicationContextList{})
}

View File

@@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
@@ -21,109 +22,57 @@ limitations under the License.
package v1alpha2
import (
"github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
standard_oam_devv1alpha1 "github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
v1 "k8s.io/api/core/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"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRollout) DeepCopyInto(out *AppRollout) {
func (in *AppHealthCondition) DeepCopyInto(out *AppHealthCondition) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]*WorkloadHealthCondition, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(WorkloadHealthCondition)
(*in).DeepCopyInto(*out)
}
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRollout.
func (in *AppRollout) DeepCopy() *AppRollout {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppHealthCondition.
func (in *AppHealthCondition) DeepCopy() *AppHealthCondition {
if in == nil {
return nil
}
out := new(AppRollout)
out := new(AppHealthCondition)
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) {
func (in *AppReference) DeepCopyInto(out *AppReference) {
*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))
if in.CompReferences != nil {
in, out := &in.CompReferences, &out.CompReferences
*out = make([]CompReference, 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 {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppReference.
func (in *AppReference) DeepCopy() *AppReference {
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)
out := new(AppReference)
in.DeepCopyInto(out)
return out
}
@@ -134,7 +83,7 @@ func (in *AppStatus) DeepCopyInto(out *AppStatus) {
in.RolloutStatus.DeepCopyInto(&out.RolloutStatus)
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]v1alpha1.TypedReference, len(*in))
*out = make([]v1.ObjectReference, len(*in))
copy(*out, *in)
}
if in.Services != nil {
@@ -146,7 +95,7 @@ func (in *AppStatus) DeepCopyInto(out *AppStatus) {
}
if in.ResourceTracker != nil {
in, out := &in.ResourceTracker, &out.ResourceTracker
*out = new(v1alpha1.TypedReference)
*out = new(v1.ObjectReference)
**out = **in
}
if in.LatestRevision != nil {
@@ -379,80 +328,6 @@ func (in *ApplicationConfigurationStatus) DeepCopy() *ApplicationConfigurationSt
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationContext) DeepCopyInto(out *ApplicationContext) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationContext.
func (in *ApplicationContext) DeepCopy() *ApplicationContext {
if in == nil {
return nil
}
out := new(ApplicationContext)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ApplicationContext) 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 *ApplicationContextList) DeepCopyInto(out *ApplicationContextList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ApplicationContext, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationContextList.
func (in *ApplicationContextList) DeepCopy() *ApplicationContextList {
if in == nil {
return nil
}
out := new(ApplicationContextList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ApplicationContextList) 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 *ApplicationContextSpec) DeepCopyInto(out *ApplicationContextSpec) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationContextSpec.
func (in *ApplicationContextSpec) DeepCopy() *ApplicationContextSpec {
if in == nil {
return nil
}
out := new(ApplicationContextSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationList) DeepCopyInto(out *ApplicationList) {
*out = *in
@@ -607,7 +482,7 @@ func (in *ApplicationSpec) DeepCopyInto(out *ApplicationSpec) {
}
if in.RolloutPlan != nil {
in, out := &in.RolloutPlan, &out.RolloutPlan
*out = new(standard_oam_devv1alpha1.RolloutPlan)
*out = new(v1alpha1.RolloutPlan)
(*in).DeepCopyInto(*out)
}
}
@@ -625,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.
@@ -654,6 +533,27 @@ func (in *CPUResources) DeepCopy() *CPUResources {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CompReference) DeepCopyInto(out *CompReference) {
*out = *in
out.Workload = in.Workload
if in.Traits != nil {
in, out := &in.Traits, &out.Traits
*out = make([]v1.ObjectReference, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompReference.
func (in *CompReference) DeepCopy() *CompReference {
if in == nil {
return nil
}
out := new(CompReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Component) DeepCopyInto(out *Component) {
*out = *in
@@ -782,6 +682,11 @@ func (in *ComponentDefinitionSpec) DeepCopy() *ComponentDefinitionSpec {
func (in *ComponentDefinitionStatus) DeepCopyInto(out *ComponentDefinitionStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.LatestRevision != nil {
in, out := &in.LatestRevision, &out.LatestRevision
*out = new(common.Revision)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentDefinitionStatus.
@@ -1208,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([]v1alpha1.TypedReference, 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
@@ -1412,7 +1205,7 @@ func (in *DataOutput) DeepCopy() *DataOutput {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DependencyFromObject) DeepCopyInto(out *DependencyFromObject) {
*out = *in
out.TypedReference = in.TypedReference
out.ObjectReference = in.ObjectReference
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DependencyFromObject.
@@ -1450,7 +1243,7 @@ func (in *DependencyStatus) DeepCopy() *DependencyStatus {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DependencyToObject) DeepCopyInto(out *DependencyToObject) {
*out = *in
out.TypedReference = in.TypedReference
out.ObjectReference = in.ObjectReference
if in.FieldPaths != nil {
in, out := &in.FieldPaths, &out.FieldPaths
*out = make([]string, len(*in))
@@ -1648,9 +1441,16 @@ func (in *HealthScopeSpec) DeepCopyInto(out *HealthScopeSpec) {
*out = new(int32)
**out = **in
}
if in.AppRefs != nil {
in, out := &in.AppRefs, &out.AppRefs
*out = make([]AppReference, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.WorkloadReferences != nil {
in, out := &in.WorkloadReferences, &out.WorkloadReferences
*out = make([]v1alpha1.TypedReference, len(*in))
*out = make([]v1.ObjectReference, len(*in))
copy(*out, *in)
}
}
@@ -1670,6 +1470,17 @@ func (in *HealthScopeStatus) DeepCopyInto(out *HealthScopeStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
out.ScopeHealthCondition = in.ScopeHealthCondition
if in.AppHealthConditions != nil {
in, out := &in.AppHealthConditions, &out.AppHealthConditions
*out = make([]*AppHealthCondition, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(AppHealthCondition)
(*in).DeepCopyInto(*out)
}
}
}
if in.WorkloadHealthConditions != nil {
in, out := &in.WorkloadHealthConditions, &out.WorkloadHealthConditions
*out = make([]*WorkloadHealthCondition, len(*in))
@@ -1677,7 +1488,7 @@ func (in *HealthScopeStatus) DeepCopyInto(out *HealthScopeStatus) {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(WorkloadHealthCondition)
**out = **in
(*in).DeepCopyInto(*out)
}
}
}
@@ -1928,7 +1739,7 @@ func (in *SecretKeySelector) DeepCopy() *SecretKeySelector {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StoreReference) DeepCopyInto(out *StoreReference) {
*out = *in
out.TypedReference = in.TypedReference
out.ObjectReference = in.ObjectReference
if in.Operations != nil {
in, out := &in.Operations, &out.Operations
*out = make([]DataOperation, len(*in))
@@ -2067,6 +1878,11 @@ func (in *TraitDefinitionSpec) DeepCopy() *TraitDefinitionSpec {
func (in *TraitDefinitionStatus) DeepCopyInto(out *TraitDefinitionStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.LatestRevision != nil {
in, out := &in.LatestRevision, &out.LatestRevision
*out = new(common.Revision)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TraitDefinitionStatus.
@@ -2079,6 +1895,21 @@ 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 *TraitHealthCondition) DeepCopyInto(out *TraitHealthCondition) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TraitHealthCondition.
func (in *TraitHealthCondition) DeepCopy() *TraitHealthCondition {
if in == nil {
return nil
}
out := new(TraitHealthCondition)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *UnstaifiedDependency) DeepCopyInto(out *UnstaifiedDependency) {
*out = *in
@@ -2258,6 +2089,17 @@ func (in *WorkloadDefinitionStatus) DeepCopy() *WorkloadDefinitionStatus {
func (in *WorkloadHealthCondition) DeepCopyInto(out *WorkloadHealthCondition) {
*out = *in
out.TargetWorkload = in.TargetWorkload
if in.Traits != nil {
in, out := &in.Traits, &out.Traits
*out = make([]*TraitHealthCondition, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(TraitHealthCondition)
**out = **in
}
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadHealthCondition.

View File

@@ -1,197 +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 (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// 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"`
}
// ClusterSelector defines the rules to select a Cluster resource.
// Either name or labels is needed.
type ClusterSelector struct {
// Name is the name of the cluster.
Name string `json:"name,omitempty"`
// Labels defines the label selector to select the cluster.
Labels map[string]string `json:"labels,omitempty"`
}
// Distribution defines the replica distribution of an AppRevision to a cluster.
type Distribution struct {
// Replicas is the replica number.
Replicas int `json:"replicas,omitempty"`
}
// ClusterPlacement defines the cluster placement rules for an app revision.
type ClusterPlacement struct {
// ClusterSelector selects the cluster to deploy apps to.
// If not specified, it indicates the host cluster per se.
ClusterSelector *ClusterSelector `json:"clusterSelector,omitempty"`
// Distribution defines the replica distribution of an AppRevision to a cluster.
Distribution Distribution `json:"distribution,omitempty"`
}
// 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 []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.
runtimev1alpha1.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}
// +kubebuilder:subresource:status
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
type AppDeploymentList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AppDeployment `json:"items"`
}

View File

@@ -17,49 +17,64 @@
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/standard.oam.dev/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
const (
// TypeHealthy application are believed to be determined as healthy by a health scope.
TypeHealthy condition.ConditionType = "Healthy"
)
// Reasons an application is or is not healthy
const (
ReasonHealthy condition.ConditionReason = "AllComponentsHealthy"
ReasonUnhealthy condition.ConditionReason = "UnhealthyOrUnknownComponents"
ReasonHealthCheckErr condition.ConditionReason = "HealthCheckeError"
)
// AppPolicy defines a global policy for all components in the app.
type AppPolicy struct {
// Name is the unique name of the policy.
Name string `json:"name"`
// ApplicationTrait defines the trait of application
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
type ApplicationComponent struct {
Name string `json:"name"`
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
// WorkflowStep defines how to execute a workflow step.
type WorkflowStep common.WorkflowStep
// Traits define the trait of one component, the type must be array to keep the order.
Traits []ApplicationTrait `json:"traits,omitempty"`
// +kubebuilder:pruning:PreserveUnknownFields
// scopes in ApplicationComponent defines the component-level scopes
// the format is <scope-type:scope-instance-name> pairs, the key represents type of `ScopeDefinition` while the value represent the name of scope instance.
Scopes map[string]string `json:"scopes,omitempty"`
// Workflow defines workflow steps and other attributes
type Workflow struct {
Ref string `json:"ref,omitempty"`
Steps []WorkflowStep `json:"steps,omitempty"`
}
// ApplicationSpec is the spec of Application
type ApplicationSpec struct {
Components []ApplicationComponent `json:"components"`
Components []common.ApplicationComponent `json:"components"`
// Policies defines the global policies for all components in the app, e.g. security, metrics, gitops,
// multi-cluster placement rules, etc.
// Policies are applied after components are rendered and before workflow steps are executed.
Policies []AppPolicy `json:"policies,omitempty"`
// Workflow defines how to customize the control logic.
// If workflow is specified, Vela won't apply any resource, but provide rendered output in AppRevision.
// Workflow steps are executed in array order, and each step:
// - will have a context in annotation.
// - should mark "finish" phase in status.conditions.
Workflow *Workflow `json:"workflow,omitempty"`
// TODO(wonderflow): we should have application level scopes supported here
// RolloutPlan is the details on how to rollout the resources
// The controller simply replace the old resources with the new one if there is no rollout plan involved
// +optional
RolloutPlan *v1alpha1.RolloutPlan `json:"rolloutPlan,omitempty"`
}
// +kubebuilder:object:root=true
@@ -67,6 +82,15 @@ type ApplicationSpec struct {
// Application is the Schema for the applications API
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:resource:categories={oam},shortName={app,velaapp}
// +kubebuilder:printcolumn:name="COMPONENT",type=string,JSONPath=`.spec.components[*].name`
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.spec.components[*].type`
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.status`
// +kubebuilder:printcolumn:name="HEALTHY",type=boolean,JSONPath=`.status.services[*].healthy`
// +kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.services[*].message`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Application struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -78,14 +102,25 @@ type Application struct {
// +kubebuilder:object:root=true
// ApplicationList contains a list of Application
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ApplicationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Application `json:"items"`
}
// SetConditions set condition to application
func (app *Application) SetConditions(c ...condition.Condition) {
app.Status.SetConditions(c...)
}
// GetCondition get condition by given condition type
func (app *Application) GetCondition(t condition.ConditionType) condition.Condition {
return app.Status.GetCondition(t)
}
// GetComponent get the component from the application based on its workload type
func (app *Application) GetComponent(workloadType string) *ApplicationComponent {
func (app *Application) GetComponent(workloadType string) *common.ApplicationComponent {
for _, c := range app.Spec.Components {
if c.Type == workloadType {
return &c
@@ -93,3 +128,36 @@ func (app *Application) GetComponent(workloadType string) *ApplicationComponent
}
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

@@ -18,9 +18,9 @@ package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha1"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
@@ -42,30 +42,57 @@ type ApplicationRevisionSpec struct {
// ScopeDefinitions records the snapshot of the scopeDefinitions related with the created/modified Application
ScopeDefinitions map[string]ScopeDefinition `json:"scopeDefinitions,omitempty"`
// Components records the rendered components from Application, it will contains the whole K8s CR of workload in it.
Components []common.RawComponent `json:"components,omitempty"`
// PolicyDefinitions records the snapshot of the PolicyDefinitions related with the created/modified Application
PolicyDefinitions map[string]PolicyDefinition `json:"policyDefinitions,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
// WorkflowStepDefinitions records the snapshot of the WorkflowStepDefinitions related with the created/modified Application
WorkflowStepDefinitions map[string]WorkflowStepDefinition `json:"workflowStepDefinitions,omitempty"`
// ScopeGVK records the apiVersion to GVK mapping
ScopeGVK map[string]metav1.GroupVersionKind `json:"scopeGVK,omitempty"`
// Policies records the external policies
Policies map[string]v1alpha1.Policy `json:"policies,omitempty"`
// 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
ApplicationConfiguration runtime.RawExtension `json:"applicationConfiguration"`
ReferredObjects []common.ReferredObject `json:"referredObjects,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
// 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
// ApplicationRevisionList contains a list of ApplicationRevision
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ApplicationRevisionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`

View File

@@ -1,82 +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/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 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}
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
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

@@ -1,61 +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
// 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
// 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,10 +17,11 @@
package v1beta1
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
@@ -59,17 +60,24 @@ type ComponentDefinitionSpec struct {
// ComponentDefinitionStatus is the status of ComponentDefinition
type ComponentDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
runtimev1alpha1.ConditionedStatus `json:",inline"`
condition.ConditionedStatus `json:",inline"`
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
ConfigMapRef string `json:"configMapRef,omitempty"`
// LatestRevision of the component definition
// +optional
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
}
// +kubebuilder:object:root=true
// ComponentDefinition is the Schema for the componentdefinitions API
// +kubebuilder:resource:scope=Namespaced,categories={oam}
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=comp
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="WORKLOAD-KIND",type=string,JSONPath=".spec.workload.definition.kind"
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ComponentDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -78,17 +86,18 @@ type ComponentDefinition struct {
Status ComponentDefinitionStatus `json:"status,omitempty"`
}
// SetConditions set condition for WorkloadDefinition
func (cd *ComponentDefinition) SetConditions(c ...runtimev1alpha1.Condition) {
// SetConditions set condition for ComponentDefinition
func (cd *ComponentDefinition) SetConditions(c ...condition.Condition) {
cd.Status.SetConditions(c...)
}
// GetCondition gets condition from WorkloadDefinition
func (cd *ComponentDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
// GetCondition gets condition from ComponentDefinition
func (cd *ComponentDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
return cd.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ComponentDefinitionList contains a list of ComponentDefinition
type ComponentDefinitionList struct {

View File

@@ -17,10 +17,11 @@
package v1beta1
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
@@ -58,7 +59,7 @@ type WorkloadDefinitionSpec struct {
// WorkloadDefinitionStatus is the status of WorkloadDefinition
type WorkloadDefinitionStatus struct {
runtimev1alpha1.ConditionedStatus `json:",inline"`
condition.ConditionedStatus `json:",inline"`
}
// +kubebuilder:object:root=true
@@ -67,9 +68,12 @@ type WorkloadDefinitionStatus struct {
// valid OAM workload kind by referencing its CustomResourceDefinition. The CRD
// is used to validate the schema of the workload when it is embedded in an OAM
// Component.
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
// +kubebuilder:resource:scope=Namespaced,categories={oam}
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=workload
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="DEFINITION-NAME",type=string,JSONPath=".spec.definitionRef.name"
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type WorkloadDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -79,18 +83,19 @@ type WorkloadDefinition struct {
}
// SetConditions set condition for WorkloadDefinition
func (wd *WorkloadDefinition) SetConditions(c ...runtimev1alpha1.Condition) {
func (wd *WorkloadDefinition) SetConditions(c ...condition.Condition) {
wd.Status.SetConditions(c...)
}
// GetCondition gets condition from WorkloadDefinition
func (wd *WorkloadDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
func (wd *WorkloadDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
return wd.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// WorkloadDefinitionList contains a list of WorkloadDefinition.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type WorkloadDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
@@ -110,6 +115,10 @@ type TraitDefinitionSpec struct {
// +optional
WorkloadRefPath string `json:"workloadRefPath,omitempty"`
// PodDisruptive specifies whether using the trait will cause the pod to restart or not.
// +optional
PodDisruptive bool `json:"podDisruptive,omitempty"`
// AppliesToWorkloads specifies the list of workload kinds this trait
// applies to. Workload kinds are specified in kind.group/version format,
// e.g. server.core.oam.dev/v1alpha2. Traits that omit this field apply to
@@ -141,14 +150,27 @@ type TraitDefinitionSpec struct {
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
// ManageWorkload defines the trait would be responsible for creating the workload
// +optional
ManageWorkload bool `json:"manageWorkload,omitempty"`
// SkipRevisionAffect defines the update this trait will not generate a new application Revision
// +optional
SkipRevisionAffect bool `json:"skipRevisionAffect,omitempty"`
// ControlPlaneOnly defines which cluster is dispatched to
// +optional
ControlPlaneOnly bool `json:"controlPlaneOnly,omitempty"`
}
// TraitDefinitionStatus is the status of TraitDefinition
type TraitDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
runtimev1alpha1.ConditionedStatus `json:",inline"`
condition.ConditionedStatus `json:",inline"`
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
ConfigMapRef string `json:"configMapRef,omitempty"`
// LatestRevision of the component definition
// +optional
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
}
// +kubebuilder:object:root=true
@@ -157,10 +179,13 @@ type TraitDefinitionStatus struct {
// OAM trait kind by referencing its CustomResourceDefinition. The CRD is used
// to validate the schema of the trait when it is embedded in an OAM
// ApplicationConfiguration.
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
// +kubebuilder:resource:scope=Namespaced,categories={oam}
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=trait
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="APPLIES-TO",type=string,JSONPath=".spec.appliesToWorkloads"
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type TraitDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -170,16 +195,17 @@ type TraitDefinition struct {
}
// SetConditions set condition for TraitDefinition
func (td *TraitDefinition) SetConditions(c ...runtimev1alpha1.Condition) {
func (td *TraitDefinition) SetConditions(c ...condition.Condition) {
td.Status.SetConditions(c...)
}
// GetCondition gets condition from TraitDefinition
func (td *TraitDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
func (td *TraitDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
return td.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// TraitDefinitionList contains a list of TraitDefinition.
type TraitDefinitionList struct {
@@ -213,8 +239,10 @@ type ScopeDefinitionSpec struct {
// to validate the schema of the scope when it is embedded in an OAM
// ApplicationConfiguration.
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
// +kubebuilder:resource:scope=Namespaced,categories={oam}
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=scope
// +kubebuilder:storageversion
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ScopeDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -223,6 +251,7 @@ type ScopeDefinition struct {
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ScopeDefinitionList contains a list of ScopeDefinition.
type ScopeDefinitionList struct {
@@ -230,21 +259,3 @@ type ScopeDefinitionList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []ScopeDefinition `json:"items"`
}
// +kubebuilder:object:root=true
// An ResourceTracker represents a tracker for track cross namespace resources
// +kubebuilder:resource:scope=Cluster,categories={oam}
type ResourceTracker struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
}
// +kubebuilder:object:root=true
// ResourceTrackerList contains a list of ResourceTracker
type ResourceTrackerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ResourceTracker `json:"items"`
}

View File

@@ -0,0 +1,73 @@
/*
Copyright 2021. The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// DefinitionRevisionSpec is the spec of DefinitionRevision
type DefinitionRevisionSpec struct {
// Revision record revision number of DefinitionRevision
Revision int64 `json:"revision"`
// RevisionHash record the hash value of the spec of DefinitionRevision object.
RevisionHash string `json:"revisionHash"`
// DefinitionType
DefinitionType common.DefinitionType `json:"definitionType"`
// ComponentDefinition records the snapshot of the created/modified ComponentDefinition
ComponentDefinition ComponentDefinition `json:"componentDefinition,omitempty"`
// TraitDefinition records the snapshot of the created/modified TraitDefinition
TraitDefinition TraitDefinition `json:"traitDefinition,omitempty"`
// PolicyDefinition records the snapshot of the created/modified PolicyDefinition
PolicyDefinition PolicyDefinition `json:"policyDefinition,omitempty"`
// WorkflowStepDefinition records the snapshot of the created/modified WorkflowStepDefinition
WorkflowStepDefinition WorkflowStepDefinition `json:"workflowStepDefinition,omitempty"`
}
// +kubebuilder:object:root=true
// DefinitionRevision is the Schema for the DefinitionRevision API
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=defrev
// +kubebuilder:printcolumn:name="REVISION",type=integer,JSONPath=".spec.revision"
// +kubebuilder:printcolumn:name="HASH",type=string,JSONPath=".spec.revisionHash"
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=".spec.definitionType"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type DefinitionRevision struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec DefinitionRevisionSpec `json:"spec,omitempty"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// DefinitionRevisionList contains a list of DefinitionRevision
type DefinitionRevisionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []DefinitionRevision `json:"items"`
}

View File

@@ -0,0 +1,88 @@
/*
Copyright 2021. The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// PolicyDefinitionSpec defines the desired state of PolicyDefinition
type PolicyDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this trait kind.
Reference common.DefinitionReference `json:"definitionRef,omitempty"`
// Schematic defines the data format and template of the encapsulation of the policy definition
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
// ManageHealthCheck means the policy will handle health checking and skip application controller
// built-in health checking.
ManageHealthCheck bool `json:"manageHealthCheck,omitempty"`
}
// PolicyDefinitionStatus is the status of PolicyDefinition
type PolicyDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
condition.ConditionedStatus `json:",inline"`
// 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"`
}
// SetConditions set condition for PolicyDefinition
func (d *PolicyDefinition) SetConditions(c ...condition.Condition) {
d.Status.SetConditions(c...)
}
// GetCondition gets condition from PolicyDefinition
func (d *PolicyDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
return d.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// PolicyDefinition is the Schema for the policydefinitions API
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=def-policy
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type PolicyDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec PolicyDefinitionSpec `json:"spec,omitempty"`
Status PolicyDefinitionStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PolicyDefinitionList contains a list of PolicyDefinition
type PolicyDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []PolicyDefinition `json:"items"`
}

View File

@@ -21,11 +21,13 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// Package type metadata.
const (
Group = "core.oam.dev"
Group = common.Group
Version = "v1beta1"
)
@@ -35,6 +37,9 @@ 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
)
// ComponentDefinition type metadata.
@@ -61,6 +66,30 @@ var (
TraitDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(TraitDefinitionKind)
)
// PolicyDefinition type metadata.
var (
PolicyDefinitionKind = reflect.TypeOf(PolicyDefinition{}).Name()
PolicyDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: PolicyDefinitionKind}.String()
PolicyDefinitionKindAPIVersion = PolicyDefinitionKind + "." + SchemeGroupVersion.String()
PolicyDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(PolicyDefinitionKind)
)
// WorkflowStepDefinition type metadata.
var (
WorkflowStepDefinitionKind = reflect.TypeOf(WorkflowStepDefinition{}).Name()
WorkflowStepDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: WorkflowStepDefinitionKind}.String()
WorkflowStepDefinitionKindAPIVersion = WorkflowStepDefinitionKind + "." + SchemeGroupVersion.String()
WorkflowStepDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(WorkflowStepDefinitionKind)
)
// DefinitionRevision type metadata.
var (
DefinitionRevisionKind = reflect.TypeOf(DefinitionRevision{}).Name()
DefinitionRevisionGroupKind = schema.GroupKind{Group: Group, Kind: DefinitionRevisionKind}.String()
DefinitionRevisionKindAPIVersion = DefinitionRevisionKind + "." + SchemeGroupVersion.String()
DefinitionRevisionGroupVersionKind = SchemeGroupVersion.WithKind(DefinitionRevisionKind)
)
// Application type metadata.
var (
ApplicationKind = reflect.TypeOf(Application{}).Name()
@@ -69,14 +98,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()
@@ -101,31 +122,20 @@ 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)
)
func init() {
SchemeBuilder.Register(&ComponentDefinition{}, &ComponentDefinitionList{})
SchemeBuilder.Register(&WorkloadDefinition{}, &WorkloadDefinitionList{})
SchemeBuilder.Register(&TraitDefinition{}, &TraitDefinitionList{})
SchemeBuilder.Register(&PolicyDefinition{}, &PolicyDefinitionList{})
SchemeBuilder.Register(&WorkflowStepDefinition{}, &WorkflowStepDefinitionList{})
SchemeBuilder.Register(&DefinitionRevision{}, &DefinitionRevisionList{})
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
SchemeBuilder.Register(&Application{}, &ApplicationList{})
SchemeBuilder.Register(&AppRollout{}, &AppRolloutList{})
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})
SchemeBuilder.Register(&AppDeployment{}, &AppDeploymentList{})
SchemeBuilder.Register(&Cluster{}, &ClusterList{})
SchemeBuilder.Register(&ResourceTracker{}, &ResourceTrackerList{})
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}

View File

@@ -0,0 +1,296 @@
/*
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
}
func newManagedResourceFromResource(rsc client.Object) ManagedResource {
gvk := rsc.GetObjectKind().GroupVersionKind()
return 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,
}
}
// ContainsManagedResource check if resource exists in ResourceTracker
func (in *ResourceTracker) ContainsManagedResource(rsc client.Object) bool {
mr := newManagedResourceFromResource(rsc)
return in.findMangedResourceIndex(mr) >= 0
}
// AddManagedResource add object to managed resources, if exists, update
func (in *ResourceTracker) AddManagedResource(rsc client.Object, metaOnly bool, creator common.ResourceCreatorRole) (updated bool) {
mr := newManagedResourceFromResource(rsc)
if !metaOnly {
mr.Data = &runtime.RawExtension{Object: rsc}
}
if creator != "" {
mr.ClusterObjectReference.Creator = creator
}
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

@@ -0,0 +1,82 @@
/*
Copyright 2021. The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// WorkflowStepDefinitionSpec defines the desired state of WorkflowStepDefinition
type WorkflowStepDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this trait kind.
Reference common.DefinitionReference `json:"definitionRef,omitempty"`
// Schematic defines the data format and template of the encapsulation of the workflow step definition
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
}
// WorkflowStepDefinitionStatus is the status of WorkflowStepDefinition
type WorkflowStepDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
condition.ConditionedStatus `json:",inline"`
// 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"`
}
// SetConditions set condition for WorkflowStepDefinition
func (d *WorkflowStepDefinition) SetConditions(c ...condition.Condition) {
d.Status.SetConditions(c...)
}
// GetCondition gets condition from WorkflowStepDefinition
func (d *WorkflowStepDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
return d.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// WorkflowStepDefinition is the Schema for the workflowstepdefinitions API
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=workflowstep
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type WorkflowStepDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec WorkflowStepDefinitionSpec `json:"spec,omitempty"`
Status WorkflowStepDefinitionStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// WorkflowStepDefinitionList contains a list of WorkflowStepDefinition
type WorkflowStepDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []WorkflowStepDefinition `json:"items"`
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,4 @@
//go:build generate
// +build generate
/*
@@ -22,14 +23,12 @@ limitations under the License.
// NOTE(@wonderflow) We don't remove existing CRDs here, because the crd folders contain not only auto generated.
// Generate deepcopy methodsets and CRD manifests
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:crdVersions=v1 output:artifacts:config=../config/crd/base
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:crdVersions=v1,generateEmbeddedObjectMeta=true output:artifacts:config=../config/crd/base
// Generate legacy_support for K8s 1.12~1.15 versions CRD manifests
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:trivialVersions=true output:artifacts:config=../legacy/charts/vela-core-legacy/crds
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:generateEmbeddedObjectMeta=true output:artifacts:config=../legacy/charts/vela-core-legacy/crds
//go:generate go run ../legacy/convert/main.go ../legacy/charts/vela-core-legacy/crds
//go:generate go run ../hack/crd/update.go ../charts/vela-core/crds/standard.oam.dev_podspecworkloads.yaml
package apis
import (

View File

@@ -0,0 +1,35 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package interfaces
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)
// 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,85 +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 (
cpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/pkg/oam"
)
// PodSpecWorkloadSpec defines the desired state of PodSpecWorkload
type PodSpecWorkloadSpec struct {
// Replicas is the desired number of replicas of the given podSpec.
// These are replicas in the sense that they are instantiations of the same podSpec.
// If unspecified, defaults to 1.
Replicas *int32 `json:"replicas,omitempty"`
// PodSpec describes the pods that will be created,
// we omit the meta part as it will be exactly the same as the PodSpecWorkload
PodSpec v1.PodSpec `json:"podSpec"`
}
// PodSpecWorkloadStatus defines the observed state of PodSpecWorkload
type PodSpecWorkloadStatus struct {
cpv1alpha1.ConditionedStatus `json:",inline"`
// Resources managed by this workload.
Resources []cpv1alpha1.TypedReference `json:"resources,omitempty"`
}
// +kubebuilder:object:root=true
// PodSpecWorkload is the Schema for the PodSpec API
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
type PodSpecWorkload struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec PodSpecWorkloadSpec `json:"spec,omitempty"`
Status PodSpecWorkloadStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// PodSpecWorkloadList contains a list of PodSpecWorkload
type PodSpecWorkloadList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []PodSpecWorkload `json:"items"`
}
func init() {
SchemeBuilder.Register(&PodSpecWorkload{}, &PodSpecWorkloadList{})
}
var _ oam.Workload = &PodSpecWorkload{}
// SetConditions set condition for this CR
func (in *PodSpecWorkload) SetConditions(c ...cpv1alpha1.Condition) {
in.Status.SetConditions(c...)
}
// GetCondition set condition for this CR
func (in *PodSpecWorkload) GetCondition(c cpv1alpha1.ConditionType) cpv1alpha1.Condition {
return in.Status.GetCondition(c)
}

View File

@@ -0,0 +1,35 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
"reflect"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// Rollout type metadata
var (
RolloutKind = reflect.TypeOf(Rollout{}).Name()
RolloutGroupKind = schema.GroupKind{Group: GroupName, Kind: RolloutKind}.String()
RolloutKindAPIVersion = RolloutKind + "." + SchemeGroupVersion.String()
RolloutKindVersionKind = SchemeGroupVersion.WithKind(RolloutKind)
)
func init() {
SchemeBuilder.Register(&Rollout{}, &RolloutList{})
}

View File

@@ -17,8 +17,10 @@ limitations under the License.
package v1alpha1
import (
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// RolloutStrategyType defines strategies for pods rollout
@@ -50,6 +52,9 @@ const (
type RollingState string
const (
// LocatingTargetAppState indicates that the rollout is in the stage of locating target app
// we use this state to make sure we special handle the target app successfully only once
LocatingTargetAppState RollingState = "locatingTargetApp"
// VerifyingSpecState indicates that the rollout is in the stage of verifying the rollout settings
// and the controller can locate both the target and the source
VerifyingSpecState RollingState = "verifyingSpec"
@@ -64,8 +69,12 @@ const (
RolloutFailingState RollingState = "rolloutFailing"
// RolloutSucceedState indicates that rollout successfully completed to match the desired target state
RolloutSucceedState RollingState = "rolloutSucceed"
// RolloutAbandoningState indicates that the rollout is abandoned, can be restarted. This is a terminal state
RolloutAbandoningState RollingState = "rolloutAbandoned"
// RolloutAbandoningState indicates that the rollout is being abandoned
// we need to finalize it by cleaning up the old resources, adjust traffic and return control back to its owner
RolloutAbandoningState RollingState = "rolloutAbandoning"
// RolloutDeletingState indicates that the rollout is being deleted
// we need to finalize it by cleaning up the old resources, adjust traffic and return control back to its owner
RolloutDeletingState RollingState = "RolloutDeletingState"
// RolloutFailedState indicates that rollout is failed, the target replica is not reached
// we can not move forward anymore, we will let the client to decide when or whether to revert.
RolloutFailedState RollingState = "rolloutFailed"
@@ -221,7 +230,7 @@ type CanaryMetric struct {
// TemplateRef references a metric template object
// +optional
TemplateRef *runtimev1alpha1.TypedReference `json:"templateRef,omitempty"`
TemplateRef *corev1.ObjectReference `json:"templateRef,omitempty"`
}
// MetricsExpectedRange defines the range used for metrics validation
@@ -238,11 +247,15 @@ type MetricsExpectedRange struct {
// RolloutStatus defines the observed state of a rollout plan
type RolloutStatus struct {
// Conditions represents the latest available observations of a CloneSet's current state.
runtimev1alpha1.ConditionedStatus `json:",inline"`
condition.ConditionedStatus `json:",inline"`
// RolloutTargetTotalSize is the size of the target resources. This is determined once the initial spec verification
// 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
RolloutTargetTotalSize int32 `json:"rolloutTargetSize,omitempty"`
RolloutOriginalSize int32 `json:"rolloutOriginalSize,omitempty"`
// RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification
// and does not change until the rollout is restarted
RolloutTargetSize int32 `json:"rolloutTargetSize,omitempty"`
// NewPodTemplateIdentifier is a string that uniquely represent the new pod template
// each workload type could use different ways to identify that so we cannot compare between resources

View File

@@ -20,7 +20,8 @@ import (
"fmt"
"time"
runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
@@ -36,9 +37,15 @@ const (
// RollingRetriableFailureEvent indicates that we encountered an unexpected but retriable error
RollingRetriableFailureEvent RolloutEvent = "RollingRetriableFailureEvent"
// AppLocatedEvent indicates that apps are located successfully
AppLocatedEvent RolloutEvent = "AppLocatedEvent"
// RollingModifiedEvent indicates that the rolling target or source has changed
RollingModifiedEvent RolloutEvent = "RollingModifiedEvent"
// RollingDeletedEvent indicates that the rolling is being deleted
RollingDeletedEvent RolloutEvent = "RollingDeletedEvent"
// RollingSpecVerifiedEvent indicates that we have successfully verified that the rollout spec
RollingSpecVerifiedEvent RolloutEvent = "RollingSpecVerifiedEvent"
@@ -75,38 +82,40 @@ const (
// These are valid conditions of the rollout.
const (
// RolloutSpecVerifying indicates that the rollout just started with verification
RolloutSpecVerifying runtimev1alpha1.ConditionType = "RolloutSpecVerifying"
RolloutSpecVerifying condition.ConditionType = "RolloutSpecVerifying"
// RolloutInitializing means we start to initialize the cluster
RolloutInitializing runtimev1alpha1.ConditionType = "RolloutInitializing"
RolloutInitializing condition.ConditionType = "RolloutInitializing"
// RolloutInProgress means we are upgrading resources.
RolloutInProgress runtimev1alpha1.ConditionType = "RolloutInProgress"
RolloutInProgress condition.ConditionType = "RolloutInProgress"
// RolloutFinalizing means the rollout is finalizing
RolloutFinalizing runtimev1alpha1.ConditionType = "RolloutFinalizing"
RolloutFinalizing condition.ConditionType = "RolloutFinalizing"
// RolloutFailing means the rollout is failing
RolloutFailing runtimev1alpha1.ConditionType = "RolloutFailing"
RolloutFailing condition.ConditionType = "RolloutFailing"
// RolloutAbandoning means that the rollout is being abandoned.
RolloutAbandoning runtimev1alpha1.ConditionType = "RolloutAbandoning"
RolloutAbandoning condition.ConditionType = "RolloutAbandoning"
// RolloutDeleting means that the rollout is being deleted.
RolloutDeleting condition.ConditionType = "RolloutDeleting"
// RolloutFailed means that the rollout failed.
RolloutFailed runtimev1alpha1.ConditionType = "RolloutFailed"
RolloutFailed condition.ConditionType = "RolloutFailed"
// RolloutSucceed means that the rollout is done.
RolloutSucceed runtimev1alpha1.ConditionType = "RolloutSucceed"
RolloutSucceed condition.ConditionType = "RolloutSucceed"
// BatchInitializing
BatchInitializing runtimev1alpha1.ConditionType = "BatchInitializing"
BatchInitializing condition.ConditionType = "BatchInitializing"
// BatchPaused
BatchPaused runtimev1alpha1.ConditionType = "BatchPaused"
BatchPaused condition.ConditionType = "BatchPaused"
// BatchVerifying
BatchVerifying runtimev1alpha1.ConditionType = "BatchVerifying"
BatchVerifying condition.ConditionType = "BatchVerifying"
// BatchRolloutFailed
BatchRolloutFailed runtimev1alpha1.ConditionType = "BatchRolloutFailed"
BatchRolloutFailed condition.ConditionType = "BatchRolloutFailed"
// BatchFinalizing
BatchFinalizing runtimev1alpha1.ConditionType = "BatchFinalizing"
BatchFinalizing condition.ConditionType = "BatchFinalizing"
// BatchReady
BatchReady runtimev1alpha1.ConditionType = "BatchReady"
BatchReady condition.ConditionType = "BatchReady"
)
// NewPositiveCondition creates a positive condition type
func NewPositiveCondition(condType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
return runtimev1alpha1.Condition{
func NewPositiveCondition(condType condition.ConditionType) condition.Condition {
return condition.Condition{
Type: condType,
Status: v1.ConditionTrue,
LastTransitionTime: metav1.NewTime(time.Now()),
@@ -114,8 +123,8 @@ func NewPositiveCondition(condType runtimev1alpha1.ConditionType) runtimev1alpha
}
// NewNegativeCondition creates a false condition type
func NewNegativeCondition(condType runtimev1alpha1.ConditionType, message string) runtimev1alpha1.Condition {
return runtimev1alpha1.Condition{
func NewNegativeCondition(condType condition.ConditionType, message string) condition.Condition {
return condition.Condition{
Type: condType,
Status: v1.ConditionFalse,
LastTransitionTime: metav1.NewTime(time.Now()),
@@ -127,7 +136,7 @@ const invalidRollingStateTransition = "the rollout state transition from `%s` st
const invalidBatchRollingStateTransition = "the batch rolling state transition from `%s` state with `%s` is invalid"
func (r *RolloutStatus) getRolloutConditionType() runtimev1alpha1.ConditionType {
func (r *RolloutStatus) getRolloutConditionType() condition.ConditionType {
// figure out which condition type should we put in the condition depends on its state
switch r.RollingState {
case VerifyingSpecState:
@@ -166,8 +175,8 @@ func (r *RolloutStatus) getRolloutConditionType() runtimev1alpha1.ConditionType
case RolloutAbandoningState:
return RolloutAbandoning
case RolloutFailedState:
return RolloutFailed
case RolloutDeletingState:
return RolloutDeleting
case RolloutSucceedState:
return RolloutSucceed
@@ -201,9 +210,9 @@ func (r *RolloutStatus) RolloutFailing(reason string) {
// ResetStatus resets the status of the rollout to start from beginning
func (r *RolloutStatus) ResetStatus() {
r.NewPodTemplateIdentifier = ""
r.RolloutTargetTotalSize = -1
r.RolloutTargetSize = -1
r.LastAppliedPodTemplateIdentifier = ""
r.RollingState = VerifyingSpecState
r.RollingState = LocatingTargetAppState
r.BatchRollingState = BatchInitializingState
r.CurrentBatch = 0
r.UpgradedReplicas = 0
@@ -212,7 +221,7 @@ func (r *RolloutStatus) ResetStatus() {
// SetRolloutCondition sets the supplied condition, replacing any existing condition
// of the same type unless they are identical.
func (r *RolloutStatus) SetRolloutCondition(new runtimev1alpha1.Condition) {
func (r *RolloutStatus) SetRolloutCondition(new condition.Condition) {
exists := false
for i, existing := range r.Conditions {
if existing.Type != new.Type {
@@ -234,7 +243,11 @@ func (r *RolloutStatus) SetRolloutCondition(new runtimev1alpha1.Condition) {
if !exists {
r.Conditions = append(r.Conditions, new)
}
}
// we can't panic since it will crash the other controllers
func (r *RolloutStatus) illegalStateTransition(err error) {
r.RolloutFailed(err.Error())
}
// StateTransition is the center place to do rollout state transition
@@ -253,15 +266,41 @@ func (r *RolloutStatus) StateTransition(event RolloutEvent) {
// we have special transition for these types of event since they require additional info
if event == RollingFailedEvent || event == RollingRetriableFailureEvent {
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
return
}
// special handle modified event here
if event == RollingModifiedEvent {
if r.RollingState == RolloutDeletingState {
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
return
}
if r.RollingState == RolloutFailedState || r.RollingState == RolloutSucceedState {
r.ResetStatus()
} else {
r.SetRolloutCondition(NewNegativeCondition(r.getRolloutConditionType(), "Rollout Spec is modified"))
r.RollingState = RolloutAbandoningState
r.BatchRollingState = BatchInitializingState
}
return
}
// special handle deleted event here, it can happen at many states
if event == RollingDeletedEvent {
if r.RollingState == RolloutFailedState || r.RollingState == RolloutSucceedState {
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
return
}
r.SetRolloutCondition(NewNegativeCondition(r.getRolloutConditionType(), "Rollout is being deleted"))
r.RollingState = RolloutDeletingState
r.BatchRollingState = BatchInitializingState
return
}
// special handle appLocatedEvent event here, it only applies to one state but it's legal to happen at other states
if event == AppLocatedEvent {
if r.RollingState == LocatingTargetAppState {
r.RollingState = VerifyingSpecState
}
return
}
@@ -273,7 +312,7 @@ func (r *RolloutStatus) StateTransition(event RolloutEvent) {
r.RollingState = InitializingState
return
}
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case InitializingState:
if event == RollingInitializedEvent {
@@ -282,7 +321,7 @@ func (r *RolloutStatus) StateTransition(event RolloutEvent) {
r.BatchRollingState = BatchInitializingState
return
}
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RollingInBatchesState:
r.batchStateTransition(event)
@@ -294,7 +333,15 @@ func (r *RolloutStatus) StateTransition(event RolloutEvent) {
r.ResetStatus()
return
}
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RolloutDeletingState:
if event == RollingFinalizedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.RollingState = RolloutFailedState
return
}
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case FinalisingState:
if event == RollingFinalizedEvent {
@@ -302,7 +349,7 @@ func (r *RolloutStatus) StateTransition(event RolloutEvent) {
r.RollingState = RolloutSucceedState
return
}
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RolloutFailingState:
if event == RollingFinalizedEvent {
@@ -310,16 +357,13 @@ func (r *RolloutStatus) StateTransition(event RolloutEvent) {
r.RollingState = RolloutFailedState
return
}
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RolloutSucceedState:
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RolloutFailedState:
panic(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RolloutSucceedState, RolloutFailedState:
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
default:
panic(fmt.Errorf("invalid rolling state %s", rollingState))
r.illegalStateTransition(fmt.Errorf("invalid rolling state %s before transition", rollingState))
}
}
@@ -338,7 +382,7 @@ func (r *RolloutStatus) batchStateTransition(event RolloutEvent) {
r.BatchRollingState = BatchInRollingState
return
}
panic(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
case BatchInRollingState:
if event == RolloutOneBatchEvent {
@@ -346,7 +390,7 @@ func (r *RolloutStatus) batchStateTransition(event RolloutEvent) {
r.BatchRollingState = BatchVerifyingState
return
}
panic(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
case BatchVerifyingState:
if event == OneBatchAvailableEvent {
@@ -354,7 +398,7 @@ func (r *RolloutStatus) batchStateTransition(event RolloutEvent) {
r.BatchRollingState = BatchFinalizingState
return
}
panic(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
case BatchFinalizingState:
if event == FinishedOneBatchEvent {
@@ -369,7 +413,7 @@ func (r *RolloutStatus) batchStateTransition(event RolloutEvent) {
r.RollingState = FinalisingState
return
}
panic(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
case BatchReadyState:
if event == BatchRolloutApprovedEvent {
@@ -378,9 +422,9 @@ func (r *RolloutStatus) batchStateTransition(event RolloutEvent) {
r.CurrentBatch++
return
}
panic(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
default:
panic(fmt.Errorf("invalid batch rolling state %s", batchRollingState))
r.illegalStateTransition(fmt.Errorf("invalid batch rolling state %s", batchRollingState))
}
}

View File

@@ -0,0 +1,77 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// Rollout is the Schema for the Rollout API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=rollout
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="TARGET",type=string,JSONPath=`.status.rolloutTargetSize`
// +kubebuilder:printcolumn:name="UPGRADED",type=string,JSONPath=`.status.upgradedReplicas`
// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.upgradedReadyReplicas`
// +kubebuilder:printcolumn:name="BATCH-STATE",type=string,JSONPath=`.status.batchRollingState`
// +kubebuilder:printcolumn:name="ROLLING-STATE",type=string,JSONPath=`.status.rollingState`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type Rollout struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec RolloutSpec `json:"spec,omitempty"`
Status CompRolloutStatus `json:"status,omitempty"`
}
// RolloutSpec defines how to describe an update between different compRevision
type RolloutSpec struct {
// TargetRevisionName contains the name of the componentRevisionName that we need to upgrade to.
TargetRevisionName string `json:"targetRevisionName"`
// SourceRevisionName contains the name of the componentRevisionName that we need to upgrade from.
// it can be empty only when it's the first time to deploy the application
SourceRevisionName string `json:"sourceRevisionName,omitempty"`
// ComponentName specify the component name
ComponentName string `json:"componentName"`
// RolloutPlan is the details on how to rollout the resources
RolloutPlan RolloutPlan `json:"rolloutPlan"`
}
// CompRolloutStatus defines the observed state of rollout
type CompRolloutStatus struct {
RolloutStatus `json:",inline"`
// LastUpgradedTargetRevision contains the name of the componentRevisionName that we upgraded to
// We will restart the rollout if this is not the same as the spec
LastUpgradedTargetRevision string `json:"lastTargetRevision"`
// LastSourceRevision contains the name of the componentRevisionName that we need to upgrade from.
// We will restart the rollout if this is not the same as the spec
LastSourceRevision string `json:"LastSourceRevision,omitempty"`
}
// RolloutList contains a list of Rollout
// +kubebuilder:object:root=true
type RolloutList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Rollout `json:"items"`
}

Some files were not shown because too many files have changed in this diff Show More