Compare commits

...

223 Commits

Author SHA1 Message Date
github-actions[bot]
4b4e4f8530 [Backport release-1.6] Fix: enhance the default permissions (#4977)
* Fix: enhance the default permissions

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

* Fix: unit test error

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-11-01 20:51:33 +08:00
github-actions[bot]
0121e8b6ef Feat: allowing restart a compeleted workflow (#4976)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 74eea5bed2)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-11-01 20:35:36 +08:00
github-actions[bot]
382510aa67 [Backport release-1.6] Fix: mongodb can not decode runtime.Object (#4974)
* Fix: mongodb can not decode runtime.Object

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

* reuse struct

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

* fix no output when filter

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

Co-authored-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-11-01 17:25:55 +08:00
github-actions[bot]
7ae7d2a5ef [Backport release-1.6] Fix: grant the permission to read the ConfigMap in the vela-system namesapce (#4970)
* Fix: grant the permission to read the ConfigMap in the vela-system namespace

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

* Fix: change the test

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-11-01 10:00:04 +08:00
github-actions[bot]
0736e85e07 [Backport release-1.6] Feat: implement pipeline APIs (#4969)
* add context when run pipeline

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

* Feat: implement pipeline API

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

* Extract get log logic and implement getPipelineRunLog API

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

* Init and delete pipeline contexts

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

* fix panic

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

* Allow not specifying context

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

* change pipeline to path parameter

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

* Add permission check filter

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

* project -> projects in route

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

* fix route conflict

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

* Add project alias

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

* Feat: change the list pipeline API

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

* Feat: filter the project

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

* Fix: the error of the run APi

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

* fix log pipeline run API

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

* Fix lint, fix the error of log api

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

* fix error returning

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

* Fix: change the lable to annotation

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

* remove log config not found error

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

* fix pipeline list api return no context info

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

* Fix: create the namespace

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

* get pipeline lastrun info

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

* allow query single step output

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

* organize code in api layer

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

* fix project filter, add context value when get pp run, extend lastRun

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

* fix get output and implement get input api

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

* Fix: change the last run

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

* if query sub-step outout, return it directly

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

* Fix: change the run stats

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

* Fix: change the output

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

* flatten the input/output api

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

* more info for i/o vars

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

* fix nested i/o struct

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

* add fromStep in input api

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

* add e2e test skeleton

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

* add more e2e test

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

* use db to store pipeline

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

* keep the last 5k lines of log

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

* use stern param to keep last lines of logs

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

* filter, nil labels, spec check

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

* empty res, index, detail param

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

* Add e2e test

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

* fix e2e test and unit test

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

* add context e2e test

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

* goimports

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

* add more test

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

* review

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

* remove optional tag in returned value, unify the imports name

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

* fix e2e test

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

* add stop test

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

* more coverage

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

* single case selct

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

* optimize log color

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

* add default permission and role

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

* fix permission ut

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

* change the log api implementation

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

* add color, add container order

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

* lint

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

* fix filter nil will cut all log

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

* longer timeout and lint

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

Co-authored-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-11-01 00:13:37 +08:00
github-actions[bot]
f01e6d9723 Chore: stable the version of cue and workflow (#4964)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 0defa2d53d)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-31 15:12:35 +08:00
github-actions[bot]
2d7d4ef99d [Backport release-1.6] Fix: do not change the workflow after the env changed (#4962)
* Fix: do not change the workflow after the env changed

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

* Fix: change the test case

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

* Fix: check app when deleting the target from a env

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-10-31 11:19:49 +08:00
github-actions[bot]
6bbce07a21 Feat: add mode in workflow template (#4960)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 19a30371dd)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-31 11:09:54 +08:00
github-actions[bot]
12ba4631c1 [Backport release-1.6] Fix: bocde error override origin error message (#4955)
* fix bcode error

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

* small fix

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-10-29 17:05:25 +08:00
github-actions[bot]
d5b4f9ae5d [Backport release-1.6] Fix: update namespace only if it doesn't have the env label (#4953)
* Fix: update namespace only if it doesn't have the env label

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
(cherry picked from commit 9cf18e94d8)

* Fix: update namespace only if it doesn't have the env label

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
(cherry picked from commit 4031aa25ae)

Co-authored-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2022-10-29 10:36:02 +08:00
github-actions[bot]
d62185315a It is unnecessary to judge that the index function is not null (#4952)
Signed-off-by: liutiangang <liutiangang@cmbchina.com>
(cherry picked from commit 2570df7e83)

Co-authored-by: liutiangang <liutiangang@cmbchina.com>
2022-10-29 09:13:48 +08:00
github-actions[bot]
12f0cebc6c more error info for apiservice and add tests (#4949)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

change the mock addon version

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-10-29 08:32:26 +08:00
github-actions[bot]
284a7d08b2 Feat: sync the model of api workflow with core (#4950)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 0bfa9f9143)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-29 08:31:13 +08:00
github-actions[bot]
c91850ce0d Fix: apiserver & vela status use multi-cluster client (#4946)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit a1a3996062)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-10-28 14:15:58 +08:00
github-actions[bot]
e13b31d00e [Backport release-1.6] Fix: can't obtain pods generated by Crontask component (patch of PR 4925) (#4945)
* Fix: get label selector from cronJob

Signed-off-by: HanMengnan <1448189829@qq.com>
(cherry picked from commit 03be6b3f8f)

* Fix: small fix

Signed-off-by: HanMengnan <1448189829@qq.com>
(cherry picked from commit b8c97411d5)

* Fix: use scheme create obj

Signed-off-by: HanMengnan <1448189829@qq.com>
(cherry picked from commit fa00132e2d)

* Fix: update method of generating selector

Signed-off-by: HanMengnan <1448189829@qq.com>
(cherry picked from commit d30010ec7a)

* Fix: update cron-task

Signed-off-by: HanMengnan <1448189829@qq.com>
(cherry picked from commit 864c04eee6)

* Fix: add test case

Signed-off-by: HanMengnan <1448189829@qq.com>
(cherry picked from commit c1cdf8f290)

* Fix: add test case

Signed-off-by: HanMengnan <1448189829@qq.com>
(cherry picked from commit f977805810)

Co-authored-by: HanMengnan <1448189829@qq.com>
2022-10-28 11:34:28 +08:00
github-actions[bot]
71d0d7344f Fix: fix gen doc for container image (#4937)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 33f7c2539b)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-27 22:19:10 +08:00
github-actions[bot]
247845db0a fix gitlab addon registry (#4939)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
(cherry picked from commit f3ee964734)

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-10-27 22:17:58 +08:00
github-actions[bot]
427809cea7 Fix: update export2config and export2secret example (#4940)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit b2de4020a4)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-10-27 19:07:39 +08:00
github-actions[bot]
6c29b7b088 Fix: get Application status using jsonpath filter expression (#4933)
Signed-off-by: yanghaojia <yanghaojia@coding.net>
(cherry picked from commit 16272cffaa)

Co-authored-by: yanghaojia <yanghaojia@coding.net>
2022-10-27 14:45:14 +08:00
github-actions[bot]
77e85472fa [Backport release-1.6] Fix: can't get pods of CronTask component (#4930)
* Fix: get label selector from cronJob

Signed-off-by: HanMengnan <1448189829@qq.com>
(cherry picked from commit a9b2c3ac88)

* Fix: update cron-task yaml

Signed-off-by: HanMengnan <1448189829@qq.com>
(cherry picked from commit 188b544db0)

* Fix: small fix

Signed-off-by: HanMengnan <1448189829@qq.com>
(cherry picked from commit 9d393df2fa)

Co-authored-by: HanMengnan <1448189829@qq.com>
2022-10-27 11:22:51 +08:00
github-actions[bot]
c60df945c3 [Backport release-1.6] Feat: support operations for workflow run (#4924)
* Feat: support operations for workflow run

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

* fix test

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

* fix lint

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

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-27 10:26:13 +08:00
github-actions[bot]
28488a4e9b [Backport release-1.6] Feat: enhance the apply-once capability (#4919)
* Feat: enhance the apply-once capability

Signed-off-by: 朱晓兵 <596908030@qq.com>
(cherry picked from commit 43eef883d0)

* Fix: add unit-test

Signed-off-by: 朱晓兵 <596908030@qq.com>
(cherry picked from commit 514c2bc8bd)

* Fix: adjustment variable name

Signed-off-by: 朱晓兵 <596908030@qq.com>
(cherry picked from commit 70b3621ac6)

* Fix: add doc

Signed-off-by: 朱晓兵 <596908030@qq.com>
(cherry picked from commit 5506fe9cda)

* Fix: adjustment variable name

Signed-off-by: 朱晓兵 <596908030@qq.com>
(cherry picked from commit 4e5f8d9443)

Co-authored-by: 朱晓兵 <596908030@qq.com>
2022-10-26 16:36:08 +08:00
github-actions[bot]
1ae7ba1e1e [Backport release-1.6] Fix: add sub step in vela workflow logs (#4918)
* Fix: add sub step in vela workflow logs

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

* fix lint

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

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-25 16:58:02 +08:00
Somefive
2076c2f937 Feat: add feature docs and controller parameters for MultiStageComponentApply (#4873) (#4917)
Signed-off-by: ZhongsJie <zhongsjie@gmail.com>

Signed-off-by: ZhongsJie <zhongsjie@gmail.com>

Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
Co-authored-by: ZhongsJie <62382570+ZhongsJie96@users.noreply.github.com>
2022-10-25 15:00:23 +08:00
Tianxin Dong
56f200fb59 Fix: deprecated resolve reference in gen open API (#4913)
* Fix: depracted resolve reference in gen open API

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

* fix test

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

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-25 11:13:41 +08:00
Somefive
210db6de95 Feat: add timeout for reconcile (#4912)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-10-24 21:36:42 +08:00
barnettZQG
2255b0a6c7 Feat: Refer to the generation when checking the application status (#4901)
* Feat: Refer to the generation when checking the application status

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

* Fix: add the test

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

* Fix: the starting status overrided the deleting status

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-10-24 19:32:45 +08:00
Tianxin Dong
5c1bf0ad70 Fix: support sub steps in vela status (#4911)
* Fix: support sub steps in vela status

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

* add http do in stdlib

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

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-24 15:58:57 +08:00
barnettZQG
accc7f9a83 Fix: assign the value for the registry of the addon (#4910)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-10-24 14:14:11 +08:00
barnettZQG
b41391a4fa Chore: wrong endpoint for LoadBalancer type service(revert #4729) (#4902)
* Chore: wrong endpoint for LoadBalancer type service(revert #4729)

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

* Fix: change the unit test

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-10-22 12:38:08 +08:00
qiaozp
70c036a4be Fix: legacy API in gateway trait (#4899)
* Fix: legacy API in gateway trait

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* rollback version

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-10-21 12:00:56 +08:00
Jianbo Sun
70f0500825 Feat: support context.clusterVersion for definition graceful upgrade (#4890)
* Feat: support context.clusterVersion for definition graceful upgrade

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

* Fix: add test for context.clusterVersion

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

* Fix: use control plane context cluster

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

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-10-20 20:31:29 +08:00
barnettZQG
7855b0024d Chore: change the package name of the readme-generator-for-helm (#4894)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-10-20 16:29:34 +08:00
Siege Lion
44b4afbcdf Feat: add the container view to vela top (#4892)
* Feat: add content to help view

Signed-off-by: HanMengnan <1448189829@qq.com>

* Feat: add the feature of viewing log of pod

Signed-off-by: HanMengnan <1448189829@qq.com>

* Feat: add the container view

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: add test case and fix some bugs

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: fix some bugs

Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-10-20 14:58:41 +08:00
wyike
416f68860e Feat: workflowStep of printing message in status (#4877)
* enable addon provider

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

* add failed

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

add backofflimit 0

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

fix comments

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

delete namespace label

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

small fix

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

upgrade workflow

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

add test and fix small bugs

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

add clean jobs with labelselector

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

go mod tidy

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

* small fix

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

use mock addon as test

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

use rollout

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

walk around mock addon registry

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

add test

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

use rollout test

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

fix time

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

more time

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

optimize revert configmap

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

upgrade go text

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

revert two definitions

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

delete useless files

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

* upgrade workflow package

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

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-10-20 11:38:47 +08:00
Tianxin Dong
95b3b31b11 Feat: remove workflow step logs to vela workflow logs (#4883)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-20 11:18:48 +08:00
barnettZQG
7fc3d7c23b Fix: the api schema can not be generated (#4889)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-10-20 10:57:23 +08:00
barnettZQG
072ef8f724 Fix: exit waiting after the workflow failed (#4879)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-10-19 11:24:01 +08:00
Siege Lion
ab4348ed67 Feat: add the feature of viewing log of pod in vela top (#4870)
* Feat: add content to help view

Signed-off-by: HanMengnan <1448189829@qq.com>

* Feat: add cluster data to pod view

Signed-off-by: HanMengnan <1448189829@qq.com>

* Feat: add the feature of viewing log of pod

Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-10-18 19:47:27 +08:00
nuclearwu
2175bb519e Feat: createOrUpdateApplication support dryRun operation (#4860)
Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2022-10-18 17:25:28 +08:00
Somefive
f1107c5018 Feat: allow empty cluster for cluster selector (#4880)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-10-18 17:19:16 +08:00
Jianbo Sun
c0e1a1a323 Feat: support parameter in health check of definition (#4872)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-10-18 17:16:23 +08:00
barnettZQG
9e00d48206 Fix: upgrade the workflow to support the provider about the config (#4878)
* Fix: upgrade the workflow to support the provider about the config

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

* Fix: change the yaml

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

* Fix: retry CI

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

* Fix: change the definitions

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-10-18 17:15:14 +08:00
barnettZQG
0fb55d9f8d Fix: remove the owner references (#4881)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-10-18 17:14:31 +08:00
qiaozp
dc7d791127 Feat: pipeline API for apiserver (#4840) 2022-10-17 20:11:06 +08:00
Tianxin Dong
51c803cc12 Chore: upgrade workflow vendor version (#4876)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-17 19:28:04 +08:00
Tianxin Dong
ccf7bdd2d6 Feat: support step logs in vela logs (#4845)
* Feat: support step logs in vela logs

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

* resolve comments

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

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-17 19:01:59 +08:00
barnettZQG
49ed837f97 Feat: support to manage the configs by the CLI, UI, and workflow. (#4794)
* Feat: support to manage the integrations by the CLI and the workflow

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

* Fix: remove the xml

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

* Fix: add the unit test for the nacos writer

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

* Feat: add the integration API

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

* Feat: make the provider commands to be deprecated

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

* Fix: make the unit test work

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

* Feat: rename the integration to the config

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

* Fix: make the unit test cases work

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

* Feat: refactor the config commands

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

* Feat: add the distribution status for the config

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

* Fix: sort the import packages

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

* Fix: refine the code style

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

* Fix: refine the code style

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

* Fix: get the content format before render the content

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

* Feat: add some examples

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

* Fix: the command test cases

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

* Feat: add the definitions of the workflow step

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

* Fix: add some tests

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

* Fix: add some tests

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

* Fix: change the name

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

* Fix: retry the CI

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

* Fix: refine some words

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-10-17 17:15:45 +08:00
Tianxin Dong
5a4bdd4f6e Fix: fix array in definition (#4875)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-17 15:50:28 +08:00
Somefive
0a9be7c164 Fix: prevent workflow end time refill (#4864)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-10-15 10:55:07 +08:00
Somefive
4fba13c813 Fix: prevent rerun application while upgrading due to old apprev lack app workflow (#4852)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-10-14 22:05:55 +08:00
Tianxin Dong
913c740a87 Chore: use use fix and optimize definitions (#4851)
* Chore: use use fix and optimize definitions

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

* Fix: use fields instead of structs

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

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-13 17:08:33 +08:00
Jianbo Sun
2c4febb9cf Fix: support default value of ui schema (#4857)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-10-13 14:02:40 +08:00
chengleqi
a03751e0ae Fix: change LabelResourceRuleFormat from Annotations to Labels (#4850)
* fix: change Annotations to Labels

Signed-off-by: chengleqi <chengleqi5g@hotmail.com>

* fix: add FormatYAML label for test case

Signed-off-by: chengleqi <chengleqi5g@hotmail.com>

* add json format rules test case

Signed-off-by: chengleqi <chengleqi5g@hotmail.com>

Signed-off-by: chengleqi <chengleqi5g@hotmail.com>
2022-10-12 15:23:04 +08:00
chengleqi
2d5871cfeb feat: add Resource Relationships for kustomize (#4849)
Signed-off-by: chengleqi <chengleqi5g@hotmail.com>

Signed-off-by: chengleqi <chengleqi5g@hotmail.com>
2022-10-11 19:57:09 +08:00
Somefive
bbdce2f6ee Chore: fix flaky multicluster test (#4848)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-10-11 19:22:30 +08:00
Somefive
fb45a94bb8 Feat: add export service (#4841)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-10-11 10:25:56 +08:00
Jianbo Sun
15c0e4122e Chore: prevent restart/resume/suspend/terminate workflow when application running (#4839)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-10-09 20:22:29 +08:00
Jianbo Sun
556535be84 Chore: omit empty message in workflow step status (#4837)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-10-09 17:32:58 +08:00
Somefive
17afabc1ff Feat: support context.cluster (#4836)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-10-09 14:08:02 +08:00
Jianbo Sun
9c5b7a526d Fix: align sha256sums file with binary name (#4830)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-10-09 10:09:05 +08:00
Jianbo Sun
4d1c8e886d Chore: add IP for gateway trait (#4833)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-10-09 10:02:12 +08:00
wyike
ba3c0305c4 fix bugs and add tests (#4831)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-10-08 17:12:05 +08:00
ZhongsJie
3299184d3b Feat: provide stage field for TraitDefinition (#4570)
* Feat: provide stage field for TraitDefinition

Signed-off-by: ZhongsJie <zhongsjie@gmail.com>

* Feat: Refactor the collect health status fn

Signed-off-by: ZhongsJie <zhongsjie@gmail.com>

Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
2022-10-08 10:38:06 +08:00
Somefive
4c56fac228 Fix: workqueue & controller client metrics not registered correctly (#4814)
* Fix: workqueue & controller client metrics not registered correctly

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

* Fix: support merging metrics registry

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

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-10-08 10:35:13 +08:00
Siege Lion
fd11f90d96 Feat: add resource topology view in vela top (#4817)
* Feat: add some feature

1. add more column of application and managed resource

2. alter <ESC> to exist key and add <Q> as the back key
Signed-off-by: HanMengnan <1448189829@qq.com>

* Refactor: refactor the yaml view and help view with singleton  design pattern

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: some small fix

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: some small fix

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: add test case

Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-10-08 10:23:12 +08:00
Diego Pinheiro
0aaab7fa30 fix typo (#4827)
Signed-off-by: Diego Pinheiro <diego.milhomes@gmail.com>

Signed-off-by: Diego Pinheiro <diego.milhomes@gmail.com>
2022-10-07 17:05:46 +08:00
Diego Pinheiro
37384fc200 fix - typo (#4826)
Signed-off-by: Diego Pinheiro <diego.milhomes@gmail.com>

Signed-off-by: Diego Pinheiro <diego.milhomes@gmail.com>
2022-10-07 17:05:09 +08:00
chengleqi
0f67440b26 Fix: Update Ingress APIVersion form v1beta1 to v1 in test case (#4819)
* Update ingress form v1beta1 to v1 in test case

Signed-off-by: chengleqi <chengleqi5g@hotmail.com>

* Change package name from v12 to networkingv1

Signed-off-by: chengleqi <chengleqi5g@hotmail.com>

Signed-off-by: chengleqi <chengleqi5g@hotmail.com>
2022-10-07 08:33:52 +08:00
Tianxin Dong
91e470acfc Fix: fix render fields in debug command (#4811)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-09-30 14:00:33 +08:00
Jianbo Sun
09e628025a Feat: beautify addon list experience (#4807)
* Feat: beautify addon list experience

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

* Fix: addon list e2e test

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

* Chore: refine logs

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

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-09-30 13:23:27 +08:00
Siege Lion
bd728cbdbc Feat: Add more data field to application view and managed resource view in vela top (#4781)
* Fix: fix the bug of cluster list

Signed-off-by: HanMengnan <1448189829@qq.com>

* Feat: add some feature

1. add more column of application and managed resource

2. alter <ESC> to exist key and add <Q> as the back key
Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-09-30 10:45:49 +08:00
Somefive
b79dc3bccf Feat: enhance collect service endpoints (#4806)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-09-30 10:44:16 +08:00
qiaozp
72827b29f2 Chore: simplify enqueueing app reconcile request for rt (#4810)
* Chore: simplify the enqueue app reconcile request for rt

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Reduce useless type convert

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-09-30 10:41:39 +08:00
Somefive
feca6ccb84 Feat: workflow will rerun when application workflow changes (#4808)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-09-29 22:41:59 +08:00
Somefive
cfcf24b657 Feat: add image-pull-policy to init-container (#4809)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-09-29 22:41:36 +08:00
Somefive
b5f0363a3d Feat: add port name to CollectServiceEndpoints (#4801)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-09-29 10:24:36 +08:00
qiaozp
aed06c3021 Chore: bump some dependencies to make sure license exists (#4803) 2022-09-28 20:57:17 +08:00
Xu Cheng
b8c2b7aa96 Fix: interface updateUser missing read body (#4802)
Signed-off-by: 1ch0 <github1ch0@163.com>

Signed-off-by: 1ch0 <github1ch0@163.com>
2022-09-28 17:21:37 +08:00
Tianxin Dong
7fa40dbe77 Feat: support workflow get-context cli (#4795)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-09-28 17:18:08 +08:00
Somefive
0fceb5ee59 Fix: add path clean for request (#4799)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-09-28 14:22:47 +08:00
nuclearwu
070d612a3d Fix: it does not check the same name for 'vela env init' (#4796)
Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2022-09-28 10:58:29 +08:00
Somefive
668a637f86 Feat: upgrade go1.19 (#4790) 2022-09-28 10:19:28 +08:00
Tianxin Dong
9b6ec588f5 Chore: revert the definitions after cue upgrade (#4786)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-09-27 10:35:10 +08:00
qiaozp
e6507cd6cd Fix: allow to read definition from user's namespace when force delete (#4778) 2022-09-26 22:30:20 +08:00
Siege Lion
6287a9caeb Fix: fix the bug of cluster list (#4772)
Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-09-26 14:49:50 +08:00
Somefive
6e986d8db1 Fix: prevent workflow rerun when appspec struct change (#4755)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-09-26 10:35:24 +08:00
barnettZQG
e99e1a650f Fix: deprecate the cue-packages command (#4762) 2022-09-23 16:53:52 +08:00
barnettZQG
9da8cb619d Fix: memory leak of the apiserver (#4773)
* Fix: memory leak of the apiserver

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

* Fix: listen to the context done event

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

* Fix: remove the shutdown code

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-09-23 16:49:17 +08:00
Somefive
cb61b30e43 Fix: gc legacy rt with regularization (#4769)
* Fix: gc legacy rt with regularization

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

* Test: add test

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

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-09-23 10:41:08 +08:00
Somefive
b9058ca360 Feat: remove skip revision affect (#4774)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-09-22 19:14:21 +08:00
Tianxin Dong
db3249a0b5 Chore: update cue version to fix panic in def (#4758)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-09-21 11:48:57 +08:00
Somefive
3fc268d13d Fix: auth lack perm for rollout (#4763)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-09-20 20:32:27 +08:00
barnettZQG
c780a1b2c2 Feat: optimize the definition controllers (#4751)
* Feat: optimize the definition controllers

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

* Fix: generate the different label key

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

* Fix: add the comment

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

* Fix: update the comment

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-09-20 15:20:19 +08:00
Tianxin Dong
d98016aa3d Fix: use value instead of instance in openapi.gen (#4739)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-09-20 15:18:31 +08:00
Jianbo Sun
99d25a3657 Feat: support no browserver when using vela show without --web (#4756)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-09-20 15:18:16 +08:00
Siege Lion
d38b20de64 Feat: add feature of refreshing resource view and fix the bug of stucking (#4743)
* Fix: add test cases

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: fix bugs in resource view switch

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: optimize the method of resource view render

1. Separate view loading and data rendering to optimize the view rendering speed

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: fix the bug of ctx value transmit in resource view switch

Signed-off-by: HanMengnan <1448189829@qq.com>

* Feat: Add the feature of auto refresh
Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: small fix

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: small fix

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: small fix

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: small fix

Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-09-20 11:28:51 +08:00
Jianbo Sun
cdbf14c328 Feat: support addon dry-run to get the yaml results (#4753)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-09-19 17:24:07 +08:00
Somefive
dd22f27e39 Fix: panic when properties empty (#4745)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-09-19 11:17:24 +08:00
barnettZQG
e2cc8b466b Fix: query the resource duplicately (#4714)
* Fix: query the resource duplicately

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

* Fix: add an e2e test case

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-09-19 10:23:10 +08:00
Siege Lion
e1cfd483cd Doc: add the design document of vela-top (#4736)
Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-09-16 16:59:13 +08:00
qiaozp
7a7ce85acb Fix: wrong endpoint for LoadBalancer type service (#4729)
* Fix: wrong endpoint for LoadBalancer type service

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Fix test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

fix test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix cli test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-09-16 16:41:26 +08:00
Tianxin Dong
cd9ac72531 Chore: update cue version to attr and notification (#4734)
* Chore: update cue version to attr and notification

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

* Fix: docgen test

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

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-09-16 16:28:35 +08:00
Somefive
b898cecf2f Feat: fix empty cluster topology and support select non-control-plane clusters (#4731)
* Feat: fix empty cluster selector topology and support select non-control-plane clusters

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

* Fix: panic bug for list clusters

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

* Fix: test

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

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-09-15 17:32:07 +08:00
Siege Lion
67f1901015 Refactor: rename interfaces and functions in vela top to promote semanticity (#4727)
* Fix: rename two interface name to make the name more specific

1. rename the ResourceListener to ViewListener
2. rename the Component to View

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: update the type of ”Main“ field in component.app

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: rename some functions of pageStack to make the name more readable

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: fix some name

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: add more test case

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: fix time format bug

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: fix test case in cluster_namespace_test.go

Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-09-15 17:10:18 +08:00
Jianbo Sun
43131d88f5 Chore: update test coverage (#4730)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-09-15 13:55:16 +08:00
qiaozp
682c76b8c0 Fix: vela show panic for component markdown format (#4706)
* Fix: vela show panic for component markdown format

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* move code

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-09-14 16:29:25 +08:00
Somefive
ac52f4aba8 Chore: remove manualscaler (#4716)
* chore: remove manualscaler CRD define in apis/

Signed-off-by: arcosx <arcosx@outlook.com>

* chore: remove manualscaler CRDs yaml in charts/

Signed-off-by: arcosx <arcosx@outlook.com>

* chore: remove manual scaler design in design/

Signed-off-by: arcosx <arcosx@outlook.com>

* chore: remove manual scaler code in doc/ hack/ legacy/ references/

Signed-off-by: arcosx <arcosx@outlook.com>

* chore: remove manual scaler code in pkg/ test/ vela-templates/

Signed-off-by: arcosx <arcosx@outlook.com>

* chore: fix some code

Signed-off-by: arcosx <arcosx@outlook.com>

* Chore: remove manualscaler in test

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

* Chore: remove outdated tests

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

* Chore: remove outdated tests

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

Signed-off-by: arcosx <arcosx@outlook.com>
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
Co-authored-by: arcosx <arcosx@outlook.com>
2022-09-14 16:28:09 +08:00
barnettZQG
1adc6d8803 Fix: the workflow records do not delete if the driver is MongoDB (#4718)
* Fix: the workflow records do not delete if the driver is MongoDB

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

* Fix: change the unit test case

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-09-14 13:15:26 +08:00
barnettZQG
86f32574cb Fix: CVE-2022-27664 (#4721)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-09-14 12:08:42 +08:00
yangs
62710f4b01 Fix: fix the sync api script (#4720)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-09-14 11:16:44 +08:00
Tianxin Dong
3a2809f658 Fix: fix config parameter in ql (#4717)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-09-13 20:07:54 +08:00
Siege Lion
dd13caf3c5 Fix: fix the vela system info command can not work (#4713)
Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-09-13 16:18:19 +08:00
Charlie Chiang
c2d6dfe920 Fix: fix uninstallation continues when answer is no (#4709)
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-09-12 21:46:58 +08:00
Somefive
cea9ef5c97 Chore: use functions from kubevela/pkg (#4693)
* Chore: use functions from kubevela/pkg

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

* Chore: rename multiclusterpkg to pkgmulticluster

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

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-09-09 15:10:18 +08:00
Siege Lion
15004d9ad8 Feat: highlight the Yaml text of vela top (#4689)
* Fix: refactor the source of all kinds of views, use the "Factory Method" design patterns to rewrite the code to upgrade the quality of code

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: fix test case of the refactored code and some bugs

Signed-off-by: HanMengnan <1448189829@qq.com>

* Feat: highlight yaml text

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: fix the bug in table stop.

Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-09-09 09:33:04 +08:00
Tianxin Dong
01bf4c5ac4 Feat: add failed state in workflow (#4695)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-09-07 16:23:51 +08:00
qiaozp
fbf25c6ba2 Feat: add nodeport in webservice (#4696)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-09-07 11:33:45 +08:00
qiaozp
d7f57ed122 Feat: request token when vela auth gen-kubeconfig (#4687)
* Feat: request token when vela auth gen-kubeconfig

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* 1.24 test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix test

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix test

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* format

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* more test on 1.24

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* rollback some logic and fix test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-09-05 17:34:51 +08:00
Somefive
19b672846f Chore: remove duplicated feature flags for workflowrun (#4691)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-09-05 16:33:21 +08:00
Nan Li
3b3e7ebb9d Fix: useless log when enabling addon (#4680)
* Fix: useless log when enabling addon

Signed-off-by: loheagn <loheagn@icloud.com>

* lint code

Signed-off-by: loheagn <loheagn@icloud.com>

Signed-off-by: loheagn <loheagn@icloud.com>
2022-09-05 13:27:28 +08:00
wyike
b9cb8fa591 fix enable addon cannot update definition bug (#4684)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-09-02 17:45:09 +08:00
Siege Lion
8df436aa3b Refactor: refactor the source of all kinds of views, use the "Factory Method" design patterns to rewrite the code to upgrade the quality of code (#4679)
* Fix: refactor the source of all kinds of views, use the "Factory Method" design patterns to rewrite the code to upgrade the quality of code

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: fix test case of the refactored code and some bugs

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: rename the interface of ResourceView

Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-09-02 17:29:12 +08:00
Tianxin Dong
239c5474dd Chore: refactor workflow from workflow engine (#4631)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-09-02 12:55:03 +08:00
qiaozp
a3e1c4d5ce Chore: Update CODEOWNERS (#4682) 2022-09-02 11:09:59 +08:00
qiaozp
6d77b9c651 Chore: Add v1.23 to regular CI test (#4673)
* Chore: use higher k8s version in CI

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* 1.23

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* egress-selector-mode=disabled

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* egress-selector-mode=disabled

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* add hub args

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix e2e test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix multicluster test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix multicluster test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* add all egress

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* version matrix

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* cal egress arg

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* regular v1.23 and restict concurency

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-09-01 16:57:13 +08:00
barnettZQG
d1159170d0 Fix: unknown field cluster (#4670)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-31 17:44:23 +08:00
qiaozp
d595a0592f Fix: flaky CI test (#4669) 2022-08-31 16:38:59 +08:00
qiaozp
e3c1e391f9 Chore: Migrate to k3d in CI & trim redundant steps (#4652) 2022-08-31 08:08:37 +08:00
Hair1ossTeenager
b462edeae6 Update definition.go (#4666)
fix bug, use labels to replace annotation
2022-08-30 13:59:25 +08:00
cezhang
bab9534ed8 Feat: vela revision support read the apprevision details in yaml format (#4659)
Signed-off-by: cezhang <c1zhang.dev@gmail.com>

make reviewable

fix errors

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

fix error

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

fix error

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

fix errors

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

fix errors

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

Signed-off-by: cezhang <c1zhang.dev@gmail.com>
2022-08-30 13:58:47 +08:00
Siege Lion
a393fb03d1 Feat: load the Yaml text of resource in vela top (#4665)
* Fix: fix inconsistent menu hints

Signed-off-by: HanMengnan <1448189829@qq.com>

* Feat: add the feature that a new view of yaml was added and by it the user can load the yaml text of resource

Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-08-30 10:20:10 +08:00
Somefive
5116ef3398 Feat: add controller parameters for apply-once (#4663)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-29 15:35:18 +08:00
47
4e08ece053 Feat: System diagnose (#4662)
* Feat: System Info & Diagnose

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

* Fix:1.misspelling 2.license

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

* Fix: pattern of imported package

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

* Fix: pattern of imported package

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

* Fix:1.return error instead of panic 2.get deployment by label instead of by namespace 3.when getting a single deployment, the result is displayed in multi rows. Feat: 1.the system info command displays the cpu and memory metrics 2.the system info command displays the numbers of ready pods and desired pods.

* Feat: 1.the system info command displays the environment variables

* Fix: Making syntax simple

* Feat(system info):1.ARGS多行展示2.指定名称时无须指定namespace3.优化界面展示,支持原始打印或者以wide/yaml形式打印4.指定名称时,打印更可读信息

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

* Feat:add comment

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

* Fix:syntactic redundancy

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

* Feat:Display all ARGS

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

* Feat:Display all ARGS

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

Add signoff

* Fix:1.return error instead of panic 2.get deployment by label instead of by namespace 3.when getting a single deployment, the result is displayed in multi rows. Feat: 1.the system info command displays the cpu and memory metrics 2.the system info command displays the numbers of ready pods and desired pods.

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

* Feat:System diagnose

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

* Feat:Diagnose cluster-gateway pod's status

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

Signed-off-by: foursevenlove <foursevenlove@gmail.com>
2022-08-29 14:00:15 +08:00
Siege Lion
3531249e1b Feat: add a new resource level view: pod view (#4661)
Pod view is the next level view of managed resource view

Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-08-29 10:30:22 +08:00
47
a4ad1ad40f Feat: System Info & Diagnose (#4657)
* Feat: System Info & Diagnose

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

* Fix:1.misspelling 2.license

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

* Fix: pattern of imported package

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

* Fix: pattern of imported package

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

* Fix:1.return error instead of panic 2.get deployment by label instead of by namespace 3.when getting a single deployment, the result is displayed in multi rows. Feat: 1.the system info command displays the cpu and memory metrics 2.the system info command displays the numbers of ready pods and desired pods.

* Feat: 1.the system info command displays the environment variables

* Fix: Making syntax simple

* Feat(system info):1.ARGS多行展示2.指定名称时无须指定namespace3.优化界面展示,支持原始打印或者以wide/yaml形式打印4.指定名称时,打印更可读信息

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

* Feat:add comment

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

* Fix:syntactic redundancy

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

* Feat:Display all ARGS

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

* Feat:Display all ARGS

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

Add signoff

* Fix:1.return error instead of panic 2.get deployment by label instead of by namespace 3.when getting a single deployment, the result is displayed in multi rows. Feat: 1.the system info command displays the cpu and memory metrics 2.the system info command displays the numbers of ready pods and desired pods.

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

Signed-off-by: foursevenlove <foursevenlove@gmail.com>
2022-08-26 16:51:17 +08:00
Tianxin Dong
20bd1eeec5 Fix: fix notification workflow step (#4656)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-08-25 11:47:02 +08:00
Somefive
514ef4cc42 Feat: add get topology placement in multi-cluster provider (#4636)
* Feat: add get topology placement in multi-cluster provider

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

* Fix: velaql in workflow use auth

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

* Chore: remove ui-hidden & support filter outer

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

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-24 19:24:08 +08:00
Yuedong Wu
68c1da847d fix: add supported but missing provider (#4645)
Signed-off-by: Yuedong Wu <57584831+lunarwhite@users.noreply.github.com>

Signed-off-by: Yuedong Wu <57584831+lunarwhite@users.noreply.github.com>
2022-08-23 21:15:32 +08:00
Tianxin Dong
ea20b6c47d Fix: fix signedKey using platform id (#4634)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-08-23 17:45:47 +08:00
Tianxin Dong
1e87f455e8 Fix: optimize workflow debug cmd (#4638)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-08-23 15:32:50 +08:00
Siege Lion
5a241078b7 Feat: add new system info to system info board and optimize code (#4640)
newly added system info including:
1. Cluster num
2. App running num
3. cpu and mem usage condition of vela-core
4. cpu and mem usage condition of vela-core cluster gateway

Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-08-22 18:00:49 +08:00
qiaozp
36ee590071 Feat: add base resource section for component ref (#4635)
* Feat: add base resource section for component ref

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* read from local

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* beautify

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* format imports

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-08-20 10:26:39 +08:00
Somefive
afb0466bcc Fix: open basic lit fails lookup path (#4632)
* Fix: open basic lit fails lookup path

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

* Fix: test

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

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

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-19 16:51:11 +08:00
Charlie Chiang
309eb2e702 Feat: support zstd compression in resourcetracker (#4630)
* Feat: zstd compression in resourcetracker

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

* Feat: zstd compression in resourcetracker

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

* Chore: add license header

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

* Chore: clearer test

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

* Test: add test

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

* Test: add tests

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

* Chore: add notices

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

* Test: better benchmarks

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

* Test: add gzip to e2e

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

* Revert: revert compression in e2e test

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

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-08-18 16:18:56 +08:00
qiaozp
924d55381e Feat: component replication (#4449) 2022-08-17 14:04:57 +08:00
qiaozp
bcb3550025 Fix: up command example (#4626)
* Fix: up command example

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* typo

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-08-17 11:33:12 +08:00
Somefive
8c6d97809b Feat: support compression in ResourceTracker (#4613)
* Feat: support compression in ResourceTracker

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

* Feat: add test & chart values

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

* Chore: refactor comments and feature name

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

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-16 18:00:53 +08:00
Somefive
b9ab50ea93 Fix: skipGC remove labels for multi-cluster resource not use correct ctx (#4616)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-15 10:57:38 +08:00
Siege Lion
2e18eaa3b2 Feat: add filtering features to the Application view and K8S object view of vela top (#4612)
* Feat: when `vela top` launch, can specify the namespace of the presentation application

Signed-off-by: HanMengnan <1448189829@qq.com>

* Feat: add filtering function to the k8s object view of the `vela top` command, which can be filtered by cluster and cluster namespace

Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-08-15 10:36:12 +08:00
barnettZQG
72591788a6 Fix: the create time of the synced policies is zero (#4604)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-12 14:37:39 +08:00
Somefive
ad6f07297c Feat: align resource selector across policies (#4595)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-12 10:45:36 +08:00
barnettZQG
c0249c5cc3 Fix: remove the ui-hidden label and the grafana traits (#4606)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-11 17:24:04 +08:00
Charlie Chiang
be0914f839 Chore: update backport bot os (#4590)
* Chore: update backport bot os

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

* go with the latest version

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

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-08-11 14:53:06 +08:00
wyike
14d3b676ec add rc test (#4600)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-08-11 14:52:43 +08:00
Somefive
d7919110cd Feat: support use update instead of patch for apply (#4592)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-10 21:30:43 +08:00
wyike
e63377092a Fix: try to fix addon flaky test (#4593)
* only for test

test

show info

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

try to fix e2e-test

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

try to fix test

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

* fix comments

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-08-10 19:44:21 +08:00
Tianxin Dong
436ff916b6 Fix: fix writing logs to file (#4587)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-08-09 23:30:23 +08:00
Zhiyu Wang
beabd4faf8 Fix: addon dependency 1.1 legacy support (#4585)
Signed-off-by: Zhiyu Wang <cloudsky.newbis@gmail.com>
2022-08-09 20:23:32 +08:00
Somefive
f23e2a8442 Fix: gc resources without resourceversion (#4583)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-09 19:20:31 +08:00
Somefive
aa1f090fb6 Fix: add status code for cue struct (#4580)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-09 15:19:32 +08:00
Siege Lion
4d3ef75601 Feat: Add a new CLI command: vela top which can display system information and resource status in UI form (#4556)
* Feat: UI sketch init

Signed-off-by: HanMengnan <1448189829@qq.com>

* Feat: Resource data load finish

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: optimize code struct

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: add test case and fix some bugs
1. add test case to package model
2. fix a bug of ListClusters
3. optimize code structure

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: fix go.mod package version

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: fix some bugs and optimize code structure

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: fix irregular code and add comments

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: supplement test cases and fix bugs

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: move the `vela status --ui` command out and add it as a new command `vela top`

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: fix package import sequence and go.mod

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: add copyright header

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: update description and example of command `vela top`

Signed-off-by: HanMengnan <1448189829@qq.com>

* Fix: convert color variables to const variables

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-08-09 10:56:22 +08:00
Tianxin Dong
c3ca308489 Chore: update cue version to 0.4.3 (#4425)
* Chore: update cue version to 0.4.3

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

* resolve some comments

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

* fix lint

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

* add more tests

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

* rebase and add more tests

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

* resolve comments

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-08-08 17:57:48 +08:00
Somefive
22553d73e5 Feat: deprecated envbinding (#4576)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-08 16:15:58 +08:00
yangs
148feeb4fd Feat: definition support controller requirement (#4573)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-08-08 16:05:31 +08:00
Somefive
a2acd06ab1 Docs: add description for shared-resource (#4572)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-08 12:04:09 +08:00
Yan Xiaodong
ad879dadfb Fix: Vela CLI 纳管集群后,无法通过APi接口对该集群创建namespace #4421 (#4507)
* Fix: Vela CLI 纳管集群后,无法通过APi接口对该集群创建namespace #4421

Signed-off-by: yanxiaodong <yanxd0818@cmbchina.com>

* Fix: Vela CLI 纳管集群后,无法通过APi接口对该集群创建namespace #4421

Signed-off-by: yanxiaodong <yanxd0818@cmbchina.com>
2022-08-08 12:02:25 +08:00
Somefive
0b03f99765 Fix: remove multicluster app test for apply-in-order for addon (#4554)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-08 11:56:44 +08:00
wyike
db26a037f3 Fix: fix addon bond component annotaion (#4571)
* fix miss spell annotation

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

* add comments

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

* fix golint

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-08-08 11:49:48 +08:00
Charlie Chiang
2d8cb1278c Fix: reject applications with empty policy properties (#4563)
* Fix: reject applications with empty policies

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

* Style: change err msg

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

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

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

* Test: fix tests

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-08-05 15:03:52 +08:00
qiaozp
fcafbef8c5 Fix: vela CLI provider compatibility (#4561)
* Fix: vela CLI provider compatibility

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* List interface won't return NotFoundError

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* format imports

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-08-05 14:05:23 +08:00
Somefive
6fbbdc97ca Fix: typo in load-test readme (#4560)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-04 17:27:41 +08:00
Somefive
9fae4df34e Fix: compare resource without version (#4559)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-04 17:26:31 +08:00
Somefive
afc1d425d7 Feat: ignore control check for resource without resource version (#4553)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-04 15:27:25 +08:00
Jianbo Sun
fce66879e7 Chore: fix cli description to remove html tag format (#4550)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-08-03 19:18:57 +08:00
barnettZQG
bb67ecaecf Fix: remove the cloudshell dockerfile (#4546)
* Fix: remove the cloudshell dockerfile

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

* Fix: change the configmap name

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

* Fix: change the way to get the namespace

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-03 15:49:40 +08:00
ghostloda
ccb122d4a7 Feat: report the manifest name when addon enabling failed (#4545)
* Feat: Report the manifest name when Addon enabling failed

Signed-off-by: ghostloda <78798447@qq.com>

* Apply suggestions from code review

Co-authored-by: Jianbo Sun <wonderflow@icloud.com>
Signed-off-by: ghostloda <78798447@qq.com>

* Apply suggestions from code review

Co-authored-by: Charlie Chiang <charlie_c_0129@outlook.com>
Signed-off-by: ghostloda <78798447@qq.com>

Co-authored-by: Jianbo Sun <wonderflow@icloud.com>
Co-authored-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-08-03 13:51:20 +08:00
qiaozp
7964ec90e4 Fix: sidecar trait (#4541)
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-08-02 23:08:44 +08:00
barnettZQG
5e7135f00d Fix: upgrade the cloudshell image (#4538)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-02 22:17:54 +08:00
wyike
258d816184 Feat: Check def binding to a component (#4531)
* finish logic

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

* finish tests

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

small fix

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

fix ci

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

* fix comments

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

fix ci

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

* fix test

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

* fix tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-08-02 21:36:58 +08:00
Somefive
53e5a3ff2d Feat: support change resource gc policy from onAppUpdate to Never (#4530)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-02 20:17:47 +08:00
qiaozp
233fe5e7a7 Fix: publish chart version (#4535)
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-08-02 20:12:22 +08:00
qiaozp
b4c65441c9 Chore: update chart-publishing, only push index and new charts (#4529)
* Chore: update chart-publishing, only push index and new charts

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-08-02 19:28:11 +08:00
Somefive
73f983e61e Fix: storage patch env (#4523)
* Fix: empty health policy do not check object existence

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

* Fix: fix health check error

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

* Fix: app use storage and env trait

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-02 19:17:16 +08:00
barnettZQG
c8a16adfe8 Feat: add the daemonset resource rule for building the tree (#4525)
* Feat: add the daemonset resource policy for building the tree

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

* Fix: the import package

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

* Fix: the unit test case

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

* Fix: change some function and variable names

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-02 19:12:54 +08:00
Arena.Su
d300d1b2d7 Feat: add http status and code from http cmd run (#4516)
* Feat: add http status and code from http cmd run

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

* Feat: fix unit test error

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

* Feat: status is not necessary

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

* Feat: make reviewable

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

* Feat: add unit test

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

* Feat: make reviewable

Signed-off-by: suxiang <704427617@qq.com>
2022-08-02 16:16:10 +08:00
wyike
1053501df1 Fix: fix e2e flaky tests (#4521)
* try to show

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

test

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

fix e2e tests

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

add mock server back

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

fix flaky tests

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

fix tests

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

fix e2e-test

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

only for tests

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

fix

* only for tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-08-02 15:16:42 +08:00
Somefive
aaf3f14fee Fix: empty health policy do not check object existence (#4496)
* Fix: empty health policy do not check object existence

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

* Fix: fix health check error

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

* Fix: add test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-08-02 10:56:37 +08:00
barnettZQG
8dfc8e35a6 Fix: can not find the resource when the resource namespace is diffrent with application (#4517)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-01 22:41:41 +08:00
barnettZQG
976d683185 Feat: refactor CLI commands related to resources (#4500)
* Feat: refactor CLI commands related to resources

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

* Fix: remove the old test case.

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

* Fix: e2e test

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

* Fix: optimize test cases

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

* Feat: rename 'vela pods' to 'vela status --pod'

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

* Feat: optimize the e2e test case

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

* Fix: sort the objects

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

* Fix: optimize the e2e test case

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

* Fix: list the pod by the labels

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

* Fix: order the tree resource

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

* Fix: set multicluster config

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-01 19:44:27 +08:00
barnettZQG
b05d3bb066 Fix: there is no color in the diff report (#4511)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-01 18:26:38 +08:00
Zhiyu Wang
f7d3fbaeca Fix: missing return when token is null (#4512)
Signed-off-by: Zhiyu Wang <cloudsky.newbis@gmail.com>
2022-08-01 16:02:18 +08:00
codinghuang
f1790e5e6b Feat: support set labels for env (#4422)
* Feat: support set labels for env

Signed-off-by: codinghuang <codinghuang@qq.com>

* Refactor: Remove util.ParseLabelString

use k8s.io/apimachinery/pkg/labels

Signed-off-by: codinghuang <codinghuang@qq.com>
2022-07-29 19:14:05 +08:00
barnettZQG
4334c4c195 Fix: failed to assign the default role for the users who log in from dex (#4491)
* Fix: failed to assign the default role for the users who log in from dex

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

* Fix: cluster e2e test case

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

* Fix: the ensure namespace error is ignored

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-29 17:17:43 +08:00
barnettZQG
c6ae772cc1 Fix: CloudShell read-only authorization is not automatically revoked (#4495)
* Fix: CloudShell read-only authorization is not automatically revoked

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

* Fix: code style

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

* Fix: rename the prefix

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-29 16:42:24 +08:00
wyike
c372578e59 Fix: check definition of addon whether is conflict (#4493)
* fix checksemver

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

override defs

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

add tests

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

* add test and fix some special cases

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

fix checkdiff

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

fix flags

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

* fix comments

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

* small fix

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-07-29 16:42:16 +08:00
47
8a82ac6277 Feat: System Info & Diagnose (#4379)
* Feat: System Info & Diagnose

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

* Fix:1.misspelling 2.license

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

* Fix: pattern of imported package

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

* Fix: pattern of imported package

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

* Fix:1.return error instead of panic 2.get deployment by label instead of by namespace 3.when getting a single deployment, the result is displayed in multi rows. Feat: 1.the system info command displays the cpu and memory metrics 2.the system info command displays the numbers of ready pods and desired pods.

* Feat: 1.the system info command displays the environment variables

* Fix: Making syntax simple
2022-07-29 13:47:35 +08:00
qiaozp
7cdaa09660 Chore: organize appliesToWorkloads field of trait defs, add doc example (#4483)
* Chore: organize appliesToWorkloads field of trait defs, add doc example

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix gen

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* add deprecate label

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix script to read all definition in directory

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* add comment

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* go.mod

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* update some usage, better trait doc gen

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* minor fix

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* minor fix

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* postpone markdown escape pipe char

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-07-29 11:20:55 +08:00
忘尘
20877f7946 Fix: repeat query configuration type (#4492)
Signed-off-by: ghostloda <78798447@qq.com>
2022-07-28 14:11:32 +08:00
Arena.Su
b95980a92b Feat: delete multi apps from vela delete cli command (#4484)
Signed-off-by: suxiang <704427617@qq.com>
2022-07-27 18:58:21 +08:00
Jianbo Sun
4283a0caef Chore: update code owner (#4482)
* Chore: update code owner

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

* Chore: update code owner

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-27 17:24:50 +08:00
Somefive
1fcb6395db Fix: rename pressure-test to load-test (#4481)
* Fix: rename pressure-test to load-test

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

* Chore: rename in texts

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-27 11:48:52 +08:00
Charlie Chiang
edc6d9c551 Fix: address vela-core crash due to empty policy properties (#4473)
* 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>
2022-07-27 08:45:01 +08:00
Charlie Chiang
feede077f6 Feat: show warnings about internal addon rendering logic (#4472)
* Feat: show warnings about addon rendering logic

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

* Feat: update vela init to not show warnings

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

* Refactor: use setter

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

* fix check-diff

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-07-26 23:35:50 +08:00
yangs
cfda756e0f Fix: fix logs to record the right publish version (#4471)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-07-26 23:33:18 +08:00
Jianbo Sun
932553ac83 Chore: refactor addon enable with package (#4467)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-26 15:22:37 +08:00
Jianbo Sun
24c6514874 Fix: docker file fail to build for vela cli (#4464)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-25 22:44:26 +08:00
Arena.Su
70eb639ba7 Feat: delete svc flag from vela delete cli cmd (#4448)
Signed-off-by: suxiang <704427617@qq.com>
2022-07-25 22:17:07 +08:00
yangs
c2a4169e6d Fix: The apply failure error is ignored when the workflow is executed (#4455)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-07-25 22:16:24 +08:00
Jianbo Sun
8fd47ef5b9 Feat: support vela addon enable with package (#4443)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-25 22:15:59 +08:00
Somefive
e595879da9 Feat: add featuregates to disallow url in ref-objects (#4446)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-25 22:03:10 +08:00
wyike
c68061bca7 Feat: support outputs for addon (#4444)
* support outputs for addon

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>
2022-07-25 21:32:32 +08:00
Charlie Chiang
bb8f4e426a Feat: make addon init use the latest CUE addon template (#4434)
* Feat: make addon init use the latest CUE addon template

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

* Refactor: simplify init cmd

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

* Feat: ignore metadata

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

* Feat: remove status

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

* do not marshal to application

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

* Feat: only look for output field

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

* Feat: use global constant

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

* Test: update tests according to changes

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-07-25 21:32:01 +08:00
barnettZQG
89037b2123 Feat: support to query the alias of the project member (#4441)
* Feat: support to query the alias of the project member

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

* Fix: optimize the e2e test case

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-25 21:28:35 +08:00
Jianbo Sun
4814bce594 Feat: adapt vela port-forward with the velaql (#4439)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-25 21:27:31 +08:00
barnettZQG
26234f5ebf Fix: the history applications are repeatedly synchronized (#4447)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-25 21:25:33 +08:00
Jianbo Sun
6a9064b823 Revert "Chore: upgrade kind in tests, fix flaky test (#4105)" (#4450)
This reverts commit 8aaf526877.
2022-07-25 19:07:46 +08:00
Charlie Chiang
572fba3539 Fix: address failure when rendering addon API schemas (#4433)
* Fix: address failure when rendering addon API schemas

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

* Fix: address failure when rendering addon API schemas

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

* Test: add tests

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

* Test: fix tests

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

* Test: fix tests

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-07-25 17:00:57 +08:00
barnettZQG
73627b8d54 Fix: support to test authentication with dex (#4429)
* Fix: support to test login with dex

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

* Fix: support to update the user when the login mode is dex

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

* Fix: systemInfoService is nil

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-25 15:26:47 +08:00
barnettZQG
e2031c1a7f Feat: support to init the roles of the user who login by dex (#4431)
* Feat: support to init the roles of the user which login by dex

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

* Fix: add the comment

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

* Fix: make the sub string to lower

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-25 11:13:04 +08:00
Jianbo Sun
cae4aa4a76 Chore: update description of policy/workflowstep definition (#4428)
* Chore: update description of policy definition

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

* Fix: support workflow step generation for doc

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

* Chore: refactor package refereces/plugins to references/docgen

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

* Chore: add examples of def docs for workflow step

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

* Feat: refine workflow description

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

* Chore: refine the workflow step definition

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

* Chore: update workflow step definition

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-25 10:34:26 +08:00
ivyilike
3e57246740 Feat: support vela def apply for directory (#4142)
Co-authored-by: ivyilike <pww123@cmbchina.com>

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

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-24 16:34:13 +08:00
qiaozp
573f60170c Feat: trim redundant makefile denpendency (#4426)
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-07-23 14:02:50 +08:00
1040 changed files with 41570 additions and 35036 deletions

33
.github/CODEOWNERS vendored
View File

@@ -1,7 +1,13 @@
# This file is a github code protect rule follow the codeowners https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners#example-of-a-codeowners-file
* @barnettZQG @wonderflow @leejanee @Somefive
design/ @barnettZQG @leejanee @wonderflow @Somefive
* @barnettZQG @wonderflow @leejanee @Somefive @jefree-cat
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
# Owner of CUE
pkg/cue @leejanee @FogDong @Somefive
@@ -11,26 +17,21 @@ pkg/stdlib @leejanee @FogDong @Somefive
pkg/workflow @leejanee @FogDong @Somefive
# Owner of rollout
pkg/controller/common/rollout/ @wangyikewxgm @wonderflow
pkg/controller/core.oam.dev/v1alpha2/applicationrollout @wangyikewxgm @wonderflow
pkg/controller/standard.oam.dev/v1alpha1/rollout @wangyikewxgm @wonderflow
runtime/rollout @wangyikewxgm @wonderflow
# Owner of definition controller
pkg/controller/core.oam.dev/v1alpha2/core/workflow/workflowstepdefinition @yangsoon @Somefive @FogDong
pkg/controller/core.oam.dev/v1alpha2/core/policies/policydefinition @yangsoon @Somefive @FogDong
pkg/controller/core.oam.dev/v1alpha2/core/components/componentdefinition @yangsoon @zzxwill @Somefive
pkg/controller/core.oam.dev/v1alpha2/core/traits/traitdefinition @yangsoon @zzxwill @Somefive
# Owner of health scope controller
pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope @captainroy-hy @zzxwill @yangsoon
pkg/controller/common/rollout/ @wangyikewxgm @wonderflow
runtime/rollout @wangyikewxgm @wonderflow
# Owner of vela templates
vela-templates/ @Somefive @barnettZQG @wonderflow
# Owner of vela CLI
references/cli/ @Somefive @zzxwill @StevenLeiZhang
references/cli/ @Somefive @zzxwill @StevenLeiZhang @charlie0129 @chivalryq
# Owner of vela APIServer
pkg/apiserver/ @barnettZQG @yangsoon @FogDong
# Owner of vela addon framework
pkg/addon/ @wangyikewxgm @wonderflow @charlie0129
# Owner of resource keeper and tracker
pkg/resourcekeeper @Somefive @FogDong
pkg/resourcetracker @Somefive @FogDong

View File

@@ -17,11 +17,10 @@ on:
env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.14.0'
KIND_IMAGE_VERSION: '[\"v1.20.15\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.15\",\"v1.22.9\"]'
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
K3D_IMAGE_VERSION: '[\"v1.20\",\"v1.24\"]'
K3D_IMAGE_VERSIONS: '[\"v1.20\",\"v1.24\"]'
jobs:
@@ -48,9 +47,9 @@ jobs:
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "pushing tag: ${{ github.ref_name }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSIONS }}"
else
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSION }}"
fi
apiserver-unit-tests:
@@ -111,6 +110,9 @@ jobs:
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
@@ -128,41 +130,58 @@ jobs:
run: |
go get -v -t -d ./...
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
- name: Tear down K3d if exist
run: |
k3d cluster delete || true
k3d cluster delete worker || true
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Setup K3d (Hub)
uses: nolar/setup-k3d-k3s@v1.0.8
with:
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
- name: Setup Kind Cluster (Worker)
- name: Setup K3d (Worker)
uses: nolar/setup-k3d-k3s@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)
run: |
kind delete cluster --name worker
kind create cluster --image kindest/node:${{ matrix.k8s-version }} --name worker
kubectl version
kubectl cluster-info
kind get kubeconfig --name worker --internal > /tmp/worker.kubeconfig
kind get kubeconfig --name worker > /tmp/worker.client.kubeconfig
internal_ip=$(docker network inspect k3d-k3s-default|jq ".[0].Containers"| jq -r '.[]| select(.Name=="k3d-worker-server-0")|.IPv4Address' | cut -d/ -f1)
k3d kubeconfig get worker > /tmp/worker.client.kubeconfig
cp /tmp/worker.client.kubeconfig /tmp/worker.kubeconfig
sed -i "s/0.0.0.0:[0-9]\+/$internal_ip:6443/" /tmp/worker.kubeconfig
- name: Setup Kind Cluster (Hub)
run: |
kind delete cluster
kind create cluster --image kindest/node:${{ matrix.k8s-version }}
kubectl version
kubectl cluster-info
- name: Load Image to kind cluster
run: make kind-load
- name: Load image to k3d cluster
run: make image-load
- name: Cleanup for e2e tests
run: |
make e2e-cleanup
make vela-cli
make e2e-cleanup
make e2e-setup-core
bin/vela addon enable fluxcd
bin/vela addon enable vela-workflow
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: |

View File

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

View File

@@ -15,11 +15,10 @@ on:
env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.14.0'
KIND_IMAGE_VERSION: '[\"v1.20.15\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.15\",\"v1.22.9\"]'
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
K3D_IMAGE_VERSION: '[\"v1.20\",\"v1.24\"]'
K3D_IMAGE_VERSIONS: '[\"v1.20\",\"v1.24\"]'
jobs:
@@ -46,9 +45,9 @@ jobs:
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "pushing tag: ${{ github.ref_name }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSIONS }}"
else
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSION }}"
fi
@@ -59,6 +58,9 @@ jobs:
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:
@@ -74,37 +76,49 @@ jobs:
run: |
go get -v -t -d ./...
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
- name: Tear down K3d if exist
run: |
k3d cluster delete || true
k3d cluster delete worker || true
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Setup K3d (Hub)
uses: nolar/setup-k3d-k3s@v1.0.8
with:
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
- name: Setup Kind Cluster (Worker)
- name: Setup K3d (Worker)
uses: nolar/setup-k3d-k3s@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
run: |
kind delete cluster --name worker
kind create cluster --image kindest/node:${{ matrix.k8s-version }} --name worker
kubectl version
kubectl cluster-info
kind get kubeconfig --name worker --internal > /tmp/worker.kubeconfig
kind get kubeconfig --name worker > /tmp/worker.client.kubeconfig
internal_ip=$(docker network inspect k3d-k3s-default|jq ".[0].Containers"| jq -r '.[]| select(.Name=="k3d-worker-server-0")|.IPv4Address' | cut -d/ -f1)
k3d kubeconfig get worker > /tmp/worker.client.kubeconfig
cp /tmp/worker.client.kubeconfig /tmp/worker.kubeconfig
sed -i "s/0.0.0.0:[0-9]\+/$internal_ip:6443/" /tmp/worker.kubeconfig
- name: Setup Kind Cluster (Hub)
run: |
kind delete cluster
kind create cluster --image kindest/node:${{ matrix.k8s-version }}
kubectl version
kubectl cluster-info
- name: Load Image to kind cluster (Hub)
run: make kind-load
- name: Load image to k3d cluster (hub and worker)
run: make image-load image-load-runtime-cluster
- name: Cleanup for e2e tests
run: |
make e2e-cleanup
make vela-cli
make e2e-cleanup
make e2e-setup-core-auth
make
make setup-runtime-e2e-cluster
- name: Run e2e multicluster tests

View File

@@ -15,11 +15,10 @@ on:
env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.14.0'
KIND_IMAGE_VERSION: '[\"v1.20.15\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.15\",\"v1.22.9\"]'
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
K3D_IMAGE_VERSION: '[\"v1.20\",\"v1.24\"]'
K3D_IMAGE_VERSIONS: '[\"v1.20\",\"v1.24\"]'
jobs:
@@ -46,9 +45,9 @@ jobs:
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "pushing tag: ${{ github.ref_name }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSIONS }}"
else
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSION }}"
fi
e2e-rollout-tests:
@@ -58,6 +57,10 @@ jobs:
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
@@ -72,33 +75,35 @@ jobs:
run: |
go get -v -t -d ./...
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
- name: Setup Kind Cluster
- name: Tear down K3d if exist
run: |
kind delete cluster
kind create cluster --image kindest/node:${{ matrix.k8s-version }}
kubectl version
kubectl cluster-info
k3d cluster delete || true
k3d cluster delete worker || true
- name: Load Image to kind cluster
run: make kind-load
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Run Make
run: make
- name: Setup K3d
uses: nolar/setup-k3d-k3s@v1.0.8
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
- name: Run Make Manager
run: make manager
- name: Load image to k3d cluster
run: make image-load image-load-runtime-cluster
- name: Prepare for e2e tests
run: |
make vela-cli
make e2e-cleanup
make e2e-setup
helm lint ./charts/vela-core
make e2e-setup-core
make setup-runtime-e2e-cluster
helm test -n vela-system kubevela --timeout 5m
- name: Run e2e tests

View File

@@ -15,11 +15,10 @@ on:
env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.14.0'
KIND_IMAGE_VERSION: '[\"v1.20.15\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.15\",\"v1.22.9\"]'
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
K3D_IMAGE_VERSION: '[\"v1.20\",\"v1.24\"]'
K3D_IMAGE_VERSIONS: '[\"v1.20\",\"v1.24\"]'
jobs:
@@ -46,9 +45,9 @@ jobs:
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "pushing tag: ${{ github.ref_name }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSIONS }}"
else
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
echo "::set-output name=matrix::${{ env.K3D_IMAGE_VERSION }}"
fi
e2e-tests:
@@ -58,6 +57,10 @@ jobs:
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
@@ -72,33 +75,36 @@ jobs:
run: |
go get -v -t -d ./...
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
- name: Setup Kind Cluster
- name: Tear down K3d if exist
run: |
kind delete cluster
kind create cluster --image kindest/node:${{ matrix.k8s-version }}
kubectl version
kubectl cluster-info
k3d cluster delete || true
k3d cluster delete worker || true
- name: Load Image to kind cluster
run: make kind-load
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Setup K3d
uses: nolar/setup-k3d-k3s@v1.0.8
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
- name: Load image to k3d cluster
run: make image-load
- name: Run Make
run: make
- name: Run Make Manager
run: make manager
- name: Prepare for e2e tests
run: |
make e2e-cleanup
make e2e-setup
helm lint ./charts/vela-core
make e2e-setup-core
helm test -n vela-system kubevela --timeout 5m
- name: Run api e2e tests

View File

@@ -13,9 +13,8 @@ on:
env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.14.0'
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
jobs:
@@ -57,7 +56,7 @@ jobs:
restore-keys: ${{ runner.os }}-pkg-
- name: Install StaticCheck
run: GO111MODULE=on go get honnef.co/go/tools/cmd/staticcheck@v0.3.0
run: go install honnef.co/go/tools/cmd/staticcheck@2022.1
- name: Static Check
run: staticcheck ./...
@@ -118,6 +117,9 @@ 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:
@@ -132,7 +134,10 @@ jobs:
run: make cross-build
- name: Check Diff
run: make 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
- name: Cleanup binary
run: make build-cleanup

View File

@@ -30,7 +30,7 @@ jobs:
configPath: issue-commands
backport:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
if: github.event.issue.pull_request && contains(github.event.comment.body, '/backport')
steps:
- name: Extract Command
@@ -65,11 +65,11 @@ jobs:
})
console.log("Added '" + label + "' label.")
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Open Backport PR
uses: zeebe-io/backport-action@v0.0.6
uses: zeebe-io/backport-action@v0.0.8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}

View File

@@ -167,25 +167,6 @@ jobs:
docker.io/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository_owner }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
- uses: docker/build-push-action@v2
name: Build & Pushing CloudShell for Dockerhub, GHCR and ACR
with:
context: .
file: Dockerfile.cloudshell
labels: |-
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
build-args: |
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
GOPROXY=https://proxy.golang.org
tags: |-
docker.io/oamdev/cloudshell:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository_owner }}/oamdev/cloudshell:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/cloudshell:${{ steps.get_version.outputs.VERSION }}
publish-capabilities:
env:

View File

@@ -31,7 +31,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.19
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.2.2
@@ -150,11 +150,15 @@ 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.17'
GOLANGCI_VERSION: 'v1.38'
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
with:
go-version: ${{ env.GO_VERSION }}
id: go

View File

@@ -13,9 +13,8 @@ on:
env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.14.0'
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
jobs:
@@ -61,10 +60,11 @@ jobs:
run: |
sudo apt-get install -y golang-ginkgo-dev
- name: Setup Kind Cluster
uses: engineerd/setup-kind@v0.5.0
- name: Setup K3d
uses: nolar/setup-k3d-k3s@v1.0.8
with:
version: ${{ env.KIND_VERSION }}
version: v1.20
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@v1.2

3
.gitignore vendored
View File

@@ -1,4 +1,4 @@
# Binaries for programs and plugins
# Binaries for programs and docgen
*.exe
*.exe~
*.dll
@@ -33,6 +33,7 @@ vendor/
# Vscode files
.vscode
.history
pkg/test/vela
config/crd/bases

View File

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

View File

@@ -1,6 +1,6 @@
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine 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.17-alpine as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-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.17-alpine as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-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} /vela
ENTRYPOINT ["/vela"]
COPY --from=builder /workspace/vela-${TARGETARCH} /bin/vela
ENTRYPOINT ["/bin/vela"]

View File

@@ -1,31 +0,0 @@
ARG BASE_IMAGE
# Build the cli binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
ARG GOPROXY
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
COPY apis/ apis/
COPY pkg/ pkg/
COPY version/ version/
COPY references/ references/
# Build
ARG VERSION
ARG GITVERSION
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
-o vela ./references/cmd/cli/main.go
FROM ghcr.io/cloudtty/cloudshell:v0.2.0
RUN apt-get install -y vim
ENV API_TOKEN_PATH=/usr/local/kubeconfig/token
COPY --from=builder /workspace/vela /usr/local/bin/vela

View File

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

View File

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

View File

@@ -26,6 +26,8 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
"github.com/oam-dev/kubevela/pkg/oam"
@@ -201,6 +203,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
@@ -245,6 +249,12 @@ type ApplicationComponentStatus struct {
Scopes []corev1.ObjectReference `json:"scopes,omitempty"`
}
// Equal check if two ApplicationComponentStatus are equal
func (in ApplicationComponentStatus) Equal(r ApplicationComponentStatus) bool {
return in.Name == r.Name && in.Namespace == r.Namespace &&
in.Cluster == r.Cluster && in.Env == r.Env
}
// ApplicationTraitStatus records the trait health status
type ApplicationTraitStatus struct {
Type string `json:"type"`
@@ -268,33 +278,6 @@ type RawComponent struct {
Raw runtime.RawExtension `json:"raw"`
}
// StepStatus record the base status of workflow step, which could be workflow step or subStep
type StepStatus struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Phase WorkflowStepPhase `json:"phase,omitempty"`
// A human readable message indicating details about why the workflowStep is in this state.
Message string `json:"message,omitempty"`
// A brief CamelCase message indicating details about why the workflowStep is in this state.
Reason string `json:"reason,omitempty"`
// FirstExecuteTime is the first time this step execution.
FirstExecuteTime metav1.Time `json:"firstExecuteTime,omitempty"`
// LastExecuteTime is the last time this step execution.
LastExecuteTime metav1.Time `json:"lastExecuteTime,omitempty"`
}
// WorkflowStepStatus record the status of a workflow step, include step status and subStep status
type WorkflowStepStatus struct {
StepStatus `json:",inline"`
SubStepsStatus []WorkflowSubStepStatus `json:"subSteps,omitempty"`
}
// WorkflowSubStepStatus record the status of a workflow subStep
type WorkflowSubStepStatus struct {
StepStatus `json:",inline"`
}
// AppStatus defines the observed state of Application
type AppStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
@@ -324,10 +307,12 @@ type AppStatus struct {
AppliedResources []ClusterObjectReference `json:"appliedResources,omitempty"`
// PolicyStatus records the status of policy
// Deprecated This field is only used by EnvBinding Policy which is deprecated.
PolicyStatus []PolicyStatus `json:"policy,omitempty"`
}
// PolicyStatus records the status of policy
// Deprecated
type PolicyStatus struct {
Name string `json:"name"`
Type string `json:"type"`
@@ -335,95 +320,26 @@ type PolicyStatus struct {
Status *runtime.RawExtension `json:"status,omitempty"`
}
// WorkflowStep defines how to execute a workflow step.
type WorkflowStep struct {
// Name is the unique name of the workflow step.
Name string `json:"name"`
Type string `json:"type"`
Meta *WorkflowStepMeta `json:"meta,omitempty"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties *runtime.RawExtension `json:"properties,omitempty"`
SubSteps []WorkflowSubStep `json:"subSteps,omitempty"`
If string `json:"if,omitempty"`
Timeout string `json:"timeout,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs StepInputs `json:"inputs,omitempty"`
Outputs StepOutputs `json:"outputs,omitempty"`
}
// WorkflowStepMeta contains the meta data of a workflow step
type WorkflowStepMeta struct {
Alias string `json:"alias,omitempty"`
}
// WorkflowSubStep defines how to execute a workflow subStep.
type WorkflowSubStep struct {
// Name is the unique name of the workflow step.
Name string `json:"name"`
Type string `json:"type"`
Meta *WorkflowStepMeta `json:"meta,omitempty"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties *runtime.RawExtension `json:"properties,omitempty"`
If string `json:"if,omitempty"`
Timeout string `json:"timeout,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs StepInputs `json:"inputs,omitempty"`
Outputs StepOutputs `json:"outputs,omitempty"`
}
// WorkflowStatus record the status of workflow
type WorkflowStatus struct {
AppRevision string `json:"appRevision,omitempty"`
Mode WorkflowMode `json:"mode"`
Message string `json:"message,omitempty"`
AppRevision string `json:"appRevision,omitempty"`
Mode string `json:"mode"`
Phase workflowv1alpha1.WorkflowRunPhase `json:"status,omitempty"`
Message string `json:"message,omitempty"`
Suspend bool `json:"suspend"`
SuspendState string `json:"suspendState,omitempty"`
Suspend bool `json:"suspend"`
Terminated bool `json:"terminated"`
Finished bool `json:"finished"`
ContextBackend *corev1.ObjectReference `json:"contextBackend,omitempty"`
Steps []WorkflowStepStatus `json:"steps,omitempty"`
ContextBackend *corev1.ObjectReference `json:"contextBackend,omitempty"`
Steps []workflowv1alpha1.WorkflowStepStatus `json:"steps,omitempty"`
StartTime metav1.Time `json:"startTime,omitempty"`
EndTime metav1.Time `json:"endTime,omitempty"`
}
// WorkflowStepPhase describes the phase of a workflow step.
type WorkflowStepPhase string
const (
// WorkflowStepPhaseSucceeded will make the controller run the next step.
WorkflowStepPhaseSucceeded WorkflowStepPhase = "succeeded"
// WorkflowStepPhaseFailed will report error in `message`.
WorkflowStepPhaseFailed WorkflowStepPhase = "failed"
// WorkflowStepPhaseSkipped will make the controller skip the step.
WorkflowStepPhaseSkipped WorkflowStepPhase = "skipped"
// WorkflowStepPhaseStopped will make the controller stop the workflow.
WorkflowStepPhaseStopped WorkflowStepPhase = "stopped"
// WorkflowStepPhaseRunning will make the controller continue the workflow.
WorkflowStepPhaseRunning WorkflowStepPhase = "running"
// WorkflowStepPhasePending will make the controller wait for the step to run.
WorkflowStepPhasePending WorkflowStepPhase = "pending"
)
// DefinitionType describes the type of DefinitionRevision.
// +kubebuilder:validation:Enum=Component;Trait;Policy;WorkflowStep
type DefinitionType string
@@ -442,16 +358,6 @@ const (
WorkflowStepType DefinitionType = "WorkflowStep"
)
// WorkflowMode describes the mode of workflow
type WorkflowMode string
const (
// WorkflowModeDAG describes the DAG mode of workflow
WorkflowModeDAG WorkflowMode = "DAG"
// WorkflowModeStep describes the step by step mode of workflow
WorkflowModeStep WorkflowMode = "StepByStep"
)
// AppRolloutStatus defines the observed state of AppRollout
type AppRolloutStatus struct {
v1alpha1.RolloutStatus `json:",inline"`
@@ -481,9 +387,9 @@ type ApplicationComponent struct {
// +kubebuilder:pruning:PreserveUnknownFields
Properties *runtime.RawExtension `json:"properties,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs StepInputs `json:"inputs,omitempty"`
Outputs StepOutputs `json:"outputs,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs workflowv1alpha1.StepInputs `json:"inputs,omitempty"`
Outputs workflowv1alpha1.StepOutputs `json:"outputs,omitempty"`
// Traits define the trait of one component, the type must be array to keep the order.
Traits []ApplicationTrait `json:"traits,omitempty"`
@@ -492,22 +398,10 @@ type ApplicationComponent struct {
// scopes in ApplicationComponent defines the component-level scopes
// the format is <scope-type:scope-instance-name> pairs, the key represents type of `ScopeDefinition` while the value represent the name of scope instance.
Scopes map[string]string `json:"scopes,omitempty"`
}
// StepOutputs defines output variable of WorkflowStep
type StepOutputs []outputItem
// StepInputs defines variable input of WorkflowStep
type StepInputs []inputItem
type inputItem struct {
ParameterKey string `json:"parameterKey"`
From string `json:"from"`
}
type outputItem struct {
ValueFrom string `json:"valueFrom"`
Name string `json:"name"`
// ReplicaKey is not empty means the component is replicated. This field is designed so that it can't be specified in application directly.
// So we set the json tag as "-". Instead, this will be filled when using replication policy.
ReplicaKey string `json:"-"`
}
// ClusterSelector defines the rules to select a Cluster resource.
@@ -536,16 +430,13 @@ type ClusterPlacement struct {
Distribution Distribution `json:"distribution,omitempty"`
}
// ResourceCreatorRole defines the resource creator.
type ResourceCreatorRole string
const (
// PolicyResourceCreator create the policy resource.
PolicyResourceCreator ResourceCreatorRole = "policy"
PolicyResourceCreator string = "policy"
// WorkflowResourceCreator create the resource in workflow.
WorkflowResourceCreator ResourceCreatorRole = "workflow"
WorkflowResourceCreator string = "workflow"
// DebugResourceCreator create the debug resource.
DebugResourceCreator ResourceCreatorRole = "debug"
DebugResourceCreator string = "debug"
)
// OAMObjectReference defines the object reference for an oam resource
@@ -592,8 +483,8 @@ func NewOAMObjectReferenceFromObject(obj client.Object) OAMObjectReference {
// ClusterObjectReference defines the object reference with cluster.
type ClusterObjectReference struct {
Cluster string `json:"cluster,omitempty"`
Creator ResourceCreatorRole `json:"creator,omitempty"`
Cluster string `json:"cluster,omitempty"`
Creator string `json:"creator,omitempty"`
corev1.ObjectReference `json:",inline"`
}

View File

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

View File

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

View File

@@ -23,8 +23,17 @@ import (
const (
// ApplyOncePolicyType refers to the type of configuration drift policy
ApplyOncePolicyType = "apply-once"
// ApplyOnceStrategyOnAppUpdate policy takes effect on application updating
ApplyOnceStrategyOnAppUpdate ApplyOnceAffectStrategy = "onUpdate"
// ApplyOnceStrategyOnAppStateKeep policy takes effect on application state keep
ApplyOnceStrategyOnAppStateKeep ApplyOnceAffectStrategy = "onStateKeep"
// ApplyOnceStrategyAlways policy takes effect always
ApplyOnceStrategyAlways ApplyOnceAffectStrategy = "always"
)
// ApplyOnceAffectStrategy is a string that mark the policy effective stage
type ApplyOnceAffectStrategy string
// ApplyOncePolicySpec defines the spec of preventing configuration drift
type ApplyOncePolicySpec struct {
Enable bool `json:"enable"`
@@ -45,6 +54,9 @@ 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
@@ -53,15 +65,7 @@ func (in ApplyOncePolicySpec) FindStrategy(manifest *unstructured.Unstructured)
return nil
}
for _, rule := range in.Rules {
match := func(src []string, val string) (found bool) {
for _, _val := range src {
found = found || _val == val
}
return val != "" && found
}
if (match(rule.Selector.CompNames, manifest.GetName()) && match(rule.Selector.ResourceTypes, manifest.GetKind())) ||
(rule.Selector.CompNames == nil && match(rule.Selector.ResourceTypes, manifest.GetKind()) ||
(rule.Selector.ResourceTypes == nil && match(rule.Selector.CompNames, manifest.GetName()))) {
if rule.Selector.Match(manifest) {
return rule.Strategy
}
}

View File

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

View File

@@ -19,8 +19,6 @@ package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// +kubebuilder:object:root=true
@@ -49,27 +47,3 @@ type PolicyList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []Policy `json:"items"`
}
// +kubebuilder:object:root=true
// Workflow is the Schema for the policy API
// +kubebuilder:storageversion
// +kubebuilder:resource:categories={oam}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Workflow struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Steps []common.WorkflowStep `json:"steps,omitempty"`
}
// +kubebuilder:object:root=true
// WorkflowList contains a list of Workflow
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type WorkflowList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Workflow `json:"items"`
}

View File

@@ -18,6 +18,7 @@ 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"
@@ -57,20 +58,19 @@ type GarbageCollectPolicyRule struct {
}
// ResourcePolicyRuleSelector select the targets of the rule
// 1) for GarbageCollectPolicyRule
// if both traitTypes, oamTypes and componentTypes are specified, combination logic is OR
// if one resource is specified with conflict strategies, strategy as component go first.
// 2) for ApplyOncePolicyRule only CompNames and ResourceTypes are used
// if multiple conditions are specified, combination logic is AND
type ResourcePolicyRuleSelector struct {
CompNames []string `json:"componentNames"`
CompTypes []string `json:"componentTypes"`
OAMResourceTypes []string `json:"oamTypes"`
TraitTypes []string `json:"traitTypes"`
ResourceTypes []string `json:"resourceTypes"`
ResourceNames []string `json:"resourceNames"`
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 {
@@ -81,15 +81,33 @@ func (in *ResourcePolicyRuleSelector) Match(manifest *unstructured.Unstructured)
}
resourceType = manifest.GetKind()
resourceName = manifest.GetName()
match := func(src []string, val string) (found bool) {
return val != "" && slices.Contains(src, val)
match := func(src []string, val string) (found *bool) {
if len(src) == 0 {
return nil
}
return pointer.Bool(val != "" && slices.Contains(src, val))
}
return match(in.CompNames, compName) ||
match(in.CompTypes, compType) ||
match(in.OAMResourceTypes, oamType) ||
match(in.TraitTypes, traitType) ||
match(in.ResourceTypes, resourceType) ||
match(in.ResourceNames, resourceName)
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
}
// GarbageCollectStrategy the strategy for target resource to recycle

View File

@@ -27,6 +27,8 @@ const (
DebugPolicyType = "debug"
// SharedResourcePolicyType refers to the type of shared resource policy
SharedResourcePolicyType = "shared-resource"
// ReplicationPolicyType refers to the type of replication policy
ReplicationPolicyType = "replication"
)
// TopologyPolicySpec defines the spec of topology policy
@@ -47,6 +49,10 @@ type Placement struct {
// Exclusive to "clusters"
ClusterLabelSelector map[string]string `json:"clusterLabelSelector,omitempty"`
// AllowEmpty ignore empty cluster error when no cluster returned for label
// selector
AllowEmpty bool `json:"allowEmpty,omitempty"`
// DeprecatedClusterSelector is a depreciated alias for ClusterLabelSelector.
// Deprecated: Use clusterLabelSelector instead.
DeprecatedClusterSelector map[string]string `json:"clusterSelector,omitempty"`
@@ -77,3 +83,11 @@ func (in SharedResourcePolicySpec) FindStrategy(manifest *unstructured.Unstructu
}
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

@@ -20,6 +20,8 @@ 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"
)
@@ -54,5 +56,5 @@ var (
func init() {
SchemeBuilder.Register(&Policy{}, &PolicyList{})
SchemeBuilder.Register(&Workflow{}, &WorkflowList{})
SchemeBuilder.Register(&workflowv1alpha1.Workflow{}, &workflowv1alpha1.WorkflowList{})
}

View File

@@ -612,6 +612,31 @@ func (in *RefObjectsComponentSpec) DeepCopy() *RefObjectsComponentSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReplicationPolicySpec) DeepCopyInto(out *ReplicationPolicySpec) {
*out = *in
if in.Keys != nil {
in, out := &in.Keys, &out.Keys
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicationPolicySpec.
func (in *ReplicationPolicySpec) DeepCopy() *ReplicationPolicySpec {
if in == nil {
return nil
}
out := new(ReplicationPolicySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourcePolicyRuleSelector) DeepCopyInto(out *ResourcePolicyRuleSelector) {
*out = *in
@@ -710,67 +735,3 @@ func (in *TopologyPolicySpec) DeepCopy() *TopologyPolicySpec {
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Workflow) DeepCopyInto(out *Workflow) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
if in.Steps != nil {
in, out := &in.Steps, &out.Steps
*out = make([]common.WorkflowStep, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workflow.
func (in *Workflow) DeepCopy() *Workflow {
if in == nil {
return nil
}
out := new(Workflow)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Workflow) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowList) DeepCopyInto(out *WorkflowList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Workflow, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowList.
func (in *WorkflowList) DeepCopy() *WorkflowList {
if in == nil {
return nil
}
out := new(WorkflowList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *WorkflowList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -19,6 +19,8 @@ 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"
)
@@ -55,7 +57,7 @@ type ApplicationRevisionSpec struct {
Policies map[string]v1alpha1.Policy `json:"policies,omitempty"`
// Workflow records the external workflow
Workflow *v1alpha1.Workflow `json:"workflow,omitempty"`
Workflow *workflowv1alpha1.Workflow `json:"workflow,omitempty"`
// ReferredObjects records the referred objects used in the ref-object typed components
// +kubebuilder:pruning:PreserveUnknownFields

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

View File

@@ -29,7 +29,8 @@ type PolicyDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this trait kind.
Reference common.DefinitionReference `json:"definitionRef,omitempty"`
// Schematic defines the data format and template of the encapsulation of the policy definition
// Schematic defines the data format and template of the encapsulation of the policy definition.
// Only CUE schematic is supported for now.
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`

View File

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

View File

@@ -18,18 +18,23 @@ package v1beta1
import (
"encoding/json"
"fmt"
"io/ioutil"
"strings"
"testing"
"time"
"github.com/stretchr/testify/require"
v12 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1"
v13 "k8s.io/apimachinery/pkg/apis/meta/v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/utils/pointer"
"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"
)
@@ -111,10 +116,10 @@ func TestManagedResourceKeys(t *testing.T) {
input := ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{
Cluster: "cluster",
ObjectReference: v1.ObjectReference{
ObjectReference: corev1.ObjectReference{
Namespace: "namespace",
Name: "name",
APIVersion: v12.SchemeGroupVersion.String(),
APIVersion: appsv1.SchemeGroupVersion.String(),
Kind: "Deployment",
},
},
@@ -125,10 +130,10 @@ func TestManagedResourceKeys(t *testing.T) {
},
}
r.Equal("namespace/name", input.NamespacedName().String())
r.Equal("apps/v1/Deployment/cluster/namespace/name", input.ResourceKey())
r.Equal("apps/Deployment/cluster/namespace/name", input.ResourceKey())
r.Equal("env/component", input.ComponentKey())
r.Equal("Deployment name (Cluster: cluster, Namespace: namespace)", input.DisplayName())
var deploy1, deploy2 v12.Deployment
var deploy1, deploy2 appsv1.Deployment
deploy1.Spec.Replicas = pointer.Int32(5)
bs, err := json.Marshal(deploy1)
r.NoError(err)
@@ -155,17 +160,17 @@ func TestManagedResourceKeys(t *testing.T) {
func TestResourceTracker_ManagedResource(t *testing.T) {
r := require.New(t)
input := &ResourceTracker{}
deploy1 := v12.Deployment{ObjectMeta: v13.ObjectMeta{Name: "deploy1"}}
input.AddManagedResource(&deploy1, true, "")
deploy1 := appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{Name: "deploy1"}}
input.AddManagedResource(&deploy1, true, false, "")
r.Equal(1, len(input.Spec.ManagedResources))
cm2 := v1.ConfigMap{ObjectMeta: v13.ObjectMeta{Name: "cm2"}}
input.AddManagedResource(&cm2, false, "")
cm2 := corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: "cm2"}}
input.AddManagedResource(&cm2, false, false, "")
r.Equal(2, len(input.Spec.ManagedResources))
pod3 := v1.Pod{ObjectMeta: v13.ObjectMeta{Name: "pod3"}}
input.AddManagedResource(&pod3, false, "")
pod3 := corev1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod3"}}
input.AddManagedResource(&pod3, false, false, "")
r.Equal(3, len(input.Spec.ManagedResources))
deploy1.Spec.Replicas = pointer.Int32(5)
input.AddManagedResource(&deploy1, false, "")
input.AddManagedResource(&deploy1, false, false, "")
r.Equal(3, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&cm2, false)
r.Equal(3, len(input.Spec.ManagedResources))
@@ -176,9 +181,171 @@ func TestResourceTracker_ManagedResource(t *testing.T) {
r.Equal(1, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&pod3, true)
r.Equal(0, len(input.Spec.ManagedResources))
secret4 := v1.Secret{ObjectMeta: v13.ObjectMeta{Name: "secret4"}}
secret4 := corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "secret4"}}
input.DeleteManagedResource(&secret4, true)
r.Equal(0, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&secret4, false)
r.Equal(1, len(input.Spec.ManagedResources))
}
func TestResourceTrackerCompression(t *testing.T) {
count := 20
r := require.New(t)
// Load some real CRDs, and other test data to simulate real use-cases.
// The user must have some large resourcetrackers if they use compression,
// so we load some large CRDs.
var data []string
paths := []string{
"../../../charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_applications.yaml",
"../../../charts/vela-core/crds/core.oam.dev_definitionrevisions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_healthscopes.yaml",
"../../../charts/vela-core/crds/core.oam.dev_traitdefinitions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_componentdefinitions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_workloaddefinitions.yaml",
"../../../charts/vela-core/crds/standard.oam.dev_rollouts.yaml",
"../../../charts/vela-core/templates/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,7 +29,8 @@ type WorkflowStepDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this trait kind.
Reference common.DefinitionReference `json:"definitionRef,omitempty"`
// Schematic defines the data format and template of the encapsulation of the workflow step definition
// Schematic defines the data format and template of the encapsulation of the workflow step definition.
// Only CUE schematic is supported for now.
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
}

View File

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

View File

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

View File

@@ -74,9 +74,9 @@ const (
AnnoIngressControllerHTTPPort = "ingress.controller/http-port"
// AnnoIngressControllerHost define ingress controller externally host
AnnoIngressControllerHost = "ingress.controller/host"
// LabelConfigType is the label for config type
// LabelConfigType is the label marked as the template that generated the config.
LabelConfigType = "config.oam.dev/type"
// LabelConfigCatalog is the label for config catalog
// LabelConfigCatalog is the label marked as the secret generated from the config.
LabelConfigCatalog = "config.oam.dev/catalog"
// LabelConfigSubType is the sub-type for a config type
LabelConfigSubType = "config.oam.dev/sub-type"
@@ -86,10 +86,18 @@ const (
LabelConfigSyncToMultiCluster = "config.oam.dev/multi-cluster"
// LabelConfigIdentifier is the label for config identifier
LabelConfigIdentifier = "config.oam.dev/identifier"
// LabelConfigScope is the label for config scope
LabelConfigScope = "config.oam.dev/scope"
// AnnotationConfigSensitive is the annotation for the sensitization
AnnotationConfigSensitive = "config.oam.dev/sensitive"
// AnnotationConfigTemplateNamespace is the annotation for the template namespace
AnnotationConfigTemplateNamespace = "config.oam.dev/template-namespace"
// AnnotationConfigDescription is the annotation for config description
AnnotationConfigDescription = "config.oam.dev/description"
// AnnotationConfigAlias is the annotation for config alias
AnnotationConfigAlias = "config.oam.dev/alias"
// AnnotationConfigDistributionSpec is the annotation key of the application that distributes the configs
AnnotationConfigDistributionSpec = "config.oam.dev/distribution-spec"
)
const (
@@ -106,6 +114,7 @@ type Config map[string]string
type EnvMeta struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Labels string `json:"labels"`
Current string `json:"current"`
}
@@ -155,11 +164,13 @@ const (
// TerraformProvider is the config type for terraform provider
TerraformProvider = "terraform-provider"
// DexConnector is the config type for dex connector
DexConnector = "config-dex-connector"
DexConnector = "dex-connector"
// ImageRegistry is the config type for image registry
ImageRegistry = "config-image-registry"
ImageRegistry = "image-registry"
// HelmRepository is the config type for Helm chart repository
HelmRepository = "config-helm-repository"
HelmRepository = "helm-repository"
// CatalogConfigDistribution is the catalog type
CatalogConfigDistribution = "config-distribution"
)
const (

View File

@@ -81,19 +81,23 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wai
### KubeVela controller optimization parameters
| Name | Description | Value |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `optimize.cachedGvks` | Optimize types of resources to be cached. | `""` |
| `optimize.resourceTrackerListOp` | Optimize ResourceTracker List Op by adding index. | `true` |
| `optimize.controllerReconcileLoopReduction` | Optimize ApplicationController reconcile by reducing the number of loops to reconcile application. | `false` |
| `optimize.markWithProb` | Optimize ResourceTracker GC by only run mark with probability. Side effect: outdated ResourceTracker might not be able to be removed immediately. | `0.1` |
| `optimize.disableComponentRevision` | Optimize componentRevision by disabling the creation and gc | `false` |
| `optimize.disableApplicationRevision` | Optimize ApplicationRevision by disabling the creation and gc. | `false` |
| `optimize.disableWorkflowRecorder` | Optimize workflow recorder by disabling the creation and gc. | `false` |
| `optimize.enableInMemoryWorkflowContext` | Optimize workflow by use in-memory context. | `false` |
| `optimize.disableResourceApplyDoubleCheck` | Optimize workflow by ignoring resource double check after apply. | `false` |
| `optimize.enableResourceTrackerDeleteOnlyTrigger` | Optimize resourcetracker by only trigger reconcile when resourcetracker is deleted. | `true` |
| `featureGates.enableLegacyComponentRevision` | if disabled, only component with rollout trait will create component revisions | `false` |
| Name | Description | Value |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- |
| `optimize.cachedGvks` | Optimize types of resources to be cached. | `""` |
| `optimize.resourceTrackerListOp` | Optimize ResourceTracker List Op by adding index. | `true` |
| `optimize.controllerReconcileLoopReduction` | Optimize ApplicationController reconcile by reducing the number of loops to reconcile application. | `false` |
| `optimize.markWithProb` | Optimize ResourceTracker GC by only run mark with probability. Side effect: outdated ResourceTracker might not be able to be removed immediately. | `0.1` |
| `optimize.disableComponentRevision` | Optimize componentRevision by disabling the creation and gc | `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` |
### MultiCluster parameters

View File

@@ -461,8 +461,6 @@ spec:
cluster:
type: string
creator:
description: ResourceCreatorRole defines the resource
creator.
type: string
fieldPath:
description: 'If referring to a piece of an object instead
@@ -623,9 +621,10 @@ spec:
format: int64
type: integer
policy:
description: PolicyStatus records the status of policy
description: PolicyStatus records the status of policy Deprecated
This field is only used by EnvBinding Policy which is deprecated.
items:
description: PolicyStatus records the status of policy
description: PolicyStatus records the status of policy Deprecated
properties:
name:
type: string
@@ -843,16 +842,22 @@ 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
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
@@ -888,8 +893,9 @@ spec:
type: string
subSteps:
items:
description: WorkflowSubStepStatus record the
status of a workflow subStep
description: StepStatus record the base status
of workflow step, which could be workflow step
or subStep
properties:
firstExecuteTime:
description: FirstExecuteTime is the first
@@ -2203,10 +2209,11 @@ spec:
execution
properties:
steps:
description: WorkflowMode describes the mode of workflow
description: Steps is the mode of workflow steps execution
type: string
subSteps:
description: WorkflowMode describes the mode of workflow
description: SubSteps is the mode of workflow sub
steps execution
type: string
type: object
ref:
@@ -2217,14 +2224,16 @@ spec:
step.
properties:
dependsOn:
description: DependsOn is the dependency of the
step
items:
type: string
type: array
if:
description: If is the if condition of the step
type: string
inputs:
description: StepInputs defines variable input of
WorkflowStep
description: Inputs is the inputs of the step
items:
properties:
from:
@@ -2237,8 +2246,8 @@ spec:
type: object
type: array
meta:
description: WorkflowStepMeta contains the meta
data of a workflow step
description: Meta is the meta data of the workflow
step.
properties:
alias:
type: string
@@ -2248,8 +2257,7 @@ spec:
step.
type: string
outputs:
description: StepOutputs defines output variable
of WorkflowStep
description: Outputs is the outputs of the step
items:
properties:
name:
@@ -2262,22 +2270,27 @@ spec:
type: object
type: array
properties:
description: Properties is the properties of the
step
type: object
x-kubernetes-preserve-unknown-fields: true
subSteps:
items:
description: WorkflowSubStep defines how to execute
a workflow subStep.
description: WorkflowStepBase defines the workflow
step base
properties:
dependsOn:
description: DependsOn is the dependency of
the step
items:
type: string
type: array
if:
description: If is the if condition of the
step
type: string
inputs:
description: StepInputs defines variable input
of WorkflowStep
description: Inputs is the inputs of the step
items:
properties:
from:
@@ -2290,8 +2303,8 @@ spec:
type: object
type: array
meta:
description: WorkflowStepMeta contains the
meta data of a workflow step
description: Meta is the meta data of the
workflow step.
properties:
alias:
type: string
@@ -2301,8 +2314,8 @@ spec:
workflow step.
type: string
outputs:
description: StepOutputs defines output variable
of WorkflowStep
description: Outputs is the outputs of the
step
items:
properties:
name:
@@ -2315,11 +2328,17 @@ 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
@@ -2327,8 +2346,10 @@ spec:
type: object
type: array
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
@@ -2355,8 +2376,6 @@ spec:
cluster:
type: string
creator:
description: ResourceCreatorRole defines the resource
creator.
type: string
fieldPath:
description: 'If referring to a piece of an object instead
@@ -2517,9 +2536,10 @@ spec:
format: int64
type: integer
policy:
description: PolicyStatus records the status of policy
description: PolicyStatus records the status of policy Deprecated
This field is only used by EnvBinding Policy which is deprecated.
items:
description: PolicyStatus records the status of policy
description: PolicyStatus records the status of policy Deprecated
properties:
name:
type: string
@@ -2737,16 +2757,22 @@ 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
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
@@ -2782,8 +2808,9 @@ spec:
type: string
subSteps:
items:
description: WorkflowSubStepStatus record the
status of a workflow subStep
description: StepStatus record the base status
of workflow step, which could be workflow step
or subStep
properties:
firstExecuteTime:
description: FirstExecuteTime is the first
@@ -3279,7 +3306,8 @@ spec:
type: boolean
schematic:
description: Schematic defines the data format and template
of the encapsulation of the policy definition
of the encapsulation of the policy definition. Only CUE
schematic is supported for now.
properties:
cue:
description: CUE defines the encapsulation in CUE format
@@ -3650,7 +3678,7 @@ spec:
appliesToWorkloads:
description: AppliesToWorkloads specifies the list of workload
kinds this trait applies to. Workload kinds are specified
in kind.group/version format, e.g. server.core.oam.dev/v1alpha2.
in resource.group/version format, e.g. server.core.oam.dev/v1alpha2.
Traits that omit this field apply to all workload kinds.
items:
type: string
@@ -3705,7 +3733,8 @@ spec:
type: boolean
schematic:
description: Schematic defines the data format and template
of the encapsulation of the trait
of the encapsulation of the trait. Only CUE and Kube schematic
are supported for now.
properties:
cue:
description: CUE defines the encapsulation in CUE format
@@ -3859,10 +3888,12 @@ spec:
- configuration
type: object
type: object
skipRevisionAffect:
description: SkipRevisionAffect defines the update this
trait will not generate a new application Revision
type: boolean
stage:
description: Stage defines the stage information to which
this trait resource processing belongs. Currently, PreDispatch
and PostDispatch are provided, which are used to control
resource pre-process and post-process respectively.
type: string
status:
description: Status defines the custom health policy and
status message for trait
@@ -3978,19 +4009,32 @@ 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: StepInputs defines variable input of WorkflowStep
description: Inputs is the inputs of the step
items:
properties:
from:
@@ -4003,8 +4047,7 @@ spec:
type: object
type: array
meta:
description: WorkflowStepMeta contains the meta data of
a workflow step
description: Meta is the meta data of the workflow step.
properties:
alias:
type: string
@@ -4013,7 +4056,7 @@ spec:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: StepOutputs defines output variable of WorkflowStep
description: Outputs is the outputs of the step
items:
properties:
name:
@@ -4026,22 +4069,24 @@ spec:
type: object
type: array
properties:
description: Properties is the properties of the step
type: object
x-kubernetes-preserve-unknown-fields: true
subSteps:
items:
description: WorkflowSubStep defines how to execute a
workflow subStep.
description: WorkflowStepBase defines the workflow step
base
properties:
dependsOn:
description: DependsOn is the dependency of the step
items:
type: string
type: array
if:
description: If is the if condition of the step
type: string
inputs:
description: StepInputs defines variable input of
WorkflowStep
description: Inputs is the inputs of the step
items:
properties:
from:
@@ -4054,8 +4099,8 @@ spec:
type: object
type: array
meta:
description: WorkflowStepMeta contains the meta data
of a workflow step
description: Meta is the meta data of the workflow
step.
properties:
alias:
type: string
@@ -4065,8 +4110,7 @@ spec:
step.
type: string
outputs:
description: StepOutputs defines output variable of
WorkflowStep
description: Outputs is the outputs of the step
items:
properties:
name:
@@ -4079,11 +4123,14 @@ spec:
type: object
type: array
properties:
description: Properties is the properties of the step
type: object
x-kubernetes-preserve-unknown-fields: true
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
@@ -4091,8 +4138,10 @@ spec:
type: object
type: array
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
@@ -4157,7 +4206,8 @@ spec:
type: object
schematic:
description: Schematic defines the data format and template
of the encapsulation of the workflow step definition
of the encapsulation of the workflow step definition.
Only CUE schematic is supported for now.
properties:
cue:
description: CUE defines the encapsulation in CUE format
@@ -4761,16 +4811,22 @@ 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
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
@@ -4804,8 +4860,8 @@ spec:
type: string
subSteps:
items:
description: WorkflowSubStepStatus record the status of
a workflow subStep
description: StepStatus record the base status of workflow
step, which could be workflow step or subStep
properties:
firstExecuteTime:
description: FirstExecuteTime is the first time this

View File

@@ -414,7 +414,6 @@ spec:
cluster:
type: string
creator:
description: ResourceCreatorRole defines the resource creator.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of
@@ -565,9 +564,10 @@ spec:
format: int64
type: integer
policy:
description: PolicyStatus records the status of policy
description: PolicyStatus records the status of policy Deprecated
This field is only used by EnvBinding Policy which is deprecated.
items:
description: PolicyStatus records the status of policy
description: PolicyStatus records the status of policy Deprecated
properties:
name:
type: string
@@ -766,16 +766,22 @@ 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
type: string
finished:
type: boolean
message:
type: string
mode:
description: WorkflowMode describes the mode of workflow
type: string
startTime:
format: date-time
type: string
status:
description: WorkflowRunPhase is a label for the condition of
a WorkflowRun at the current time
type: string
steps:
items:
description: WorkflowStepStatus record the status of a workflow
@@ -809,8 +815,8 @@ spec:
type: string
subSteps:
items:
description: WorkflowSubStepStatus record the status of
a workflow subStep
description: StepStatus record the base status of workflow
step, which could be workflow step or subStep
properties:
firstExecuteTime:
description: FirstExecuteTime is the first time this
@@ -1014,10 +1020,10 @@ spec:
execution
properties:
steps:
description: WorkflowMode describes the mode of workflow
description: Steps is the mode of workflow steps execution
type: string
subSteps:
description: WorkflowMode describes the mode of workflow
description: SubSteps is the mode of workflow sub steps execution
type: string
type: object
ref:
@@ -1028,13 +1034,15 @@ spec:
step.
properties:
dependsOn:
description: DependsOn is the dependency of the step
items:
type: string
type: array
if:
description: If is the if condition of the step
type: string
inputs:
description: StepInputs defines variable input of WorkflowStep
description: Inputs is the inputs of the step
items:
properties:
from:
@@ -1047,8 +1055,7 @@ spec:
type: object
type: array
meta:
description: WorkflowStepMeta contains the meta data of
a workflow step
description: Meta is the meta data of the workflow step.
properties:
alias:
type: string
@@ -1057,7 +1064,7 @@ spec:
description: Name is the unique name of the workflow step.
type: string
outputs:
description: StepOutputs defines output variable of WorkflowStep
description: Outputs is the outputs of the step
items:
properties:
name:
@@ -1070,22 +1077,24 @@ spec:
type: object
type: array
properties:
description: Properties is the properties of the step
type: object
x-kubernetes-preserve-unknown-fields: true
subSteps:
items:
description: WorkflowSubStep defines how to execute a
workflow subStep.
description: WorkflowStepBase defines the workflow step
base
properties:
dependsOn:
description: DependsOn is the dependency of the step
items:
type: string
type: array
if:
description: If is the if condition of the step
type: string
inputs:
description: StepInputs defines variable input of
WorkflowStep
description: Inputs is the inputs of the step
items:
properties:
from:
@@ -1098,8 +1107,8 @@ spec:
type: object
type: array
meta:
description: WorkflowStepMeta contains the meta data
of a workflow step
description: Meta is the meta data of the workflow
step.
properties:
alias:
type: string
@@ -1109,8 +1118,7 @@ spec:
step.
type: string
outputs:
description: StepOutputs defines output variable of
WorkflowStep
description: Outputs is the outputs of the step
items:
properties:
name:
@@ -1123,11 +1131,14 @@ spec:
type: object
type: array
properties:
description: Properties is the properties of the step
type: object
x-kubernetes-preserve-unknown-fields: true
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
@@ -1135,8 +1146,10 @@ spec:
type: object
type: array
timeout:
description: Timeout is the timeout of the step
type: string
type:
description: Type is the type of the workflow step.
type: string
required:
- name
@@ -1163,7 +1176,6 @@ spec:
cluster:
type: string
creator:
description: ResourceCreatorRole defines the resource creator.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of
@@ -1314,9 +1326,10 @@ spec:
format: int64
type: integer
policy:
description: PolicyStatus records the status of policy
description: PolicyStatus records the status of policy Deprecated
This field is only used by EnvBinding Policy which is deprecated.
items:
description: PolicyStatus records the status of policy
description: PolicyStatus records the status of policy Deprecated
properties:
name:
type: string
@@ -1515,16 +1528,22 @@ 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
type: string
finished:
type: boolean
message:
type: string
mode:
description: WorkflowMode describes the mode of workflow
type: string
startTime:
format: date-time
type: string
status:
description: WorkflowRunPhase is a label for the condition of
a WorkflowRun at the current time
type: string
steps:
items:
description: WorkflowStepStatus record the status of a workflow
@@ -1558,8 +1577,8 @@ spec:
type: string
subSteps:
items:
description: WorkflowSubStepStatus record the status of
a workflow subStep
description: StepStatus record the base status of workflow
step, which could be workflow step or subStep
properties:
firstExecuteTime:
description: FirstExecuteTime is the first time this

View File

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

View File

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

View File

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

View File

@@ -56,6 +56,16 @@ 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
@@ -69,7 +79,6 @@ spec:
component:
type: string
creator:
description: ResourceCreatorRole defines the resource creator.
type: string
deleted:
description: Deleted marks the resource to be deleted
@@ -105,6 +114,9 @@ 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:
@@ -134,7 +146,6 @@ spec:
cluster:
type: string
creator:
description: ResourceCreatorRole defines the resource creator.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -6,6 +6,7 @@ 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/ui-hidden: "true"
name: apply-application-in-parallel
namespace: {{ include "systemDefinitionNamespace" . }}

View File

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

View File

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

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: PolicyDefinition
metadata:
annotations:
definition.oam.dev/description: Configure the behaviour of preventing configuration drift.
definition.oam.dev/description: Allow configuration drift for applied resources, delivery the resource without continuously reconciliation.
name: apply-once
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
@@ -12,6 +12,8 @@ spec:
cue:
template: |
#ApplyOnceStrategy: {
// +usage=When the strategy takes effect,e.g. onUpdate、onStateKeep
affect?: string
// +usage=Specify the path of the resource that allow configuration drift
path: [...string]
}

View File

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

View File

@@ -0,0 +1,97 @@
# 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,13 +5,14 @@ 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: |
@@ -47,7 +48,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: {}
@@ -62,7 +63,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

@@ -1,86 +0,0 @@
# 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:
alias.config.oam.dev: Image Registry
definition.oam.dev/description: Config information to authenticate image registry
labels:
catalog.config.oam.dev: velacore-config
custom.definition.oam.dev/ui-hidden: "true"
multi-cluster.config.oam.dev: "true"
type.config.oam.dev: image-registry
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,13 +5,14 @@ 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:
@@ -71,7 +72,7 @@ spec:
}]
}
}
parameter: *#PatchParams | close({
parameter: close(#PatchParams) | close({
// +usage=Specify the container image for multiple containers
containers: [...#PatchParams]
})

View File

@@ -5,13 +5,12 @@ 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

@@ -0,0 +1,44 @@
# 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"
type: "pvc" | "configMap" | "secret" | "emptyDir"
// +usage=Specify volume type, options: "pvc","configMap","secret","emptyDir", default to emptyDir
type: *"emptyDir" | "pvc" | "configMap" | "secret"
if type == "pvc" {
claimName: string
}

View File

@@ -15,116 +15,117 @@ spec:
"strconv"
)
mountsArray: {
pvc: *[
for v in parameter.volumeMounts.pvc {
{
mountPath: v.mountPath
name: v.name
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
}
},
configMap: *[
for v in parameter.volumeMounts.configMap {
{
mountPath: v.mountPath
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
}
},
secret: *[
for v in parameter.volumeMounts.secret {
{
mountPath: v.mountPath
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
}
},
emptyDir: *[
for v in parameter.volumeMounts.emptyDir {
{
mountPath: v.mountPath
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
}
},
hostPath: *[
for v in parameter.volumeMounts.hostPath {
{
mountPath: v.mountPath
if v.mountPropagation != _|_ {
mountPropagation: v.mountPropagation
}
name: v.name
if v.readOnly != _|_ {
readOnly: v.readOnly
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
}
}
},
] | []
}
volumesArray: {
pvc: *[
for v in parameter.volumeMounts.pvc {
{
name: v.name
persistentVolumeClaim: claimName: v.claimName
}
},
] | []
}
},
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
}
}
},
] | []
}
},
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
}
},
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
},
] | []
hostPath: *[
for v in parameter.volumeMounts.hostPath {
{
name: v.name
hostPath: path: v.path
}
},
] | []
}
] if val._ignore == _|_ {
val
},
]
output: {
apiVersion: "apps/v1"
kind: "DaemonSet"
@@ -210,7 +211,7 @@ spec:
}
if parameter["volumeMounts"] != _|_ {
volumeMounts: mountsArray.pvc + mountsArray.configMap + mountsArray.secret + mountsArray.emptyDir + mountsArray.hostPath
volumeMounts: mountsArray
}
if parameter["livenessProbe"] != _|_ {
@@ -268,14 +269,14 @@ spec:
}
if parameter["volumeMounts"] != _|_ {
volumes: volumesArray.pvc + volumesArray.configMap + volumesArray.secret + volumesArray.emptyDir + volumesArray.hostPath
volumes: deDupVolumesArray
}
}
}
}
}
exposePorts: [
for v in parameter.ports if v.expose == true {
if parameter.ports != _|_ for v in parameter.ports if v.expose == true {
port: v.port
targetPort: v.port
if v.name != _|_ {
@@ -428,8 +429,8 @@ spec:
volumes?: [...{
name: string
mountPath: string
// +usage=Specify volume type, options: "pvc","configMap","secret","emptyDir"
type: "pvc" | "configMap" | "secret" | "emptyDir"
// +usage=Specify volume type, options: "pvc","configMap","secret","emptyDir", default to emptyDir
type: *"emptyDir" | "pvc" | "configMap" | "secret"
if type == "pvc" {
claimName: string
}

View File

@@ -0,0 +1,34 @@
# 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: check or install depends-on Application
definition.oam.dev/description: Wait for the specified Application to complete.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: depends-on-app

View File

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

View File

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

View File

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

View File

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

View File

@@ -5,13 +5,14 @@ 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: |
@@ -28,7 +29,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: *_|_ | {...}
@@ -46,7 +47,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 shoued be remove, default false
// +usage=Specify if the trait should be remove, default false
disable: *false | bool
}]
}

View File

@@ -0,0 +1,64 @@
# 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

@@ -0,0 +1,79 @@
# 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 config map for your workflow steps
definition.oam.dev/description: Export data to specified Kubernetes ConfigMap in your workflow.
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 secret for your workflow steps
definition.oam.dev/description: Export data to Kubernetes Secret in your workflow.
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 config map
// +usage=Specify the cluster of the secret
cluster: *"" | string
}

View File

@@ -5,11 +5,12 @@ 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:

View File

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

View File

@@ -5,13 +5,14 @@ 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

@@ -1,41 +0,0 @@
# 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,13 +5,14 @@ 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:
@@ -27,8 +28,9 @@ spec:
}]
}]
initContainers: [{
name: parameter.name
image: parameter.image
name: parameter.name
image: parameter.image
imagePullPolicy: parameter.imagePullPolicy
if parameter.cmd != _|_ {
command: parameter.cmd
}
@@ -58,6 +60,9 @@ 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,9 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
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"
definition.oam.dev/description: Add labels on your workload. if it generates pod, add same label for generated pods.
name: labels
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
@@ -20,13 +18,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,13 +5,14 @@ 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

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

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Send message to webhook
definition.oam.dev/description: Send notifications to Email, DingTalk, Slack, Lark or webhook in your workflow.
name: notification
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
@@ -17,19 +17,21 @@ spec:
)
parameter: {
// +usage=Please fulfill its url and message if you want to send Lark messages
lark?: {
// +usage=Specify the the lark url, you can either sepcify it in value or use secretRef
url: {
url: close({
// +usage=the url address content in string
value: string
} | {
}) | close({
secretRef: {
// +usage=name is the name of the secret
name: string
// +usage=key is the key in the secret
key: string
}
}
// +useage=Specify the message that you want to sent
})
// +usage=Specify the message that you want to sent, refer to [Lark messaging](https://open.feishu.cn/document/ukTMukTMukTM/ucTM5YjL3ETO24yNxkjN#8b0f2a1b).
message: {
// +usage=msg_type can be text, post, image, interactive, share_chat, share_user, audio, media, file, sticker
msg_type: string
@@ -37,88 +39,93 @@ spec:
content: string
}
}
// +usage=Please fulfill its url and message if you want to send DingTalk messages
dingding?: {
// +usage=Specify the the dingding url, you can either sepcify it in value or use secretRef
url: {
url: close({
// +usage=the url address content in string
value: string
} | {
}) | close({
secretRef: {
// +usage=name is the name of the secret
name: string
// +usage=key is the key in the secret
key: string
}
}
// +useage=Specify the message that you want to sent
})
// +usage=Specify the message that you want to sent, refer to [dingtalk messaging](https://developers.dingtalk.com/document/robots/custom-robot-access/title-72m-8ag-pqw)
message: {
text?: *null | {
// +usage=Specify the message content of dingtalk notification
text?: *null | close({
content: string
}
})
// +usage=msgType can be text, link, mardown, actionCard, feedCard
msgtype: *"text" | "link" | "markdown" | "actionCard" | "feedCard"
link?: *null | {
link?: *null | close({
text?: string
title?: string
messageUrl?: string
picUrl?: string
}
markdown?: *null | {
})
markdown?: *null | close({
text: string
title: string
}
at?: *null | {
})
at?: *null | close({
atMobiles?: *null | [...string]
isAtAll?: bool
}
actionCard?: *null | {
})
actionCard?: *null | close({
text: string
title: string
hideAvatar: string
btnOrientation: string
singleTitle: string
singleURL: string
btns: *null | [...*null | {
btns: *null | close([...*null | close({
title: string
actionURL: string
}]
}
feedCard?: *null | {
links: *null | [...*null | {
})])
})
feedCard?: *null | close({
links: *null | close([...*null | close({
text?: string
title?: string
messageUrl?: string
picUrl?: string
}]
}
})])
})
}
}
// +usage=Please fulfill its url and message if you want to send Slack messages
slack?: {
// +usage=Specify the the slack url, you can either sepcify it in value or use secretRef
url: {
url: close({
// +usage=the url address content in string
value: string
} | {
}) | close({
secretRef: {
// +usage=name is the name of the secret
name: string
// +usage=key is the key in the secret
key: string
}
}
// +useage=Specify the message that you want to sent
})
// +usage=Specify the message that you want to sent, refer to [slack messaging](https://api.slack.com/reference/messaging/payload)
message: {
// +usage=Specify the message text for slack notification
text: string
blocks?: *null | [...block]
attachments?: *null | {
blocks?: *null | [...block]
blocks?: *null | close([...block])
attachments?: *null | close({
blocks?: *null | close([...block])
color?: string
}
})
thread_ts?: string
mrkdwn?: *true | bool
// +usage=Specify the message text format in markdown for slack notification
mrkdwn?: *true | bool
}
}
// +usage=Please fulfill its from, to and content if you want to send email
email?: {
// +usage=Specify the email info that you want to send from
from: {
@@ -127,16 +134,17 @@ spec:
// +usage=The alias is the email alias to show after sending the email
alias?: string
// +usage=Specify the password of the email, you can either sepcify it in value or use secretRef
password: {
password: close({
// +usage=the password content in string
value: string
} | {
}) | close({
secretRef: {
// +usage=name is the name of the secret
name: string
// +usage=key is the key in the secret
key: string
}
}
})
// +usage=Specify the host of your email
host: string
// +usage=Specify the port of the email host, default to 587
@@ -219,8 +227,7 @@ spec:
}
}
decoded: base64.Decode(null, read.value.data[parameter.dingding.url.secretRef.key])
stringValue: op.#ConvertString & {bt: decoded}
stringValue: op.#ConvertString & {bt: base64.Decode(null, read.value.data[parameter.dingding.url.secretRef.key])}
ding2: op.#DingTalk & {
message: parameter.dingding.message
dingUrl: stringValue.str
@@ -248,8 +255,7 @@ spec:
}
}
decoded: base64.Decode(null, read.value.data[parameter.lark.url.secretRef.key])
stringValue: op.#ConvertString & {bt: decoded}
stringValue: op.#ConvertString & {bt: base64.Decode(null, read.value.data[parameter.lark.url.secretRef.key])}
lark2: op.#Lark & {
message: parameter.lark.message
larkUrl: stringValue.str
@@ -277,8 +283,7 @@ spec:
}
}
decoded: base64.Decode(null, read.value.data[parameter.slack.url.secretRef.key])
stringValue: op.#ConvertString & {bt: decoded}
stringValue: op.#ConvertString & {bt: base64.Decode(null, read.value.data[parameter.slack.url.secretRef.key])}
slack2: op.#Slack & {
message: parameter.slack.message
slackUrl: stringValue.str
@@ -316,8 +321,7 @@ spec:
}
}
decoded: base64.Decode(null, read.value.data[parameter.email.from.password.secretRef.key])
stringValue: op.#ConvertString & {bt: decoded}
stringValue: op.#ConvertString & {bt: base64.Decode(null, read.value.data[parameter.email.from.password.secretRef.key])}
email2: op.#SendEmail & {
from: {
address: parameter.email.from.address

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: PolicyDefinition
metadata:
annotations:
definition.oam.dev/description: Override configuration when deploying resources
definition.oam.dev/description: Describe the configuration to override when deploying resources, it only works with specified `deploy` step in workflow.
name: override
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
@@ -16,11 +16,15 @@ spec:
name?: string
// +usage=Specify the type of the patch component.
type?: string
// +usage=Specify the properties to override.
properties?: {...}
// +usage=Specify the traits to override.
traits?: [...{
// +usage=Specify the type of the trait to be patched.
type: string
// +usage=Specify the properties to override.
properties?: {...}
// +usage=Specify if the trait shoued be remove, default false
// +usage=Specify if the trait should be remove, default false
disable: *false | bool
}]
}

View File

@@ -0,0 +1,24 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/print-message-in-status.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: pring message in workflow status
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: print-message-in-status
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
parameter: message: string
msg: op.#Message & {
message: parameter.message
}

View File

@@ -6,11 +6,13 @@ metadata:
annotations:
definition.oam.dev/description: Enable public web traffic for the component without creating a Service.
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/ui-hidden: "true"
name: pure-ingress
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads: []
appliesToWorkloads:
- '*'
conflictsWith: []
podDisruptive: false
schematic:

View File

@@ -52,7 +52,7 @@ spec:
},
]
}
outputs: "\(parameter.claimName)": {
outputs: claim: {
apiVersion: "v1"
kind: "PersistentVolumeClaim"
metadata: name: parameter.claimName
@@ -67,7 +67,7 @@ spec:
storageClassName: parameter.storageClassName
}
resources: requests: storage: parameter.resources.requests.storage
if parameter.resources.limits.storage != _|_ {
if parameter.resources.limits != _|_ {
resources: limits: storage: parameter.resources.limits.storage
}
if parameter.dataSourceRef != _|_ {

View File

@@ -0,0 +1,34 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/read-config.cue
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Read a config
name: read-config
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
import (
"vela/op"
)
output: op.#ReadConfig & {
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: Read objects for your workflow steps
definition.oam.dev/description: Read Kubernetes objects from cluster for your workflow steps
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: read-object
@@ -50,15 +50,15 @@ spec:
}
}
parameter: {
// +usage=Specify the apiVersion of the object, defaults to core.oam.dev/v1beta1
// +usage=Specify the apiVersion of the object, defaults to 'core.oam.dev/v1beta1'
apiVersion?: string
// +usage=Specify the kind of the object, defaults to Application
kind?: string
// +usage=Specify the name of the object
name: string
// +usage=Specify the namespace of the object
namespace?: string
// +usage=Specify the cluster of the object
// +usage=The namespace of the resource you want to read
namespace?: *"default" | string
// +usage=The cluster you want to apply the resource to, default is the current control plane cluster
cluster: *"" | string
}

View File

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

View File

@@ -0,0 +1,20 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/replication.cue
apiVersion: core.oam.dev/v1beta1
kind: PolicyDefinition
metadata:
annotations:
definition.oam.dev/description: Describe the configuration to replicate components when deploying resources, it only works with specified `deploy` step in workflow.
name: replication
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
parameter: {
// +usage=Spicify the keys of replication. Every key coresponds to a replication components
keys: [...string]
// +usage=Specify the components which will be replicated.
selector?: [...string]
}

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