Compare commits

..

106 Commits

Author SHA1 Message Date
Somefive
35a84e9cbf [Backport release-1.4] Fix: gc failure cause workflow restart not working properly (#5241)
* Fix: gc failure cause workflow restart not working properly

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

* Feat: switch ci machine

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

* Fix: enhance test

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

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-01-03 14:52:37 +08:00
github-actions[bot]
bf251d5039 Chore: change the package name of the readme-generator-for-helm (#4895)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 8b46e6076a)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-10-20 16:38:40 +08:00
github-actions[bot]
31f0b28d96 Fix: support default value of ui schema (#4858)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit e584a35c83)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-10-13 14:45:10 +08:00
github-actions[bot]
810c47545e [Backport release-1.4] Fix: allow to read definition from user's namespace when force delete (#4788)
* Fix: allow to read definition from user's namespace when force deleting app with configuration

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
(cherry picked from commit 2f08c36132)

* Fix test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
(cherry picked from commit 981950a14d)

* Fix wrong test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
(cherry picked from commit 62863f1007)

Co-authored-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-09-27 11:58:19 +08:00
github-actions[bot]
293f38dd84 Fix: panic when properties empty (#4747)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 13fec3cb18)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-09-19 11:18:33 +08:00
barnettZQG
1cf2cd23d2 Fix: CVE-2022-27664 (#4721) (#4724)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-09-14 16:15:30 +08:00
github-actions[bot]
69cf083d4a Fix: fix uninstallation continues when answer is no (#4711)
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
(cherry picked from commit 81115ef6ff)

Co-authored-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-09-13 10:24:46 +08:00
Tianxin Dong
7df2b34a0b Fix: fix signedKey using platform id (#4653)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-08-24 19:33:24 +08:00
github-actions[bot]
2a03e16098 fix: add supported but missing provider (#4650)
Signed-off-by: Yuedong Wu <57584831+lunarwhite@users.noreply.github.com>
(cherry picked from commit fa96c917a8)

Co-authored-by: Yuedong Wu <57584831+lunarwhite@users.noreply.github.com>
2022-08-24 09:28:35 +08:00
github-actions[bot]
110927ed97 Fix: fix writing logs to file (#4588)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit d4b3bbf049)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-08-10 10:00:39 +08:00
github-actions[bot]
90fbfa0f81 Feat: definition support controller requirement (#4578)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>
(cherry picked from commit 714f218f90)

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-08-08 16:07:44 +08:00
github-actions[bot]
7fb045328d [Backport release-1.4] Fix: reject applications with empty policy properties (#4565)
* Fix: reject applications with empty policies

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

* Style: change err msg

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

* Fix: use 400 instead of 422 to show err msg

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

* Test: fix tests

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

Co-authored-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-08-05 15:04:47 +08:00
Somefive
766c5852c6 Fix: address vela-core crash due to empty policy properties (#4473) (#4480)
* Fix: fix topology core crash

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

* Test: add tests

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

* Fix: same problem in other places

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

* Style: remove empty line

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

* Feat: raise error when empty topology is used

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

* Feat: raise error when empty override policy is used

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

Co-authored-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-07-27 13:48:19 +08:00
github-actions[bot]
4cb9a14b18 Fix: fix logs to record the right publish version (#4476)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>
(cherry picked from commit 4846104c8f)

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-07-27 01:13:07 +08:00
github-actions[bot]
9a1e75cf48 Fix: The apply failure error is ignored when the workflow is executed (#4461)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>
(cherry picked from commit b1d8e6c88b)

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-07-25 22:19:26 +08:00
Tianxin Dong
192dc8966d Fix: fix backoff time after default backoff times (#4414)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-07-20 17:48:28 +08:00
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
1212 changed files with 38494 additions and 70898 deletions

41
.github/CODEOWNERS vendored
View File

@@ -1,37 +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 @Somefive @jefree-cat
design/ @barnettZQG @leejanee @wonderflow @Somefive @jefree-cat
# Owner of Core Controllers
pkg/controller/core.oam.dev @Somefive @FogDong @barnettZQG @wonderflow
# Owner of Standard Controllers
pkg/controller/standard.oam.dev @wangyikewxgm @barnettZQG @wonderflow
* @barnettZQG @wonderflow @leejanee
design/ @barnettZQG @leejanee @wonderflow
# Owner of CUE
pkg/cue @leejanee @FogDong @Somefive
pkg/stdlib @leejanee @FogDong @Somefive
pkg/cue @leejanee @FogDong
pkg/stdlib @leejanee @FogDong
# Owner of Workflow
pkg/workflow @leejanee @FogDong @Somefive
pkg/workflow @leejanee @FogDong
# Owner of rollout
pkg/controller/common/rollout/ @wangyikewxgm @wonderflow
runtime/rollout @wangyikewxgm @wonderflow
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 @StevenLeiZhang @charlie0129 @chivalryq
references/cli/ @Somefive @zzxwill
# Owner of vela APIServer
pkg/apiserver/ @barnettZQG @yangsoon @FogDong
pkg/apiserver/ @barnettZQG @yangsoon
# Owner of vela addon framework
pkg/addon/ @wangyikewxgm @wonderflow @charlie0129
# Owner of resource keeper and tracker
pkg/resourcekeeper @Somefive @FogDong
pkg/resourcetracker @Somefive @FogDong

View File

@@ -1,4 +1,4 @@
name: VelaUX APIServer Test
name: APIServer Unit Test & E2E Test
on:
push:
@@ -17,10 +17,11 @@ on:
env:
# Common versions
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
K3D_IMAGE_VERSION: '[\"v1.20\",\"v1.24\"]'
K3D_IMAGE_VERSIONS: '[\"v1.20\",\"v1.24\"]'
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:
@@ -31,7 +32,7 @@ jobs:
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v4.0.0
uses: fkirc/skip-duplicate-actions@v3.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
@@ -47,74 +48,19 @@ jobs:
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "pushing tag: ${{ github.ref_name }}"
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSIONS }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
else
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSION }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
fi
apiserver-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 sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y golang-ginkgo-dev
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.7.0
with:
mongodb-version: '5.0'
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@v1.2
with:
version: 3.1.0
kubebuilderOnly: false
kubernetesVersion: v1.21.2
- name: Run api server unit test
run: make unit-test-apiserver
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: apiserver-unittests
name: codecov-umbrella
apiserver-e2e-tests:
runs-on: aliyun
runs-on: aliyun-legacy
needs: [ detect-noop,set-k8s-matrix ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ${{ fromJson(needs.set-k8s-matrix.outputs.matrix) }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
- name: Set up Go
@@ -132,58 +78,44 @@ jobs:
run: |
go get -v -t -d ./...
- name: Tear down K3d if exist
run: |
k3d cluster delete || true
k3d cluster delete worker || true
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Setup K3d (Hub)
uses: nolar/setup-k3d-k3s@v1.0.8
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
- name: Setup K3d (Worker)
uses: nolar/setup-k3d-k3s@v1.0.8
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-name: worker
k3d-args: --kubeconfig-update-default=false --network=k3d-k3s-default ${{ env.EGRESS_ARG }}
- name: Kind Cluster (Worker)
- name: Setup Kind Cluster (Worker)
run: |
internal_ip=$(docker network inspect k3d-k3s-default|jq ".[0].Containers"| jq -r '.[]| select(.Name=="k3d-worker-server-0")|.IPv4Address' | cut -d/ -f1)
k3d kubeconfig get worker > /tmp/worker.client.kubeconfig
cp /tmp/worker.client.kubeconfig /tmp/worker.kubeconfig
sed -i "s/0.0.0.0:[0-9]\+/$internal_ip:6443/" /tmp/worker.kubeconfig
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: Load image to k3d cluster
run: make image-load
- 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 vela-cli
make e2e-cleanup
make vela-cli
make e2e-setup-core
bin/vela addon enable fluxcd
bin/vela addon enable vela-workflow
timeout 600s bash -c -- 'while true; do kubectl get ns flux-system; if [ $? -eq 0 ] ; then break; else sleep 5; fi;done'
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-core,app.kubernetes.io/instance=kubevela -n vela-system --timeout=600s
kubectl wait --for=condition=Ready pod -l app=source-controller -n flux-system --timeout=600s
kubectl wait --for=condition=Ready pod -l app=helm-controller -n flux-system --timeout=600s
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-workflow -n vela-system --timeout=600s
- name: Run api server e2e test
run: |
@@ -199,8 +131,8 @@ jobs:
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/e2e_apiserver_test.out
flags: apiserver-e2etests
files: ./coverage.txt,/tmp/e2e_apiserver_test.out
flags: apiserver-unittests
name: codecov-umbrella
- name: Clean e2e profile

View File

@@ -21,11 +21,7 @@ jobs:
MINIMAL_HELM_CHART: charts/vela-minimal
LEGACY_HELM_CHART: legacy/charts/vela-core-legacy
VELA_ROLLOUT_HELM_CHART: runtime/rollout/charts
LOCAL_OSS_DIRECTORY: .oss
HELM_CHART_NAME: vela-core
MINIMAL_HELM_CHART_NAME: vela-minimal
LEGACY_HELM_CHART_NAME: vela-core-legacy
VELA_ROLLOUT_HELM_CHART_NAME: vela-rollout
LOCAL_OSS_DIRECTORY: .oss/
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
@@ -90,11 +86,4 @@ jobs:
helm package $VELA_ROLLOUT_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm repo index --url https://$BUCKET.$ENDPOINT/core $LOCAL_OSS_DIRECTORY
- name: sync local to cloud
run: |
image_tag=${{ steps.get_version.outputs.VERSION }}
chart_semver=${image_tag#"v"}
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/index.yaml oss://$BUCKET/core/index.yaml
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/$HELM_CHART_NAME-${chart_semver}.tgz oss://$BUCKET/core/$HELM_CHART_NAME-${chart_semver}.tgz
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/$MINIMAL_HELM_CHART_NAME-${chart_semver}.tgz oss://$BUCKET/core/$MINIMAL_HELM_CHART_NAME-${chart_semver}.tgz
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/$LEGACY_HELM_CHART_NAME-${chart_semver}.tgz oss://$BUCKET/core/$LEGACY_HELM_CHART_NAME-${chart_semver}.tgz
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/$VELA_ROLLOUT_HELM_CHART_NAME-${chart_semver}.tgz oss://$BUCKET/core/$VELA_ROLLOUT_HELM_CHART_NAME-${chart_semver}.tgz
run: ./ossutil --config-file .ossutilconfig sync $LOCAL_OSS_DIRECTORY oss://$BUCKET/core -f

View File

@@ -1,44 +0,0 @@
name: Definition-Lint
on:
push:
branches:
- master
- release-*
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
env:
# Common versions
GO_VERSION: '1.19'
jobs:
definition-doc:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Setup K3d
uses: nolar/setup-k3d-k3s@v1.0.9
with:
version: v1.20
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Definition Doc generate check
run: |
go build -o docgen hack/docgen/def/gen.go
./docgen --type=comp --force-example-doc --path=./comp-def-check.md
./docgen --type=trait --force-example-doc --path=./trait-def-check.md
./docgen --type=wf --force-example-doc --path=./wf-def-check.md
./docgen --type=policy --force-example-doc --path=./policy-def-check.md

View File

@@ -15,10 +15,11 @@ on:
env:
# Common versions
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
K3D_IMAGE_VERSION: '[\"v1.20\",\"v1.24\"]'
K3D_IMAGE_VERSIONS: '[\"v1.20\",\"v1.24\"]'
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:
@@ -29,7 +30,7 @@ jobs:
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v4.0.0
uses: fkirc/skip-duplicate-actions@v3.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
@@ -45,22 +46,19 @@ jobs:
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "pushing tag: ${{ github.ref_name }}"
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSIONS }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
else
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSION }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
fi
e2e-multi-cluster-tests:
runs-on: aliyun
runs-on: aliyun-legacy
needs: [ detect-noop,set-k8s-matrix ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ${{ fromJson(needs.set-k8s-matrix.outputs.matrix) }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
@@ -76,49 +74,39 @@ jobs:
run: |
go get -v -t -d ./...
- name: Tear down K3d if exist
run: |
k3d cluster delete || true
k3d cluster delete worker || true
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Setup K3d (Hub)
uses: nolar/setup-k3d-k3s@v1.0.8
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
- name: Setup K3d (Worker)
uses: nolar/setup-k3d-k3s@v1.0.8
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-name: worker
k3d-args: --kubeconfig-update-default=false --network=k3d-k3s-default ${{ env.EGRESS_ARG }}
- name: Generating internal worker kubeconfig
- name: Setup Kind Cluster (Worker)
run: |
internal_ip=$(docker network inspect k3d-k3s-default|jq ".[0].Containers"| jq -r '.[]| select(.Name=="k3d-worker-server-0")|.IPv4Address' | cut -d/ -f1)
k3d kubeconfig get worker > /tmp/worker.client.kubeconfig
cp /tmp/worker.client.kubeconfig /tmp/worker.kubeconfig
sed -i "s/0.0.0.0:[0-9]\+/$internal_ip:6443/" /tmp/worker.kubeconfig
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: Load image to k3d cluster (hub and worker)
run: make image-load image-load-runtime-cluster
- 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
make kind-load-runtime-cluster
- name: Cleanup for e2e tests
run: |
make vela-cli
make e2e-cleanup
make vela-cli
make e2e-setup-core-auth
make
make setup-runtime-e2e-cluster
- name: Run e2e multicluster tests

View File

@@ -15,10 +15,11 @@ on:
env:
# Common versions
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
K3D_IMAGE_VERSION: '[\"v1.20\",\"v1.24\"]'
K3D_IMAGE_VERSIONS: '[\"v1.20\",\"v1.24\"]'
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:
@@ -29,7 +30,7 @@ jobs:
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v4.0.0
uses: fkirc/skip-duplicate-actions@v3.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
@@ -45,22 +46,18 @@ jobs:
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "pushing tag: ${{ github.ref_name }}"
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSIONS }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
else
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSION }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
fi
e2e-rollout-tests:
runs-on: aliyun
runs-on: aliyun-legacy
needs: [ detect-noop,set-k8s-matrix ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ${{ fromJson(needs.set-k8s-matrix.outputs.matrix) }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
- name: Check out code into the Go module directory
@@ -75,35 +72,33 @@ jobs:
run: |
go get -v -t -d ./...
- name: Tear down K3d if exist
run: |
k3d cluster delete || true
k3d cluster delete worker || true
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Setup K3d
uses: nolar/setup-k3d-k3s@v1.0.8
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
- name: Load image to k3d cluster
run: make image-load image-load-runtime-cluster
- 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 vela-cli
make e2e-cleanup
make e2e-setup-core
make setup-runtime-e2e-cluster
make e2e-setup
helm lint ./charts/vela-core
helm test -n vela-system kubevela --timeout 5m
- name: Run e2e tests

View File

@@ -15,10 +15,11 @@ on:
env:
# Common versions
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
K3D_IMAGE_VERSION: '[\"v1.20\",\"v1.24\"]'
K3D_IMAGE_VERSIONS: '[\"v1.20\",\"v1.24\"]'
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:
@@ -29,7 +30,7 @@ jobs:
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v4.0.0
uses: fkirc/skip-duplicate-actions@v3.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
@@ -45,22 +46,18 @@ jobs:
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "pushing tag: ${{ github.ref_name }}"
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSIONS }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
else
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSION }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
fi
e2e-tests:
runs-on: aliyun
runs-on: aliyun-legacy
needs: [ detect-noop,set-k8s-matrix ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ${{ fromJson(needs.set-k8s-matrix.outputs.matrix) }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
- name: Check out code into the Go module directory
@@ -75,36 +72,33 @@ jobs:
run: |
go get -v -t -d ./...
- name: Tear down K3d if exist
run: |
k3d cluster delete || true
k3d cluster delete worker || true
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Setup K3d
uses: nolar/setup-k3d-k3s@v1.0.8
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
- name: Load image to k3d cluster
run: make image-load
- 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-core
make e2e-setup
helm lint ./charts/vela-core
helm test -n vela-system kubevela --timeout 5m
- name: Run api e2e tests

View File

@@ -13,8 +13,9 @@ on:
env:
# Common versions
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
jobs:
@@ -25,7 +26,7 @@ jobs:
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v4.0.0
uses: fkirc/skip-duplicate-actions@v3.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
@@ -56,7 +57,7 @@ jobs:
restore-keys: ${{ runner.os }}-pkg-
- name: Install StaticCheck
run: go install honnef.co/go/tools/cmd/staticcheck@2022.1
run: GO111MODULE=on go get honnef.co/go/tools/cmd/staticcheck@v0.3.0
- name: Static Check
run: staticcheck ./...
@@ -97,7 +98,7 @@ jobs:
version: ${{ env.GOLANGCI_VERSION }}
check-diff:
runs-on: aliyun
runs-on: aliyun-legacy
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
@@ -117,9 +118,6 @@ jobs:
with:
node-version: '14'
- name: Install StaticCheck
run: go install honnef.co/go/tools/cmd/staticcheck@2022.1
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
@@ -134,42 +132,7 @@ jobs:
run: make cross-build
- name: Check Diff
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.49.0
export PATH=$(pwd)/bin/:$PATH
make check-diff
run: make check-diff
- name: Cleanup binary
run: make build-cleanup
check-windows:
runs-on: windows-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Run Build CLI
run: make vela-cli
- name: Run CLI for version
shell: cmd
run: |
move .\bin\vela .\bin\vela.exe
.\bin\vela.exe version

View File

@@ -7,7 +7,7 @@ on:
jobs:
bot:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout Actions
uses: actions/checkout@v2
@@ -15,13 +15,7 @@ jobs:
repository: "oam-dev/kubevela-github-actions"
path: ./actions
ref: v0.4.2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'npm'
cache-dependency-path: ./actions/package-lock.json
- name: Install Dependencies
- name: Install Actions
run: npm ci --production --prefix ./actions
- name: Run Commands
uses: ./actions/commands
@@ -30,7 +24,7 @@ jobs:
configPath: issue-commands
backport:
runs-on: ubuntu-22.04
runs-on: ubuntu-18.04
if: github.event.issue.pull_request && contains(github.event.comment.body, '/backport')
steps:
- name: Extract Command
@@ -65,11 +59,11 @@ jobs:
})
console.log("Added '" + label + "' label.")
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Open Backport PR
uses: zeebe-io/backport-action@v0.0.8
uses: zeebe-io/backport-action@v0.0.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}

View File

@@ -31,7 +31,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.17
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.2.2
@@ -150,15 +150,11 @@ jobs:
- name: Display structure of downloaded files
run: ls -R
working-directory: cli-artifacts
- name: Get version
run: echo "VELA_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- shell: bash
working-directory: cli-artifacts
run: |
for file in *
do
sed -i "s/\/vela/-${{ env.VELA_VERSION }}/g" ${file}
sed -i "s/\/kubectl-vela/-${{ env.VELA_VERSION }}/g" ${file}
cat ${file} >> sha256sums.txt
done
- name: Upload Checksums

View File

@@ -14,8 +14,8 @@ jobs:
- name: Set up Go 1.17
uses: actions/setup-go@v1
env:
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
with:
go-version: ${{ env.GO_VERSION }}
id: go

View File

@@ -4,7 +4,7 @@ on:
- cron: '* * * * *'
jobs:
clean-image:
runs-on: aliyun
runs-on: aliyun-legacy
steps:
- name: Cleanup image
run: docker image prune -f

View File

@@ -13,8 +13,9 @@ on:
env:
# Common versions
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
jobs:
@@ -25,7 +26,7 @@ jobs:
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v4.0.0
uses: fkirc/skip-duplicate-actions@v3.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
@@ -58,15 +59,12 @@ jobs:
- name: Install ginkgo
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y golang-ginkgo-dev
- name: Setup K3d
uses: nolar/setup-k3d-k3s@v1.0.8
- name: Setup Kind Cluster
uses: engineerd/setup-kind@v0.5.0
with:
version: v1.20
github-token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.KIND_VERSION }}
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@v1.2

7
.gitignore vendored
View File

@@ -1,4 +1,4 @@
# Binaries for programs and docgen
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
@@ -7,7 +7,6 @@
bin
_bin
e2e/vela
vela
# Test binary, build with `go test -c`
*.test
@@ -33,7 +32,6 @@ vendor/
# Vscode files
.vscode
.history
pkg/test/vela
config/crd/bases
@@ -51,5 +49,4 @@ tmp/
git-page/
# e2e rollout runtime image build
runtime/rollout/e2e/tmp
vela.json
runtime/rollout/e2e/tmp

View File

@@ -38,7 +38,7 @@ linters-settings:
# report about shadowed variables
check-shadowing: false
revive:
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
@@ -116,20 +116,11 @@ linters:
- goconst
- goimports
- gofmt # We enable this as well as goimports for its simplify mode.
- revive
- golint
- unconvert
- misspell
- nakedret
- exportloopref
disable:
- deadcode
- scopelint
- structcheck
- varcheck
- rowserrcheck
- sqlclosecheck
- errchkjson
- contextcheck
presets:
- bugs
- unused
@@ -146,7 +137,7 @@ issues:
- errcheck
- dupl
- gosec
- exportloopref
- scopelint
- unparam
# Ease some gocritic warnings on test files.
@@ -195,15 +186,7 @@ issues:
- text: "don't use an underscore"
linters:
- revive
- text: "package-comments: should have a package comment"
linters:
- revive
- text: "error-strings: error strings should not be capitalized or end with punctuation or a newline"
linters:
- revive
- golint
# Independently from option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all

View File

@@ -15,7 +15,7 @@ This is a minor fix for release-1.0, please refer to release-1.1.x for the lates
# v1.0.5
1. Fix Terraform application status issue (#1611)
2. application supports specifying different versions of Definition (#1597)
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)

View File

@@ -31,7 +31,7 @@
## What's Changed
* Fix: can't query data from the MongoDB by @barnettZQG in https://github.com/oam-dev/kubevela/pull/3095
* Fix: use personal token of vela-bot instead of github token for homebrew update by @wonderflow in https://github.com/oam-dev/kubevela/pull/3096
* 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

View File

@@ -1,6 +1,6 @@
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
WORKDIR /workspace
# Copy the Go Modules manifests

View File

@@ -1,6 +1,6 @@
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
ARG GOPROXY
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
WORKDIR /workspace

View File

@@ -1,6 +1,6 @@
ARG BASE_IMAGE
# Build the cli binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
ARG GOPROXY
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
WORKDIR /workspace
@@ -39,5 +39,5 @@ RUN apk add --no-cache ca-certificates bash expat
WORKDIR /
ARG TARGETARCH
COPY --from=builder /workspace/vela-${TARGETARCH} /bin/vela
ENTRYPOINT ["/bin/vela"]
COPY --from=builder /workspace/vela-${TARGETARCH} /vela
ENTRYPOINT ["/vela"]

View File

@@ -1,6 +1,6 @@
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
WORKDIR /workspace
# Copy the Go Modules manifests

View File

@@ -9,12 +9,12 @@ include makefiles/e2e.mk
all: build
# Run tests
test: unit-test-core test-cli-gen
test: vet lint staticcheck unit-test-core test-cli-gen
@$(OK) unit-tests pass
test-cli-gen:
mkdir -p ./bin/doc
go run ./hack/docgen/cli/gen.go ./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)
@@ -22,7 +22,7 @@ unit-test-apiserver:
go test -gcflags=all=-l -coverprofile=coverage.txt $(shell go list ./pkg/... ./cmd/... | grep -E 'apiserver|velaql')
# Build vela cli binary
build: vela-cli kubectl-vela
build: fmt vet lint staticcheck vela-cli kubectl-vela
@$(OK) build succeed
build-cleanup:
@@ -82,28 +82,30 @@ endif
# load docker image to the k3d cluster
image-load:
# load docker image to the kind cluster
kind-load: kind-load-rollout
docker build -t $(VELA_CORE_TEST_IMAGE) -f Dockerfile.e2e .
k3d image import $(VELA_CORE_TEST_IMAGE) || { echo >&2 "kind not installed or error loading image: $(VELA_CORE_TEST_IMAGE)"; exit 1; }
kind load docker-image $(VELA_CORE_TEST_IMAGE) || { echo >&2 "kind not installed or error loading image: $(VELA_CORE_TEST_IMAGE)"; exit 1; }
image-load-runtime-cluster:
kind-load-rollout:
/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
k3d image import $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE) || { echo >&2 "kind not installed or error loading image: $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE)"; exit 1; }
k3d cluster get $(RUNTIME_CLUSTER_NAME) && k3d image import $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE) --cluster=$(RUNTIME_CLUSTER_NAME) || echo "no worker cluster"
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-runtime-cluster:
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:
core-test: fmt vet manifests
go test ./pkg/... -coverprofile cover.out
# Build vela core manager and apiserver binary
manager:
manager: fmt vet lint manifests
$(GOBUILD_ENV) go build -o bin/manager -a -ldflags $(LDFLAGS) ./cmd/core/main.go
$(GOBUILD_ENV) go build -o bin/apiserver -a -ldflags $(LDFLAGS) ./cmd/apiserver/main.go
vela-runtime-rollout-manager:
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.

View File

@@ -21,29 +21,23 @@
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)
![](docs/resources/what-is-kubevela.png)
## Highlights
KubeVela practices the "render, orchestrate, deploy" workflow with below highlighted values added to existing ecosystem:
* Deployment as Code
- *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.
Declare your deployment plan as workflow, run it automatically with any CI/CD or GitOps system, extend or re-program the workflow steps with CUE. No add-hoc scripts, no dirty glue code, just deploy. The deployment workflow in KubeVela is powered by [Open Application Model](https://oam.dev/).
- *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.
* Built-in security and compliance building blocks
Choose from the wide range of LDAP integrations we provided out-of-box, enjoy multi-cluster authorization that is fully automated, pick and apply fine-grained RBAC modules and customize them per your own supply chain requirements.
* Multi-cloud/hybrid-environments app delivery as first-class citizen
Progressive rollout across test/staging/production environments, automatic canary, blue-green and continuous verification, rich placement strategy across clusters and clouds, fully managed cloud environments provision.
- *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
* [Introduction](https://kubevela.io/docs)
* [Installation](https://kubevela.io/docs/install)
* [Deploy Your Application](https://kubevela.io/docs/quick-start)
- [Introduction](https://kubevela.io/docs)
- [Installation](https://kubevela.io/docs/install)
- [Design Your First Deployment Plan](https://kubevela.io/docs/quick-start)
## Documentation
@@ -55,7 +49,7 @@ Official blog is available on [KubeVela blog](https://kubevela.io/blog).
## Community
We want your contributions and suggestions!
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).
@@ -75,17 +69,23 @@ Every two weeks we host a community call to showcase new features, review upcomi
- Bi-weekly Community Call:
- [Meeting Notes](https://docs.google.com/document/d/1nqdFEyULekyksFHtFvgvFAYE-0AMHKoS3RMnaKsarjs).
- [Video Records](https://www.youtube.com/channel/UCSCTHhGI5XJ0SEhDHVakPAA/videos).
- [Video Records](https://kubevela.io/videos/meetings/en/meetings).
- Bi-weekly Chinese Community Call:
- [Video Records](https://space.bilibili.com/180074935/channel/seriesdetail?sid=1842207).
- [Video Records](https://kubevela.io/videos/meetings/cn/v1.3).
## Talks and Conferences
Check out [KubeVela videos](https://kubevela.io/videos/talks/en/oam-dapr) for these talks and conferences.
| Engagement | Link |
|:-----------|:------------|
| 🎤 Talks | - [KubeVela - The Modern App Delivery System in Alibaba](https://docs.google.com/presentation/d/1CWCLcsKpDQB3bBDTfdv2BZ8ilGGJv2E8L-iOA5HMrV0/edit?usp=sharing) |
| 🌎 KubeCon | - [ [NA 2020] Standardizing Cloud Native Application Delivery Across Different Clouds](https://www.youtube.com/watch?v=0yhVuBIbHcI) <br> - [ [EU 2021] Zero Pain Microservice Development and Deployment with Dapr and KubeVela](https://sched.co/iE4S) |
| 📺 Conferences | - [Dapr, Rudr, OAM: Mark Russinovich presents next gen app development & deployment](https://www.youtube.com/watch?v=eJCu6a-x9uo) <br> - [Mark Russinovich presents "The Future of Cloud Native Applications with OAM and Dapr"](https://myignite.techcommunity.microsoft.com/sessions/82059)|
For more talks, please checkout [KubeVela Talks](https://kubevela.io/videos/talks/en/standardizing-app).
## Contributing
Check out [CONTRIBUTING](https://kubevela.io/docs/contributor/overview) to see how to develop with KubeVela.
Check out [CONTRIBUTING](./CONTRIBUTING.md) to see how to develop with KubeVela.
## Report Vulnerability

View File

@@ -26,8 +26,6 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
"github.com/oam-dev/kubevela/pkg/oam"
@@ -189,6 +187,8 @@ type Status struct {
type ApplicationPhase string
const (
// ApplicationRollingOut means the app is in the middle of rolling out
ApplicationRollingOut ApplicationPhase = "rollingOut"
// ApplicationStarting means the app is preparing for reconcile
ApplicationStarting ApplicationPhase = "starting"
// ApplicationRendering means the app is rendering
@@ -201,8 +201,8 @@ const (
ApplicationWorkflowSuspending ApplicationPhase = "workflowSuspending"
// ApplicationWorkflowTerminated means the app's workflow is terminated
ApplicationWorkflowTerminated ApplicationPhase = "workflowTerminated"
// ApplicationWorkflowFailed means the app's workflow is failed
ApplicationWorkflowFailed ApplicationPhase = "workflowFailed"
// ApplicationWorkflowFinished means the app's workflow is finished
ApplicationWorkflowFinished ApplicationPhase = "workflowFinished"
// ApplicationRunning means the app finished rendering and applied result to the cluster
ApplicationRunning ApplicationPhase = "running"
// ApplicationUnhealthy means the app finished rendering and applied result to the cluster, but still unhealthy
@@ -216,19 +216,19 @@ type WorkflowState string
const (
// WorkflowStateInitializing means the workflow is in initial state
WorkflowStateInitializing WorkflowState = "Initializing"
WorkflowStateInitializing WorkflowState = "initializing"
// WorkflowStateTerminated means workflow is terminated manually, and it won't be started unless the spec changed.
WorkflowStateTerminated WorkflowState = "Terminated"
WorkflowStateTerminated WorkflowState = "terminated"
// WorkflowStateSuspended means workflow is suspended manually, and it can be resumed.
WorkflowStateSuspended WorkflowState = "Suspended"
WorkflowStateSuspended WorkflowState = "suspended"
// WorkflowStateSucceeded means workflow is running successfully, all steps finished.
WorkflowStateSucceeded WorkflowState = "Succeeded"
// WorkflowStateFinished means workflow is end.
WorkflowStateFinished WorkflowState = "Finished"
WorkflowStateFinished WorkflowState = "finished"
// WorkflowStateExecuting means workflow is still running or waiting some steps.
WorkflowStateExecuting WorkflowState = "Executing"
WorkflowStateExecuting WorkflowState = "executing"
// WorkflowStateSkipping means it will skip this reconcile and let next reconcile to handle it.
WorkflowStateSkipping WorkflowState = "Skipping"
WorkflowStateSkipping WorkflowState = "skipping"
)
// ApplicationComponentStatus record the health status of App component
@@ -245,12 +245,6 @@ type ApplicationComponentStatus struct {
Scopes []corev1.ObjectReference `json:"scopes,omitempty"`
}
// Equal check if two ApplicationComponentStatus are equal
func (in ApplicationComponentStatus) Equal(r ApplicationComponentStatus) bool {
return in.Name == r.Name && in.Namespace == r.Namespace &&
in.Cluster == r.Cluster && in.Env == r.Env
}
// ApplicationTraitStatus records the trait health status
type ApplicationTraitStatus struct {
Type string `json:"type"`
@@ -274,6 +268,33 @@ 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
@@ -303,12 +324,10 @@ type AppStatus struct {
AppliedResources []ClusterObjectReference `json:"appliedResources,omitempty"`
// PolicyStatus records the status of policy
// Deprecated This field is only used by EnvBinding Policy which is deprecated.
PolicyStatus []PolicyStatus `json:"policy,omitempty"`
}
// PolicyStatus records the status of policy
// Deprecated
type PolicyStatus struct {
Name string `json:"name"`
Type string `json:"type"`
@@ -316,27 +335,80 @@ type PolicyStatus struct {
Status *runtime.RawExtension `json:"status,omitempty"`
}
// WorkflowStep defines how to execute a workflow step.
type WorkflowStep struct {
// Name is the unique name of the workflow step.
Name string `json:"name"`
Type string `json:"type"`
// +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 string `json:"mode"`
Phase workflowv1alpha1.WorkflowRunPhase `json:"status,omitempty"`
Message string `json:"message,omitempty"`
AppRevision string `json:"appRevision,omitempty"`
Mode WorkflowMode `json:"mode"`
Message string `json:"message,omitempty"`
Suspend bool `json:"suspend"`
SuspendState string `json:"suspendState,omitempty"`
Suspend bool `json:"suspend"`
Terminated bool `json:"terminated"`
Finished bool `json:"finished"`
ContextBackend *corev1.ObjectReference `json:"contextBackend,omitempty"`
Steps []workflowv1alpha1.WorkflowStepStatus `json:"steps,omitempty"`
ContextBackend *corev1.ObjectReference `json:"contextBackend,omitempty"`
Steps []WorkflowStepStatus `json:"steps,omitempty"`
StartTime metav1.Time `json:"startTime,omitempty"`
// +nullable
EndTime metav1.Time `json:"endTime,omitempty"`
}
// WorkflowStepPhase describes the phase of a workflow step.
type WorkflowStepPhase string
const (
// WorkflowStepPhaseSucceeded will make the controller run the next step.
WorkflowStepPhaseSucceeded WorkflowStepPhase = "succeeded"
// WorkflowStepPhaseFailed will report error in `message`.
WorkflowStepPhaseFailed WorkflowStepPhase = "failed"
// WorkflowStepPhaseSkipped will make the controller skip the step.
WorkflowStepPhaseSkipped WorkflowStepPhase = "skipped"
// WorkflowStepPhaseStopped will make the controller stop the workflow.
WorkflowStepPhaseStopped WorkflowStepPhase = "stopped"
// WorkflowStepPhaseRunning will make the controller continue the workflow.
WorkflowStepPhaseRunning WorkflowStepPhase = "running"
)
// DefinitionType describes the type of DefinitionRevision.
// +kubebuilder:validation:Enum=Component;Trait;Policy;WorkflowStep
type DefinitionType string
@@ -355,6 +427,16 @@ const (
WorkflowStepType DefinitionType = "WorkflowStep"
)
// WorkflowMode describes the mode of workflow
type WorkflowMode string
const (
// WorkflowModeDAG describes the DAG mode of workflow
WorkflowModeDAG WorkflowMode = "DAG"
// WorkflowModeStep describes the step by step mode of workflow
WorkflowModeStep WorkflowMode = "StepByStep"
)
// AppRolloutStatus defines the observed state of AppRollout
type AppRolloutStatus struct {
v1alpha1.RolloutStatus `json:",inline"`
@@ -384,9 +466,9 @@ type ApplicationComponent struct {
// +kubebuilder:pruning:PreserveUnknownFields
Properties *runtime.RawExtension `json:"properties,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs workflowv1alpha1.StepInputs `json:"inputs,omitempty"`
Outputs workflowv1alpha1.StepOutputs `json:"outputs,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"`
@@ -395,10 +477,22 @@ type ApplicationComponent struct {
// scopes in ApplicationComponent defines the component-level scopes
// the format is <scope-type:scope-instance-name> pairs, the key represents type of `ScopeDefinition` while the value represent the name of scope instance.
Scopes map[string]string `json:"scopes,omitempty"`
}
// ReplicaKey is not empty means the component is replicated. This field is designed so that it can't be specified in application directly.
// So we set the json tag as "-". Instead, this will be filled when using replication policy.
ReplicaKey string `json:"-"`
// 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.
@@ -427,13 +521,16 @@ type ClusterPlacement struct {
Distribution Distribution `json:"distribution,omitempty"`
}
// ResourceCreatorRole defines the resource creator.
type ResourceCreatorRole string
const (
// PolicyResourceCreator create the policy resource.
PolicyResourceCreator string = "policy"
PolicyResourceCreator ResourceCreatorRole = "policy"
// WorkflowResourceCreator create the resource in workflow.
WorkflowResourceCreator string = "workflow"
WorkflowResourceCreator ResourceCreatorRole = "workflow"
// DebugResourceCreator create the debug resource.
DebugResourceCreator string = "debug"
DebugResourceCreator ResourceCreatorRole = "debug"
)
// OAMObjectReference defines the object reference for an oam resource
@@ -480,8 +577,8 @@ func NewOAMObjectReferenceFromObject(obj client.Object) OAMObjectReference {
// ClusterObjectReference defines the object reference with cluster.
type ClusterObjectReference struct {
Cluster string `json:"cluster,omitempty"`
Creator string `json:"creator,omitempty"`
Cluster string `json:"cluster,omitempty"`
Creator ResourceCreatorRole `json:"creator,omitempty"`
corev1.ObjectReference `json:",inline"`
}

View File

@@ -22,7 +22,6 @@ limitations under the License.
package common
import (
"github.com/kubevela/workflow/api/v1alpha1"
crossplane_runtime "github.com/oam-dev/terraform-controller/api/types/crossplane-runtime"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
@@ -109,12 +108,12 @@ func (in *ApplicationComponent) DeepCopyInto(out *ApplicationComponent) {
}
if in.Inputs != nil {
in, out := &in.Inputs, &out.Inputs
*out = make(v1alpha1.StepInputs, len(*in))
*out = make(StepInputs, len(*in))
copy(*out, *in)
}
if in.Outputs != nil {
in, out := &in.Outputs, &out.Outputs
*out = make(v1alpha1.StepOutputs, len(*in))
*out = make(StepOutputs, len(*in))
copy(*out, *in)
}
if in.Traits != nil {
@@ -574,6 +573,61 @@ 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
@@ -609,13 +663,12 @@ func (in *WorkflowStatus) DeepCopyInto(out *WorkflowStatus) {
}
if in.Steps != nil {
in, out := &in.Steps, &out.Steps
*out = make([]v1alpha1.WorkflowStepStatus, len(*in))
*out = make([]WorkflowStepStatus, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
in.StartTime.DeepCopyInto(&out.StartTime)
in.EndTime.DeepCopyInto(&out.EndTime)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStatus.
@@ -628,6 +681,122 @@ func (in *WorkflowStatus) DeepCopy() *WorkflowStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowStep) DeepCopyInto(out *WorkflowStep) {
*out = *in
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
if in.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

@@ -31,7 +31,7 @@ import (
)
// A ConditionType represents a condition a resource could be in.
// nolint
// nolint:golint
type ConditionType string
// Condition types.
@@ -45,7 +45,7 @@ const (
)
// A ConditionReason represents the reason a resource is in a condition.
// nolint
// nolint:golint
type ConditionReason string
// Reasons a resource is or is not ready.

View File

@@ -23,17 +23,8 @@ import (
const (
// ApplyOncePolicyType refers to the type of configuration drift policy
ApplyOncePolicyType = "apply-once"
// ApplyOnceStrategyOnAppUpdate policy takes effect on application updating
ApplyOnceStrategyOnAppUpdate ApplyOnceAffectStrategy = "onUpdate"
// ApplyOnceStrategyOnAppStateKeep policy takes effect on application state keep
ApplyOnceStrategyOnAppStateKeep ApplyOnceAffectStrategy = "onStateKeep"
// ApplyOnceStrategyAlways policy takes effect always
ApplyOnceStrategyAlways ApplyOnceAffectStrategy = "always"
)
// ApplyOnceAffectStrategy is a string that mark the policy effective stage
type ApplyOnceAffectStrategy string
// ApplyOncePolicySpec defines the spec of preventing configuration drift
type ApplyOncePolicySpec struct {
Enable bool `json:"enable"`
@@ -54,9 +45,6 @@ type ApplyOnceStrategy struct {
// Path the specified path that allow configuration drift
// like 'spec.template.spec.containers[0].resources' and '*' means the whole target allow configuration drift
Path []string `json:"path"`
// ApplyOnceAffectStrategy Decide when the strategy will take effect
// like affect:onUpdate/onStateKeep/always
ApplyOnceAffectStrategy ApplyOnceAffectStrategy `json:"affect"`
}
// FindStrategy find apply-once strategy for target resource
@@ -65,7 +53,15 @@ func (in ApplyOncePolicySpec) FindStrategy(manifest *unstructured.Unstructured)
return nil
}
for _, rule := range in.Rules {
if rule.Selector.Match(manifest) {
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
}
}

View File

@@ -25,8 +25,6 @@ const (
type RefObjectsComponentSpec struct {
// Objects the referrers to the Kubernetes objects
Objects []ObjectReferrer `json:"objects,omitempty"`
// URLs are the links that stores the referred objects
URLs []string `json:"urls,omitempty"`
}
// ObjectReferrer selects Kubernetes objects

View File

@@ -97,7 +97,6 @@ type EnvSelector struct {
}
// EnvConfig is the configuration for different environments.
// Deprecated
type EnvConfig struct {
Name string `json:"name"`
Placement EnvPlacement `json:"placement,omitempty"`
@@ -106,7 +105,6 @@ type EnvConfig struct {
}
// EnvBindingSpec defines a list of envs
// Deprecated This spec is deprecated and replaced by Topology/Override Policy
type EnvBindingSpec struct {
Envs []EnvConfig `json:"envs"`
}
@@ -126,21 +124,18 @@ func (in PlacementDecision) String() string {
}
// EnvStatus records the status of one env
// Deprecated
type EnvStatus struct {
Env string `json:"env"`
Placements []PlacementDecision `json:"placements"`
}
// ClusterConnection records the connection with clusters and the last active app revision when they are active (still be used)
// Deprecated
type ClusterConnection struct {
ClusterName string `json:"clusterName"`
LastActiveRevision string `json:"lastActiveRevision"`
}
// EnvBindingStatus records the status of all env
// Deprecated
type EnvBindingStatus struct {
Envs []EnvStatus `json:"envs"`
ClusterConnections []ClusterConnection `json:"clusterConnections"`

View File

@@ -19,6 +19,8 @@ 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
@@ -47,3 +49,27 @@ type PolicyList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []Policy `json:"items"`
}
// +kubebuilder:object:root=true
// Workflow is the Schema for the policy API
// +kubebuilder:storageversion
// +kubebuilder:resource:categories={oam}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Workflow struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Steps []common.WorkflowStep `json:"steps,omitempty"`
}
// +kubebuilder:object:root=true
// WorkflowList contains a list of Workflow
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type WorkflowList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Workflow `json:"items"`
}

View File

@@ -18,8 +18,6 @@ package v1alpha1
import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/utils/pointer"
"k8s.io/utils/strings/slices"
"github.com/oam-dev/kubevela/pkg/oam"
)
@@ -58,56 +56,16 @@ type GarbageCollectPolicyRule struct {
}
// ResourcePolicyRuleSelector select the targets of the rule
// if multiple conditions are specified, combination logic is AND
// 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,omitempty"`
CompTypes []string `json:"componentTypes,omitempty"`
OAMResourceTypes []string `json:"oamTypes,omitempty"`
TraitTypes []string `json:"traitTypes,omitempty"`
ResourceTypes []string `json:"resourceTypes,omitempty"`
ResourceNames []string `json:"resourceNames,omitempty"`
}
// Match check if current rule selector match the target resource
// If at least one condition is matched and no other condition failed (could be empty), return true
// Otherwise, return false
func (in *ResourcePolicyRuleSelector) Match(manifest *unstructured.Unstructured) bool {
var compName, compType, oamType, traitType, resourceType, resourceName string
if labels := manifest.GetLabels(); labels != nil {
compName = labels[oam.LabelAppComponent]
compType = labels[oam.WorkloadTypeLabel]
oamType = labels[oam.LabelOAMResourceType]
traitType = labels[oam.TraitTypeLabel]
}
resourceType = manifest.GetKind()
resourceName = manifest.GetName()
match := func(src []string, val string) (found *bool) {
if len(src) == 0 {
return nil
}
return pointer.Bool(val != "" && slices.Contains(src, val))
}
conditions := []*bool{
match(in.CompNames, compName),
match(in.CompTypes, compType),
match(in.OAMResourceTypes, oamType),
match(in.TraitTypes, traitType),
match(in.ResourceTypes, resourceType),
match(in.ResourceNames, resourceName),
}
hasMatched := false
for _, cond := range conditions {
// if any non-empty condition failed, return false
if cond != nil && !*cond {
return false
}
// if condition succeed, record it
if cond != nil && *cond {
hasMatched = true
}
}
// if at least one condition is met, return true
return hasMatched
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
@@ -126,7 +84,23 @@ const (
// FindStrategy find gc strategy for target resource
func (in GarbageCollectPolicySpec) FindStrategy(manifest *unstructured.Unstructured) *GarbageCollectStrategy {
for _, rule := range in.Rules {
if rule.Selector.Match(manifest) {
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
}
}

View File

@@ -16,8 +16,6 @@ limitations under the License.
package v1alpha1
import "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
const (
// TopologyPolicyType refers to the type of topology policy
TopologyPolicyType = "topology"
@@ -25,10 +23,6 @@ const (
OverridePolicyType = "override"
// DebugPolicyType refers to the type of debug policy
DebugPolicyType = "debug"
// SharedResourcePolicyType refers to the type of shared resource policy
SharedResourcePolicyType = "shared-resource"
// ReplicationPolicyType refers to the type of replication policy
ReplicationPolicyType = "replication"
)
// TopologyPolicySpec defines the spec of topology policy
@@ -49,10 +43,6 @@ type Placement struct {
// Exclusive to "clusters"
ClusterLabelSelector map[string]string `json:"clusterLabelSelector,omitempty"`
// AllowEmpty ignore empty cluster error when no cluster returned for label
// selector
AllowEmpty bool `json:"allowEmpty,omitempty"`
// DeprecatedClusterSelector is a depreciated alias for ClusterLabelSelector.
// Deprecated: Use clusterLabelSelector instead.
DeprecatedClusterSelector map[string]string `json:"clusterSelector,omitempty"`
@@ -63,31 +53,3 @@ type OverridePolicySpec struct {
Components []EnvComponentPatch `json:"components,omitempty"`
Selector []string `json:"selector,omitempty"`
}
// SharedResourcePolicySpec defines the spec of shared-resource policy
type SharedResourcePolicySpec struct {
Rules []SharedResourcePolicyRule `json:"rules"`
}
// SharedResourcePolicyRule defines the rule for sharing resources
type SharedResourcePolicyRule struct {
Selector ResourcePolicyRuleSelector `json:"selector"`
}
// FindStrategy return if the target resource should be shared
func (in SharedResourcePolicySpec) FindStrategy(manifest *unstructured.Unstructured) bool {
for _, rule := range in.Rules {
if rule.Selector.Match(manifest) {
return true
}
}
return false
}
// ReplicationPolicySpec defines the spec of replication policy
// Override policy should be used together with replication policy to select the deployment target components
type ReplicationPolicySpec struct {
Keys []string `json:"keys,omitempty"`
// Selector is the subset of selected components which will be replicated.
Selector []string `json:"selector,omitempty"`
}

View File

@@ -1,69 +0,0 @@
/*
Copyright 2022 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
"testing"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
func TestSharedResourcePolicySpec_FindStrategy(t *testing.T) {
testCases := map[string]struct {
rules []SharedResourcePolicyRule
input *unstructured.Unstructured
matched bool
}{
"shared resource rule resourceName match": {
rules: []SharedResourcePolicyRule{{
Selector: ResourcePolicyRuleSelector{ResourceNames: []string{"example"}},
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"name": "example",
},
}},
matched: true,
},
"shared resource rule resourceType match": {
rules: []SharedResourcePolicyRule{{
Selector: ResourcePolicyRuleSelector{ResourceTypes: []string{"ConfigMap", "Namespace"}},
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"kind": "Namespace",
}},
matched: true,
},
"shared resource rule mismatch": {
rules: []SharedResourcePolicyRule{{
Selector: ResourcePolicyRuleSelector{ResourceNames: []string{"mismatch"}},
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"kind": "Namespace",
}},
matched: false,
},
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
r := require.New(t)
spec := SharedResourcePolicySpec{Rules: tc.rules}
r.Equal(tc.matched, spec.FindStrategy(tc.input))
})
}
}

View File

@@ -20,8 +20,6 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
@@ -56,5 +54,5 @@ var (
func init() {
SchemeBuilder.Register(&Policy{}, &PolicyList{})
SchemeBuilder.Register(&workflowv1alpha1.Workflow{}, &workflowv1alpha1.WorkflowList{})
SchemeBuilder.Register(&Workflow{}, &WorkflowList{})
}

View File

@@ -595,11 +595,6 @@ func (in *RefObjectsComponentSpec) DeepCopyInto(out *RefObjectsComponentSpec) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.URLs != nil {
in, out := &in.URLs, &out.URLs
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RefObjectsComponentSpec.
@@ -612,31 +607,6 @@ func (in *RefObjectsComponentSpec) DeepCopy() *RefObjectsComponentSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReplicationPolicySpec) DeepCopyInto(out *ReplicationPolicySpec) {
*out = *in
if in.Keys != nil {
in, out := &in.Keys, &out.Keys
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicationPolicySpec.
func (in *ReplicationPolicySpec) DeepCopy() *ReplicationPolicySpec {
if in == nil {
return nil
}
out := new(ReplicationPolicySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourcePolicyRuleSelector) DeepCopyInto(out *ResourcePolicyRuleSelector) {
*out = *in
@@ -665,11 +635,6 @@ func (in *ResourcePolicyRuleSelector) DeepCopyInto(out *ResourcePolicyRuleSelect
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.ResourceNames != nil {
in, out := &in.ResourceNames, &out.ResourceNames
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePolicyRuleSelector.
@@ -682,44 +647,6 @@ func (in *ResourcePolicyRuleSelector) DeepCopy() *ResourcePolicyRuleSelector {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SharedResourcePolicyRule) DeepCopyInto(out *SharedResourcePolicyRule) {
*out = *in
in.Selector.DeepCopyInto(&out.Selector)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedResourcePolicyRule.
func (in *SharedResourcePolicyRule) DeepCopy() *SharedResourcePolicyRule {
if in == nil {
return nil
}
out := new(SharedResourcePolicyRule)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SharedResourcePolicySpec) DeepCopyInto(out *SharedResourcePolicySpec) {
*out = *in
if in.Rules != nil {
in, out := &in.Rules, &out.Rules
*out = make([]SharedResourcePolicyRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedResourcePolicySpec.
func (in *SharedResourcePolicySpec) DeepCopy() *SharedResourcePolicySpec {
if in == nil {
return nil
}
out := new(SharedResourcePolicySpec)
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
@@ -735,3 +662,67 @@ func (in *TopologyPolicySpec) DeepCopy() *TopologyPolicySpec {
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Workflow) DeepCopyInto(out *Workflow) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
if in.Steps != nil {
in, out := &in.Steps, &out.Steps
*out = make([]common.WorkflowStep, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workflow.
func (in *Workflow) DeepCopy() *Workflow {
if in == nil {
return nil
}
out := new(Workflow)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Workflow) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowList) DeepCopyInto(out *WorkflowList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Workflow, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowList.
func (in *WorkflowList) DeepCopy() *WorkflowList {
if in == nil {
return nil
}
out := new(WorkflowList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *WorkflowList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

View File

@@ -0,0 +1,65 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha2
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/pkg/oam"
)
var _ oam.Trait = &ManualScalerTrait{}
// A ManualScalerTraitSpec defines the desired state of a ManualScalerTrait.
type ManualScalerTraitSpec struct {
// ReplicaCount of the workload this trait applies to.
ReplicaCount int32 `json:"replicaCount"`
// WorkloadReference to the workload this trait applies to.
WorkloadReference corev1.ObjectReference `json:"workloadRef"`
}
// A ManualScalerTraitStatus represents the observed state of a
// ManualScalerTrait.
type ManualScalerTraitStatus struct {
condition.ConditionedStatus `json:",inline"`
}
// +kubebuilder:object:root=true
// A ManualScalerTrait determines how many replicas a workload should have.
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
type ManualScalerTrait struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ManualScalerTraitSpec `json:"spec,omitempty"`
Status ManualScalerTraitStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ManualScalerTraitList contains a list of ManualScalerTrait.
type ManualScalerTraitList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ManualScalerTrait `json:"items"`
}

View File

@@ -24,6 +24,26 @@ import (
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// GetCondition of this ManualScalerTrait.
func (tr *ManualScalerTrait) GetCondition(ct condition.ConditionType) condition.Condition {
return tr.Status.GetCondition(ct)
}
// SetConditions of this ManualScalerTrait.
func (tr *ManualScalerTrait) SetConditions(c ...condition.Condition) {
tr.Status.SetConditions(c...)
}
// GetWorkloadReference of this ManualScalerTrait.
func (tr *ManualScalerTrait) GetWorkloadReference() corev1.ObjectReference {
return tr.Spec.WorkloadReference
}
// SetWorkloadReference of this ManualScalerTrait.
func (tr *ManualScalerTrait) SetWorkloadReference(r corev1.ObjectReference) {
tr.Spec.WorkloadReference = r
}
// GetCondition of this ApplicationConfiguration.
func (ac *ApplicationConfiguration) GetCondition(ct condition.ConditionType) condition.Condition {
return ac.Status.GetCondition(ct)

View File

@@ -87,6 +87,14 @@ var (
ApplicationConfigurationGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationConfigurationKind)
)
// ManualScalerTrait type metadata.
var (
ManualScalerTraitKind = reflect.TypeOf(ManualScalerTrait{}).Name()
ManualScalerTraitGroupKind = schema.GroupKind{Group: Group, Kind: ManualScalerTraitKind}.String()
ManualScalerTraitKindAPIVersion = ManualScalerTraitKind + "." + SchemeGroupVersion.String()
ManualScalerTraitGroupVersionKind = SchemeGroupVersion.WithKind(ManualScalerTraitKind)
)
// HealthScope type metadata.
var (
HealthScopeKind = reflect.TypeOf(HealthScope{}).Name()
@@ -118,6 +126,7 @@ func init() {
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
SchemeBuilder.Register(&Component{}, &ComponentList{})
SchemeBuilder.Register(&ApplicationConfiguration{}, &ApplicationConfigurationList{})
SchemeBuilder.Register(&ManualScalerTrait{}, &ManualScalerTraitList{})
SchemeBuilder.Register(&HealthScope{}, &HealthScopeList{})
SchemeBuilder.Register(&Application{}, &ApplicationList{})
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})

View File

@@ -1520,6 +1520,97 @@ func (in *HistoryWorkload) DeepCopy() *HistoryWorkload {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ManualScalerTrait) DeepCopyInto(out *ManualScalerTrait) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManualScalerTrait.
func (in *ManualScalerTrait) DeepCopy() *ManualScalerTrait {
if in == nil {
return nil
}
out := new(ManualScalerTrait)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ManualScalerTrait) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ManualScalerTraitList) DeepCopyInto(out *ManualScalerTraitList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ManualScalerTrait, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManualScalerTraitList.
func (in *ManualScalerTraitList) DeepCopy() *ManualScalerTraitList {
if in == nil {
return nil
}
out := new(ManualScalerTraitList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ManualScalerTraitList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ManualScalerTraitSpec) DeepCopyInto(out *ManualScalerTraitSpec) {
*out = *in
out.WorkloadReference = in.WorkloadReference
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManualScalerTraitSpec.
func (in *ManualScalerTraitSpec) DeepCopy() *ManualScalerTraitSpec {
if in == nil {
return nil
}
out := new(ManualScalerTraitSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ManualScalerTraitStatus) DeepCopyInto(out *ManualScalerTraitStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManualScalerTraitStatus.
func (in *ManualScalerTraitStatus) DeepCopy() *ManualScalerTraitStatus {
if in == nil {
return nil
}
out := new(ManualScalerTraitStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MemoryResources) DeepCopyInto(out *MemoryResources) {
*out = *in

View File

@@ -23,8 +23,6 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
@@ -51,11 +49,13 @@ type AppPolicy struct {
Properties *runtime.RawExtension `json:"properties,omitempty"`
}
// WorkflowStep defines how to execute a workflow step.
type WorkflowStep common.WorkflowStep
// Workflow defines workflow steps and other attributes
type Workflow struct {
Ref string `json:"ref,omitempty"`
Mode *workflowv1alpha1.WorkflowExecuteMode `json:"mode,omitempty"`
Steps []workflowv1alpha1.WorkflowStep `json:"steps,omitempty"`
Ref string `json:"ref,omitempty"`
Steps []WorkflowStep `json:"steps,omitempty"`
}
// ApplicationSpec is the spec of Application

View File

@@ -19,8 +19,6 @@ package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha1"
)
@@ -57,7 +55,7 @@ type ApplicationRevisionSpec struct {
Policies map[string]v1alpha1.Policy `json:"policies,omitempty"`
// Workflow records the external workflow
Workflow *workflowv1alpha1.Workflow `json:"workflow,omitempty"`
Workflow *v1alpha1.Workflow `json:"workflow,omitempty"`
// ReferredObjects records the referred objects used in the ref-object typed components
// +kubebuilder:pruning:PreserveUnknownFields

View File

@@ -120,7 +120,7 @@ type TraitDefinitionSpec struct {
PodDisruptive bool `json:"podDisruptive,omitempty"`
// AppliesToWorkloads specifies the list of workload kinds this trait
// applies to. Workload kinds are specified in resource.group/version format,
// applies to. Workload kinds are specified in kind.group/version format,
// e.g. server.core.oam.dev/v1alpha2. Traits that omit this field apply to
// all workload kinds.
// +optional
@@ -138,8 +138,7 @@ type TraitDefinitionSpec struct {
// +optional
ConflictsWith []string `json:"conflictsWith,omitempty"`
// Schematic defines the data format and template of the encapsulation of the trait.
// Only CUE and Kube schematic are supported for now.
// Schematic defines the data format and template of the encapsulation of the trait
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
@@ -155,32 +154,14 @@ type TraitDefinitionSpec struct {
// ManageWorkload defines the trait would be responsible for creating the workload
// +optional
ManageWorkload bool `json:"manageWorkload,omitempty"`
// SkipRevisionAffect defines the update this trait will not generate a new application Revision
// +optional
SkipRevisionAffect bool `json:"skipRevisionAffect,omitempty"`
// ControlPlaneOnly defines which cluster is dispatched to
// +optional
ControlPlaneOnly bool `json:"controlPlaneOnly,omitempty"`
// Stage defines the stage information to which this trait resource processing belongs.
// Currently, PreDispatch and PostDispatch are provided, which are used to control resource
// pre-process and post-process respectively.
// +optional
Stage StageType `json:"stage,omitempty"`
}
// StageType describes how the manifests should be dispatched.
// Only one of the following stage types may be specified.
// If none of the following types is specified, the default one
// is DefaultDispatch.
type StageType string
const (
// PreDispatch means that pre dispatch for manifests
PreDispatch StageType = "PreDispatch"
// DefaultDispatch means that default dispatch for manifests
DefaultDispatch StageType = "DefaultDispatch"
// PostDispatch means that post dispatch for manifests
PostDispatch StageType = "PostDispatch"
)
// TraitDefinitionStatus is the status of TraitDefinition
type TraitDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource

View File

@@ -29,8 +29,7 @@ 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.
// Only CUE schematic is supported for now.
// Schematic defines the data format and template of the encapsulation of the policy definition
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`

View File

@@ -21,8 +21,8 @@ import (
"reflect"
"strings"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
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"
@@ -33,8 +33,7 @@ import (
"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/compression"
velaerr "github.com/oam-dev/kubevela/pkg/utils/errors"
"github.com/oam-dev/kubevela/pkg/utils/errors"
)
// +kubebuilder:object:root=true
@@ -70,80 +69,9 @@ const (
// ResourceTrackerSpec define the spec of resourceTracker
type ResourceTrackerSpec struct {
Type ResourceTrackerType `json:"type,omitempty"`
ApplicationGeneration int64 `json:"applicationGeneration"`
ManagedResources []ManagedResource `json:"managedResources,omitempty"`
Compression ResourceTrackerCompression `json:"compression,omitempty"`
}
// ResourceTrackerCompression the compression for ResourceTracker ManagedResources
type ResourceTrackerCompression struct {
Type compression.Type `json:"type,omitempty"`
Data string `json:"data,omitempty"`
}
// MarshalJSON will encode ResourceTrackerSpec according to the compression type. If type specified,
// it will encode data to compression data.
// Note: this is not the standard json Marshal process but re-use the framework function.
func (in *ResourceTrackerSpec) MarshalJSON() ([]byte, error) {
type Alias ResourceTrackerSpec
tmp := &struct{ *Alias }{}
switch in.Compression.Type {
case compression.Uncompressed:
tmp.Alias = (*Alias)(in)
case compression.Gzip:
cpy := in.DeepCopy()
data, err := compression.GzipObjectToString(in.ManagedResources)
if err != nil {
return nil, err
}
cpy.ManagedResources = nil
cpy.Compression.Data = data
tmp.Alias = (*Alias)(cpy)
case compression.Zstd:
cpy := in.DeepCopy()
data, err := compression.ZstdObjectToString(in.ManagedResources)
if err != nil {
return nil, err
}
cpy.ManagedResources = nil
cpy.Compression.Data = data
tmp.Alias = (*Alias)(cpy)
default:
return nil, compression.NewUnsupportedCompressionTypeError(string(in.Compression.Type))
}
return json.Marshal(tmp.Alias)
}
// UnmarshalJSON will decode ResourceTrackerSpec according to the compression type. If type specified,
// it will decode data from compression data.
// Note: this is not the standard json Unmarshal process but re-use the framework function.
func (in *ResourceTrackerSpec) UnmarshalJSON(src []byte) error {
type Alias ResourceTrackerSpec
tmp := &struct{ *Alias }{}
if err := json.Unmarshal(src, tmp); err != nil {
return err
}
switch tmp.Compression.Type {
case compression.Uncompressed:
break
case compression.Gzip:
tmp.ManagedResources = []ManagedResource{}
if err := compression.GunzipStringToObject(tmp.Compression.Data, &tmp.ManagedResources); err != nil {
return err
}
tmp.Compression.Data = ""
case compression.Zstd:
tmp.ManagedResources = []ManagedResource{}
if err := compression.UnZstdStringToObject(tmp.Compression.Data, &tmp.ManagedResources); err != nil {
return err
}
tmp.Compression.Data = ""
default:
return compression.NewUnsupportedCompressionTypeError(string(in.Compression.Type))
}
(*ResourceTrackerSpec)(tmp.Alias).DeepCopyInto(in)
return nil
Type ResourceTrackerType `json:"type,omitempty"`
ApplicationGeneration int64 `json:"applicationGeneration"`
ManagedResources []ManagedResource `json:"managedResources,omitempty"`
}
// ManagedResource define the resource to be managed by ResourceTracker
@@ -154,8 +82,6 @@ type ManagedResource struct {
Data *runtime.RawExtension `json:"raw,omitempty"`
// Deleted marks the resource to be deleted
Deleted bool `json:"deleted,omitempty"`
// SkipGC marks the resource to skip gc
SkipGC bool `json:"skipGC,omitempty"`
}
// Equal check if two managed resource equals
@@ -195,13 +121,12 @@ func (in ManagedResource) NamespacedName() types.NamespacedName {
// ResourceKey computes the key for managed resource, resources with the same key points to the same resource
func (in ManagedResource) ResourceKey() string {
group := in.GroupVersionKind().Group
kind := in.GroupVersionKind().Kind
gv, kind := in.GroupVersionKind().ToAPIVersionAndKind()
cluster := in.Cluster
if cluster == "" {
cluster = velatypes.ClusterLocalName
}
return strings.Join([]string{group, kind, cluster, in.Namespace, in.Name}, "/")
return strings.Join([]string{gv, kind, cluster, in.Namespace, in.Name}, "/")
}
// ComponentKey computes the key for the component which managed resource belongs to
@@ -212,7 +137,7 @@ func (in ManagedResource) ComponentKey() string {
// UnmarshalTo unmarshal ManagedResource into target object
func (in ManagedResource) UnmarshalTo(obj interface{}) error {
if in.Data == nil || in.Data.Raw == nil {
return velaerr.ManagedResourceHasNoDataError{}
return errors.ManagedResourceHasNoDataError{}
}
return json.Unmarshal(in.Data.Raw, obj)
}
@@ -233,7 +158,7 @@ func (in ManagedResource) ToUnstructured() *unstructured.Unstructured {
func (in ManagedResource) ToUnstructuredWithData() (*unstructured.Unstructured, error) {
obj := in.ToUnstructured()
if err := in.UnmarshalTo(obj); err != nil {
if errors.Is(err, velaerr.ManagedResourceHasNoDataError{}) {
if errors2.Is(err, errors.ManagedResourceHasNoDataError{}) {
return nil, err
}
}
@@ -270,7 +195,7 @@ func newManagedResourceFromResource(rsc client.Object) ManagedResource {
gvk := rsc.GetObjectKind().GroupVersionKind()
return ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{
ObjectReference: corev1.ObjectReference{
ObjectReference: v1.ObjectReference{
APIVersion: gvk.GroupVersion().String(),
Kind: gvk.Kind,
Name: rsc.GetName(),
@@ -290,9 +215,8 @@ func (in *ResourceTracker) ContainsManagedResource(rsc client.Object) bool {
}
// AddManagedResource add object to managed resources, if exists, update
func (in *ResourceTracker) AddManagedResource(rsc client.Object, metaOnly bool, skipGC bool, creator string) (updated bool) {
func (in *ResourceTracker) AddManagedResource(rsc client.Object, metaOnly bool, creator common.ResourceCreatorRole) (updated bool) {
mr := newManagedResourceFromResource(rsc)
mr.SkipGC = skipGC
if !metaOnly {
mr.Data = &runtime.RawExtension{Object: rsc}
}
@@ -318,7 +242,7 @@ func (in *ResourceTracker) DeleteManagedResource(rsc client.Object, remove bool)
gvk := rsc.GetObjectKind().GroupVersionKind()
mr := ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{
ObjectReference: corev1.ObjectReference{
ObjectReference: v1.ObjectReference{
APIVersion: gvk.GroupVersion().String(),
Kind: gvk.Kind,
Name: rsc.GetName(),
@@ -361,7 +285,7 @@ func (in *ResourceTracker) addClusterObjectReference(ref common.ClusterObjectRef
// Deprecated
func (in *ResourceTracker) AddTrackedResource(rsc interfaces.TrackableResource) bool {
return in.addClusterObjectReference(common.ClusterObjectReference{
ObjectReference: corev1.ObjectReference{
ObjectReference: v1.ObjectReference{
APIVersion: rsc.GetAPIVersion(),
Kind: rsc.GetKind(),
Name: rsc.GetName(),

View File

@@ -18,23 +18,18 @@ package v1beta1
import (
"encoding/json"
"fmt"
"io/ioutil"
"strings"
"testing"
"time"
"github.com/stretchr/testify/require"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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/compression"
"github.com/oam-dev/kubevela/pkg/utils/errors"
)
@@ -116,10 +111,10 @@ func TestManagedResourceKeys(t *testing.T) {
input := ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{
Cluster: "cluster",
ObjectReference: corev1.ObjectReference{
ObjectReference: v1.ObjectReference{
Namespace: "namespace",
Name: "name",
APIVersion: appsv1.SchemeGroupVersion.String(),
APIVersion: v12.SchemeGroupVersion.String(),
Kind: "Deployment",
},
},
@@ -130,10 +125,10 @@ func TestManagedResourceKeys(t *testing.T) {
},
}
r.Equal("namespace/name", input.NamespacedName().String())
r.Equal("apps/Deployment/cluster/namespace/name", input.ResourceKey())
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 appsv1.Deployment
var deploy1, deploy2 v12.Deployment
deploy1.Spec.Replicas = pointer.Int32(5)
bs, err := json.Marshal(deploy1)
r.NoError(err)
@@ -160,17 +155,17 @@ func TestManagedResourceKeys(t *testing.T) {
func TestResourceTracker_ManagedResource(t *testing.T) {
r := require.New(t)
input := &ResourceTracker{}
deploy1 := appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{Name: "deploy1"}}
input.AddManagedResource(&deploy1, true, false, "")
deploy1 := v12.Deployment{ObjectMeta: v13.ObjectMeta{Name: "deploy1"}}
input.AddManagedResource(&deploy1, true, "")
r.Equal(1, len(input.Spec.ManagedResources))
cm2 := corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: "cm2"}}
input.AddManagedResource(&cm2, false, false, "")
cm2 := v1.ConfigMap{ObjectMeta: v13.ObjectMeta{Name: "cm2"}}
input.AddManagedResource(&cm2, false, "")
r.Equal(2, len(input.Spec.ManagedResources))
pod3 := corev1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod3"}}
input.AddManagedResource(&pod3, false, false, "")
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, false, "")
input.AddManagedResource(&deploy1, false, "")
r.Equal(3, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&cm2, false)
r.Equal(3, len(input.Spec.ManagedResources))
@@ -181,171 +176,9 @@ func TestResourceTracker_ManagedResource(t *testing.T) {
r.Equal(1, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&pod3, true)
r.Equal(0, len(input.Spec.ManagedResources))
secret4 := corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "secret4"}}
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))
}
func TestResourceTrackerCompression(t *testing.T) {
count := 20
r := require.New(t)
// Load some real CRDs, and other test data to simulate real use-cases.
// The user must have some large resourcetrackers if they use compression,
// so we load some large CRDs.
var data []string
paths := []string{
"../../../charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_applications.yaml",
"../../../charts/vela-core/crds/core.oam.dev_definitionrevisions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_healthscopes.yaml",
"../../../charts/vela-core/crds/core.oam.dev_traitdefinitions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_componentdefinitions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_workloaddefinitions.yaml",
"../../../charts/vela-core/crds/standard.oam.dev_rollouts.yaml",
"../../../charts/vela-core/templates/addon/fluxcd.yaml",
"../../../charts/vela-core/templates/kubevela-controller.yaml",
"../../../charts/vela-core/README.md",
"../../../pkg/velaql/providers/query/testdata/machinelearning.seldon.io_seldondeployments.yaml",
"../../../legacy/charts/vela-core-legacy/crds/standard.oam.dev_podspecworkloads.yaml",
}
for _, p := range paths {
b, err := ioutil.ReadFile(p)
r.NoError(err)
data = append(data, string(b))
}
size := len(data)
// Gzip
var (
gzipCompressTime int64
gzipSize int
gzipBs []byte
)
for c := 0; c < count; c++ {
var err error
rtGzip := &ResourceTracker{}
for i := 0; i < size; i++ {
rtGzip.AddManagedResource(&corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("cm%d", i)}, Data: map[string]string{"1": data[i]}}, false, false, "")
rtGzip.AddManagedResource(&corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("secret%d", i)}}, true, false, "")
}
rtGzip.Spec.Compression.Type = compression.Gzip
// Compress
t0 := time.Now()
gzipBs, err = json.Marshal(rtGzip)
elapsed := time.Since(t0).Nanoseconds()
if gzipCompressTime == 0 {
gzipCompressTime = elapsed
} else {
gzipCompressTime = (elapsed + gzipCompressTime) / 2
}
if gzipSize == 0 {
gzipSize = len(gzipBs)
} else {
gzipSize = (len(gzipBs) + gzipSize) / 2
}
r.NoError(err)
r.Contains(string(gzipBs), `"type":"gzip","data":`)
}
// Zstd
var (
zstdCompressTime int64
zstdSize int
zstdBs []byte
)
for c := 0; c < count; c++ {
var err error
rtZstd := &ResourceTracker{}
for i := 0; i < size; i++ {
rtZstd.AddManagedResource(&corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("cm%d", i)}, Data: map[string]string{"1": data[i]}}, false, false, "")
rtZstd.AddManagedResource(&corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("secret%d", i)}}, true, false, "")
}
rtZstd.Spec.Compression.Type = compression.Zstd
t0 := time.Now()
zstdBs, err = json.Marshal(rtZstd)
elapsed := time.Since(t0).Nanoseconds()
if zstdCompressTime == 0 {
zstdCompressTime = elapsed
} else {
zstdCompressTime = (elapsed + zstdCompressTime) / 2
}
if zstdSize == 0 {
zstdSize = len(zstdBs)
} else {
zstdSize = (len(zstdBs) + zstdSize) / 2
}
r.NoError(err)
r.Contains(string(zstdBs), `"type":"zstd","data":`)
}
rtUncmp := &ResourceTracker{}
r.NoError(json.Unmarshal(gzipBs, rtUncmp))
r.Equal(size*2, len(rtUncmp.Spec.ManagedResources))
for i, rsc := range rtUncmp.Spec.ManagedResources {
r.Equal(i%2 == 1, rsc.Data == nil)
}
r.NoError(json.Unmarshal(zstdBs, rtUncmp))
r.Equal(size*2, len(rtUncmp.Spec.ManagedResources))
for i, rsc := range rtUncmp.Spec.ManagedResources {
r.Equal(i%2 == 1, rsc.Data == nil)
}
// No compression
var (
uncmpTime int64
uncmpSize int
)
rtUncmp.Spec.Compression.Type = compression.Uncompressed
for c := 0; c < count; c++ {
t0 := time.Now()
_bs, err := json.Marshal(rtUncmp)
if uncmpTime == 0 {
uncmpTime = time.Since(t0).Nanoseconds()
} else {
uncmpTime = (time.Since(t0).Nanoseconds() + uncmpTime) / 2
}
if uncmpSize == 0 {
uncmpSize = len(_bs)
} else {
uncmpSize = (len(_bs) + uncmpSize) / 2
}
r.NoError(err)
before, after := len(_bs), len(zstdBs)
r.Less(after, before)
before, after = len(_bs), len(gzipBs)
r.Less(after, before)
}
fmt.Printf(`Compressed Size:
uncompressed: %d bytes 100.00%%
gzip: %d bytes %.2f%%
zstd: %d bytes %.2f%%
`,
uncmpSize,
gzipSize, float64(gzipSize)*100.0/float64(uncmpSize),
zstdSize, float64(zstdSize)*100.0/float64(uncmpSize))
fmt.Printf(`Marshal Time:
no compression: %d ns 1.00x
gzip: %d ns %.2fx
zstd: %d ns %.2fx
`,
uncmpTime,
gzipCompressTime, float64(gzipCompressTime)/float64(uncmpTime),
zstdCompressTime, float64(zstdCompressTime)/float64(uncmpTime),
)
}
func TestResourceTrackerInvalidMarshal(t *testing.T) {
r := require.New(t)
rt := &ResourceTracker{}
rt.Spec.Compression.Type = "invalid"
_, err := json.Marshal(rt)
r.ErrorIs(err, compression.NewUnsupportedCompressionTypeError("invalid"))
r.True(strings.Contains(err.Error(), "invalid"))
r.ErrorIs(json.Unmarshal([]byte(`{"spec":{"compression":{"type":"invalid"}}}`), rt), compression.NewUnsupportedCompressionTypeError("invalid"))
r.NotNil(json.Unmarshal([]byte(`{"spec":{"compression":{"type":"gzip","data":"xxx"}}}`), rt))
r.NotNil(json.Unmarshal([]byte(`{"spec":["invalid"]}`), rt))
}

View File

@@ -29,8 +29,7 @@ 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.
// Only CUE schematic is supported for now.
// Schematic defines the data format and template of the encapsulation of the workflow step definition
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
}

View File

@@ -22,12 +22,11 @@ limitations under the License.
package v1beta1
import (
"github.com/kubevela/workflow/api/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
core_oam_devv1alpha1 "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha1"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@@ -223,7 +222,7 @@ func (in *ApplicationRevisionSpec) DeepCopyInto(out *ApplicationRevisionSpec) {
}
if in.Policies != nil {
in, out := &in.Policies, &out.Policies
*out = make(map[string]core_oam_devv1alpha1.Policy, len(*in))
*out = make(map[string]v1alpha1.Policy, len(*in))
for key, val := range *in {
(*out)[key] = *val.DeepCopy()
}
@@ -651,21 +650,6 @@ func (in *ResourceTracker) DeepCopyObject() runtime.Object {
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceTrackerCompression) DeepCopyInto(out *ResourceTrackerCompression) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceTrackerCompression.
func (in *ResourceTrackerCompression) DeepCopy() *ResourceTrackerCompression {
if in == nil {
return nil
}
out := new(ResourceTrackerCompression)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceTrackerList) DeepCopyInto(out *ResourceTrackerList) {
*out = *in
@@ -708,7 +692,6 @@ func (in *ResourceTrackerSpec) DeepCopyInto(out *ResourceTrackerSpec) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
out.Compression = in.Compression
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceTrackerSpec.
@@ -944,14 +927,9 @@ func (in *TraitDefinitionStatus) DeepCopy() *TraitDefinitionStatus {
// 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
if in.Mode != nil {
in, out := &in.Mode, &out.Mode
*out = new(v1alpha1.WorkflowExecuteMode)
**out = **in
}
if in.Steps != nil {
in, out := &in.Steps, &out.Steps
*out = make([]v1alpha1.WorkflowStep, len(*in))
*out = make([]WorkflowStep, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@@ -968,6 +946,48 @@ func (in *Workflow) DeepCopy() *Workflow {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *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([]common.WorkflowSubStep, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.DependsOn != nil {
in, out := &in.DependsOn, &out.DependsOn
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Inputs != nil {
in, out := &in.Inputs, &out.Inputs
*out = make(common.StepInputs, len(*in))
copy(*out, *in)
}
if in.Outputs != nil {
in, out := &in.Outputs, &out.Outputs
*out = make(common.StepOutputs, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStep.
func (in *WorkflowStep) DeepCopy() *WorkflowStep {
if in == nil {
return nil
}
out := new(WorkflowStep)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowStepDefinition) DeepCopyInto(out *WorkflowStepDefinition) {
*out = *in

View File

@@ -80,8 +80,6 @@ const (
OpenapiV3JSONSchema string = "openapi-v3-json-schema"
// UISchema is the key to store ui custom schema
UISchema string = "ui-schema"
// VelaQLConfigmapKey is the key to store velaql view
VelaQLConfigmapKey string = "template"
)
// CapabilityCategory defines the category of a capability
@@ -165,7 +163,6 @@ type Capability struct {
Center string `json:"center,omitempty"`
Status string `json:"status,omitempty"`
Description string `json:"description,omitempty"`
Example string `json:"example,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Category CapabilityCategory `json:"category,omitempty"`

View File

@@ -39,18 +39,4 @@ const (
var (
// AnnotationClusterAlias the annotation key for cluster alias
AnnotationClusterAlias = config.MetaApiGroupName + "/cluster-alias"
// AnnotationClusterVersion the annotation key for cluster version
AnnotationClusterVersion = config.MetaApiGroupName + "/cluster-version"
)
// ClusterVersion defines the Version info of managed clusters.
type ClusterVersion struct {
Major string `json:"major"`
Minor string `json:"minor"`
GitVersion string `json:"gitVersion,omitempty"`
Platform string `json:"platform,omitempty"`
}
// ControlPlaneClusterVersion will be the default value of cluster info if managed cluster version get error, it will have value when vela-core started.
var ControlPlaneClusterVersion ClusterVersion

View File

@@ -48,8 +48,6 @@ var DefaultKubeVelaNS = "vela-system"
const (
// AnnoDefinitionDescription is the annotation which describe what is the capability used for in a WorkloadDefinition/TraitDefinition Object
AnnoDefinitionDescription = "definition.oam.dev/description"
// AnnoDefinitionExampleURL is the annotation which describe url of usage examples of the capability, it will be loaded in documentation generate.
AnnoDefinitionExampleURL = "definition.oam.dev/example-url"
// AnnoDefinitionAlias is the annotation for definition alias
AnnoDefinitionAlias = "definition.oam.dev/alias"
// AnnoDefinitionIcon is the annotation which describe the icon url
@@ -64,8 +62,6 @@ const (
LabelDefinitionDeprecated = "custom.definition.oam.dev/deprecated"
// LabelDefinitionHidden is the label which describe whether the capability is hidden by UI
LabelDefinitionHidden = "custom.definition.oam.dev/ui-hidden"
// LabelDefinitionScope is the label which describe whether the capability's scope
LabelDefinitionScope = "custom.definition.oam.dev/scope"
// LabelNodeRoleGateway gateway role of node
LabelNodeRoleGateway = "node-role.kubernetes.io/gateway"
// LabelNodeRoleWorker worker role of node
@@ -74,11 +70,9 @@ const (
AnnoIngressControllerHTTPSPort = "ingress.controller/https-port"
// AnnoIngressControllerHTTPPort define ingress controller listen port for http
AnnoIngressControllerHTTPPort = "ingress.controller/http-port"
// AnnoIngressControllerHost define ingress controller externally host
AnnoIngressControllerHost = "ingress.controller/host"
// LabelConfigType is the label marked as the template that generated the config.
// LabelConfigType is the label for config type
LabelConfigType = "config.oam.dev/type"
// LabelConfigCatalog is the label marked as the secret generated from the config.
// LabelConfigCatalog is the label for config catalog
LabelConfigCatalog = "config.oam.dev/catalog"
// LabelConfigSubType is the sub-type for a config type
LabelConfigSubType = "config.oam.dev/sub-type"
@@ -88,18 +82,10 @@ const (
LabelConfigSyncToMultiCluster = "config.oam.dev/multi-cluster"
// LabelConfigIdentifier is the label for config identifier
LabelConfigIdentifier = "config.oam.dev/identifier"
// LabelConfigScope is the label for config scope
LabelConfigScope = "config.oam.dev/scope"
// AnnotationConfigSensitive is the annotation for the sensitization
AnnotationConfigSensitive = "config.oam.dev/sensitive"
// AnnotationConfigTemplateNamespace is the annotation for the template namespace
AnnotationConfigTemplateNamespace = "config.oam.dev/template-namespace"
// AnnotationConfigDescription is the annotation for config description
AnnotationConfigDescription = "config.oam.dev/description"
// AnnotationConfigAlias is the annotation for config alias
AnnotationConfigAlias = "config.oam.dev/alias"
// AnnotationConfigDistributionSpec is the annotation key of the application that distributes the configs
AnnotationConfigDistributionSpec = "config.oam.dev/distribution-spec"
)
const (
@@ -116,7 +102,6 @@ type Config map[string]string
type EnvMeta struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Labels string `json:"labels"`
Current string `json:"current"`
}
@@ -166,13 +151,11 @@ const (
// TerraformProvider is the config type for terraform provider
TerraformProvider = "terraform-provider"
// DexConnector is the config type for dex connector
DexConnector = "dex-connector"
DexConnector = "config-dex-connector"
// ImageRegistry is the config type for image registry
ImageRegistry = "image-registry"
ImageRegistry = "config-image-registry"
// HelmRepository is the config type for Helm chart repository
HelmRepository = "helm-repository"
// CatalogConfigDistribution is the catalog type
CatalogConfigDistribution = "config-distribution"
HelmRepository = "config-helm-repository"
)
const (

View File

@@ -81,23 +81,18 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wai
### KubeVela controller optimization parameters
| Name | Description | Value |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- |
| `optimize.cachedGvks` | Optimize types of resources to be cached. | `""` |
| `optimize.resourceTrackerListOp` | Optimize ResourceTracker List Op by adding index. | `true` |
| `optimize.controllerReconcileLoopReduction` | Optimize ApplicationController reconcile by reducing the number of loops to reconcile application. | `false` |
| `optimize.markWithProb` | Optimize ResourceTracker GC by only run mark with probability. Side effect: outdated ResourceTracker might not be able to be removed immediately. | `0.1` |
| `optimize.disableComponentRevision` | Optimize componentRevision by disabling the creation and gc | `false` |
| `optimize.disableApplicationRevision` | Optimize ApplicationRevision by disabling the creation and gc. | `false` |
| `optimize.disableWorkflowRecorder` | Optimize workflow recorder by disabling the creation and gc. | `false` |
| `optimize.enableInMemoryWorkflowContext` | Optimize workflow by use in-memory context. | `false` |
| `optimize.disableResourceApplyDoubleCheck` | Optimize workflow by ignoring resource double check after apply. | `false` |
| `optimize.enableResourceTrackerDeleteOnlyTrigger` | Optimize resourcetracker by only trigger reconcile when resourcetracker is deleted. | `true` |
| `featureGates.enableLegacyComponentRevision` | if disabled, only component with rollout trait will create component revisions | `false` |
| `featureGates.gzipResourceTracker` | if enabled, resourceTracker will be compressed using gzip before being stored | `false` |
| `featureGates.zstdResourceTracker` | if enabled, resourceTracker will be compressed using zstd before being stored. It is much faster and more efficient than gzip. If both gzip and zstd are enabled, zstd will be used. | `false` |
| `featureGates.applyOnce` | if enabled, the apply-once feature will be applied to all applications, no state-keep and no resource data storage in ResourceTracker | `false` |
| `featureGates.multiStageComponentApply` | if enabled, the multiStageComponentApply feature will be combined with the stage field in TraitDefinition to complete the multi-stage apply. | `false` |
| Name | Description | Value |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `optimize.cachedGvks` | Optimize types of resources to be cached. | `""` |
| `optimize.resourceTrackerListOp` | Optimize ResourceTracker List Op by adding index. | `true` |
| `optimize.controllerReconcileLoopReduction` | Optimize ApplicationController reconcile by reducing the number of loops to reconcile application. | `false` |
| `optimize.markWithProb` | Optimize ResourceTracker GC by only run mark with probability. Side effect: outdated ResourceTracker might not be able to be removed immediately. | `0.1` |
| `optimize.disableComponentRevision` | Optimize componentRevision by disabling the creation and gc | `false` |
| `optimize.disableApplicationRevision` | Optimize ApplicationRevision by disabling the creation and gc. | `false` |
| `optimize.disableWorkflowRecorder` | Optimize workflow recorder by disabling the creation and gc. | `false` |
| `optimize.enableInMemoryWorkflowContext` | Optimize workflow by use in-memory context. | `false` |
| `optimize.disableResourceApplyDoubleCheck` | Optimize workflow by ignoring resource double check after apply. | `false` |
| `optimize.enableResourceTrackerDeleteOnlyTrigger` | Optimize resourcetracker by only trigger reconcile when resourcetracker is deleted. | `true` |
### MultiCluster parameters

View File

@@ -461,6 +461,8 @@ spec:
cluster:
type: string
creator:
description: ResourceCreatorRole defines the resource
creator.
type: string
fieldPath:
description: 'If referring to a piece of an object instead
@@ -499,7 +501,7 @@ spec:
description: Components record the related Components created
by Application Controller
items:
description: "ObjectReference contains enough information
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object. ---
New uses of this type are discouraged because of difficulty
describing its usage when embedded in APIs. 1. Ignored
@@ -508,25 +510,25 @@ spec:
are both very rarely valid in actual usage. 2. Invalid
usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are
particular restrictions like, \"must refer only to
types A and B\" or \"UID not honored\" or \"name must
be restricted\". Those cannot be well described when
embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage,
which makes it hard for users to predict what will happen.
\ 4. The fields are both imprecise and overly precise.
\ Kind is not a precise mapping to a URL. This can produce
ambiguity during interpretation and require a REST
mapping. In most cases, the dependency is on the group,resource
tuple and the version of the actual struct is irrelevant.
\ 5. We cannot easily change it. Because this type is
embedded in many locations, updates to this type will
affect numerous schemas. Don't make new APIs embed an
underspecified API type they do not control. \n Instead
of using this type, create a locally provided and used
type that is well-focused on your reference. For example,
ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
particular restrictions like, "must refer only to
types A and B" or "UID not honored" or "name must be restricted". Those
cannot be well described when embedded. 3. Inconsistent
validation. Because the usages are different, the validation
rules are different by usage, which makes it hard for
users to predict what will happen. 4. The fields are
both imprecise and overly precise. Kind is not a precise
mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most cases,
the dependency is on the group,resource tuple and
the version of the actual struct is irrelevant. 5. We
cannot easily change it. Because this type is embedded
in many locations, updates to this type will affect
numerous schemas. Don''t make new APIs embed an underspecified
API type they do not control. Instead of using this type,
create a locally provided and used type that is well-focused
on your reference. For example, ServiceReferences for
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
@@ -621,10 +623,9 @@ spec:
format: int64
type: integer
policy:
description: PolicyStatus records the status of policy Deprecated
This field is only used by EnvBinding Policy which is deprecated.
description: PolicyStatus records the status of policy
items:
description: PolicyStatus records the status of policy Deprecated
description: PolicyStatus records the status of policy
properties:
name:
type: string
@@ -659,7 +660,7 @@ spec:
type: string
scopes:
items:
description: "ObjectReference contains enough information
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object.
--- New uses of this type are discouraged because
of difficulty describing its usage when embedded
@@ -668,28 +669,28 @@ spec:
ResourceVersion and FieldPath are both very rarely
valid in actual usage. 2. Invalid usage help. It
is impossible to add specific help for individual
usage. In most embedded usages, there are particular
\ restrictions like, \"must refer only to types
A and B\" or \"UID not honored\" or \"name must
be restricted\". Those cannot be well described
when embedded. 3. Inconsistent validation. Because
the usages are different, the validation rules are
different by usage, which makes it hard for users
to predict what will happen. 4. The fields are
both imprecise and overly precise. Kind is not
a precise mapping to a URL. This can produce ambiguity
\ during interpretation and require a REST mapping.
\ In most cases, the dependency is on the group,resource
tuple and the version of the actual struct is
irrelevant. 5. We cannot easily change it. Because
this type is embedded in many locations, updates
to this type will affect numerous schemas. Don't
make new APIs embed an underspecified API type they
do not control. \n Instead of using this type, create
a locally provided and used type that is well-focused
on your reference. For example, ServiceReferences
for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
usage. In most embedded usages, there are particular restrictions
like, "must refer only to types A and B" or "UID
not honored" or "name must be restricted". Those
cannot be well described when embedded. 3. Inconsistent
validation. Because the usages are different, the
validation rules are different by usage, which makes
it hard for users to predict what will happen. 4.
The fields are both imprecise and overly precise. Kind
is not a precise mapping to a URL. This can produce
ambiguity during interpretation and require
a REST mapping. In most cases, the dependency is
on the group,resource tuple and the version
of the actual struct is irrelevant. 5. We cannot
easily change it. Because this type is embedded
in many locations, updates to this type will
affect numerous schemas. Don''t make new APIs embed
an underspecified API type they do not control.
Instead of using this type, create a locally provided
and used type that is well-focused on your reference.
For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
@@ -776,7 +777,7 @@ spec:
appRevision:
type: string
contextBackend:
description: "ObjectReference contains enough information
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object. ---
New uses of this type are discouraged because of difficulty
describing its usage when embedded in APIs. 1. Ignored
@@ -785,11 +786,11 @@ spec:
are both very rarely valid in actual usage. 2. Invalid
usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are
particular restrictions like, \"must refer only
to types A and B\" or \"UID not honored\" or \"name
must be restricted\". Those cannot be well described
when embedded. 3. Inconsistent validation. Because
the usages are different, the validation rules are different
particular restrictions like, "must refer only to
types A and B" or "UID not honored" or "name must be
restricted". Those cannot be well described when
embedded. 3. Inconsistent validation. Because the
usages are different, the validation rules are different
by usage, which makes it hard for users to predict what
will happen. 4. The fields are both imprecise and overly
precise. Kind is not a precise mapping to a URL. This
@@ -798,13 +799,13 @@ spec:
is on the group,resource tuple and the version of
the actual struct is irrelevant. 5. We cannot easily
change it. Because this type is embedded in many locations,
updates to this type will affect numerous schemas.
\ Don't make new APIs embed an underspecified API type
they do not control. \n Instead of using this type,
create a locally provided and used type that is well-focused
updates to this type will affect numerous schemas. Don''t
make new APIs embed an underspecified API type they
do not control. Instead of using this type, create a
locally provided and used type that is well-focused
on your reference. For example, ServiceReferences for
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
.'
properties:
apiVersion:
description: API version of the referent.
@@ -842,23 +843,16 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
endTime:
format: date-time
nullable: true
type: string
finished:
type: boolean
message:
type: string
mode:
description: WorkflowMode describes the mode of workflow
type: string
startTime:
format: date-time
type: string
status:
description: WorkflowRunPhase is a label for the condition
of a WorkflowRun at the current time
type: string
steps:
items:
description: WorkflowStepStatus record the status of
@@ -894,9 +888,8 @@ spec:
type: string
subSteps:
items:
description: StepStatus record the base status
of workflow step, which could be workflow step
or subStep
description: WorkflowSubStepStatus record the
status of a workflow subStep
properties:
firstExecuteTime:
description: FirstExecuteTime is the first
@@ -2205,18 +2198,6 @@ spec:
a context in annotation. - should mark "finish" phase in
status.conditions.'
properties:
mode:
description: WorkflowExecuteMode defines the mode of workflow
execution
properties:
steps:
description: Steps is the mode of workflow steps execution
type: string
subSteps:
description: SubSteps is the mode of workflow sub
steps execution
type: string
type: object
ref:
type: string
steps:
@@ -2225,16 +2206,14 @@ spec:
step.
properties:
dependsOn:
description: DependsOn is the dependency of the
step
items:
type: string
type: array
if:
description: If is the if condition of the step
type: string
inputs:
description: Inputs is the inputs of the step
description: StepInputs defines variable input of
WorkflowStep
items:
properties:
from:
@@ -2246,19 +2225,13 @@ spec:
- parameterKey
type: object
type: array
meta:
description: Meta is the meta data of the workflow
step.
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the workflow
step.
type: string
outputs:
description: Outputs is the outputs of the step
description: StepOutputs defines output variable
of WorkflowStep
items:
properties:
name:
@@ -2271,27 +2244,22 @@ spec:
type: object
type: array
properties:
description: Properties is the properties of the
step
type: object
x-kubernetes-preserve-unknown-fields: true
subSteps:
items:
description: WorkflowStepBase defines the workflow
step base
description: WorkflowSubStep defines how to execute
a workflow subStep.
properties:
dependsOn:
description: DependsOn is the dependency of
the step
items:
type: string
type: array
if:
description: If is the if condition of the
step
type: string
inputs:
description: Inputs is the inputs of the step
description: StepInputs defines variable input
of WorkflowStep
items:
properties:
from:
@@ -2303,20 +2271,13 @@ spec:
- parameterKey
type: object
type: array
meta:
description: Meta is the meta data of the
workflow step.
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the
workflow step.
type: string
outputs:
description: Outputs is the outputs of the
step
description: StepOutputs defines output variable
of WorkflowStep
items:
properties:
name:
@@ -2329,28 +2290,16 @@ spec:
type: object
type: array
properties:
description: Properties is the properties
of the step
type: object
x-kubernetes-preserve-unknown-fields: true
timeout:
description: Timeout is the timeout of the
step
type: string
type:
description: Type is the type of the workflow
step.
type: string
required:
- name
- type
type: object
type: array
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
@@ -2377,6 +2326,8 @@ spec:
cluster:
type: string
creator:
description: ResourceCreatorRole defines the resource
creator.
type: string
fieldPath:
description: 'If referring to a piece of an object instead
@@ -2415,7 +2366,7 @@ spec:
description: Components record the related Components created
by Application Controller
items:
description: "ObjectReference contains enough information
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object. ---
New uses of this type are discouraged because of difficulty
describing its usage when embedded in APIs. 1. Ignored
@@ -2424,25 +2375,25 @@ spec:
are both very rarely valid in actual usage. 2. Invalid
usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are
particular restrictions like, \"must refer only to
types A and B\" or \"UID not honored\" or \"name must
be restricted\". Those cannot be well described when
embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage,
which makes it hard for users to predict what will happen.
\ 4. The fields are both imprecise and overly precise.
\ Kind is not a precise mapping to a URL. This can produce
ambiguity during interpretation and require a REST
mapping. In most cases, the dependency is on the group,resource
tuple and the version of the actual struct is irrelevant.
\ 5. We cannot easily change it. Because this type is
embedded in many locations, updates to this type will
affect numerous schemas. Don't make new APIs embed an
underspecified API type they do not control. \n Instead
of using this type, create a locally provided and used
type that is well-focused on your reference. For example,
ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
particular restrictions like, "must refer only to
types A and B" or "UID not honored" or "name must be restricted". Those
cannot be well described when embedded. 3. Inconsistent
validation. Because the usages are different, the validation
rules are different by usage, which makes it hard for
users to predict what will happen. 4. The fields are
both imprecise and overly precise. Kind is not a precise
mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most cases,
the dependency is on the group,resource tuple and
the version of the actual struct is irrelevant. 5. We
cannot easily change it. Because this type is embedded
in many locations, updates to this type will affect
numerous schemas. Don''t make new APIs embed an underspecified
API type they do not control. Instead of using this type,
create a locally provided and used type that is well-focused
on your reference. For example, ServiceReferences for
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
@@ -2537,10 +2488,9 @@ spec:
format: int64
type: integer
policy:
description: PolicyStatus records the status of policy Deprecated
This field is only used by EnvBinding Policy which is deprecated.
description: PolicyStatus records the status of policy
items:
description: PolicyStatus records the status of policy Deprecated
description: PolicyStatus records the status of policy
properties:
name:
type: string
@@ -2575,7 +2525,7 @@ spec:
type: string
scopes:
items:
description: "ObjectReference contains enough information
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object.
--- New uses of this type are discouraged because
of difficulty describing its usage when embedded
@@ -2584,28 +2534,28 @@ spec:
ResourceVersion and FieldPath are both very rarely
valid in actual usage. 2. Invalid usage help. It
is impossible to add specific help for individual
usage. In most embedded usages, there are particular
\ restrictions like, \"must refer only to types
A and B\" or \"UID not honored\" or \"name must
be restricted\". Those cannot be well described
when embedded. 3. Inconsistent validation. Because
the usages are different, the validation rules are
different by usage, which makes it hard for users
to predict what will happen. 4. The fields are
both imprecise and overly precise. Kind is not
a precise mapping to a URL. This can produce ambiguity
\ during interpretation and require a REST mapping.
\ In most cases, the dependency is on the group,resource
tuple and the version of the actual struct is
irrelevant. 5. We cannot easily change it. Because
this type is embedded in many locations, updates
to this type will affect numerous schemas. Don't
make new APIs embed an underspecified API type they
do not control. \n Instead of using this type, create
a locally provided and used type that is well-focused
on your reference. For example, ServiceReferences
for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
usage. In most embedded usages, there are particular restrictions
like, "must refer only to types A and B" or "UID
not honored" or "name must be restricted". Those
cannot be well described when embedded. 3. Inconsistent
validation. Because the usages are different, the
validation rules are different by usage, which makes
it hard for users to predict what will happen. 4.
The fields are both imprecise and overly precise. Kind
is not a precise mapping to a URL. This can produce
ambiguity during interpretation and require
a REST mapping. In most cases, the dependency is
on the group,resource tuple and the version
of the actual struct is irrelevant. 5. We cannot
easily change it. Because this type is embedded
in many locations, updates to this type will
affect numerous schemas. Don''t make new APIs embed
an underspecified API type they do not control.
Instead of using this type, create a locally provided
and used type that is well-focused on your reference.
For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
@@ -2692,7 +2642,7 @@ spec:
appRevision:
type: string
contextBackend:
description: "ObjectReference contains enough information
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object. ---
New uses of this type are discouraged because of difficulty
describing its usage when embedded in APIs. 1. Ignored
@@ -2701,11 +2651,11 @@ spec:
are both very rarely valid in actual usage. 2. Invalid
usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are
particular restrictions like, \"must refer only
to types A and B\" or \"UID not honored\" or \"name
must be restricted\". Those cannot be well described
when embedded. 3. Inconsistent validation. Because
the usages are different, the validation rules are different
particular restrictions like, "must refer only to
types A and B" or "UID not honored" or "name must be
restricted". Those cannot be well described when
embedded. 3. Inconsistent validation. Because the
usages are different, the validation rules are different
by usage, which makes it hard for users to predict what
will happen. 4. The fields are both imprecise and overly
precise. Kind is not a precise mapping to a URL. This
@@ -2714,13 +2664,13 @@ spec:
is on the group,resource tuple and the version of
the actual struct is irrelevant. 5. We cannot easily
change it. Because this type is embedded in many locations,
updates to this type will affect numerous schemas.
\ Don't make new APIs embed an underspecified API type
they do not control. \n Instead of using this type,
create a locally provided and used type that is well-focused
updates to this type will affect numerous schemas. Don''t
make new APIs embed an underspecified API type they
do not control. Instead of using this type, create a
locally provided and used type that is well-focused
on your reference. For example, ServiceReferences for
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
.'
properties:
apiVersion:
description: API version of the referent.
@@ -2758,23 +2708,16 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
endTime:
format: date-time
nullable: true
type: string
finished:
type: boolean
message:
type: string
mode:
description: WorkflowMode describes the mode of workflow
type: string
startTime:
format: date-time
type: string
status:
description: WorkflowRunPhase is a label for the condition
of a WorkflowRun at the current time
type: string
steps:
items:
description: WorkflowStepStatus record the status of
@@ -2810,9 +2753,8 @@ spec:
type: string
subSteps:
items:
description: StepStatus record the base status
of workflow step, which could be workflow step
or subStep
description: WorkflowSubStepStatus record the
status of a workflow subStep
properties:
firstExecuteTime:
description: FirstExecuteTime is the first
@@ -3308,8 +3250,7 @@ spec:
type: boolean
schematic:
description: Schematic defines the data format and template
of the encapsulation of the policy definition. Only CUE
schematic is supported for now.
of the encapsulation of the policy definition
properties:
cue:
description: CUE defines the encapsulation in CUE format
@@ -3680,7 +3621,7 @@ spec:
appliesToWorkloads:
description: AppliesToWorkloads specifies the list of workload
kinds this trait applies to. Workload kinds are specified
in resource.group/version format, e.g. server.core.oam.dev/v1alpha2.
in kind.group/version format, e.g. server.core.oam.dev/v1alpha2.
Traits that omit this field apply to all workload kinds.
items:
type: string
@@ -3735,8 +3676,7 @@ spec:
type: boolean
schematic:
description: Schematic defines the data format and template
of the encapsulation of the trait. Only CUE and Kube schematic
are supported for now.
of the encapsulation of the trait
properties:
cue:
description: CUE defines the encapsulation in CUE format
@@ -3890,12 +3830,10 @@ spec:
- configuration
type: object
type: object
stage:
description: Stage defines the stage information to which
this trait resource processing belongs. Currently, PreDispatch
and PostDispatch are provided, which are used to control
resource pre-process and post-process respectively.
type: string
skipRevisionAffect:
description: SkipRevisionAffect defines the update this
trait will not generate a new application Revision
type: boolean
status:
description: Status defines the custom health policy and
status message for trait
@@ -4011,32 +3949,19 @@ spec:
namespace:
type: string
type: object
mode:
description: WorkflowExecuteMode defines the mode of workflow
execution
properties:
steps:
description: Steps is the mode of workflow steps execution
type: string
subSteps:
description: SubSteps is the mode of workflow sub steps execution
type: string
type: object
steps:
items:
description: WorkflowStep defines how to execute a workflow
step.
properties:
dependsOn:
description: DependsOn is the dependency of the step
items:
type: string
type: array
if:
description: If is the if condition of the step
type: string
inputs:
description: Inputs is the inputs of the step
description: StepInputs defines variable input of WorkflowStep
items:
properties:
from:
@@ -4048,17 +3973,11 @@ spec:
- parameterKey
type: object
type: array
meta:
description: Meta is the meta data of the workflow step.
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: Outputs is the outputs of the step
description: StepOutputs defines output variable of WorkflowStep
items:
properties:
name:
@@ -4071,24 +3990,22 @@ spec:
type: object
type: array
properties:
description: Properties is the properties of the step
type: object
x-kubernetes-preserve-unknown-fields: true
subSteps:
items:
description: WorkflowStepBase defines the workflow step
base
description: WorkflowSubStep defines how to execute a
workflow subStep.
properties:
dependsOn:
description: DependsOn is the dependency of the step
items:
type: string
type: array
if:
description: If is the if condition of the step
type: string
inputs:
description: Inputs is the inputs of the step
description: StepInputs defines variable input of
WorkflowStep
items:
properties:
from:
@@ -4100,19 +4017,13 @@ spec:
- parameterKey
type: object
type: array
meta:
description: Meta is the meta data of the workflow
step.
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the workflow
step.
type: string
outputs:
description: Outputs is the outputs of the step
description: StepOutputs defines output variable of
WorkflowStep
items:
properties:
name:
@@ -4125,25 +4036,16 @@ spec:
type: object
type: array
properties:
description: Properties is the properties of the step
type: object
x-kubernetes-preserve-unknown-fields: true
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
- type
type: object
type: array
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
@@ -4208,8 +4110,7 @@ spec:
type: object
schematic:
description: Schematic defines the data format and template
of the encapsulation of the workflow step definition.
Only CUE schematic is supported for now.
of the encapsulation of the workflow step definition
properties:
cue:
description: CUE defines the encapsulation in CUE format
@@ -4754,32 +4655,31 @@ spec:
appRevision:
type: string
contextBackend:
description: "ObjectReference contains enough information to let
description: 'ObjectReference contains enough information to let
you inspect or modify the referred object. --- New uses of this
type are discouraged because of difficulty describing its usage
when embedded in APIs. 1. Ignored fields. It includes many
fields which are not generally honored. For instance, ResourceVersion
and FieldPath are both very rarely valid in actual usage. 2.
Invalid usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are particular
\ restrictions like, \"must refer only to types A and B\"
or \"UID not honored\" or \"name must be restricted\". Those
cannot be well described when embedded. 3. Inconsistent validation.
\ Because the usages are different, the validation rules are
different by usage, which makes it hard for users to predict
what will happen. 4. The fields are both imprecise and overly
precise. Kind is not a precise mapping to a URL. This can produce
ambiguity during interpretation and require a REST mapping.
\ In most cases, the dependency is on the group,resource tuple
\ and the version of the actual struct is irrelevant. 5.
We cannot easily change it. Because this type is embedded in
many locations, updates to this type will affect numerous
schemas. Don't make new APIs embed an underspecified API type
they do not control. \n Instead of using this type, create a
locally provided and used type that is well-focused on your
reference. For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
individual usage. In most embedded usages, there are particular restrictions
like, "must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be well described
when embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage,
which makes it hard for users to predict what will happen. 4.
The fields are both imprecise and overly precise. Kind is not
a precise mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most cases, the
dependency is on the group,resource tuple and the version
of the actual struct is irrelevant. 5. We cannot easily change
it. Because this type is embedded in many locations, updates
to this type will affect numerous schemas. Don''t make
new APIs embed an underspecified API type they do not control.
Instead of using this type, create a locally provided and used
type that is well-focused on your reference. For example, ServiceReferences
for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
@@ -4814,23 +4714,16 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
endTime:
format: date-time
nullable: true
type: string
finished:
type: boolean
message:
type: string
mode:
description: WorkflowMode describes the mode of workflow
type: string
startTime:
format: date-time
type: string
status:
description: WorkflowRunPhase is a label for the condition of
a WorkflowRun at the current time
type: string
steps:
items:
description: WorkflowStepStatus record the status of a workflow
@@ -4864,8 +4757,8 @@ spec:
type: string
subSteps:
items:
description: StepStatus record the base status of workflow
step, which could be workflow step or subStep
description: WorkflowSubStepStatus record the status of
a workflow subStep
properties:
firstExecuteTime:
description: FirstExecuteTime is the first time this

View File

@@ -414,6 +414,7 @@ spec:
cluster:
type: string
creator:
description: ResourceCreatorRole defines the resource creator.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of
@@ -450,31 +451,31 @@ spec:
description: Components record the related Components created by Application
Controller
items:
description: "ObjectReference contains enough information to let
description: 'ObjectReference contains enough information to let
you inspect or modify the referred object. --- New uses of this
type are discouraged because of difficulty describing its usage
when embedded in APIs. 1. Ignored fields. It includes many fields
which are not generally honored. For instance, ResourceVersion
and FieldPath are both very rarely valid in actual usage. 2.
Invalid usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are particular
\ restrictions like, \"must refer only to types A and B\" or
\"UID not honored\" or \"name must be restricted\". Those
cannot be well described when embedded. 3. Inconsistent validation.
\ Because the usages are different, the validation rules are different
by usage, which makes it hard for users to predict what will happen.
\ 4. The fields are both imprecise and overly precise. Kind is
not a precise mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most cases, the
dependency is on the group,resource tuple and the version
of the actual struct is irrelevant. 5. We cannot easily change
it. Because this type is embedded in many locations, updates
to this type will affect numerous schemas. Don't make new
APIs embed an underspecified API type they do not control. \n
Instead of using this type, create a locally provided and used
type that is well-focused on your reference. For example, ServiceReferences
for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
individual usage. In most embedded usages, there are particular restrictions
like, "must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be well described
when embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage, which
makes it hard for users to predict what will happen. 4. The fields
are both imprecise and overly precise. Kind is not a precise
mapping to a URL. This can produce ambiguity during interpretation
and require a REST mapping. In most cases, the dependency is
on the group,resource tuple and the version of the actual
struct is irrelevant. 5. We cannot easily change it. Because
this type is embedded in many locations, updates to this type will
affect numerous schemas. Don''t make new APIs embed an underspecified
API type they do not control. Instead of using this type, create
a locally provided and used type that is well-focused on your
reference. For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
@@ -564,10 +565,9 @@ spec:
format: int64
type: integer
policy:
description: PolicyStatus records the status of policy Deprecated
This field is only used by EnvBinding Policy which is deprecated.
description: PolicyStatus records the status of policy
items:
description: PolicyStatus records the status of policy Deprecated
description: PolicyStatus records the status of policy
properties:
name:
type: string
@@ -601,7 +601,7 @@ spec:
type: string
scopes:
items:
description: "ObjectReference contains enough information
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object. --- New
uses of this type are discouraged because of difficulty
describing its usage when embedded in APIs. 1. Ignored
@@ -610,24 +610,24 @@ spec:
both very rarely valid in actual usage. 2. Invalid usage
help. It is impossible to add specific help for individual
usage. In most embedded usages, there are particular restrictions
like, \"must refer only to types A and B\" or \"UID not
honored\" or \"name must be restricted\". Those cannot
be well described when embedded. 3. Inconsistent validation.
\ Because the usages are different, the validation rules
are different by usage, which makes it hard for users to
predict what will happen. 4. The fields are both imprecise
and overly precise. Kind is not a precise mapping to a
URL. This can produce ambiguity during interpretation
and require a REST mapping. In most cases, the dependency
is on the group,resource tuple and the version of the
actual struct is irrelevant. 5. We cannot easily change
it. Because this type is embedded in many locations, updates
to this type will affect numerous schemas. Don't make
new APIs embed an underspecified API type they do not control.
\n Instead of using this type, create a locally provided
and used type that is well-focused on your reference. For
example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
like, "must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be well described
when embedded. 3. Inconsistent validation. Because the
usages are different, the validation rules are different
by usage, which makes it hard for users to predict what
will happen. 4. The fields are both imprecise and overly
precise. Kind is not a precise mapping to a URL. This can
produce ambiguity during interpretation and require
a REST mapping. In most cases, the dependency is on the
group,resource tuple and the version of the actual struct
is irrelevant. 5. We cannot easily change it. Because
this type is embedded in many locations, updates to this
type will affect numerous schemas. Don''t make new
APIs embed an underspecified API type they do not control.
Instead of using this type, create a locally provided and
used type that is well-focused on your reference. For example,
ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
@@ -707,32 +707,31 @@ spec:
appRevision:
type: string
contextBackend:
description: "ObjectReference contains enough information to let
description: 'ObjectReference contains enough information to let
you inspect or modify the referred object. --- New uses of this
type are discouraged because of difficulty describing its usage
when embedded in APIs. 1. Ignored fields. It includes many
fields which are not generally honored. For instance, ResourceVersion
and FieldPath are both very rarely valid in actual usage. 2.
Invalid usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are particular
\ restrictions like, \"must refer only to types A and B\"
or \"UID not honored\" or \"name must be restricted\". Those
cannot be well described when embedded. 3. Inconsistent validation.
\ Because the usages are different, the validation rules are
different by usage, which makes it hard for users to predict
what will happen. 4. The fields are both imprecise and overly
precise. Kind is not a precise mapping to a URL. This can produce
ambiguity during interpretation and require a REST mapping.
\ In most cases, the dependency is on the group,resource tuple
\ and the version of the actual struct is irrelevant. 5.
We cannot easily change it. Because this type is embedded in
many locations, updates to this type will affect numerous
schemas. Don't make new APIs embed an underspecified API type
they do not control. \n Instead of using this type, create a
locally provided and used type that is well-focused on your
reference. For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
individual usage. In most embedded usages, there are particular restrictions
like, "must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be well described
when embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage,
which makes it hard for users to predict what will happen. 4.
The fields are both imprecise and overly precise. Kind is not
a precise mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most cases, the
dependency is on the group,resource tuple and the version
of the actual struct is irrelevant. 5. We cannot easily change
it. Because this type is embedded in many locations, updates
to this type will affect numerous schemas. Don''t make
new APIs embed an underspecified API type they do not control.
Instead of using this type, create a locally provided and used
type that is well-focused on your reference. For example, ServiceReferences
for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
@@ -767,23 +766,16 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
endTime:
format: date-time
nullable: true
type: string
finished:
type: boolean
message:
type: string
mode:
description: WorkflowMode describes the mode of workflow
type: string
startTime:
format: date-time
type: string
status:
description: WorkflowRunPhase is a label for the condition of
a WorkflowRun at the current time
type: string
steps:
items:
description: WorkflowStepStatus record the status of a workflow
@@ -817,8 +809,8 @@ spec:
type: string
subSteps:
items:
description: StepStatus record the base status of workflow
step, which could be workflow step or subStep
description: WorkflowSubStepStatus record the status of
a workflow subStep
properties:
firstExecuteTime:
description: FirstExecuteTime is the first time this
@@ -1017,17 +1009,6 @@ spec:
order, and each step: - will have a context in annotation. - should
mark "finish" phase in status.conditions.'
properties:
mode:
description: WorkflowExecuteMode defines the mode of workflow
execution
properties:
steps:
description: Steps is the mode of workflow steps execution
type: string
subSteps:
description: SubSteps is the mode of workflow sub steps execution
type: string
type: object
ref:
type: string
steps:
@@ -1036,15 +1017,13 @@ spec:
step.
properties:
dependsOn:
description: DependsOn is the dependency of the step
items:
type: string
type: array
if:
description: If is the if condition of the step
type: string
inputs:
description: Inputs is the inputs of the step
description: StepInputs defines variable input of WorkflowStep
items:
properties:
from:
@@ -1056,17 +1035,11 @@ spec:
- parameterKey
type: object
type: array
meta:
description: Meta is the meta data of the workflow step.
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: Outputs is the outputs of the step
description: StepOutputs defines output variable of WorkflowStep
items:
properties:
name:
@@ -1079,24 +1052,22 @@ spec:
type: object
type: array
properties:
description: Properties is the properties of the step
type: object
x-kubernetes-preserve-unknown-fields: true
subSteps:
items:
description: WorkflowStepBase defines the workflow step
base
description: WorkflowSubStep defines how to execute a
workflow subStep.
properties:
dependsOn:
description: DependsOn is the dependency of the step
items:
type: string
type: array
if:
description: If is the if condition of the step
type: string
inputs:
description: Inputs is the inputs of the step
description: StepInputs defines variable input of
WorkflowStep
items:
properties:
from:
@@ -1108,19 +1079,13 @@ spec:
- parameterKey
type: object
type: array
meta:
description: Meta is the meta data of the workflow
step.
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the workflow
step.
type: string
outputs:
description: Outputs is the outputs of the step
description: StepOutputs defines output variable of
WorkflowStep
items:
properties:
name:
@@ -1133,25 +1098,16 @@ spec:
type: object
type: array
properties:
description: Properties is the properties of the step
type: object
x-kubernetes-preserve-unknown-fields: true
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
- type
type: object
type: array
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
@@ -1178,6 +1134,7 @@ spec:
cluster:
type: string
creator:
description: ResourceCreatorRole defines the resource creator.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of
@@ -1214,31 +1171,31 @@ spec:
description: Components record the related Components created by Application
Controller
items:
description: "ObjectReference contains enough information to let
description: 'ObjectReference contains enough information to let
you inspect or modify the referred object. --- New uses of this
type are discouraged because of difficulty describing its usage
when embedded in APIs. 1. Ignored fields. It includes many fields
which are not generally honored. For instance, ResourceVersion
and FieldPath are both very rarely valid in actual usage. 2.
Invalid usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are particular
\ restrictions like, \"must refer only to types A and B\" or
\"UID not honored\" or \"name must be restricted\". Those
cannot be well described when embedded. 3. Inconsistent validation.
\ Because the usages are different, the validation rules are different
by usage, which makes it hard for users to predict what will happen.
\ 4. The fields are both imprecise and overly precise. Kind is
not a precise mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most cases, the
dependency is on the group,resource tuple and the version
of the actual struct is irrelevant. 5. We cannot easily change
it. Because this type is embedded in many locations, updates
to this type will affect numerous schemas. Don't make new
APIs embed an underspecified API type they do not control. \n
Instead of using this type, create a locally provided and used
type that is well-focused on your reference. For example, ServiceReferences
for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
individual usage. In most embedded usages, there are particular restrictions
like, "must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be well described
when embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage, which
makes it hard for users to predict what will happen. 4. The fields
are both imprecise and overly precise. Kind is not a precise
mapping to a URL. This can produce ambiguity during interpretation
and require a REST mapping. In most cases, the dependency is
on the group,resource tuple and the version of the actual
struct is irrelevant. 5. We cannot easily change it. Because
this type is embedded in many locations, updates to this type will
affect numerous schemas. Don''t make new APIs embed an underspecified
API type they do not control. Instead of using this type, create
a locally provided and used type that is well-focused on your
reference. For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
@@ -1328,10 +1285,9 @@ spec:
format: int64
type: integer
policy:
description: PolicyStatus records the status of policy Deprecated
This field is only used by EnvBinding Policy which is deprecated.
description: PolicyStatus records the status of policy
items:
description: PolicyStatus records the status of policy Deprecated
description: PolicyStatus records the status of policy
properties:
name:
type: string
@@ -1365,7 +1321,7 @@ spec:
type: string
scopes:
items:
description: "ObjectReference contains enough information
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object. --- New
uses of this type are discouraged because of difficulty
describing its usage when embedded in APIs. 1. Ignored
@@ -1374,24 +1330,24 @@ spec:
both very rarely valid in actual usage. 2. Invalid usage
help. It is impossible to add specific help for individual
usage. In most embedded usages, there are particular restrictions
like, \"must refer only to types A and B\" or \"UID not
honored\" or \"name must be restricted\". Those cannot
be well described when embedded. 3. Inconsistent validation.
\ Because the usages are different, the validation rules
are different by usage, which makes it hard for users to
predict what will happen. 4. The fields are both imprecise
and overly precise. Kind is not a precise mapping to a
URL. This can produce ambiguity during interpretation
and require a REST mapping. In most cases, the dependency
is on the group,resource tuple and the version of the
actual struct is irrelevant. 5. We cannot easily change
it. Because this type is embedded in many locations, updates
to this type will affect numerous schemas. Don't make
new APIs embed an underspecified API type they do not control.
\n Instead of using this type, create a locally provided
and used type that is well-focused on your reference. For
example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
like, "must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be well described
when embedded. 3. Inconsistent validation. Because the
usages are different, the validation rules are different
by usage, which makes it hard for users to predict what
will happen. 4. The fields are both imprecise and overly
precise. Kind is not a precise mapping to a URL. This can
produce ambiguity during interpretation and require
a REST mapping. In most cases, the dependency is on the
group,resource tuple and the version of the actual struct
is irrelevant. 5. We cannot easily change it. Because
this type is embedded in many locations, updates to this
type will affect numerous schemas. Don''t make new
APIs embed an underspecified API type they do not control.
Instead of using this type, create a locally provided and
used type that is well-focused on your reference. For example,
ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
@@ -1471,32 +1427,31 @@ spec:
appRevision:
type: string
contextBackend:
description: "ObjectReference contains enough information to let
description: 'ObjectReference contains enough information to let
you inspect or modify the referred object. --- New uses of this
type are discouraged because of difficulty describing its usage
when embedded in APIs. 1. Ignored fields. It includes many
fields which are not generally honored. For instance, ResourceVersion
and FieldPath are both very rarely valid in actual usage. 2.
Invalid usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are particular
\ restrictions like, \"must refer only to types A and B\"
or \"UID not honored\" or \"name must be restricted\". Those
cannot be well described when embedded. 3. Inconsistent validation.
\ Because the usages are different, the validation rules are
different by usage, which makes it hard for users to predict
what will happen. 4. The fields are both imprecise and overly
precise. Kind is not a precise mapping to a URL. This can produce
ambiguity during interpretation and require a REST mapping.
\ In most cases, the dependency is on the group,resource tuple
\ and the version of the actual struct is irrelevant. 5.
We cannot easily change it. Because this type is embedded in
many locations, updates to this type will affect numerous
schemas. Don't make new APIs embed an underspecified API type
they do not control. \n Instead of using this type, create a
locally provided and used type that is well-focused on your
reference. For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
individual usage. In most embedded usages, there are particular restrictions
like, "must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be well described
when embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage,
which makes it hard for users to predict what will happen. 4.
The fields are both imprecise and overly precise. Kind is not
a precise mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most cases, the
dependency is on the group,resource tuple and the version
of the actual struct is irrelevant. 5. We cannot easily change
it. Because this type is embedded in many locations, updates
to this type will affect numerous schemas. Don''t make
new APIs embed an underspecified API type they do not control.
Instead of using this type, create a locally provided and used
type that is well-focused on your reference. For example, ServiceReferences
for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
@@ -1531,23 +1486,16 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
endTime:
format: date-time
nullable: true
type: string
finished:
type: boolean
message:
type: string
mode:
description: WorkflowMode describes the mode of workflow
type: string
startTime:
format: date-time
type: string
status:
description: WorkflowRunPhase is a label for the condition of
a WorkflowRun at the current time
type: string
steps:
items:
description: WorkflowStepStatus record the status of a workflow
@@ -1581,8 +1529,8 @@ spec:
type: string
subSteps:
items:
description: StepStatus record the base status of workflow
step, which could be workflow step or subStep
description: WorkflowSubStepStatus record the status of
a workflow subStep
properties:
firstExecuteTime:
description: FirstExecuteTime is the first time this

View File

@@ -445,8 +445,7 @@ spec:
type: boolean
schematic:
description: Schematic defines the data format and template
of the encapsulation of the policy definition. Only CUE
schematic is supported for now.
of the encapsulation of the policy definition
properties:
cue:
description: CUE defines the encapsulation in CUE format
@@ -709,7 +708,7 @@ spec:
appliesToWorkloads:
description: AppliesToWorkloads specifies the list of workload
kinds this trait applies to. Workload kinds are specified
in resource.group/version format, e.g. server.core.oam.dev/v1alpha2.
in kind.group/version format, e.g. server.core.oam.dev/v1alpha2.
Traits that omit this field apply to all workload kinds.
items:
type: string
@@ -763,8 +762,7 @@ spec:
type: boolean
schematic:
description: Schematic defines the data format and template
of the encapsulation of the trait. Only CUE and Kube schematic
are supported for now.
of the encapsulation of the trait
properties:
cue:
description: CUE defines the encapsulation in CUE format
@@ -916,12 +914,10 @@ spec:
- configuration
type: object
type: object
stage:
description: Stage defines the stage information to which
this trait resource processing belongs. Currently, PreDispatch
and PostDispatch are provided, which are used to control
resource pre-process and post-process respectively.
type: string
skipRevisionAffect:
description: SkipRevisionAffect defines the update this trait
will not generate a new application Revision
type: boolean
status:
description: Status defines the custom health policy and status
message for trait
@@ -1056,8 +1052,7 @@ spec:
type: object
schematic:
description: Schematic defines the data format and template
of the encapsulation of the workflow step definition. Only
CUE schematic is supported for now.
of the encapsulation of the workflow step definition
properties:
cue:
description: CUE defines the encapsulation in CUE format

View File

@@ -59,7 +59,7 @@ spec:
type: string
traits:
items:
description: "ObjectReference contains enough information
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object.
--- New uses of this type are discouraged because
of difficulty describing its usage when embedded in
@@ -69,26 +69,26 @@ spec:
usage. 2. Invalid usage help. It is impossible to
add specific help for individual usage. In most embedded
usages, there are particular restrictions like,
\"must refer only to types A and B\" or \"UID not
honored\" or \"name must be restricted\". Those
cannot be well described when embedded. 3. Inconsistent
validation. Because the usages are different, the
validation rules are different by usage, which makes
it hard for users to predict what will happen. 4.
The fields are both imprecise and overly precise.
\ Kind is not a precise mapping to a URL. This can
produce ambiguity during interpretation and require
a REST mapping. In most cases, the dependency is
on the group,resource tuple and the version of
the actual struct is irrelevant. 5. We cannot easily
change it. Because this type is embedded in many
locations, updates to this type will affect numerous
schemas. Don't make new APIs embed an underspecified
API type they do not control. \n Instead of using
this type, create a locally provided and used type
that is well-focused on your reference. For example,
ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
"must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be
well described when embedded. 3. Inconsistent validation. Because
the usages are different, the validation rules are
different by usage, which makes it hard for users
to predict what will happen. 4. The fields are both
imprecise and overly precise. Kind is not a precise
mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most
cases, the dependency is on the group,resource tuple and
the version of the actual struct is irrelevant. 5.
We cannot easily change it. Because this type is
embedded in many locations, updates to this type will
affect numerous schemas. Don''t make new APIs embed
an underspecified API type they do not control. Instead
of using this type, create a locally provided and
used type that is well-focused on your reference.
For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
@@ -129,7 +129,7 @@ spec:
type: object
type: array
workload:
description: "ObjectReference contains enough information
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object. ---
New uses of this type are discouraged because of difficulty
describing its usage when embedded in APIs. 1. Ignored
@@ -138,11 +138,11 @@ spec:
are both very rarely valid in actual usage. 2. Invalid
usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are
particular restrictions like, \"must refer only
to types A and B\" or \"UID not honored\" or \"name
must be restricted\". Those cannot be well described
when embedded. 3. Inconsistent validation. Because
the usages are different, the validation rules are different
particular restrictions like, "must refer only to
types A and B" or "UID not honored" or "name must be
restricted". Those cannot be well described when
embedded. 3. Inconsistent validation. Because the
usages are different, the validation rules are different
by usage, which makes it hard for users to predict what
will happen. 4. The fields are both imprecise and overly
precise. Kind is not a precise mapping to a URL. This
@@ -151,13 +151,13 @@ spec:
is on the group,resource tuple and the version of
the actual struct is irrelevant. 5. We cannot easily
change it. Because this type is embedded in many locations,
updates to this type will affect numerous schemas.
\ Don't make new APIs embed an underspecified API type
they do not control. \n Instead of using this type,
create a locally provided and used type that is well-focused
updates to this type will affect numerous schemas. Don''t
make new APIs embed an underspecified API type they
do not control. Instead of using this type, create a
locally provided and used type that is well-focused
on your reference. For example, ServiceReferences for
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
.'
properties:
apiVersion:
description: API version of the referent.
@@ -213,31 +213,31 @@ spec:
description: WorkloadReferences to the workloads that are in this
scope.
items:
description: "ObjectReference contains enough information to let
description: 'ObjectReference contains enough information to let
you inspect or modify the referred object. --- New uses of this
type are discouraged because of difficulty describing its usage
when embedded in APIs. 1. Ignored fields. It includes many fields
which are not generally honored. For instance, ResourceVersion
and FieldPath are both very rarely valid in actual usage. 2.
Invalid usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are particular
\ restrictions like, \"must refer only to types A and B\" or
\"UID not honored\" or \"name must be restricted\". Those
cannot be well described when embedded. 3. Inconsistent validation.
\ Because the usages are different, the validation rules are different
by usage, which makes it hard for users to predict what will happen.
\ 4. The fields are both imprecise and overly precise. Kind is
not a precise mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most cases, the
dependency is on the group,resource tuple and the version
of the actual struct is irrelevant. 5. We cannot easily change
it. Because this type is embedded in many locations, updates
to this type will affect numerous schemas. Don't make new
APIs embed an underspecified API type they do not control. \n
Instead of using this type, create a locally provided and used
type that is well-focused on your reference. For example, ServiceReferences
for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
individual usage. In most embedded usages, there are particular restrictions
like, "must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be well described
when embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage, which
makes it hard for users to predict what will happen. 4. The fields
are both imprecise and overly precise. Kind is not a precise
mapping to a URL. This can produce ambiguity during interpretation
and require a REST mapping. In most cases, the dependency is
on the group,resource tuple and the version of the actual
struct is irrelevant. 5. We cannot easily change it. Because
this type is embedded in many locations, updates to this type will
affect numerous schemas. Don''t make new APIs embed an underspecified
API type they do not control. Instead of using this type, create
a locally provided and used type that is well-focused on your
reference. For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
@@ -305,7 +305,7 @@ spec:
description: HealthStatus represents health status strings.
type: string
targetWorkload:
description: "ObjectReference contains enough information
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object. ---
New uses of this type are discouraged because of difficulty
describing its usage when embedded in APIs. 1. Ignored
@@ -314,11 +314,11 @@ spec:
are both very rarely valid in actual usage. 2. Invalid
usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are
particular restrictions like, \"must refer only
to types A and B\" or \"UID not honored\" or \"name
must be restricted\". Those cannot be well described
when embedded. 3. Inconsistent validation. Because
the usages are different, the validation rules are different
particular restrictions like, "must refer only to
types A and B" or "UID not honored" or "name must be
restricted". Those cannot be well described when
embedded. 3. Inconsistent validation. Because the
usages are different, the validation rules are different
by usage, which makes it hard for users to predict what
will happen. 4. The fields are both imprecise and overly
precise. Kind is not a precise mapping to a URL. This
@@ -327,13 +327,13 @@ spec:
is on the group,resource tuple and the version of
the actual struct is irrelevant. 5. We cannot easily
change it. Because this type is embedded in many locations,
updates to this type will affect numerous schemas.
\ Don't make new APIs embed an underspecified API type
they do not control. \n Instead of using this type,
create a locally provided and used type that is well-focused
updates to this type will affect numerous schemas. Don''t
make new APIs embed an underspecified API type they
do not control. Instead of using this type, create a
locally provided and used type that is well-focused
on your reference. For example, ServiceReferences for
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
.'
properties:
apiVersion:
description: API version of the referent.
@@ -461,7 +461,7 @@ spec:
description: HealthStatus represents health status strings.
type: string
targetWorkload:
description: "ObjectReference contains enough information to
description: 'ObjectReference contains enough information to
let you inspect or modify the referred object. --- New uses
of this type are discouraged because of difficulty describing
its usage when embedded in APIs. 1. Ignored fields. It includes
@@ -469,25 +469,24 @@ spec:
ResourceVersion and FieldPath are both very rarely valid in
actual usage. 2. Invalid usage help. It is impossible to
add specific help for individual usage. In most embedded
usages, there are particular restrictions like, \"must
refer only to types A and B\" or \"UID not honored\" or \"name
must be restricted\". Those cannot be well described when
usages, there are particular restrictions like, "must
refer only to types A and B" or "UID not honored" or "name
must be restricted". Those cannot be well described when
embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage,
which makes it hard for users to predict what will happen.
\ 4. The fields are both imprecise and overly precise. Kind
is not a precise mapping to a URL. This can produce ambiguity
\ during interpretation and require a REST mapping. In
most cases, the dependency is on the group,resource tuple
\ and the version of the actual struct is irrelevant. 5.
We cannot easily change it. Because this type is embedded
in many locations, updates to this type will affect numerous
schemas. Don't make new APIs embed an underspecified API
type they do not control. \n Instead of using this type, create
a locally provided and used type that is well-focused on your
reference. For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
."
which makes it hard for users to predict what will happen. 4.
The fields are both imprecise and overly precise. Kind is
not a precise mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most cases,
the dependency is on the group,resource tuple and the
version of the actual struct is irrelevant. 5. We cannot
easily change it. Because this type is embedded in many locations,
updates to this type will affect numerous schemas. Don''t
make new APIs embed an underspecified API type they do not
control. Instead of using this type, create a locally provided
and used type that is well-focused on your reference. For
example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.

View File

@@ -0,0 +1,134 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: manualscalertraits.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: ManualScalerTrait
listKind: ManualScalerTraitList
plural: manualscalertraits
singular: manualscalertrait
scope: Namespaced
versions:
- name: v1alpha2
schema:
openAPIV3Schema:
description: A ManualScalerTrait determines how many replicas a workload should
have.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: A ManualScalerTraitSpec defines the desired state of a ManualScalerTrait.
properties:
replicaCount:
description: ReplicaCount of the workload this trait applies to.
format: int32
type: integer
workloadRef:
description: WorkloadReference to the workload this trait applies
to.
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of
an entire object, this string should contain a valid JSON/Go
field access statement, such as desiredState.manifest.containers[2].
For example, if the object reference is to a container within
a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container that triggered
the event) or if no container name is specified "spec.containers[2]"
(container with index 2 in this pod). This syntax is chosen
only to have some well-defined way of referencing a part of
an object. TODO: this design is not final and this field is
subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this reference
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
required:
- replicaCount
- workloadRef
type: object
status:
description: A ManualScalerTraitStatus represents the observed state of
a ManualScalerTrait.
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -60,8 +60,7 @@ spec:
type: boolean
schematic:
description: Schematic defines the data format and template of the
encapsulation of the policy definition. Only CUE schematic is supported
for now.
encapsulation of the policy definition
properties:
cue:
description: CUE defines the encapsulation in CUE format

View File

@@ -56,16 +56,6 @@ spec:
applicationGeneration:
format: int64
type: integer
compression:
description: ResourceTrackerCompression the compression for ResourceTracker
ManagedResources
properties:
data:
type: string
type:
description: Type the compression type
type: string
type: object
managedResources:
items:
description: ManagedResource define the resource to be managed by
@@ -79,6 +69,7 @@ spec:
component:
type: string
creator:
description: ResourceCreatorRole defines the resource creator.
type: string
deleted:
description: Deleted marks the resource to be deleted
@@ -114,9 +105,6 @@ spec:
description: 'Specific resourceVersion to which this reference
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
skipGC:
description: SkipGC marks the resource to skip gc
type: boolean
trait:
type: string
uid:
@@ -146,6 +134,7 @@ spec:
cluster:
type: string
creator:
description: ResourceCreatorRole defines the resource creator.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of

View File

@@ -356,7 +356,7 @@ spec:
properties:
appliesToWorkloads:
description: AppliesToWorkloads specifies the list of workload kinds
this trait applies to. Workload kinds are specified in resource.group/version
this trait applies to. Workload kinds are specified in kind.group/version
format, e.g. server.core.oam.dev/v1alpha2. Traits that omit this
field apply to all workload kinds.
items:
@@ -410,8 +410,7 @@ spec:
type: boolean
schematic:
description: Schematic defines the data format and template of the
encapsulation of the trait. Only CUE and Kube schematic are supported
for now.
encapsulation of the trait
properties:
cue:
description: CUE defines the encapsulation in CUE format
@@ -558,12 +557,10 @@ spec:
- configuration
type: object
type: object
stage:
description: Stage defines the stage information to which this trait
resource processing belongs. Currently, PreDispatch and PostDispatch
are provided, which are used to control resource pre-process and
post-process respectively.
type: string
skipRevisionAffect:
description: SkipRevisionAffect defines the update this trait will
not generate a new application Revision
type: boolean
status:
description: Status defines the custom health policy and status message
for trait

View File

@@ -1,10 +1,10 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.6.2
name: workflows.core.oam.dev
spec:
group: core.oam.dev
@@ -20,7 +20,7 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Workflow is the Schema for the workflow API
description: Workflow is the Schema for the policy API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
@@ -34,30 +34,18 @@ spec:
type: string
metadata:
type: object
mode:
description: WorkflowExecuteMode defines the mode of workflow execution
properties:
steps:
description: Steps is the mode of workflow steps execution
type: string
subSteps:
description: SubSteps is the mode of workflow sub steps execution
type: string
type: object
steps:
items:
description: WorkflowStep defines how to execute a workflow step.
properties:
dependsOn:
description: DependsOn is the dependency of the step
items:
type: string
type: array
if:
description: If is the if condition of the step
type: string
inputs:
description: Inputs is the inputs of the step
description: StepInputs defines variable input of WorkflowStep
items:
properties:
from:
@@ -69,17 +57,11 @@ spec:
- parameterKey
type: object
type: array
meta:
description: Meta is the meta data of the workflow step.
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: Outputs is the outputs of the step
description: StepOutputs defines output variable of WorkflowStep
items:
properties:
name:
@@ -92,23 +74,21 @@ spec:
type: object
type: array
properties:
description: Properties is the properties of the step
type: object
x-kubernetes-preserve-unknown-fields: true
subSteps:
items:
description: WorkflowStepBase defines the workflow step base
description: WorkflowSubStep defines how to execute a workflow
subStep.
properties:
dependsOn:
description: DependsOn is the dependency of the step
items:
type: string
type: array
if:
description: If is the if condition of the step
type: string
inputs:
description: Inputs is the inputs of the step
description: StepInputs defines variable input of WorkflowStep
items:
properties:
from:
@@ -120,17 +100,11 @@ spec:
- parameterKey
type: object
type: array
meta:
description: Meta is the meta data of the workflow step.
properties:
alias:
type: string
type: object
name:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: Outputs is the outputs of the step
description: StepOutputs defines output variable of WorkflowStep
items:
properties:
name:
@@ -143,25 +117,16 @@ spec:
type: object
type: array
properties:
description: Properties is the properties of the step
type: object
x-kubernetes-preserve-unknown-fields: true
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
- type
type: object
type: array
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
@@ -171,3 +136,118 @@ spec:
type: object
served: true
storage: true
- name: v1beta1
schema:
openAPIV3Schema:
description: Workflow defines workflow steps and other attributes
properties:
ref:
type: string
steps:
items:
description: WorkflowStep defines how to execute a workflow step.
properties:
dependsOn:
items:
type: string
type: array
if:
type: string
inputs:
description: StepInputs defines variable input of WorkflowStep
items:
properties:
from:
type: string
parameterKey:
type: string
required:
- from
- parameterKey
type: object
type: array
name:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: StepOutputs defines output variable of WorkflowStep
items:
properties:
name:
type: string
valueFrom:
type: string
required:
- name
- valueFrom
type: object
type: array
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
subSteps:
items:
description: WorkflowSubStep defines how to execute a workflow
subStep.
properties:
dependsOn:
items:
type: string
type: array
if:
type: string
inputs:
description: StepInputs defines variable input of WorkflowStep
items:
properties:
from:
type: string
parameterKey:
type: string
required:
- from
- parameterKey
type: object
type: array
name:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: StepOutputs defines output variable of WorkflowStep
items:
properties:
name:
type: string
valueFrom:
type: string
required:
- name
- valueFrom
type: object
type: array
properties:
type: object
x-kubernetes-preserve-unknown-fields: true
type:
type: string
required:
- name
- type
type: object
type: array
type:
type: string
required:
- name
- type
type: object
type: array
type: object
served: true
storage: false
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -57,8 +57,7 @@ spec:
type: object
schematic:
description: Schematic defines the data format and template of the
encapsulation of the workflow step definition. Only CUE schematic
is supported for now.
encapsulation of the workflow step definition
properties:
cue:
description: CUE defines the encapsulation in CUE format

View File

@@ -11,10 +11,7 @@ metadata:
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- daemonsets.apps
- jobs.batch
- '*'
podDisruptive: true
schematic:
cue:

View File

@@ -4,7 +4,9 @@ apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add annotations on your workload. if it generates pod, add same annotations for generated pods.
definition.oam.dev/description: Add annotations on K8s pod for your workload which follows the pod spec in path 'spec.template'.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: annotations
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
@@ -18,13 +20,13 @@ spec:
patch: {
metadata: annotations: {
for k, v in parameter {
(k): v
"\(k)": v
}
}
if context.output.spec != _|_ && context.output.spec.template != _|_ {
spec: template: metadata: annotations: {
for k, v in parameter {
(k): v
"\(k)": v
}
}
}

View File

@@ -6,8 +6,6 @@ metadata:
annotations:
definition.oam.dev/description: Apply components of an application in parallel for your workflow steps
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/scope: Application
custom.definition.oam.dev/ui-hidden: "true"
name: apply-application-in-parallel
namespace: {{ include "systemDefinitionNamespace" . }}

View File

@@ -4,10 +4,8 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Apply application for your workflow steps, it has no arguments, should be used for custom steps before or after application applied.
definition.oam.dev/description: Apply application for your workflow steps
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/scope: Application
custom.definition.oam.dev/ui-hidden: "true"
name: apply-application
namespace: {{ include "systemDefinitionNamespace" . }}

View File

@@ -1,23 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/apply-component.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Apply a specific component and its corresponding traits in application
labels:
custom.definition.oam.dev/scope: Application
custom.definition.oam.dev/ui-hidden: "true"
name: apply-component
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
parameter: {
// +usage=Specify the component name to apply
component: string
// +usage=Specify the cluster
cluster: *"" | string
}

View File

@@ -22,9 +22,9 @@ spec:
cluster: parameter.cluster
}
parameter: {
// +usage=Specify Kubernetes native resource object to be applied
// +usage=Specify the value of the object
value: {...}
// +usage=The cluster you want to apply the resource to, default is the current control plane cluster
// +usage=Specify the cluster of the object
cluster: *"" | string
}

View File

@@ -1,46 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/apply-once.cue
apiVersion: core.oam.dev/v1beta1
kind: PolicyDefinition
metadata:
annotations:
definition.oam.dev/description: Allow configuration drift for applied resources, delivery the resource without continuously reconciliation.
name: apply-once
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
#ApplyOnceStrategy: {
// +usage=When the strategy takes effect,e.g. onUpdate、onStateKeep
affect?: string
// +usage=Specify the path of the resource that allow configuration drift
path: [...string]
}
#ApplyOncePolicyRule: {
// +usage=Specify how to select the targets of the rule
selector?: #ResourcePolicyRuleSelector
// +usage=Specify the strategy for configuring the resource level configuration drift behaviour
strategy: #ApplyOnceStrategy
}
#ResourcePolicyRuleSelector: {
// +usage=Select resources by component names
componentNames?: [...string]
// +usage=Select resources by component types
componentTypes?: [...string]
// +usage=Select resources by oamTypes (COMPONENT or TRAIT)
oamTypes?: [...string]
// +usage=Select resources by trait types
traitTypes?: [...string]
// +usage=Select resources by resource types (like Deployment)
resourceTypes?: [...string]
// +usage=Select resources by their names
resourceNames?: [...string]
}
parameter: {
// +usage=Whether to enable apply-once for the whole application
enable: *false | bool
// +usage=Specify the rules for configuring apply-once policy in resource level
rules?: [...#ApplyOncePolicyRule]
}

View File

@@ -6,8 +6,6 @@ metadata:
annotations:
definition.oam.dev/description: Apply remaining components and traits
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/scope: Application
custom.definition.oam.dev/ui-hidden: "true"
name: apply-remaining
namespace: {{ include "systemDefinitionNamespace" . }}

View File

@@ -1,97 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/collect-service-endpoints.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Collect service endpoints for the application.
name: collect-service-endpoints
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
"vela/ql"
"strconv"
)
collect: ql.#CollectServiceEndpoints & {
app: {
name: *context.name | string
namespace: *context.namespace | string
if parameter.name != _|_ {
name: parameter.name
}
if parameter.namespace != _|_ {
namespace: parameter.namespace
}
filter: {
if parameter.components != _|_ {
components: parameter.components
}
}
}
} @step(1)
outputs: {
eps_port_name_filtered: *[] | [...]
if parameter.portName == _|_ {
eps_port_name_filtered: collect.list
}
if parameter.portName != _|_ {
eps_port_name_filtered: [ for ep in collect.list if parameter.portName == ep.endpoint.portName {ep}]
}
eps_port_filtered: *[] | [...]
if parameter.port == _|_ {
eps_port_filtered: eps_port_name_filtered
}
if parameter.port != _|_ {
eps_port_filtered: [ for ep in eps_port_name_filtered if parameter.port == ep.endpoint.port {ep}]
}
eps: eps_port_filtered
endpoints: *[] | [...]
if parameter.outer != _|_ {
tmps: [ for ep in eps {
ep
if ep.endpoint.inner == _|_ {
outer: true
}
if ep.endpoint.inner != _|_ {
outer: !ep.endpoint.inner
}
}]
endpoints: [ for ep in tmps if (!parameter.outer || ep.outer) {ep}]
}
if parameter.outer == _|_ {
endpoints: eps_port_filtered
}
}
wait: op.#ConditionalWait & {
continue: len(outputs.endpoints) > 0
} @step(2)
value: {
if len(outputs.endpoints) > 0 {
endpoint: outputs.endpoints[0].endpoint
_portStr: strconv.FormatInt(endpoint.port, 10)
url: "\(parameter.protocal)://\(endpoint.host):\(_portStr)"
}
}
parameter: {
// +usage=Specify the name of the application
name?: string
// +usage=Specify the namespace of the application
namespace?: string
// +usage=Filter the component of the endpoints
components?: [...string]
// +usage=Filter the port of the endpoints
port?: int
// +usage=Filter the port name of the endpoints
portName?: string
// +usage=Filter the endpoint that are only outer
outer?: bool
// +usage=The protocal of endpoint url
protocal: *"http" | "https"
}

View File

@@ -5,14 +5,13 @@ kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add command on K8s pod for your workload which follows the pod spec in path 'spec.template'
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: command
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- daemonsets.apps
- jobs.batch
- '*'
schematic:
cue:
template: |
@@ -48,7 +47,7 @@ spec:
}
_delArgs: {...}
if _params.delArgs != null {
_delArgs: {for k in _params.delArgs {(k): ""}}
_delArgs: {for k in _params.delArgs {"\(k)": ""}}
}
if _params.delArgs == null {
_delArgs: {}
@@ -63,7 +62,7 @@ spec:
if _params.args == null && _baseContainer.args == _|_ {
_args: []
}
_argsMap: {for a in _args {(a): ""}}
_argsMap: {for a in _args {"\(a)": ""}}
_addArgs: [...string]
if _params.addArgs != null {
_addArgs: _params.addArgs

View File

@@ -0,0 +1,86 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/config-image-registry.cue
apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
annotations:
custom.definition.oam.dev/alias.config.oam.dev: Image Registry
definition.oam.dev/description: Config information to authenticate image registry
labels:
custom.definition.oam.dev/catalog.config.oam.dev: velacore-config
custom.definition.oam.dev/multi-cluster.config.oam.dev: "true"
custom.definition.oam.dev/type.config.oam.dev: image-registry
custom.definition.oam.dev/ui-hidden: "true"
name: config-image-registry
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"encoding/base64"
"encoding/json"
"strconv"
)
output: {
apiVersion: "v1"
kind: "Secret"
metadata: {
name: context.name
namespace: context.namespace
labels: {
"config.oam.dev/catalog": "velacore-config"
"config.oam.dev/type": "image-registry"
"config.oam.dev/multi-cluster": "true"
"config.oam.dev/identifier": parameter.registry
"config.oam.dev/sub-type": "auth"
}
}
if parameter.auth != _|_ {
type: "kubernetes.io/dockerconfigjson"
}
if parameter.auth == _|_ {
type: "Opaque"
}
stringData: {
if parameter.auth != _|_ && parameter.auth.username != _|_ {
".dockerconfigjson": json.Marshal({
auths: "\(parameter.registry)": {
username: parameter.auth.username
password: parameter.auth.password
if parameter.auth.email != _|_ {
email: parameter.auth.email
}
auth: base64.Encode(null, (parameter.auth.username + ":" + parameter.auth.password))
}
})
}
if parameter.insecure != _|_ {
"insecure-skip-verify": strconv.FormatBool(parameter.insecure)
}
if parameter.useHTTP != _|_ {
"protocol-use-http": strconv.FormatBool(parameter.useHTTP)
}
}
}
parameter: {
// +usage=Image registry FQDN, such as: index.docker.io
registry: string
// +usage=Authenticate the image registry
auth?: {
// +usage=Private Image registry username
username: string
// +usage=Private Image registry password
password: string
// +usage=Private Image registry email
email?: string
}
// +usage=For the registry server that uses the self-signed certificate
insecure?: bool
// +usage=For the registry server that uses the HTTP protocol
useHTTP?: bool
}
workload:
type: autodetects.core.oam.dev

View File

@@ -42,7 +42,7 @@ spec:
outputs: {
for v in parameter.volumes {
if v.data != _|_ {
(v.name): {
"\(v.name)": {
apiVersion: "v1"
kind: "ConfigMap"
metadata: name: v.name

View File

@@ -5,14 +5,13 @@ kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Set the image of the container.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: container-image
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- daemonsets.apps
- jobs.batch
- '*'
podDisruptive: true
schematic:
cue:

View File

@@ -5,12 +5,13 @@ kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Automatically scale the component based on CPU usage.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: cpuscaler
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
schematic:
cue:
template: |

View File

@@ -1,44 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/create-config.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Create or update a config
name: create-config
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
deploy: op.#CreateConfig & {
name: parameter.name
if parameter.namespace != _|_ {
namespace: parameter.namespace
}
if parameter.namespace == _|_ {
namespace: context.namespace
}
if parameter.template != _|_ {
template: parameter.template
}
config: parameter.config
}
parameter: {
//+usage=Specify the name of the config.
name: string
//+usage=Specify the namespace of the config.
namespace?: string
//+usage=Specify the template of the config.
template?: string
//+usage=Specify the content of the config.
config: {...}
}

View File

@@ -222,8 +222,8 @@ spec:
volumes?: [...{
name: string
mountPath: string
// +usage=Specify volume type, options: "pvc","configMap","secret","emptyDir", default to emptyDir
type: *"emptyDir" | "pvc" | "configMap" | "secret"
// +usage=Specify volume type, options: "pvc","configMap","secret","emptyDir"
type: "pvc" | "configMap" | "secret" | "emptyDir"
if type == "pvc" {
claimName: string
}

View File

@@ -1,575 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/daemon.cue
apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
annotations:
definition.oam.dev/description: Describes daemonset services in Kubernetes.
name: daemon
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"strconv"
)
mountsArray: [
if parameter.volumeMounts != _|_ && parameter.volumeMounts.pvc != _|_ for v in parameter.volumeMounts.pvc {
{
mountPath: v.mountPath
if v.subPath != _|_ {
subPath: v.subPath
}
name: v.name
}
},
if parameter.volumeMounts != _|_ && parameter.volumeMounts.configMap != _|_ for v in parameter.volumeMounts.configMap {
{
mountPath: v.mountPath
if v.subPath != _|_ {
subPath: v.subPath
}
name: v.name
}
},
if parameter.volumeMounts != _|_ && parameter.volumeMounts.secret != _|_ for v in parameter.volumeMounts.secret {
{
mountPath: v.mountPath
if v.subPath != _|_ {
subPath: v.subPath
}
name: v.name
}
},
if parameter.volumeMounts != _|_ && parameter.volumeMounts.emptyDir != _|_ for v in parameter.volumeMounts.emptyDir {
{
mountPath: v.mountPath
if v.subPath != _|_ {
subPath: v.subPath
}
name: v.name
}
},
if parameter.volumeMounts != _|_ && parameter.volumeMounts.hostPath != _|_ for v in parameter.volumeMounts.hostPath {
{
mountPath: v.mountPath
if v.subPath != _|_ {
subPath: v.subPath
}
name: v.name
}
},
]
volumesList: [
if parameter.volumeMounts != _|_ && parameter.volumeMounts.pvc != _|_ for v in parameter.volumeMounts.pvc {
{
name: v.name
persistentVolumeClaim: claimName: v.claimName
}
},
if parameter.volumeMounts != _|_ && parameter.volumeMounts.configMap != _|_ for v in parameter.volumeMounts.configMap {
{
name: v.name
configMap: {
defaultMode: v.defaultMode
name: v.cmName
if v.items != _|_ {
items: v.items
}
}
}
},
if parameter.volumeMounts != _|_ && parameter.volumeMounts.secret != _|_ for v in parameter.volumeMounts.secret {
{
name: v.name
secret: {
defaultMode: v.defaultMode
secretName: v.secretName
if v.items != _|_ {
items: v.items
}
}
}
},
if parameter.volumeMounts != _|_ && parameter.volumeMounts.emptyDir != _|_ for v in parameter.volumeMounts.emptyDir {
{
name: v.name
emptyDir: medium: v.medium
}
},
if parameter.volumeMounts != _|_ && parameter.volumeMounts.hostPath != _|_ for v in parameter.volumeMounts.hostPath {
{
name: v.name
hostPath: path: v.path
}
},
]
deDupVolumesArray: [
for val in [
for i, vi in volumesList {
for j, vj in volumesList if j < i && vi.name == vj.name {
_ignore: true
}
vi
},
] if val._ignore == _|_ {
val
},
]
output: {
apiVersion: "apps/v1"
kind: "DaemonSet"
spec: {
selector: matchLabels: "app.oam.dev/component": context.name
template: {
metadata: {
labels: {
if parameter.labels != _|_ {
parameter.labels
}
if parameter.addRevisionLabel {
"app.oam.dev/revision": context.revision
}
"app.oam.dev/name": context.appName
"app.oam.dev/component": context.name
}
if parameter.annotations != _|_ {
annotations: parameter.annotations
}
}
spec: {
containers: [{
name: context.name
image: parameter.image
if parameter["port"] != _|_ && parameter["ports"] == _|_ {
ports: [{
containerPort: parameter.port
}]
}
if parameter["ports"] != _|_ {
ports: [ for v in parameter.ports {
{
containerPort: v.port
protocol: v.protocol
if v.name != _|_ {
name: v.name
}
if v.name == _|_ {
name: "port-" + strconv.FormatInt(v.port, 10)
}
}}]
}
if parameter["imagePullPolicy"] != _|_ {
imagePullPolicy: parameter.imagePullPolicy
}
if parameter["cmd"] != _|_ {
command: parameter.cmd
}
if parameter["env"] != _|_ {
env: parameter.env
}
if context["config"] != _|_ {
env: context.config
}
if parameter["cpu"] != _|_ {
resources: {
limits: cpu: parameter.cpu
requests: cpu: parameter.cpu
}
}
if parameter["memory"] != _|_ {
resources: {
limits: memory: parameter.memory
requests: memory: parameter.memory
}
}
if parameter["volumes"] != _|_ && parameter["volumeMounts"] == _|_ {
volumeMounts: [ for v in parameter.volumes {
{
mountPath: v.mountPath
name: v.name
}}]
}
if parameter["volumeMounts"] != _|_ {
volumeMounts: mountsArray
}
if parameter["livenessProbe"] != _|_ {
livenessProbe: parameter.livenessProbe
}
if parameter["readinessProbe"] != _|_ {
readinessProbe: parameter.readinessProbe
}
}]
if parameter["hostAliases"] != _|_ {
// +patchKey=ip
hostAliases: parameter.hostAliases
}
if parameter["imagePullSecrets"] != _|_ {
imagePullSecrets: [ for v in parameter.imagePullSecrets {
name: v
},
]
}
if parameter["volumes"] != _|_ && parameter["volumeMounts"] == _|_ {
volumes: [ for v in parameter.volumes {
{
name: v.name
if v.type == "pvc" {
persistentVolumeClaim: claimName: v.claimName
}
if v.type == "configMap" {
configMap: {
defaultMode: v.defaultMode
name: v.cmName
if v.items != _|_ {
items: v.items
}
}
}
if v.type == "secret" {
secret: {
defaultMode: v.defaultMode
secretName: v.secretName
if v.items != _|_ {
items: v.items
}
}
}
if v.type == "emptyDir" {
emptyDir: medium: v.medium
}
}
}]
}
if parameter["volumeMounts"] != _|_ {
volumes: deDupVolumesArray
}
}
}
}
}
exposePorts: [
if parameter.ports != _|_ for v in parameter.ports if v.expose == true {
port: v.port
targetPort: v.port
if v.name != _|_ {
name: v.name
}
if v.name == _|_ {
name: "port-" + strconv.FormatInt(v.port, 10)
}
},
]
outputs: {
if len(exposePorts) != 0 {
webserviceExpose: {
apiVersion: "v1"
kind: "Service"
metadata: name: context.name
spec: {
selector: "app.oam.dev/component": context.name
ports: exposePorts
type: parameter.exposeType
}
}
}
}
parameter: {
// +usage=Specify the labels in the workload
labels?: [string]: string
// +usage=Specify the annotations in the workload
annotations?: [string]: string
// +usage=Which image would you like to use for your service
// +short=i
image: string
// +usage=Specify image pull policy for your service
imagePullPolicy?: "Always" | "Never" | "IfNotPresent"
// +usage=Specify image pull secrets for your service
imagePullSecrets?: [...string]
// +ignore
// +usage=Deprecated field, please use ports instead
// +short=p
port?: int
// +usage=Which ports do you want customer traffic sent to, defaults to 80
ports?: [...{
// +usage=Number of port to expose on the pod's IP address
port: int
// +usage=Name of the port
name?: string
// +usage=Protocol for port. Must be UDP, TCP, or SCTP
protocol: *"TCP" | "UDP" | "SCTP"
// +usage=Specify if the port should be exposed
expose: *false | bool
}]
// +ignore
// +usage=Specify what kind of Service you want. options: "ClusterIP", "NodePort", "LoadBalancer", "ExternalName"
exposeType: *"ClusterIP" | "NodePort" | "LoadBalancer" | "ExternalName"
// +ignore
// +usage=If addRevisionLabel is true, the revision label will be added to the underlying pods
addRevisionLabel: *false | bool
// +usage=Commands to run in the container
cmd?: [...string]
// +usage=Define arguments by using environment variables
env?: [...{
// +usage=Environment variable name
name: string
// +usage=The value of the environment variable
value?: string
// +usage=Specifies a source the value of this var should come from
valueFrom?: {
// +usage=Selects a key of a secret in the pod's namespace
secretKeyRef?: {
// +usage=The name of the secret in the pod's namespace to select from
name: string
// +usage=The key of the secret to select from. Must be a valid secret key
key: string
}
// +usage=Selects a key of a config map in the pod's namespace
configMapKeyRef?: {
// +usage=The name of the config map in the pod's namespace to select from
name: string
// +usage=The key of the config map to select from. Must be a valid secret key
key: string
}
}
}]
// +usage=Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core)
cpu?: string
// +usage=Specifies the attributes of the memory resource required for the container.
memory?: string
volumeMounts?: {
// +usage=Mount PVC type volume
pvc?: [...{
name: string
mountPath: string
// +usage=The name of the PVC
claimName: string
}]
// +usage=Mount ConfigMap type volume
configMap?: [...{
name: string
mountPath: string
defaultMode: *420 | int
cmName: string
items?: [...{
key: string
path: string
mode: *511 | int
}]
}]
// +usage=Mount Secret type volume
secret?: [...{
name: string
mountPath: string
defaultMode: *420 | int
secretName: string
items?: [...{
key: string
path: string
mode: *511 | int
}]
}]
// +usage=Mount EmptyDir type volume
emptyDir?: [...{
name: string
mountPath: string
medium: *"" | "Memory"
}]
// +usage=Mount HostPath type volume
hostPath?: [...{
name: string
mountPath: string
mountPropagation?: "None" | "HostToContainer" | "Bidirectional"
path: string
readOnly?: bool
}]
}
// +usage=Deprecated field, use volumeMounts instead.
volumes?: [...{
name: string
mountPath: string
// +usage=Specify volume type, options: "pvc","configMap","secret","emptyDir", default to emptyDir
type: *"emptyDir" | "pvc" | "configMap" | "secret"
if type == "pvc" {
claimName: string
}
if type == "configMap" {
defaultMode: *420 | int
cmName: string
items?: [...{
key: string
path: string
mode: *511 | int
}]
}
if type == "secret" {
defaultMode: *420 | int
secretName: string
items?: [...{
key: string
path: string
mode: *511 | int
}]
}
if type == "emptyDir" {
medium: *"" | "Memory"
}
}]
// +usage=Instructions for assessing whether the container is alive.
livenessProbe?: #HealthProbe
// +usage=Instructions for assessing whether the container is in a suitable state to serve traffic.
readinessProbe?: #HealthProbe
// +usage=Specify the hostAliases to add
hostAliases?: [...{
ip: string
hostnames: [...string]
}]
}
#HealthProbe: {
// +usage=Instructions for assessing container health by executing a command. Either this attribute or the httpGet attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive with both the httpGet attribute and the tcpSocket attribute.
exec?: {
// +usage=A command to be executed inside the container to assess its health. Each space delimited token of the command is a separate array element. Commands exiting 0 are considered to be successful probes, whilst all other exit codes are considered failures.
command: [...string]
}
// +usage=Instructions for assessing container health by executing an HTTP GET request. Either this attribute or the exec attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive with both the exec attribute and the tcpSocket attribute.
httpGet?: {
// +usage=The endpoint, relative to the port, to which the HTTP GET request should be directed.
path: string
// +usage=The TCP socket within the container to which the HTTP GET request should be directed.
port: int
host?: string
scheme?: *"HTTP" | string
httpHeaders?: [...{
name: string
value: string
}]
}
// +usage=Instructions for assessing container health by probing a TCP socket. Either this attribute or the exec attribute or the httpGet attribute MUST be specified. This attribute is mutually exclusive with both the exec attribute and the httpGet attribute.
tcpSocket?: {
// +usage=The TCP socket within the container that should be probed to assess container health.
port: int
}
// +usage=Number of seconds after the container is started before the first probe is initiated.
initialDelaySeconds: *0 | int
// +usage=How often, in seconds, to execute the probe.
periodSeconds: *10 | int
// +usage=Number of seconds after which the probe times out.
timeoutSeconds: *1 | int
// +usage=Minimum consecutive successes for the probe to be considered successful after having failed.
successThreshold: *1 | int
// +usage=Number of consecutive failures required to determine the container is not alive (liveness probe) or not ready (readiness probe).
failureThreshold: *3 | int
}
status:
customStatus: |-
ready: {
replicas: *0 | int
} & {
if context.output.status.numberReady != _|_ {
replicas: context.output.status.numberReady
}
}
desired: {
replicas: *0 | int
} & {
if context.output.status.desiredNumberScheduled != _|_ {
replicas: context.output.status.desiredNumberScheduled
}
}
message: "Ready:\(ready.replicas)/\(desired.replicas)"
healthPolicy: |-
ready: {
replicas: *0 | int
} & {
if context.output.status.numberReady != _|_ {
replicas: context.output.status.numberReady
}
}
desired: {
replicas: *0 | int
} & {
if context.output.status.desiredNumberScheduled != _|_ {
replicas: context.output.status.desiredNumberScheduled
}
}
current: {
replicas: *0 | int
} & {
if context.output.status.currentNumberScheduled != _|_ {
replicas: context.output.status.currentNumberScheduled
}
}
updated: {
replicas: *0 | int
} & {
if context.output.status.updatedNumberScheduled != _|_ {
replicas: context.output.status.updatedNumberScheduled
}
}
generation: {
metadata: context.output.metadata.generation
observed: *0 | int
} & {
if context.output.status.observedGeneration != _|_ {
observed: context.output.status.observedGeneration
}
}
isHealth: (desired.replicas == ready.replicas) && (desired.replicas == updated.replicas) && (desired.replicas == current.replicas) && (generation.observed == generation.metadata || generation.observed > generation.metadata)
workload:
definition:
apiVersion: apps/v1
kind: DaemonSet
type: daemonsets.apps

View File

@@ -1,34 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/delete-config.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Delete a config
name: delete-config
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
deploy: op.#DeleteConfig & {
name: parameter.name
if parameter.namespace != _|_ {
namespace: parameter.namespace
}
if parameter.namespace == _|_ {
namespace: context.namespace
}
}
parameter: {
//+usage=Specify the name of the config.
name: string
//+usage=Specify the namespace of the config.
namespace?: string
}

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Wait for the specified Application to complete.
definition.oam.dev/description: check or install depends-on Application
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: depends-on-app

View File

@@ -4,9 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Deploy cloud resource and deliver secret to multi clusters.
labels:
custom.definition.oam.dev/scope: Application
definition.oam.dev/description: Deploy cloud resource and bind secret to clusters
name: deploy-cloud-resource
namespace: {{ include "systemDefinitionNamespace" . }}
spec:

View File

@@ -4,9 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: A powerful and unified deploy step for components multi-cluster delivery with policies.
labels:
custom.definition.oam.dev/scope: Application
definition.oam.dev/description: Deploy components with policies.
name: deploy
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
@@ -23,9 +21,9 @@ spec:
ignoreTerraformComponent: parameter.ignoreTerraformComponent
}
parameter: {
//+usage=If set to false, the workflow will suspend automatically before this step, default to be true.
//+usage=If set false, the workflow will be suspend before this step.
auto: *true | bool
//+usage=Declare the policies that used for this deployment. If not specified, the components will be deployed to the hub cluster.
//+usage=Declare the policies used for this step.
policies?: [...string]
//+usage=Maximum number of concurrent delivered components.
parallelism: *5 | int

View File

@@ -6,8 +6,6 @@ metadata:
annotations:
definition.oam.dev/description: Deploy env binding component to target env
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/scope: Application
custom.definition.oam.dev/ui-hidden: "true"
name: deploy2env
namespace: {{ include "systemDefinitionNamespace" . }}

View File

@@ -6,8 +6,6 @@ metadata:
annotations:
definition.oam.dev/description: Deploy application to runtime clusters
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/scope: Application
custom.definition.oam.dev/ui-hidden: "true"
name: deploy2runtime
namespace: {{ include "systemDefinitionNamespace" . }}
@@ -20,10 +18,10 @@ spec:
)
app: op.#Steps & {
load: op.#Load
load: op.#Load @step(1)
clusters: [...string]
if parameter.clusters == _|_ {
listClusters: op.#ListClusters
listClusters: op.#ListClusters @step(2)
clusters: listClusters.outputs.clusters
}
if parameter.clusters != _|_ {
@@ -39,7 +37,7 @@ spec:
}
}
}
}
} @step(3)
}
parameter: {
// +usage=Declare the runtime clusters to apply, if empty, all runtime clusters will be used

View File

@@ -5,14 +5,13 @@ kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add env on K8s pod for your workload which follows the pod spec in path 'spec.template'
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: env
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- daemonsets.apps
- jobs.batch
- '*'
schematic:
cue:
template: |
@@ -29,7 +28,7 @@ spec:
PatchContainer: {
_params: #PatchParams
name: _params.containerName
_delKeys: {for k in _params.unset {(k): ""}}
_delKeys: {for k in _params.unset {"\(k)": ""}}
_baseContainers: context.output.spec.template.spec.containers
_matchContainers_: [ for _container_ in _baseContainers if _container_.name == name {_container_}]
_baseContainer: *_|_ | {...}
@@ -47,7 +46,7 @@ spec:
}]
}
if _baseEnv != _|_ {
_baseEnvMap: {for envVar in _baseEnv {(envVar.name): envVar}}
_baseEnvMap: {for envVar in _baseEnv {"\(envVar.name)": envVar}}
// +patchStrategy=replace
env: [ for envVar in _baseEnv if _delKeys[envVar.name] == _|_ && !_params.replace {
name: envVar.name

View File

@@ -22,7 +22,7 @@ spec:
traits?: [...{
type: string
properties?: {...}
// +usage=Specify if the trait should be remove, default false
// +usage=Specify if the trait shoued be remove, default false
disable: *false | bool
}]
}

View File

@@ -1,64 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/export-data.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Export data to clusters specified by topology.
name: export-data
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
object: {
apiVersion: "v1"
kind: parameter.kind
metadata: {
name: *context.name | string
namespace: *context.namespace | string
if parameter.name != _|_ {
name: parameter.name
}
if parameter.namespace != _|_ {
namespace: parameter.namespace
}
}
if parameter.kind == "ConfigMap" {
data: parameter.data
}
if parameter.kind == "Secret" {
stringData: parameter.data
}
} @step(1)
getPlacements: op.#GetPlacementsFromTopologyPolicies & {
policies: *[] | [...string]
if parameter.topology != _|_ {
policies: [parameter.topology]
}
} @step(2)
apply: op.#Steps & {
for p in getPlacements.placements {
(p.cluster): op.#Apply & {
value: object
cluster: p.cluster
}
}
} @step(3)
parameter: {
// +usage=Specify the name of the export destination
name?: string
// +usage=Specify the namespace of the export destination
namespace?: string
// +usage=Specify the kind of the export destination
kind: *"ConfigMap" | "Secret"
// +usage=Specify the data to export
data: {}
// +usage=Specify the topology to export
topology?: string
}

View File

@@ -1,79 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/export-service.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Export service to clusters specified by topology.
name: export-service
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
meta: {
name: *context.name | string
namespace: *context.namespace | string
if parameter.name != _|_ {
name: parameter.name
}
if parameter.namespace != _|_ {
namespace: parameter.namespace
}
}
objects: [{
apiVersion: "v1"
kind: "Service"
metadata: meta
spec: {
type: "ClusterIP"
ports: [{
protocol: "TCP"
port: parameter.port
targetPort: parameter.targetPort
}]
}
}, {
apiVersion: "v1"
kind: "Endpoints"
metadata: meta
subsets: [{
addresses: [{ip: parameter.ip}]
ports: [{port: parameter.targetPort}]
}]
}] @step(1)
getPlacements: op.#GetPlacementsFromTopologyPolicies & {
policies: *[] | [...string]
if parameter.topology != _|_ {
policies: [parameter.topology]
}
} @step(2)
apply: op.#Steps & {
for p in getPlacements.placements {
for o in objects {
"\(p.cluster)-\(o.kind)": op.#Apply & {
value: o
cluster: p.cluster
}
}
}
} @step(3)
parameter: {
// +usage=Specify the name of the export destination
name?: string
// +usage=Specify the namespace of the export destination
namespace?: string
// +usage=Specify the ip to be export
ip: string
// +usage=Specify the port to be used in service
port: int
// +usage=Specify the port to be export
targetPort: int
// +usage=Specify the topology to export
topology?: string
}

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Export data to specified Kubernetes ConfigMap in your workflow.
definition.oam.dev/description: Export data to config map for your workflow steps
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: export2config

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Export data to Kubernetes Secret in your workflow.
definition.oam.dev/description: Export data to secret for your workflow steps
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: export2secret
@@ -46,7 +46,7 @@ spec:
type?: string
// +usage=Specify the data of secret
data: {}
// +usage=Specify the cluster of the secret
// +usage=Specify the cluster of the config map
cluster: *"" | string
}

View File

@@ -5,30 +5,23 @@ kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Expose port to enable web traffic for your component.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: expose
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
podDisruptive: false
schematic:
cue:
template: |
import (
"strconv"
)
outputs: service: {
apiVersion: "v1"
kind: "Service"
metadata: name: context.name
metadata: annotations: parameter.annotations
metadata: name: context.name
spec: {
selector: "app.oam.dev/component": context.name
ports: [
for p in parameter.port {
name: "port-" + strconv.FormatInt(p, 10)
port: p
targetPort: p
},
@@ -39,33 +32,7 @@ spec:
parameter: {
// +usage=Specify the exposion ports
port: [...int]
// +usage=Specify the annotaions of the exposed service
annotations: [string]: string
// +usage=Specify what kind of Service you want. options: "ClusterIP","NodePort","LoadBalancer","ExternalName"
type: *"ClusterIP" | "NodePort" | "LoadBalancer" | "ExternalName"
}
status:
customStatus: |-
message: *"" | string
service: context.outputs.service
if service.spec.type == "ClusterIP" {
message: "ClusterIP: \(service.spec.clusterIP)"
}
if service.spec.type == "LoadBalancer" {
status: service.status
isHealth: status != _|_ && status.loadBalancer != _|_ && status.loadBalancer.ingress != _|_ && len(status.loadBalancer.ingress) > 0
if !isHealth {
message: "ExternalIP: Pending"
}
if isHealth {
message: "ExternalIP: \(status.loadBalancer.ingress[0].ip)"
}
}
healthPolicy: |-
isHealth: *true | bool
service: context.outputs.service
if service.spec.type == "LoadBalancer" {
status: service.status
isHealth: status != _|_ && status.loadBalancer != _|_ && status.loadBalancer.ingress != _|_ && len(status.loadBalancer.ingress) > 0
}

View File

@@ -1,40 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/garbage-collect.cue
apiVersion: core.oam.dev/v1beta1
kind: PolicyDefinition
metadata:
annotations:
definition.oam.dev/description: Configure the garbage collect behaviour for the application.
name: garbage-collect
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
#GarbageCollectPolicyRule: {
// +usage=Specify how to select the targets of the rule
selector: [...#ResourcePolicyRuleSelector]
// +usage=Specify the strategy for target resource to recycle
strategy: *"onAppUpdate" | "onAppDelete" | "never"
}
#ResourcePolicyRuleSelector: {
// +usage=Select resources by component names
componentNames?: [...string]
// +usage=Select resources by component types
componentTypes?: [...string]
// +usage=Select resources by oamTypes (COMPONENT or TRAIT)
oamTypes?: [...string]
// +usage=Select resources by trait types
traitTypes?: [...string]
// +usage=Select resources by resource types (like Deployment)
resourceTypes?: [...string]
// +usage=Select resources by their names
resourceNames?: [...string]
}
parameter: {
// +usage=If is set, outdated versioned resourcetracker will not be recycled automatically, outdated resources will be kept until resourcetracker be deleted manually
keepLegacyResource: *false | bool
// +usage=Specify the 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]
}

View File

@@ -9,8 +9,7 @@ metadata:
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- '*'
podDisruptive: false
schematic:
cue:
@@ -30,24 +29,15 @@ spec:
]
}
}
legacyAPI: context.clusterVersion.minor < 19
outputs: ingress: {
if legacyAPI {
apiVersion: "networking.k8s.io/v1beta1"
}
if !legacyAPI {
apiVersion: "networking.k8s.io/v1"
}
kind: "Ingress"
apiVersion: "networking.k8s.io/v1"
kind: "Ingress"
metadata: {
name: context.name
annotations: {
if !parameter.classInSpec {
"kubernetes.io/ingress.class": parameter.class
}
if parameter.gatewayHost != _|_ {
"ingress.controller/host": parameter.gatewayHost
}
}
}
spec: {
@@ -70,17 +60,9 @@ spec:
for k, v in parameter.http {
path: k
pathType: "ImplementationSpecific"
backend: {
if legacyAPI {
serviceName: context.name
servicePort: v
}
if !legacyAPI {
service: {
name: context.name
port: number: v
}
}
backend: service: {
name: context.name
port: number: v
}
},
]
@@ -100,25 +82,22 @@ spec:
// +usage=Set ingress class in '.spec.ingressClassName' instead of 'kubernetes.io/ingress.class' annotation.
classInSpec: *false | bool
// +usage=Specify the secret name you want to quote to use tls.
// +usage=Specify the secret name you want to quote.
secretName?: string
// +usage=Specify the host of the ingress gateway, which is used to generate the endpoints when the host is empty.
gatewayHost?: string
}
status:
customStatus: |-
if context.outputs.ingress.status.loadBalancer.ingress == _|_ {
let igs = context.outputs.ingress.status.loadBalancer.ingress
if igs == _|_ {
message: "No loadBalancer found, visiting by using 'vela port-forward " + context.appName + "'\n"
}
if context.outputs.ingress.status.loadBalancer.ingress != _|_ {
let igs = context.outputs.ingress.status.loadBalancer.ingress
if len(igs) > 0 {
if igs[0].ip != _|_ {
if igs[0].host != _|_ {
message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host + ", IP: " + igs[0].ip
}
if igs[0].host == _|_ {
message: "Host not specified, visit the cluster or load balancer in front of the cluster with IP: " + igs[0].ip
message: "Host not specified, visit the cluster or load balancer in front of the cluster"
}
}
if igs[0].ip == _|_ {

View File

@@ -5,14 +5,13 @@ kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add host aliases on K8s pod for your workload which follows the pod spec in path 'spec.template'.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: hostalias
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- daemonsets.apps
- jobs.batch
- '*'
podDisruptive: false
schematic:
cue:

View File

@@ -0,0 +1,41 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/import-grafana-dashboard.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Import dashboards to Grafana
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: import-grafana-dashboard
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads: []
conflictsWith: []
podDisruptive: false
schematic:
cue:
template: |
outputs: registerdatasource: {
apiVersion: "grafana.extension.oam.dev/v1alpha1"
kind: "ImportDashboard"
spec: {
grafana: {
service: parameter.grafanaServiceName
namespace: parameter.grafanaServiceNamespace
credentialSecret: parameter.credentialSecret
credentialSecretNamespace: parameter.credentialSecretNamespace
}
urls: parameter.urls
}
}
parameter: {
grafanaServiceName: string
grafanaServiceNamespace: *"default" | string
credentialSecret: string
credentialSecretNamespace: *"default" | string
urls: [...string]
}
workloadRefPath: ""

View File

@@ -5,14 +5,13 @@ kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: add an init container and use shared volume with pod
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: init-container
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- daemonsets.apps
- jobs.batch
podDisruptive: true
schematic:
cue:
@@ -28,9 +27,8 @@ spec:
}]
}]
initContainers: [{
name: parameter.name
image: parameter.image
imagePullPolicy: parameter.imagePullPolicy
name: parameter.name
image: parameter.image
if parameter.cmd != _|_ {
command: parameter.cmd
}
@@ -60,9 +58,6 @@ spec:
// +usage=Specify the image of init container
image: string
// +usage=Specify image pull policy for your service
imagePullPolicy: *"IfNotPresent" | "Always" | "Never"
// +usage=Specify the commands run in the init container
cmd?: [...string]

View File

@@ -4,7 +4,9 @@ apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add labels on your workload. if it generates pod, add same label for generated pods.
definition.oam.dev/description: Add labels on K8s pod for your workload which follows the pod spec in path 'spec.template'.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: labels
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
@@ -18,13 +20,13 @@ spec:
patch: {
metadata: labels: {
for k, v in parameter {
(k): v
"\(k)": v
}
}
if context.output.spec != _|_ && context.output.spec.template != _|_ {
spec: template: metadata: labels: {
for k, v in parameter {
(k): v
"\(k)": v
}
}
}

View File

@@ -5,14 +5,13 @@ kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add lifecycle hooks for every container of K8s pod for your workload which follows the pod spec in path 'spec.template'.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: lifecycle
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- daemonsets.apps
- jobs.batch
- '*'
podDisruptive: true
schematic:
cue:

View File

@@ -1,33 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/list-config.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: List the configs
name: list-config
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
output: op.#ListConfig & {
if parameter.namespace != _|_ {
namespace: parameter.namespace
}
if parameter.namespace == _|_ {
namespace: context.namespace
}
template: parameter.template
}
parameter: {
//+usage=Specify the template of the config.
template: string
//+usage=Specify the namespace of the config.
namespace?: string
}

View File

@@ -11,10 +11,7 @@ metadata:
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- daemonsets.apps
- jobs.batch
- '*'
podDisruptive: true
schematic:
cue:
@@ -108,7 +105,7 @@ spec:
portForward: parameter.portForward
}
if parameter.portForward == _|_ {
portForward: ["\(parameter.port):\(parameter.port)"]
portForward: ["\(parameter.port)" + ":" + "\(parameter.port)"]
}
}
},

Some files were not shown because too many files have changed in this diff Show More