Compare commits

...

1318 Commits

Author SHA1 Message Date
github-actions[bot]
f49f11dd72 Fix: suppress klog logs output for vela top (#5452)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 55662b645a)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2023-02-08 16:26:44 +08:00
github-actions[bot]
191d9038f1 [Backport release-1.7] Fix: use get before create or update (#5450)
* Fix: use get before create or update

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

* Fix: ignore resource not found error when manage privileges for target

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

---------

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2023-02-08 14:50:38 +08:00
github-actions[bot]
e10e43b6c8 [Backport release-1.7] Fix: simplify notification parameters (#5446)
* Fix: simplify notification parameters

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

* remove close

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

* format

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

---------

Co-authored-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-02-08 14:05:13 +08:00
github-actions[bot]
b9cc523267 [Backport release-1.7] Fix: Add confirmation prompt for vela adopt --apply with existing app name (#5419)
* Add confirmation prompt for vela adopt --apply with existing app name

Signed-off-by: Karanjot Singh <drquark@duck.com>
(cherry picked from commit 5278e1b350)

* Added changes according to the review

Signed-off-by: Karanjot Singh <drquark@duck.com>
(cherry picked from commit 0a437e336f)

* Fixed Userinput and used loadremoteApplication

Signed-off-by: Karanjot Singh <drquark@duck.com>

minor fixes

Signed-off-by: Karanjot Singh <drquark@duck.com>

used loadRemoteApplication

Signed-off-by: Karanjot Singh <drquark@duck.com>

Minor Fix

Signed-off-by: Karanjot Singh <drquark@duck.com>

Minor Fix

Signed-off-by: Karanjot Singh <drquark@duck.com>

Minor Fix

Signed-off-by: Karanjot Singh <drquark@duck.com>

Minor Fix

Signed-off-by: Karanjot Singh <drquark@duck.com>

Minor Fix

Signed-off-by: Karanjot Singh <drquark@duck.com>

Minor fix

Signed-off-by: Karanjot Singh <drquark@duck.com>

Minor fix

Signed-off-by: Karanjot Singh <drquark@duck.com>
(cherry picked from commit 4e92eaf73e)

* Used f.Client().Get method

Signed-off-by: Karanjot Singh <drquark@duck.com>

minor fix

Signed-off-by: Karanjot Singh <drquark@duck.com>

minor fix

Signed-off-by: Karanjot Singh <drquark@duck.com>
(cherry picked from commit 96a2ae8fb7)

* Changed bool to False

Signed-off-by: Karanjot Singh <drquark@duck.com>
(cherry picked from commit 17a1131b90)

---------

Co-authored-by: Karanjot Singh <drquark@duck.com>
2023-02-03 18:03:42 +08:00
github-actions[bot]
7f1743ef58 [Backport release-1.7] Fix: sync project from app crd to velaux (#5410)
* Fix: sync project from app crd to velaux

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

* Fix: sync project from app crd to velaux

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

* Fix: sync project from app crd to velaux

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

* Fix: sync project from app crd to velaux

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

* Fix: sync project from app crd to velaux

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

* Fix: sync project from app crd to velaux

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

---------

Co-authored-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2023-02-02 15:31:25 +08:00
github-actions[bot]
dd39c38cf1 fix bugs of specified addonName (#5407)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
(cherry picked from commit 3a9df79b3a)

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2023-02-01 16:44:30 +08:00
github-actions[bot]
0851454c6f Fix: ignore validation webhook for ref-objects typed component (#5406)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 0fb1ab497b)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2023-02-01 16:10:16 +08:00
github-actions[bot]
cd3577db53 Fix: skip last-applied-configuration error for threewaymergepatch (#5405)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 6bf79461d4)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2023-02-01 16:00:44 +08:00
github-actions[bot]
d578adfe6e Fix: longer releaser timeout (#5400)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
(cherry picked from commit 4ca1acdc22)

Co-authored-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-02-01 14:01:07 +08:00
github-actions[bot]
4b88cd201e [Backport release-1.7] Fix: replace homemade release script with goreleaser (#5398)
* Replace homemade release script with goreleaser

refactor release.yml

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

* wrap files in a directory

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

---------

Co-authored-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-01-31 20:55:06 +08:00
github-actions[bot]
492e7d7f0d [Backport release-1.7] Fix: use the namespace specified in the resource if -n is not s… (#5396)
* fix #5368, use the namespace specified in the resource if -n is not specified

Signed-off-by: Basuotian <basuoluomiu@gmail.com>
(cherry picked from commit 47c9b4457b)

* add default namespace for the case missing namespace in resourceRef

Signed-off-by: Basuotian <basuoluomiu@gmail.com>
(cherry picked from commit 3ae0657796)

* add test case

Signed-off-by: Basuotian <basuoluomiu@gmail.com>
(cherry picked from commit 4ba5eb88eb)

---------

Co-authored-by: Basuotian <basuoluomiu@gmail.com>
2023-01-31 20:16:18 +08:00
Jianbo Sun
0742ca9ee5 Fix: aligin config create to be managed by apps with Dispatch function (#5384) (#5394)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2023-01-31 18:04:36 +08:00
github-actions[bot]
1cf4ae3fc3 [Backport release-1.7] Feat: add the updating the application trigger API (#5395)
* Feat: add the updating the application trigger API

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

* Fix: change the test case

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

* Fix: imported more than once

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

---------

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2023-01-31 17:14:03 +08:00
qiaozp
444d315143 Fix: rework on apisrever e2e test covergae (#5390)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-01-31 15:04:24 +08:00
github-actions[bot]
2e3a89f6b1 Chore: update workflow version to fix panic (#5386)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 4ae1fe044e)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-01-31 10:57:40 +08:00
github-actions[bot]
d94293ac59 Fix: failed to create the record when rollbacking the application (#5381)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 57d85ecb7c)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2023-01-30 20:51:04 +08:00
github-actions[bot]
cc604cfadb Feat: upgrade cluster gateway to 1.7.0 (#5356)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 3245ea148c)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2023-01-19 11:21:38 +08:00
github-actions[bot]
8ef2513b2e fix: fix --cluster when addon enable (#5343)
Signed-off-by: zhaowei.wang <zhaowei.wang@metabit-trading.com>
(cherry picked from commit 021ca69cfd)

Co-authored-by: zhaowei.wang <zhaowei.wang@metabit-trading.com>
2023-01-13 17:09:26 +08:00
github-actions[bot]
657e3b1bde Fix: optimize skip reconcile and expose error if the traits patch an invalid workload like terraform (#5342)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 3730291eff)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-01-13 17:08:52 +08:00
github-actions[bot]
004e2a814d Feat: upgrade the workflow version to v0.4.0 (#5337)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit e0b8c9e4c9)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-01-13 16:57:03 +08:00
github-actions[bot]
6dcba5ef11 [Backport release-1.7] Fix: conflict while using gc policy and shared-resource policy concurrently (#5333)
* Fix: conflict while using gc policy and shared-resource policy concurrently

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

* Fix: github ci

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

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2023-01-13 15:55:05 +08:00
github-actions[bot]
fd39804dc9 Fix: maintain compatibility with old project data (#5331)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit fef55b9b1b)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2023-01-13 13:59:35 +08:00
github-actions[bot]
ce57fbb752 Feat: need one Trait to set Rollout strategy of Workload (#5327)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
(cherry picked from commit 5d00b2ac73)

Co-authored-by: StevenLeiZhang <zhangleiic@163.com>
2023-01-12 17:19:17 +08:00
github-actions[bot]
80b2b2c2d3 velaql support indexing into exported array field (#5323)
Signed-off-by: hnd4r7 <307365651@qq.com>
(cherry picked from commit 441d8f0a66)

Co-authored-by: hnd4r7 <307365651@qq.com>
2023-01-12 10:13:57 +08:00
github-actions[bot]
49d97e5c2b Fix typo in the long cli description of vela system command (#5322)
Signed-off-by: Girish Ramnani <girishramnani95@gmail.com>
(cherry picked from commit 273b91c41f)

Co-authored-by: Girish <girishramnani95@gmail.com>
2023-01-12 10:10:15 +08:00
github-actions[bot]
1ee5915546 Fix: the developer user can't load the definition (#5319)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 78c9a1a370)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2023-01-11 18:28:36 +08:00
github-actions[bot]
3f6b38cc7f small optimzie for addon (#5318)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

name the compoennt

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2023-01-11 16:33:16 +08:00
Jianbo Sun
c2c7ab91f9 Feat: vela dry-run render results should be affected by override policy and deploy workflowstep (#4815) (#5314)
* [Feature] vela dry-run render results should be affected by override policy and deploy workflowstep

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

* multiple input files support; policy,workflow support; new flag: merge orphan policy or workflow

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

* add more tests

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

* fix comment issues

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

* add tests

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

* fix e2e

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

* fix tests

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

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

Signed-off-by: cezhang <c1zhang.dev@gmail.com>
Co-authored-by: cezhang <c1zhang.dev@gmail.com>
2023-01-11 15:39:45 +08:00
github-actions[bot]
866ffb9689 Chore: vela delete doc (#5315)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit ce79ab1691)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2023-01-11 15:08:08 +08:00
github-actions[bot]
61afb366ee Fix: fix vela debug cli to find id for step (#5313)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit 2f77353cbe)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-01-11 14:57:02 +08:00
github-actions[bot]
a2a8d73a58 Fix: don't return err if subresource type is not found when listing application resources (#5312)
Signed-off-by: hnd4r7 <307365651@qq.com>
(cherry picked from commit 58a150d1d4)

Co-authored-by: hnd4r7 <307365651@qq.com>
2023-01-11 14:56:22 +08:00
github-actions[bot]
fc3b428788 fix: errorMsg when uninstall vela (#5310)
Signed-off-by: bitliu <bitliu@tencent.com>
(cherry picked from commit 771e0b5429)

Co-authored-by: bitliu <bitliu@tencent.com>
2023-01-11 14:49:14 +08:00
github-actions[bot]
500dc52b34 [Backport release-1.7] Fix: create a config with the same name reported an incorrect error (#5307)
* Fix: create a config with the same name reported an incorrect error

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

* Fix: create a config with the same name reported an incorrect error

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

Co-authored-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2023-01-11 14:25:13 +08:00
github-actions[bot]
789aa38476 [Backport release-1.7] Feat: enhance the application synchronizer (#5305)
* Feat: enhance the application synchronizer

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

* Fix: e2e test case

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

* Fix: the unit test case

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2023-01-11 14:24:25 +08:00
github-actions[bot]
17adf35717 Fix: Index structure map[string]string,Mongo resulting in inconsistent results obtained by filtering non-string type by index. (#5303)
Signed-off-by: old.prince <di7zhang@gmail.com>
(cherry picked from commit a763d3da54)

Co-authored-by: old.prince <di7zhang@gmail.com>
2023-01-11 13:06:15 +08:00
github-actions[bot]
586f266798 [Backport release-1.7] Fix: more explicit error when addon package hasn't a metadata.yaml (#5302)
* more explicit error when addon package hasn't a metadata.yaml

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

fix checkdiff

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

* fix commets

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

* fix test

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2023-01-11 11:53:00 +08:00
github-actions[bot]
b8dcbe4964 Fix: Delete appplication fails if status.workflow.endTime not specified. (#5297)
Error Details:
E0106 08:12:02.807341       1 controller.go:317] controller/application "msg"="Reconciler error" "error"="Application.core.oam.dev \"test\" is invalid: status.workflow.endTime: Invalid value: \"null\": status.workflow.endTime in body must be of type string: \"null\"" "name"="test" "namespace"="test" "reconciler group"="core.oam.dev" "reconciler kind"="Application"

If the workflow is not completed, the endtime should be null, and the deletion of the application will fail

Signed-off-by: old.prince <di7zhang@gmail.com>
(cherry picked from commit 16b6a02018)

Co-authored-by: old.prince <di7zhang@gmail.com>
2023-01-10 15:16:26 +08:00
github-actions[bot]
778579c79b Test: let addon helper tests use local helm server (#5290)
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
(cherry picked from commit 44eaa1d004)

Co-authored-by: Charlie Chiang <charlie_c_0129@outlook.com>
2023-01-09 13:30:04 +08:00
Somefive
69293f4094 Feat: upgrade cluster-gateway to support client-identity-exchange config (#5284)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-01-06 16:37:57 +08:00
barnettZQG
3a917cb6af Fix: the addon management APIs support the user impersonation (#5282)
* Fix: the addon management APIs support the user impersonation

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

* Fix: change the test case

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2023-01-06 15:11:56 +08:00
barnettZQG
1c43c6d1c5 Fix: keep the workflow data structure in MongoDB (#5276)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2023-01-06 15:11:42 +08:00
barnettZQG
9bbf7bf01b Fix: make the synced workflow name normative (#5278)
* Fix: make the synced workflow name normative

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

* Fix: query the latest workflow

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2023-01-06 15:11:29 +08:00
Somefive
5a845104fb Feat: support interactive mode to manually skip encountered errors (#5266) 2023-01-06 15:03:47 +08:00
Somefive
693eb3cb1d Feat: add pre-dispatch dryrun check (#5277)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-01-06 10:46:50 +08:00
Jianbo Sun
78f5827fa6 Fix: move notes to the right to avoid package head to be invalid format (#5280)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2023-01-06 10:29:34 +08:00
Tianxin Dong
af8a7eb695 Fix: check the legacy definitions in vela install (#5268)
* Fix: check the legacy definitions in vela install

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

* take over views

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-01-05 19:13:19 +08:00
barnettZQG
97ce8ba500 Feat: add the API that rollbacks the application (#5273)
* Feat: add the API that rollbacks the application

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

* Fix: enhance the test cases

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

* Fix: use the klog/v2 package

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2023-01-05 17:45:42 +08:00
qiaozp
03d892bcf1 Fix: apiserver k8sclient have duplicated multicluster wrapper (#5275)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-01-05 15:42:38 +08:00
Tianxin Dong
360c9e24b2 Feat: support hostpath in storage and vela cli (#5265)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-01-05 10:08:54 +08:00
barnettZQG
ba0a726cfc Fix: make the impersonation feature work (#5261)
* Fix: make the impersonation feature work

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

* Fix: update the document of the chart

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2023-01-04 16:58:03 +08:00
aimuz
b2f4e237c2 docs: update bot.md link fail (#5262)
Signed-off-by: aimuz <mr.imuz@gmail.com>

Signed-off-by: aimuz <mr.imuz@gmail.com>
2023-01-04 11:52:29 +08:00
Tianxin Dong
5f71d05db1 Fix: fix inputs conflict for workflow (#5251)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-01-04 10:45:51 +08:00
barnettZQG
340059989b Feat: enhance the workflow restful APIs (#5252)
* Feat: enhange the workflow restful APIs

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

* Fix: change the test case

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

* Fix: the workflow record status is empty

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

* Fix: change the unit test case

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

* Fix: add some logs

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

* Fix: enhance the e2e test case

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2023-01-04 09:56:36 +08:00
suwliang3
5b636e451a Feat: Detect the correctness of the custom addon repository when adding add… (#5221)
* Detect the correctness of the custom addon repository when adding addon registry

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>

* wrap error

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>

* don't check if the registry is not helm

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>

* modify unit-test

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>

* Modify unit-test

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>
2023-01-03 20:02:59 +08:00
James Dobson
ecc77f8cae Test: prevent notification step definition test from failing when re-run. (#5253)
Signed-off-by: James Dobson <jdobson@guidewire.com>

Signed-off-by: James Dobson <jdobson@guidewire.com>
2023-01-03 13:46:07 +08:00
StevenLeiZhang
8a5239575a Feat: need one new Trait to support HorizontalPodAutoscaler of CPU/MEM/PodCustomMetrcs (#5225)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>

Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2023-01-03 11:17:31 +08:00
william302
6461625832 Docs: correct update project user api's doc description (#5244)
Signed-off-by: william302 <william902@qq.com>

Signed-off-by: william302 <william902@qq.com>
Co-authored-by: william302 <william902@qq.com>
2023-01-03 11:02:55 +08:00
James Dobson
28f6f42ed4 Fix: apply label to pod for vela-cli workflow step definition. Fixes #5247 (#5248)
Signed-off-by: James Dobson <jdobson@guidewire.com>

Signed-off-by: James Dobson <jdobson@guidewire.com>
2023-01-03 10:47:34 +08:00
old prince
7bc2f4e8d1 Fix:Dry-run from revision application,Problems caused by resource version lower than the current version (#5246)
Signed-off-by: old.prince <di7zhang@gmail.com>

Signed-off-by: old.prince <di7zhang@gmail.com>
2023-01-03 10:46:59 +08:00
barnettZQG
d588def0af Feat: versioned the context backend values to the app revision (#5231)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2023-01-02 21:23:12 +08:00
Somefive
6c12b968a7 Fix: add permission for release ci (#5245)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-12-31 13:23:03 +08:00
Somefive
18f778a871 Fix: gc failure cause workflow restart not working properly (#5240)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-12-29 23:15:02 +08:00
Siege Lion
0f6c244d81 Fix: remove cluster field from pod view in vela top and optimize some ui (#5237) 2022-12-29 19:58:43 +08:00
my-git9
2fb0633354 cleanup ioutil for newer go version (#5238)
Signed-off-by: xin.li <xin.li@daocloud.io>

Signed-off-by: xin.li <xin.li@daocloud.io>
2022-12-29 19:34:45 +08:00
Tianxin Dong
38aa522016 Chore: update workflow version to add restart from step and fix bugs (#5233)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-12-29 18:34:59 +08:00
dependabot[bot]
7cc7ea2fa0 Chore(deps): Bump github.com/containerd/containerd from 1.6.6 to 1.6.12 (#5235)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.6.6 to 1.6.12.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.6.6...v1.6.12)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-27 18:04:49 +08:00
Somefive
88f4c33d72 Feat: upgrade dependency (#5217) 2022-12-27 16:28:13 +08:00
qiaozp
a11f2cdae5 Fix: dependency makefile variable error (#5234)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-27 15:45:45 +08:00
Somefive
f0902e91d1 Feat: add prestart-hook for vela-core and add crd guard check (#5232)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-12-27 10:18:01 +08:00
qiaozp
8988d9a224 Fix: pin dependencies to hash (#5223)
* Fix: pin dependencies to hash

remove useless action and makefile steps

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

* reinstall golangci-lint with certain version

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

* rollback setup node

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

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-26 17:36:14 +08:00
qiaozp
cadaa996da Fix: remove useless field when loading pod in top (#5228)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-26 11:57:42 +08:00
xingming01
25b9350fd4 Feat: the webservice component has no args parameter #5226 (#5227)
Add the args parameter to the webservice component

Signed-off-by: xingming01 <whatissoftware@163.com>

Signed-off-by: xingming01 <whatissoftware@163.com>
2022-12-26 10:38:49 +08:00
Joshua Agboola
a9bc43a9dd Feat: Support SSH for retrieving terraform modules in private git repo (#5059)
* Feat: Support SSH for retrieving terraform modules in private git repo

Signed-off-by: motilayo <44736801+motilayo@users.noreply.github.com>

* fix lint errors

Signed-off-by: motilayo <44736801+motilayo@users.noreply.github.com>

* fix gofmt lint error

Signed-off-by: motilayo <joshuaagboola@live.ca>

* update gitCredentialsReference to gitCredentialsSecretReference, validate secret, improve known_hosts logic

Signed-off-by: motilayo <joshuaagboola@live.ca>

* SImplify logic to get publickey

Signed-off-by: motilayo <joshuaagboola@live.ca>

* Set known_hosts and export SSH_KNOWN_HOSTS

Signed-off-by: motilayo <joshuaagboola@live.ca>

* Call GetGitSSHPublicKey for cli

Signed-off-by: motilayo <joshuaagboola@live.ca>

* fix parser.go - nil check for ref.Client

Signed-off-by: motilayo <joshuaagboola@live.ca>

* Unit test for GetGitSSHPublicKey

Signed-off-by: motilayo <joshuaagboola@live.ca>

* improve test coverage

Signed-off-by: motilayo <joshuaagboola@live.ca>

* make reviewable

Signed-off-by: motilayo <joshuaagboola@live.ca>

* minor improvements & cleanup

Signed-off-by: motilayo <joshuaagboola@live.ca>

* update secret name in test

Signed-off-by: motilayo <joshuaagboola@live.ca>

Signed-off-by: motilayo <44736801+motilayo@users.noreply.github.com>
Signed-off-by: motilayo <joshuaagboola@live.ca>
2022-12-23 16:27:27 +08:00
qiaozp
4ad8a13b5e Feat: support data-passing in deploy step (#5161)
* Feat: support component data-passing in deploy step

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

* health check with input

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

* add union test for io and replication

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

* format

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

* format

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

* use pkg/slices.parMap

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

* reduce the GET request

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

* reviewable

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

* fix break test

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

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-23 14:50:28 +08:00
Jianbo Sun
c7c6009e1c Chore: enhance workflow with specific git commit id (#5220)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-12-21 14:29:54 +08:00
Tianxin Dong
a5a1a2ed15 Fix: optimize build push image step (#5215)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-12-20 17:28:01 +08:00
Somefive
8798371454 Feat: change health check resource fetch order (#5190)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-12-20 17:09:47 +08:00
Somefive
9151b3d51f Fix: registry permission (#5216)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-12-20 17:07:07 +08:00
Somefive
8ef512d9f6 Feat: gc orphan resources (#4847)
* Feat: support orphan resource when deleting application

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

* Test: add test for vela delete --orphan

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

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-12-20 16:14:23 +08:00
Somefive
c98d0d5bd1 Feat: vela adopt command (#5197)
* Feat: vela adopt

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

* Feat: support adopt native resources

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

* Test: add test for vela adopt

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

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-12-20 16:12:34 +08:00
Siege Lion
4e611fe736 Feat: vela top supports custom theme features (#5180)
* Feat: add the diy theme feature

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

* Fix: add test case

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

* Fix: update go mod to fix vela top can't show on some terminal

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

* Fix: add test case

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

* Feat: embed theme file

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

* Feat: add theme selector and add test cases

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

* Fix: fix type bug

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

* Fix: fix some file bugs

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

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-12-20 14:13:26 +08:00
qiaozp
3f600b2e28 Fix: add write package permission in registry CI (#5213)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-20 12:01:41 +08:00
Tianxin Dong
0b21c54236 Fix: fix ci with override-definitions for definitions conflict (#5208)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-12-20 11:40:06 +08:00
qiaozp
2899fa6f8f Fix: limit github action permission (#5210)
* Fix: limit github action permission

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

* all limit

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

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-20 10:21:02 +08:00
Jianbo Sun
9bd443cded Chore: add ossf/scorecard-action to secure workflows (#5209)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-12-19 19:18:30 +08:00
Tianxin Dong
1f7b9cebcc Feat: add unify step definitions from catalog (#5199)
* Feat: add unify step definitions from catalog

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

* add kaniko executor example

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

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-12-19 17:06:51 +08:00
Tianxin Dong
863b36226d Fix: add controller version for pipeline in velaux (#5185)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-12-19 13:41:24 +08:00
zhaohuiweixiao
1ebb64d4d4 Fix: addon ls comman does not show the componentless application (#5201)
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
2022-12-19 12:42:31 +08:00
suwliang3
e6fe7eb7d3 Feat: rollout support statefulsets (#5202)
* rollout support workload

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>

* modify the error output

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>
2022-12-19 12:08:42 +08:00
Jianbo Sun
dcb5378ff9 Feat: support NOTES.cue in addon for additional info printer (#5195)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-12-16 18:07:27 +08:00
Jianbo Sun
c94fa21c28 Feat: optimize controller default value for better performance (#5194)
* Feat: optimize controller default value for better performance

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

* try to fix rollout e2e-test

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

try 2 fix

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

fix e2e test

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

fix e2e test

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

fix e2e tests

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

fix e2e tests

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

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-12-16 17:54:59 +08:00
suwliang3
2b3da03da8 Feat: return notFound error when deleting app (#5189)
Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>
2022-12-14 18:47:57 +08:00
zhaohuiweixiao
66fbd104e9 Fix: The error of cannot fetch addon package breaks the loop to continue looking for addon package in the remaining registries (#5187)
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
2022-12-14 13:35:12 +08:00
Jianbo Sun
ac9cf58afa Feat: support fallback to kubeconfig namespace when env not set (#5182)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-12-13 14:53:54 +08:00
Jianbo Sun
b6f4328167 Feat: support outputs objects for policy (#5183)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-12-13 14:52:16 +08:00
wyike
e63aa444e5 Fix: check if enabling operation will uninstall controller from some clusters (#5179)
* check clusters parameter of addon will uninstall from clusters

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

* revert go mod

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

* fix comments

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

* skip verify version check

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

* small fix for error notice

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

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-12-12 13:40:48 +08:00
qiaozp
54285e6c64 Feat: add multicluster test for vela logs (#5168)
* Feat: add multicluster test for vela logs

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

* reviewable

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>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-09 10:43:54 +08:00
Jianbo Sun
48bf5cb644 Fix: readme badge broken (#5175)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-12-08 20:05:22 +08:00
dependabot[bot]
336408f3d0 Chore(deps): Bump github.com/containerd/containerd from 1.5.13 to 1.5.16 (#5169)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.5.13 to 1.5.16.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.5.13...v1.5.16)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-08 10:57:11 +08:00
Jianbo Sun
b9e7c710d8 Feat: add options for addon parameter (#5166)
* Feat: add options for addon parameter

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

* Fix: wrongly report disbaled when addon is not existed

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

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-12-07 17:22:38 +08:00
Jianbo Sun
c8b24ab363 Fix: vela show docs can't generate composition type (#5163)
* Fix: vela show can not display or result

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

* Fix: vela show docs can't generate composition type

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

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-12-06 16:12:45 +08:00
qiaozp
62b4d9144f Fix: CollectLogsInPod won't work in multicluster (#5160)
* Fix: CollectLogsInPod won't work in multicluster

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

* clean up

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

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-06 15:49:39 +08:00
qiaozp
6627dc33a9 Fix: can not logs from pod of subclusters (#5157)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-03 21:07:11 +08:00
Siege Lion
49335fdcdb Feat: Introduce timeout mechanism into cache and update network request mechanism in vela top (#5153)
* Fix: update cache to lru cache with expire time

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

* Fix: add auto refresh to topology view and fix the refresh bug in resource view
Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-12-03 12:43:33 +08:00
qiaozp
b8c08c3574 Feat: support huawei cloud terraform generation (#5144)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-12-03 12:42:52 +08:00
zhaohuiweixiao
32354d7fb1 Fix: addon upgrade command does not recognize the --clusters flag (#5143)
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
2022-12-03 12:42:24 +08:00
Tianxin Dong
11c6b2bc98 Fix: update the workflow vendor and delete mode in workflow spec (#5149)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-12-02 19:04:12 +08:00
Jianbo Sun
ec07e641ee Chore: refine logs and align using klog/v2 (#5145)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-12-02 14:50:06 +08:00
jguionnet
3b8cd84f82 Feat: Add startup probe trait (#5093)
* Feat: Add startup probe trait

Signed-off-by: Jerome Guionnet <jguionnet@guidewire.com>

* Feat: Implemented review comments in startup probe trait

Signed-off-by: Jerome Guionnet <jguionnet@guidewire.com>

Signed-off-by: Jerome Guionnet <jguionnet@guidewire.com>
2022-12-02 11:49:00 +08:00
Ziqi Zhao
88545e5aa8 fix format error (#5146)
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
2022-12-01 16:00:32 +08:00
qiaozp
bc041cf940 Fix: vela status --endpoint show no IP when only one master node (#5129)
Add fallback if no worker node

check app exist

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

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-11-30 10:41:11 +08:00
JohnJan
9aa2ec3ccd Refactor: Use github.com/spf13/cobra to execute cmd for vela-core (#5126)
* Refactor: Use github.com/spf13/cobra to execute cmd for vela-core

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Refactor: Use github.com/spf13/cobra to execute cmd for vela-core

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Refactor: Use github.com/spf13/cobra to execute cmd for vela-core

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2022-11-28 17:56:38 +08:00
Somefive
1dd08f35ef Fix: container image cue (#5127)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-11-28 11:35:20 +08:00
Somefive
a205fff1a7 Fix: add fogdong to codeowners of packages (#5134)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-11-28 11:33:39 +08:00
wyike
191dbcc58d Fix: bug of filter registry func will modify origin data (#5118)
* fix filter registry func flaky

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

* fix comments

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

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-11-24 15:05:38 +08:00
Jianbo Sun
cd565f362f Chore: add definition example doc CI check (#5117)
* Chore: add definition example doc CI check

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

* Fix: add example doc for trait

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

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-11-24 14:47:41 +08:00
Jianbo Sun
e5d8fcf2f8 Fix: apiserver image build and add CI check for it (#5116)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-11-24 12:11:16 +08:00
Charlie Chiang
fdc4622208 Feat: add support for compressing apprev using gzip and zstd (#5090)
* Feat: add support for compressing apprev using gzip and zstd

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>

* Refactor: use move compressible fields into a separate struct

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

* Refactor: use compression util from kubevela/pkg

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

* Test: fix core-api-test

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

* Feat: add compression ratio in `revision list`

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

* Test: fix tests

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

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-11-24 10:27:13 +08:00
Somefive
734025f03f Feat: takeover & readonly policy (#5102)
* Feat: takeover & readonly

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

* Feat: add tests

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

* Feat: add cue def for read-only and take-over

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

* Docs: add example doc

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

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-11-24 09:48:27 +08:00
wyike
277d94f447 Fix: bug when addon dependent an addon in other registry (#5083)
* fix several bugs of addon

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

* fix golint error

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

* fix error and add tests

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

* fix comments and fix apiserver test

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

* fix typo

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

* fix tests

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

* small fix

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

* small fix

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

* add parameter in apiserver and test

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

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-11-24 09:42:28 +08:00
Somefive
e05f34392d Fix: multicluster cluster scope ref (#5111)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-11-23 19:41:29 +08:00
basefas
8516ede345 fix: update actions (#5108)
Signed-off-by: basefas <basefas@hotmail.com>

Signed-off-by: basefas <basefas@hotmail.com>
2022-11-23 10:05:25 +08:00
basefas
6363967895 Fix: update actions to solve 「 deprecated 」warnings (#5094)
* Fix: update actions to solve 「 deprecated 」warnings

Signed-off-by: basefas <basefas@hotmail.com>

* fix: update action & delete unused parameter

Signed-off-by: basefas <basefas@hotmail.com>

Signed-off-by: basefas <basefas@hotmail.com>
2022-11-22 23:22:25 +08:00
qiaozp
655697f2fd Fix: end test environments (#5106)
* Fix: end test environments

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-11-22 19:06:51 +08:00
Somefive
8252b1eada Fix: patchOutputs bug for multiple outputs (#5101)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-11-22 10:52:49 +08:00
Jianbo Sun
139009546c Chore: merge goverance doc to community repo (#5103)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-11-22 10:19:30 +08:00
JohnJan
1530f6c24f Refactor: Use github.com/spf13/cobra to execute cmd for apiserver (#5085)
Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2022-11-22 10:08:31 +08:00
Somefive
eddd131dcd Docs: add KEPs introduction to the main repo (#5099)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-11-21 15:19:31 +08:00
Tianxin Dong
78f4e00dac Fix: fix acr webhook for enterprise registry (#5097)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-11-21 14:16:04 +08:00
jguionnet
66bffabc1b Feat: add topologySpreadConstraints traits (#5081)
* Feat: add topologySpreadConstraints traits

Signed-off-by: Jerome Guionnet <jguionnet@guidewire.com>

* make reviewable formatting and file gen

Signed-off-by: Jerome Guionnet <jguionnet@guidewire.com>

Signed-off-by: Jerome Guionnet <jguionnet@guidewire.com>
2022-11-21 11:02:05 +08:00
Jianbo Sun
c89f268af1 Feat: support dry-run with cue format definition (#5078)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-11-16 18:09:59 +08:00
Tianxin Dong
ee28112015 Feat: add print message example (#5077)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-11-16 16:32:08 +08:00
Tianxin Dong
a5c7804185 Feat: add apply component definition for docs (#5070)
* Feat: add apply component definition for docs

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

* Feat: add apply component definition for docs

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

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-11-16 14:02:50 +08:00
qiaozp
85d5eec8b4 Fix: code vulnerability (#5054)
* Fix: code vulnerability

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

* lint

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

* imports

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

* use space

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

* reuse sanitize function

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-11-16 13:47:03 +08:00
Jianbo Sun
3bd38584d7 Feat: support vela up --wait and --timeout (#5073)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-11-15 20:59:15 +08:00
Jianbo Sun
2c7f294279 Chore: update test case and remove unnecessary info (#5069)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-11-15 20:02:30 +08:00
nuclearwu
380d0ff9a1 Fix: remove unnecessary case in field selector (#5064)
Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2022-11-15 15:00:30 +08:00
Tianxin Dong
2bbf957c29 Fix: fix fill array with array in inputs (#5066)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-11-15 14:13:34 +08:00
Jianbo Sun
467e7c992b Chore: Cleanup useless examples (#5067)
* Chore: remove appdeployment examples as it's already deprecated

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

* Chore: remove approllout docs as it's already deprecated

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

* Chore: remove kubecon 2020 demo as it's not worked due to deprecation

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

* Chore: remove unused Observability Implementation

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

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-11-15 14:02:13 +08:00
wyike
e706b5d4a3 add tests (#5058)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-11-15 13:16:11 +08:00
qiaozp
84feb2beb4 Fix: update action script (#4959) 2022-11-14 19:42:57 +08:00
tigerK
46c8f104c3 [docs]cpuscaler traits documentation example (#5062)
Signed-off-by: yanru.lv <yanru.lv@daocloud.io>

Signed-off-by: yanru.lv <yanru.lv@daocloud.io>
2022-11-14 16:55:12 +08:00
Tianxin Dong
23c959fb71 Fix: unify stdlib for workflow and kubevela (#5053)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-11-14 13:24:24 +08:00
qiaozp
a74fb181b3 Chore: remove legacy o11y logic (#5046)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-11-14 11:43:23 +08:00
nuclearwu
b8535d2c5e Fix: Failed to get detail policy for application (#5043)
* Fix: Failed to get detail policy for application

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Fix: Failed to get detail policy for application

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2022-11-10 19:23:48 +08:00
Tianxin Dong
986a3a1f2a Fix: add debug for workflowrun and support debug sub steps (#5037)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-11-10 10:53:10 +08:00
Siege Lion
522efff188 Fix: fix the stuck problem and use LRU cache to promote the speed of loading topology (#5002)
* Fix: fix the stuck problem and use lru cache to promote the speed of loading topology

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

* Fix: reuse existing lru golang library

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

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-11-09 16:08:57 +08:00
Somefive
afd363b896 Feat: support webservice containing duplicate port with different protocol (#5034)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-11-09 13:14:27 +08:00
nuclearwu
a944f47313 Feat: support field selector filter for 'vela ls' (#5016)
* Feat: support field selector filter for 'vela ls'

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Feat: support field selector filter for 'vela ls'

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Feat: support field selector filter for 'vela ls'

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Feat: support field selector filter for 'vela ls'

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2022-11-09 11:27:25 +08:00
qiaozp
755005bb56 Fix: higher version contraint in install command (#5021)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-11-09 11:24:57 +08:00
wyike
5ad47a1947 Fix: remove the reference of v1beta1 ingress (#5026) 2022-11-08 22:59:31 +08:00
Tianxin Dong
7c0918375e Fix: temporary fix comments in comprehesions for env trait (#5020)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-11-08 15:26:27 +08:00
Tianxin Dong
d6466368c1 Feat: add scope label in workflow step defs (#4980)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-11-08 15:05:27 +08:00
wyike
5d0b64773e use vi as ingress's target apiVersion (#5019)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix test

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

fix test

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

revert test

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

add tests

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

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-11-08 12:03:09 +08:00
qiaozp
e79e12fbe6 Fix: vela status will always get external ip first (#5014)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-11-07 17:54:54 +08:00
nuclearwu
853df82f4a Fix: vela cluster join reports 'resource name may not be empty' error (#4998)
Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2022-11-07 16:13:39 +08:00
Siege Lion
0e849d142c Fix: fix problem of loading pods of cronjob (#5007)
Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-11-07 11:06:14 +08:00
qiaozp
7e012f5ca0 Fix: remove duplicate mock server in CI (#5011)
* Fix: not killing mock server process every time

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

* remove redundent mock server

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

Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-11-07 10:13:12 +08:00
nuclearwu
ef897db10b Feat: support label selector filter for 'vela ls' (#4966) 2022-11-06 11:43:10 +08:00
wyike
85489c63b4 Fix: forbid 302 request to avoid SSRF (#5000)
* fix helm chart list endpoint SSRF CVE

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

* revert error log

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

* change with const value

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

fix ci

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

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-11-04 20:15:20 +08:00
barnettZQG
7f1a9010dc Chore: update the API schema (#4992)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-11-04 12:00:04 +08:00
Jianbo Sun
6b79104923 Fix: test ci windows (#4990)
* Fix: test ci windows

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

* Fix: rename add exe suffix for command

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

* Fix: trim extra commands

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

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-11-03 15:20:29 +08:00
yangs
0c3db0b0e6 Feat: add build check for generate kubevela-core-api (#4973)
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-11-03 13:25:55 +08:00
Somefive
89237d2681 Fix: app contains app override the child app with parent app label (#4985)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-11-02 22:38:59 +08:00
Tianxin Dong
0a53eb2973 Fix: fix filepath for windows (#4984)
* Fix: fix filepath for windows

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

* test ci

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

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-11-02 22:38:39 +08:00
barnettZQG
195d35dcc6 Fix: enhance the default permissions (#4975)
* Fix: enhance the default permissions

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

* Fix: unit test error

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-11-01 20:50:49 +08:00
Tianxin Dong
19fbe2faa8 Feat: allowing restart a compeleted workflow (#4972)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-11-01 20:34:56 +08:00
qiaozp
4b9e071558 Fix: mongodb can not decode runtime.Object (#4971)
* Fix: mongodb can not decode runtime.Object

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

* reuse struct

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

* fix no output when filter

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

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-11-01 17:20:30 +08:00
barnettZQG
fa44776702 Fix: grant the permission to read the ConfigMap in the vela-system namesapce (#4961)
* Fix: grant the permission to read the ConfigMap in the vela-system namespace

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

* Fix: change the test

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-11-01 09:58:18 +08:00
qiaozp
23cbc9c91f Feat: implement pipeline APIs (#4908)
* add context when run pipeline

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

* Feat: implement pipeline API

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

* Extract get log logic and implement getPipelineRunLog API

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

* Init and delete pipeline contexts

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

* fix panic

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

* Allow not specifying context

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

* change pipeline to path parameter

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

* Add permission check filter

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

* project -> projects in route

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

* fix route conflict

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

* Add project alias

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

* Feat: change the list pipeline API

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

* Feat: filter the project

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

* Fix: the error of the run APi

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

* fix log pipeline run API

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

* Fix lint, fix the error of log api

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

* fix error returning

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

* Fix: change the lable to annotation

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

* remove log config not found error

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

* fix pipeline list api return no context info

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

* Fix: create the namespace

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

* get pipeline lastrun info

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

* allow query single step output

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

* organize code in api layer

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

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

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

* fix get output and implement get input api

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

* Fix: change the last run

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

* if query sub-step outout, return it directly

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

* Fix: change the run stats

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

* Fix: change the output

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

* flatten the input/output api

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

* more info for i/o vars

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

* fix nested i/o struct

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

* add fromStep in input api

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

* add e2e test skeleton

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

* add more e2e test

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

* use db to store pipeline

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

* keep the last 5k lines of log

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

* use stern param to keep last lines of logs

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

* filter, nil labels, spec check

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

* empty res, index, detail param

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

* Add e2e test

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

* fix e2e test and unit test

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

* add context e2e test

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

* goimports

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

* add more test

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

* review

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

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

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

* fix e2e test

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

* add stop test

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

* more coverage

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

* single case selct

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

* optimize log color

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

* add default permission and role

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

* fix permission ut

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

* change the log api implementation

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

* add color, add container order

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

* lint

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

* fix filter nil will cut all log

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

* longer timeout and lint

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

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-10-31 23:59:04 +08:00
Tianxin Dong
8f4ce76543 Chore: stable the version of cue and workflow (#4963)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-31 14:27:46 +08:00
barnettZQG
2dfe233ebe Fix: do not change the workflow after the env changed (#4954)
* Fix: do not change the workflow after the env changed

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

* Fix: change the test case

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

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

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

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-10-31 11:15:48 +08:00
Tianxin Dong
73bed17869 Feat: add mode in workflow template (#4926)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-31 10:57:05 +08:00
wyike
21bf141019 Fix: bocde error override origin error message (#4951)
* fix bcode error

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

* small fix

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

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-10-29 16:02:30 +08:00
nuclearwu
c990bcdf66 Fix: update namespace only if it doesn't have the env label (#4947)
* Fix: update namespace only if it doesn't have the env label

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

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

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2022-10-29 10:35:21 +08:00
tangoliu
14ac74f76d It is unnecessary to judge that the index function is not null (#4944)
Signed-off-by: liutiangang <liutiangang@cmbchina.com>

Signed-off-by: liutiangang <liutiangang@cmbchina.com>
2022-10-29 09:11:18 +08:00
Tianxin Dong
63c7285b8b Feat: sync the model of api workflow with core (#4936)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-28 17:43:00 +08:00
wyike
560dad3873 more error info for apiservice and add tests (#4927)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

change the mock addon version

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

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-10-28 17:35:46 +08:00
Somefive
b97c3af09f Fix: apiserver & vela status use multi-cluster client (#4916) 2022-10-28 14:02:42 +08:00
Siege Lion
de9fa2f821 Fix: can't obtain pods generated by Crontask component (patch of PR 4925) (#4942)
* Fix: get label selector from cronJob

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

* Fix: small fix

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

* Fix: use scheme create obj

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

* Fix: update method of generating selector

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

* Fix: update cron-task

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

* Fix: add test case

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-28 10:57:48 +08:00
Jianbo Sun
63c9896d82 Fix: update export2config and export2secret example (#4932)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-10-27 19:06:17 +08:00
wyike
cad525ff16 fix gitlab addon registry (#4934)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-10-27 19:03:57 +08:00
Tianxin Dong
01c759dcd1 Fix: fix gen doc for container image (#4935)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-27 19:03:13 +08:00
Young-Zen
ea12c0f11e Fix: get Application status using jsonpath filter expression (#4923)
Signed-off-by: yanghaojia <yanghaojia@coding.net>

Signed-off-by: yanghaojia <yanghaojia@coding.net>
Co-authored-by: yanghaojia <yanghaojia@coding.net>
2022-10-27 14:41:55 +08:00
Siege Lion
bd5864f40a Fix: can't get pods of CronTask component (#4925)
* Fix: get label selector from cronJob

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

* Fix: update cron-task yaml

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-10-27 10:47:47 +08:00
Tianxin Dong
b7a763c074 Feat: support operations for workflow run (#4920)
* Feat: support operations for workflow run

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

* fix test

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

* fix lint

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

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-26 16:04:34 +08:00
朱晓兵
c4a0c1480d Feat: enhance the apply-once capability (#4874)
* Feat: enhance the apply-once capability

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

* Fix: add unit-test

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

* Fix: adjustment variable name

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

* Fix: add doc

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

* Fix: adjustment variable name

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

Signed-off-by: 朱晓兵 <596908030@qq.com>
2022-10-25 21:15:21 +08:00
Tianxin Dong
2324357907 Fix: add sub step in vela workflow logs (#4915)
* Fix: add sub step in vela workflow logs

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

* fix lint

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

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-10-25 16:39:38 +08:00
ZhongsJie
1e3759bb25 Feat: add feature docs and controller parameters for MultiStageComponentApply (#4873)
Signed-off-by: ZhongsJie <zhongsjie@gmail.com>

Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
2022-10-25 14:51:26 +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
wyike
25b0cb8ee1 Feat: Addon support app template written by cuelang. (#4401)
* pass tests

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

refactor some codes

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

WIP delete useless workflow

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

add checklegacy addon

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

refactor some logics

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

fix panic test

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

delete useless addon test

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

fix empty clusterargs

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

fix comments

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

* rewrite some logic to support parameter ui

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

* rename template cue

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

fix panic test

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

add tests

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

fix render tests

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

fix checkdiff

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

* add tests

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

fix

add more tests

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

add tests

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

* update file header

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-22 17:58:19 +08:00
barnettZQG
96ece000dc Feat: support to sync the revision and the workflow status (#4419)
* Feat: support to sync the revision and the workflow status

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

* Fix: pass the unit test and e2e test

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

* Fix: e2e test case

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

* Fix: update the component pod view

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

* Fix: the pod struct does not match

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

* Fix: optimize the e2e test case

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-22 16:14:38 +08:00
StevenLeiZhang
67f3f2747a Fix: vela addon upgrade missing the history args (#4388)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-07-22 14:39:09 +08:00
Charlie Chiang
5890b58aea Feat: get raw Application yaml, json or jsonpath (#4415)
* Feat: get raw Application

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

* Fix: add gvk

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

* Feat: git rid of managedFields

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

* Style: fix typos

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

* Test: add test and make changes according to comments

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

* Feat: more help text

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

* Style: format imports

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-07-22 14:36:50 +08:00
barnettZQG
68967f7af8 Fix: the env name is empty (#4412)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-22 10:37:04 +08:00
Jianbo Sun
68a9565a1f Chore: trim debug info (#4423)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-22 10:36:38 +08:00
qiaozp
8aaf526877 Chore: upgrade kind in tests, fix flaky test (#4105)
* Chore: upgrade kind in tests, fix some hacky test.

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

* longer wait

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

* make e2e-multicluster test timeout 20m

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

* switch to kind v0.14.0

Signed-off-by: 伊灵 <qiaozhongpei.qzp@alibaba-inc.com>
2022-07-22 10:09:31 +08:00
Jianbo Sun
957302cb9d Feat: support vela kube apply for CUE and JSON files (#4420)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-21 16:02:57 +08:00
ZhongsJie
285a5cce18 Fix: ignore save when source is local-path (#4417)
Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
2022-07-21 14:30:49 +08:00
ZhongsJie
d386b64ea2 Feat: provide defualt namespace for dry-run (#4416)
Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
2022-07-21 10:04:20 +08:00
Tianxin Dong
181bc926f6 Fix: fix backoff time after default backoff times (#4413)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-07-20 15:45:23 +08:00
barnettZQG
ab6c1a57eb Fix: the empty SectionName causes panic (#4408)
* Fix: the empty SectionName causes panic

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

* Fix: unit test bug

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-19 22:05:56 +08:00
TIEDPAG
e37b0276c8 Feat: support addon helm repo skip tls verify (#4122) (#4146)
* Feat: support addon helm repo skip tls verify (#4122)

Signed-off-by: damianqin <damianqin@tiedpag.club>

* Fix: mv http server to BeforeSuite

Signed-off-by: damianqin <damianqin@tiedpag.club>

* Fix: fix ci error

Signed-off-by: damianqin <damianqin@tiedpag.club>

* Fix: fix merge

Signed-off-by: damianqin <damianqin@tiedpag.club>

* Feat: support addon helm repo skip tls verify (#4122)

Signed-off-by: damianqin <damianqin@tiedpag.club>

* Fix: mv http server to BeforeSuite

Signed-off-by: damianqin <damianqin@tiedpag.club>

* Fix: fix ci error

Signed-off-by: damianqin <damianqin@tiedpag.club>

* Fix: fix ci

Signed-off-by: damianqin <damianqin@tiedpag.club>

Co-authored-by: damianqin <damianqin@tiedpag.club>
Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-19 18:00:28 +08:00
Somefive
fd784e291c Feat: add several policy definition (#4409)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-19 15:47:01 +08:00
Tianxin Dong
16dfc1bf8a Feat: add pending phase in workflow step (#4365)
* Feat: add pending phase in workflow step

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

* fix test

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

* fix lint

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

* fix test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-07-19 14:31:20 +08:00
barnettZQG
f876a0b8f8 Fix: only compare with the default environment (#4402)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-19 11:01:33 +08:00
wyike
60129e0f94 Fix: fetch workflowpolicy policy info when request detail policy info (#4403)
* fix several bugs

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

* fix commentes

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

move test back

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-07-19 10:29:41 +08:00
Somefive
e747eae779 Fix: prevent apply existing orphan resource (#4399)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-18 19:23:41 +08:00
Jianbo Sun
b24e7523d8 Feat: generate docs for reference automatically (#4377)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Feat: refactor hardcode example to embd.FS

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

Fix: refactor doc gen for general types

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

Fix: update generate format

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

Fix: generate terraform reference docs

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

Feat: add definition reference generate script

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

Fix: refine output format

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

Fix: remove dup annotation

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

Fix: update doc

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

Fix: add i18n support

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

Feat: add translation

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

Feat: add policy definition gen

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

Fix: add compatibility for lable Annotation change

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

Fix: add more tests

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

Feat: allow mark example doc url on annotation

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

Fix: align vela show with vela def doc-gen, add vela def show equals with vela show

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-18 19:22:55 +08:00
barnettZQG
a519a6c89d Feat: optimize the dry run feature (#4364)
* Feat: optimize the dry run feature

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

* Fix: e2e test case

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

* Fix: change the bcode

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

* Fix: change some names

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-18 14:01:11 +08:00
Charlie Chiang
ace23f1c6f Feat: enhance addon init (#4370)
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-07-18 10:40:42 +08:00
Zheng Xi Zhou
557f7197b5 Fix: examples on how to use cloud resources (#3385)
Added RDS and OSS examples to show to use cloud resources

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-07-18 10:18:42 +08:00
Jianbo Sun
01737d62b0 Chore: split unit test from e2e test for apiserver and use skip-dup v4 (#4369)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-16 17:34:52 +08:00
barnettZQG
945852284f Fix: read the ca cert from the test env (#4391)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-15 22:09:13 +08:00
Tianxin Dong
eed081fd6f Fix: fix volumes duplicate in list (#4387)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-07-15 20:09:44 +08:00
wyike
203a7dfbda add two fileds (#4383)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-07-15 16:00:59 +08:00
Somefive
cba8cb4c94 Fix: add usage comment for ref-objects (#4384)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-14 18:49:54 +08:00
barnettZQG
1fc65f56bf Feat: support HTTPRoute to generate endpoint (#4378)
* Feat: support HTTPRoute to generate endpoint

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

* Feat: print the inner in CLI

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

* Fix: change the comment

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-14 18:15:20 +08:00
wyike
c29e980e8a Fix: fail directly when app terminated (#4363)
* fail directly when app terminated

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

* support suspend

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

fix typo

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-07-14 18:14:09 +08:00
barnettZQG
e52ae78bd7 Fix: the project manager no permission to query the project base info (#4380)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-14 11:54:58 +08:00
wyike
930d866e09 Feat: velaux support override policy (#4352)
* velaux support override policy

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

add comments

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

* in the middle of add test

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

fix

in the middle of work

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

add test

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

* add comments

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

reverse flacky test

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

fix goling

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

* add test for syspend step

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-07-14 11:52:49 +08:00
Somefive
3159da0bb3 Fix: several minor bugs (#4367)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-14 10:51:22 +08:00
Jianbo Sun
8571aa76ef Fix: abuse timeout context in terraform provider (#4374)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-13 15:47:15 +08:00
Jianbo Sun
072b80f6c6 Feat: support vela def apply for yaml definition (#4372)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-13 15:31:30 +08:00
Jianbo Sun
cde76989a0 Feat: support resource topology for endpoints (#4362)
* Feat: support resource topology for endpoints

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

* Fix: add and refactor the test for endpoint

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-13 14:51:06 +08:00
Somefive
3b3898bf71 Feat: add status check for expose trait (#4356)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-12 13:24:56 +08:00
barnettZQG
c43575a63c Fix: add the job of independently publishing chart packages (#4360)
* Fix: add the job of independently publishing chart packages

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

* Fix: add the job of independently publishing chart packages

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-12 12:23:28 +08:00
huiwq1990
b0020b0600 cleanup cluster exist check (#4357)
Signed-off-by: huiwq1990 <huiwq1990@163.com>
2022-07-12 11:11:06 +08:00
Tianxin Dong
a8d5403fee Feat: optimize imports packages to reduce 75% cpu with better performance (#4345)
* Feat: optimize imports packages

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

* fix test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-07-11 17:32:18 +08:00
Jianbo Sun
649aaa29a4 Chore: upgrade cloud.google.com/go/compute to 1.7.0 (#4350)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-11 17:29:23 +08:00
Somefive
40c76071a8 Fix: init container bug (#4351)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-11 17:02:03 +08:00
Jianbo Sun
4bd4e9014f Feat: support read from URL for --file command globally (#4346)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-11 16:59:54 +08:00
Somefive
0cb85d897a Fix: health check use original ns if no override and original exists (#4349)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-11 16:46:14 +08:00
Somefive
2cfedf7439 Fix: escape resource name for label selector (#4348)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-11 15:26:14 +08:00
Somefive
b9b6c5f8bf Fix: ignore empty output file (#4347)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-11 14:59:32 +08:00
Somefive
ec094f2e36 Fix: enhance sidecar & init traits (#4341)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-08 19:08:38 +08:00
barnettZQG
b7bf9df55f Feat: supports multiple difference compare modes (#4334)
* Feat: supports multiple difference alignment modes

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

* Fix: change field name

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-08 09:38:18 +08:00
Somefive
201f68c6cd Feat: add daemon component def (#4335)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-07 19:48:52 +08:00
Somefive
cae7b327f8 Feat: reuse informer for app metrics (#4336)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-07 16:46:35 +08:00
Somefive
fd70aa96e9 Fix: disable apprev status update when apprev disabled (#4337)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-07 15:32:46 +08:00
Charlie Chiang
3a6d947f07 Feat: create VelaQL views using vela ql apply (#4324)
* Feat: create VelaQL views using `vela ql create`

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

* Style: format imports

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

* Refactor: merge reusable function

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

* Style: format import

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

* Refactor: make changes according to comments

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

* Test: add tests for `status` or `export` fields

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>

* Refactor: make changes according to comments

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

* Refactor: rename variables

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-07-07 13:59:16 +08:00
wyike
5de790413f Feat: support self-signed helm repo (#4322)
* support self-signed helmrepo

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

fix golint

fix golint error

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

* add certkey and certfile

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-07-07 12:21:59 +08:00
barnettZQG
09acc8a989 Fix: the target conflict when syncing the application (#4312)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-06 17:54:16 +08:00
Jianbo Sun
37605a1a8d Fix: filter last applied config for CRD, fixes #3679 (#4331)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-06 17:42:54 +08:00
Jianbo Sun
e0ab16851e Chore: refine the output of velaux addon fixes #3902 (#4332)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-06 17:42:20 +08:00
wyike
4ed3171b8e Fix: more cluster system info range. (#4329)
* more collect info

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

* fix comments

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-07-06 16:13:33 +08:00
huiwq1990
a3ab08741e end logic not use (#4325)
Signed-off-by: huiwq1990 <huiwq1990@163.com>
2022-07-06 15:46:10 +08:00
huiwq1990
c97124a30f Feat: add policy parser test (#4174)
Signed-off-by: huiwq1990 <huiwq1990@163.com>
2022-07-06 15:42:06 +08:00
Charlie Chiang
da5282a15d Feat: show or list revisions in vela def get and vela show (#4307)
* Feat: support --version when getting definitions

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

* Test: add tests

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

* Test: add tests for vela show

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

* Style: format imports

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>

* Test: fix tests

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-07-06 15:41:00 +08:00
Charlie Chiang
be317c412a Feat: print complex values in addon parameters (#4309)
* Feat: support nested parameters in addon parameters

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

* Feat: show all params

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

* Feat: handle any addon parameters

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

* Refactor: add a error check on json marshell

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-06 15:39:46 +08:00
Sumit Tembe
a422ae8ab4 Feat: don't ask user confirmation when delete with --force or --yes (#4259)
* feature: don't ask user confirmation when delete with --force or --yes

Signed-off-by: Sumit Tembe <sumit.tembe@outlook.com>

* added a new flag 'yes'

* don't skip user confirmation for --force

* skip user confirmation for --yes
2022-07-06 15:34:41 +08:00
Somefive
4509b974ad Feat: enhance deploy workflow step generator (#4315)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-06 14:31:46 +08:00
jiangshantao
d85f95fa19 Fix: ref-objects parameter with invalid field definition (#4319)
* fix: ref-objects parameter with invalid field definition

which cause validating webhook failed when use ref-objects component

Signed-off-by: jiangshantao <jiangshantao-dbg@qq.com>

* fix: run make reviewable

Signed-off-by: jiangshantao <jiangshantao-dbg@qq.com>

Co-authored-by: jst <jst@meitu.com>
2022-07-06 14:09:00 +08:00
barnettZQG
0e71a9d044 Feat: set the cloudshell instance max live time (#4313)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-05 10:58:00 +08:00
Jianbo Sun
eea8570e10 Feat: add the CloudShell feature (#4280)
* Feat: add the CloudShell feature

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

* Fix: unit test bug

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

* Feat: handle the error

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

* Feat: change the auth package

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

* Fix: change the CSR name

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

* Fix: change the generate function

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

* Fix: unit test

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

* Fix: e2e test

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-01 23:31:15 +08:00
barnettZQG
2af8ab13d6 Fix: fail to query the application logs with the special characters (#4305)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-01 20:14:05 +08:00
Jianbo Sun
9042bb29d5 Fix: Jfrog Webhook Handler Cannot Get Right Image (#4301)
Merge branch 'release-1.4'

Apply suggestions from code review

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

Update webhook.go

Fix: format

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

Co-authored-by: qingsliu <lqs429521992@qq.com>
2022-07-01 20:04:50 +08:00
Tianxin Dong
c6d170fef6 Fix: fix the goroutine leak in http request (#4298)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-07-01 17:52:54 +08:00
Somefive
8f11b5b1a4 Fix: kube apply ignore userinfo for rt (#4297)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-01 17:30:55 +08:00
wyike
7df0f20f70 support only provide vela or kubernetes version requirement (#4284)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix

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

helm package logic

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

delete useless code

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-07-01 17:06:22 +08:00
Somefive
51a60593cf Fix: context.namespace use override namespace when rendering component and trait (#4291)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-01 15:28:25 +08:00
Charlie Chiang
b2dfee134b Feat: print addon parameters recursively (#4290)
* Feat: support nested parameters in addon parameters

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

* Feat: show all params

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-06-30 23:38:38 +08:00
huiwq1990
68d2d84880 addon use cluster sdk to check deploy (#4282)
Signed-off-by: huiwq1990 <huiwq1990@163.com>
2022-06-30 19:10:32 +08:00
Somefive
de37545a12 Feat: disable component revision for component wo rollout (#4281)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-06-30 16:22:46 +08:00
qiaozp
7a87e6e632 Chore: avoid update version file when publish smaller version (#4272)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-06-30 15:50:04 +08:00
Somefive
0469ba494e Fix: controller use cluster client to support empty label selector selecting local cluster (#4275)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-06-29 19:04:28 +08:00
Siege Lion
cdafc03e7d Feat: search useful addon version automatically (#4232)
* Feat: search useful addon version automatically

Verify whether the current addon version meets the system version requirements according to the obtained specified version. There are two system version requirements: Vela core version, K8s version.

If meet the requirements and continue to perform the next task.

If the requirements are not met, obtain the highest version that meets the requirements

Refs #4181

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

* Fix: Optimize function implementation and code order, and modify test cases

add more comments of function

optimize package import sequence

optimize user interaction logic and error information extraction logic

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

* Fix: change template string of regular expression to const type string

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-06-29 17:46:56 +08:00
Jianbo Sun
0ece1d4400 Chore: update readme (#4279)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-29 16:22:55 +08:00
Somefive
ffb0d2fa87 Feat: enhance ServiceAccount trait to support privileges (#4276)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-06-29 14:59:06 +08:00
Jianbo Sun
71df27a8c3 Fix: support stdin and url for vela ql (#4274)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-29 14:50:24 +08:00
Charlie Chiang
370940070b Feat: filter definitions by which addon installed them (#4156)
* Feat: filter by source addon in `vela def list`

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

* Style: change header year to 2022

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

* Refactor: use generic filters for extensibility

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

* Refactor: change variable addonFilter to addonName

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

* Test: update tests according to code changes

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

* Refactor: unify SearchDefinition params using filters

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

* Test: simplify tests

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

* Style: remove redundant code

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

* Test: add tests with multiple filters

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

* Feat: show SOURCE-ADDON column in `def list`, if any

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

* Feat: add addon filter to apiserver definition-lists

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

* Style: fix lint issues

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

* Chore: update swagger doc accordingly

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

* Test: add tests for filter Applying

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

* Feat: add a helper function to apply filters to lists

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

* Style: format imports

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

* Feat: add OwnerAddon to DefinitionBase

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

* Test: add tests for OwnerAddon field

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

* Test: add addon util tests

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-06-29 10:55:50 +08:00
Charlie Chiang
d3454ec9d5 Feat: implement addon push command (#4261)
* Feat: implement addon push command

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

* Refactor: split functions

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

* Feat: add command usages

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

* Test: add tests for addon push command

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

* Chore: fix lint

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

* Test: fix old incomplete tests

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

* Test: also add test in pkg/addon

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

* Style: sort import

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

* Refactor: add break in for loop and remove default repo checks

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

* Style: format imports

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

* Feat: add a cli option to keep original Chart.yaml

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

* Style: add more help text

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

* Style: fix typo in comments

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

* Style: add more help text

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-06-28 20:16:45 +08:00
Tianxin Dong
4ecb26e8a2 Feat: store outputs for unsuccessful steps in workflow context (#4270)
* Feat: store outputs for unsuccessful steps in workflow context

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

* fix the test of velaql

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-06-28 18:49:17 +08:00
Jianbo Sun
0e98959d61 Fix: trim quot char for velaql output (#4267)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-27 16:48:31 +08:00
Jianbo Sun
8b441b6579 Fix: provider can't be added since 1.4 as context abused && Feat: add cache for remote terraform module in vela show (#4256)
* Fix: provider can't be added since 1.4 as context abused

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

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

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

* Fix: add message for terraform resource in error state

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-27 11:31:06 +08:00
Tianxin Dong
82fc74840d Fix: fix the dash case in if validate for inputs (#4253)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-06-27 11:28:00 +08:00
Sumit Tembe
5b9fb49a91 Feat: omit service output if there's nothing (#4260)
Signed-off-by: Sumit Tembe <sumit.tembe@outlook.com>
2022-06-27 10:18:43 +08:00
Carmen de Lope Contreras
15a56408fc environment from configmap or secret not mandatory in task and crontask componentdefinition (#4252)
Signed-off-by: Carmendelope <carmen@napptive.com>
2022-06-25 08:56:07 +08:00
Somefive
92fa67cd69 Feat: support url in ref-objects (#4240)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-06-24 19:34:51 +08:00
wyike
c4e1f39d28 Feat: Support kruise rollout (#4243)
* Feat: support kruise rollout

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

resolve roll back

fix

add tests

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

small fix

* fix rollback

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

topology filter by owner reference

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

fix ci

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

add comments

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

fix imports

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

fix lint

* rollback related tests

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

rename the operator

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

fix bugs

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

fix test

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

fix test

* clean args before start

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

fix test

* remove replace go mod

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

* fix operation tests

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

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-06-24 18:03:04 +08:00
StevenLeiZhang
dc660fc97d Fix: vela status print wrong STATUS (#4239)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-06-24 17:00:38 +08:00
Charlie Chiang
f8833e34bc Feat: implement addon init command (#4162)
* Feat: implement addon create command

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

* Refactor: make global vars local

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

* Style: fix typos

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

* Test: create test for file utils

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

* Feat: use -p flag to manually specify paths

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

* Refactor: make changes according to comments

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

* Feat: create empty scaffold if Chart-related paramaters are not provided

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

* Refactor: fix golangci-lint warnings

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

* Test: add cli tests

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

* Feat: show URL in errors if an invalid URL is detected

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-06-24 14:25:36 +08:00
Somefive
198fcfcc73 Feat: add metrics for workflow and app phase (#4236)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-06-24 14:15:02 +08:00
wyike
22fe52b19c Feat: skip validating version check (#4231)
* skip validating version check

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

* add comments

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

* fix comments

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

* fix test

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

* fix commments

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

* add compatible logic for old controller

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

* modify minimal

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-06-24 14:11:57 +08:00
Somefive
9c7d3f408d Feat: support shared resource (#4213)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-06-24 10:56:27 +08:00
Zheng Xi Zhou
4c90e90fff Fix: fixed the problems of display definition in web and support displaying WorkflowStep and Policy (#4234)
* Fix: fixed the problems of display definition in web

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

Signed-off-by: Zheng Xi Zhou <zhengxi.zzx@alibaba-inc.com>

* set printable type for {}

Signed-off-by: Zheng Xi Zhou <zhengxi.zzx@alibaba-inc.com>

* support WorkflowSteps and Policies

Signed-off-by: Zheng Xi Zhou <zhengxi.zzx@alibaba-inc.com>

Co-authored-by: Zheng Xi Zhou <zhengxi.zzx@alibaba-inc.com>
2022-06-23 19:45:49 +08:00
Tianxin Dong
e10928d96f Feat: add mode and meta in workflow (#4206)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-06-23 10:55:34 +08:00
Tianxin Dong
72ac218982 Feat: add timeout and if examples (#4226)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-06-23 10:30:24 +08:00
Somefive
85173a7597 Fix: json-patch & json-merge-patch open result (#4225)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-06-22 19:55:58 +08:00
Tianxin Dong
f7be1cd2fc Feat: support more expressions in if and op.Fail (#4151)
* Feat: support more expressions in if

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

* fix cache overrides context

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

* fix skip status

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

* add tests in tasks

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

* Feat: add fail action

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

* fix annotation in tests

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

* add failed reason in substeps

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

* fix look up nil value

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

* add tests in workflow

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

* add tests in application controller

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

* optimize the code

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

* add status in if

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

* fix dash case

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-06-22 14:51:23 +08:00
barnettZQG
cf296b757c Chore: change the acr registry address (#4214)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-06-22 13:48:33 +08:00
barnettZQG
2ec18bd52e Feat: add the API for querying the image info (#4209)
* Feat: add the API for querying the image info

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

* Fix: the code style

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-06-21 15:03:55 +08:00
Somefive
73be281273 Fix: cue patch remove temp var (#4207)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-06-20 17:36:28 +08:00
Jianbo Sun
71a02b434b Feat: support dry run for policy (#4201)
* Feat: support dry run for policy

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

* Fix: upgrade runc package

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-20 16:15:06 +08:00
barnettZQG
2ac3a7562d Feat: support to manage the CLI-created apps in VelaUX (#4197)
* Feat: support for automatically hosting CLI-created apps

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

* Fix: add the comment

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

* Fix: unit test bug

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

* Fix: unit test bug

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

* Fix: e2e error

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-06-20 16:06:48 +08:00
Charlie Chiang
e81d8ddacb Fix: skip endpoint table if no endpoints are found in addons (#4166)
* Feat: skip endpoint table if no endpoints are found in addons

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

* Style: rename function name

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

* Test: update tests to also exclude endpoints

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

* Refactor: reduce code changes

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-06-20 10:37:40 +08:00
Zhiyu Wang
e572235434 Feat: cli def alias support (#4185)
Signed-off-by: Zhiyu Wang <zhiyuwang.newbis@gmail.com>
2022-06-18 10:34:44 +08:00
Jianbo Sun
f157515251 Feat: enhance velq ql and support cue file (#4196)
* Feat: enhance velq ql and support cue file

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

* add statement

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-17 13:44:09 +08:00
Somefive
6ed041c590 Fix: clear namespace for cluster scoped resource for dispatching (#4193)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-06-16 14:29:08 +08:00
Zheng Xi Zhou
195c4267c6 Fix: fix the annotation for APIService (#4187)
Make the annatation for cert-manger be the same as the new version
secret

Signed-off-by: Zheng Xi Zhou <zhengxi.zzx@alibaba-inc.com>

Co-authored-by: Zheng Xi Zhou <zhengxi.zzx@alibaba-inc.com>
2022-06-16 11:01:18 +08:00
wyike
d2fca08acb Feat: cli addon add registry add more git types (#4170)
* add more git types

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-06-16 10:54:23 +08:00
maoyangLiu
dc0c194833 fix typo mistake (#4186) 2022-06-15 19:05:08 +08:00
Somefive
27ec48b617 Fix: enhance CLI for managing OCM clusters (#4165)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-06-15 11:18:59 +08:00
Xiangbo Ma
9d414ce123 Fix: fix trait customStatus error when controlPlanOnly=true (#4167)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-06-15 11:18:26 +08:00
Siege Lion
a9210487fa Fix: add handle of ".yml" type in readviewfile function (#4172)
handle of files of type ".yml" is ignored in the original function

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-06-15 00:29:16 +08:00
Siege Lion
0c190ef329 Feat: add the feature that views in addon are applied independently.(#3905) (#4154)
* Feat: add the feature that views in addon are applied independently.(#3905)

separate the deployment of views in addon and deploy them separately instead of nested in application.

see the issue for details

Refs #3905

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

* Fix: add test case of readViewFile.

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

* Fix: add the apply method of yaml view.

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

* Fix: add addon suit-test case

Signed-off-by: HanMengnan <1448189829@qq.com>
2022-06-13 20:07:20 +08:00
Tianxin Dong
87673093e9 Feat: add timeout in workflow step (#4121)
* Feat: add timeout in workflow step

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

* Feat: implement timeout in steps

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

* support backoff time for timeout

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

* fix tests

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

* fix resume workflow cli

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

* set suspend to false when terminate the workflow

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

* Feat: add validate workflow step name and more tests

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

* optimize the code

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-06-13 14:30:52 +08:00
barnettZQG
75156d5e75 Feat: optimize the API that list and detail definition (#4147)
* Fix: ignore the error that the definition API schema is not exist

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

* Fix: disable the cache when listing the definitions

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-06-13 13:24:30 +08:00
Somefive
2411399683 Feat: support insecure cluster (#4157)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-06-13 13:14:25 +08:00
kang.feng
f978519e69 Fix: mongoDB datastore can't list special email user(#4104) (#4129)
* Add description column to vela trait and component command (#4107)

Signed-off-by: Holger Protzek <holger.protzek@springernature.com>
Signed-off-by: fengkang <fengkangb@digitalchina.com>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Co-authored-by: Holger Protzek <3481523+hprotzek@users.noreply.github.com>
2022-06-10 15:26:48 +08:00
dependabot[bot]
6eca997ddd Chore(deps): Bump github.com/emicklei/go-restful/v3 (#4144)
Bumps [github.com/emicklei/go-restful/v3](https://github.com/emicklei/go-restful) from 3.0.0-rc2 to 3.8.0.
- [Release notes](https://github.com/emicklei/go-restful/releases)
- [Changelog](https://github.com/emicklei/go-restful/blob/v3/CHANGES.md)
- [Commits](https://github.com/emicklei/go-restful/compare/v3.0.0-rc2...v3.8.0)

---
updated-dependencies:
- dependency-name: github.com/emicklei/go-restful/v3
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-10 10:19:11 +08:00
Charlie Chiang
f8272d822b Chore: fix potential bot failures (#4141)
* Chore: fix potential bot failures

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

* Chore: add npm cache

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

* Chore: fix ubuntu version to 20.04 in issue-commands

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-06-09 22:45:05 +08:00
wyike
cbf9776fea Fix: api not exist don't break whole query process (#4130)
* make resource tree more

resourceTree more robust

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

* log the error

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-06-09 11:36:08 +08:00
ZhongsJie
ca0faa1f46 Fix: vela addon registry get panic (#4135)
Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
2022-06-09 10:15:47 +08:00
JarHMJ
146bcbd9a8 Feat: render color for outputs of vela up command (#4133)
Signed-off-by: huangminjie <minjie.huang@daocloud.io>
2022-06-09 10:15:05 +08:00
Charlie Chiang
b77cdaf5f5 Fix(cli): avoid incorrect addon name when using dot as local addon path (#4126)
* Fix(cli): avoid issues when using dot as local addon path

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

* Test(cli): add tests for `vela addon enable .`

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

* Test(cli): use sample addon to test

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

* Test(cli): fix typos in tests accordingly

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

* Test(cli): correct file path

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

* Test(cli): do not focus single test

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

* Test(cli): fix typos in tests accordingly

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

* Refactor: correct error output

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

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

Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-06-09 10:12:19 +08:00
Holger Protzek
deaf309f9b Add description column to vela trait and component command (#4107)
Signed-off-by: Holger Protzek <holger.protzek@springernature.com>
2022-06-08 14:28:32 +08:00
dependabot[bot]
910cb50ac3 Chore(deps): Bump github.com/containerd/containerd from 1.5.10 to 1.5.13 (#4123)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.5.10 to 1.5.13.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.5.10...v1.5.13)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-07 21:13:24 +08:00
Jianbo Sun
c1ccfb1d83 Fix: bump oamdev/kube-webhook-certgen to v2.4.1 to support arm64 (#4113)
* Fix: split the image build process to make it faster

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

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

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-05 14:16:31 +08:00
Jianbo Sun
05b45fa52c Fix: change the image name in ghcr to align with docker image registry (#4110)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-04 14:11:58 +08:00
Afzal Ansari
373abf4fe7 Fix: refactors lint issues in missing err in json return value (#3828)
* refactors error return value of encoding addon

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

* refactor error return value of encoding kubeapi

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

* refactors error return value of encoding worker

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

* refactors error return value of encoding handle

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

* Modifies the json returned err

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

Skips the err

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

adds suggestion for error()

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

* Adds error return value

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

minor changes

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

* updates extendedfile method and adjusts the error

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

* fixes lint error

Signed-off-by: afzal442 <afzal442@gmail.com>
2022-06-03 15:36:55 +08:00
wyike
a00fee91fc Fix: hold the force uninstalling process untill the last addon been deleted (#4101)
* hold the force uninstalling process untill the last addon been deleted

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

fix lint

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

fix comments

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

fix comments

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

* fix comments

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

fix lint

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

* add period

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-06-02 16:28:08 +08:00
Jianbo Sun
7f3b55efa0 Chore: add @StevenLeiZhang into owners file and ajust for more flexible owners (#4100)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-06-02 13:34:09 +08:00
StevenLeiZhang
e012bbd1e4 Fix: vela provider delete command's example is wrong (#4094)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-06-02 11:02:19 +08:00
barnettZQG
c82bcf146a Fix: the new default values do not take effect when upgrading the vela core (#4092)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-06-02 10:22:10 +08:00
barnettZQG
f550e89331 Fix: show the default password (#4091)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-06-02 10:01:04 +08:00
barnettZQG
f47dc5f598 Fix: load the provider subcommands on demand (#4086)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-06-01 16:21:18 +08:00
Somefive
985d49d9e6 Feat: use deferred config in CLI (#4083) 2022-06-01 08:31:01 +08:00
wyike
f04f29dff0 Fix(addon): more note info and filter prerelease addon version (#4081)
* more note info and filter prerelease addon version

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

* wrap the error optimize the show info

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

* fix golint

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-05-31 18:56:04 +08:00
barnettZQG
ffbd53e3e1 Chore: hide some definitions in VelaUX (#4073)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-31 16:39:36 +08:00
barnettZQG
c691649256 Fix: change the region to customRegion (#4075)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-31 16:17:39 +08:00
StevenLeiZhang
3484e8102d Fix: Improve vela provider add response (#4055)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-31 16:14:46 +08:00
Shukun Zhang
f8c24ba912 Feat: vela ql into vela-cli (#3519)
Signed-off-by: Shukun Zhang <2236407598@qq.com>
2022-05-31 16:12:04 +08:00
Jianbo Sun
efb6475f2a Fix: upgrade from v1.3+ to v1.4+ with new secret for cluster-gateway (#4072)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-05-31 16:04:34 +08:00
StevenLeiZhang
f8f0730ed8 Fix: Can not delete terraform provider (#4070)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-31 15:01:00 +08:00
barnettZQG
a5cd007311 Chore: change the key features in readme (#4064)
* Chore: change the key features and add the demo entrance

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

* Chore: reuse the Highlights

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

* Chore: remove the demo

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-31 14:26:22 +08:00
barnettZQG
b13eb4adb5 Fix: remove the tcp protocol prefix in the endpoint string (#4059)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-30 20:11:55 +08:00
wyike
48236f69bd Fix: CI workflow for rollout acr image build and push (#4061)
* fix the rollout acr image

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

* fix

test

test

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

finish fix

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

* merge two sction

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-05-30 19:34:57 +08:00
Tianxin Dong
7508794798 Fix: set workflow to finish before record in controller revision (#4060)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-30 19:29:23 +08:00
Tianxin Dong
65f17bf37f Fix: fix the dependency gc policy to reverse dependency (#4063)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-30 19:27:43 +08:00
barnettZQG
f5267f7654 Fix: the policies can not be deleted (#4057)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-30 16:21:07 +08:00
yangs
c8eb0b4dbd Fix: fail to get the endpoints via the velaql (#4056)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-05-30 15:48:28 +08:00
qiaozp
8fb38672f5 Fix: release script condition syntax (#4042)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-05-28 01:28:19 +08:00
Somefive
383a2bd695 Feat: minimize controller privileges & enforce authentication in multicluster e2e test (#4031)
* Feat: enable auth in multicluster test & restrict controller privileges while enabling authentication

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

* Feat: fix statekeep permission leak & comprev cleanup leak

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

* Fix: use user info in ref-object select

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

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

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

* Fix: pending healthscope with authentication test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-28 01:26:06 +08:00
Tianxin Dong
fcfb1012d6 Feat: add if in workflow (#3941)
* Feat: add if in workflow struct

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

* Feat: implement the if in workflow

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

* Feat: support dependency and skip for suspend step

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

* Fix: fix the rebase from sub steps

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

* Fix: fix the lint

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

* Feat: support if in sub steps

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

* Feat: add tests in application controller

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

* Fix: fix the lint

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

* Test: add more tests in discover and custom

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

* Lint: fix lint

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

* Tests: add more tests in application controller

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

* Fix: change failed after retries into reason

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

* Fix: fix the terminate cli

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

* fix lint

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

* remove the terminate workflow to pkg and add feature gates

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

* resolve comments

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

* nit fix

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

* make finish condition more clear

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-05-27 22:01:14 +08:00
Somefive
fd024bc3e2 Fix: env trait error when existing env exists (#4038)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-27 21:07:28 +08:00
wyike
c8264b8c34 some small fixes (#4033)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-05-27 18:36:47 +08:00
barnettZQG
6eb7af9aea Feat: add the creating and deleting permission APIs (#4026)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-27 17:41:29 +08:00
ZhongsJie
39d5ce48dc Feat: add affinity trait to merge node and pod affinity (#3973)
Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
2022-05-27 17:36:39 +08:00
Xiangbo Ma
3538007fc4 Fix: error message of vela init env is not clear (#4016)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-05-27 17:34:02 +08:00
Xiangbo Ma
83704058af Fix: vela port-forward not working for webservice component (#4007)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-05-27 17:14:15 +08:00
barnettZQG
1226a14cbd Fix: unknown field ignoreTerraformComponent (#4013)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-27 17:12:19 +08:00
yangs
d0a725b51e Fix: velaql fail to parse query result to json format (#4011)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-05-27 16:23:15 +08:00
Somefive
57309884fc Feat: enhance controller auth by removing useless features & add authentication for componentrevision+healthcheck (#3992)
* Feat: use application identity in gc & componentrevision & collectHealthStatus

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

* Chore: remove useless features and roles

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

* Fix: remove DELETE from mutating webhook

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

* Chore: enhance deploy error display

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

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

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-27 15:50:21 +08:00
zq200618
260c831df2 Fix: step group documentation update and bug fix of firstExecuteTime not record (#3975)
Signed-off-by: Qiang Zheng <zhengq20018@cmbchina.com>

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

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

Co-authored-by: Qiang Zheng <zhengq20018@cmbchina.com>
2022-05-27 11:25:38 +08:00
barnettZQG
3a887ecdf9 Fix: fail to query the count with mongodb (#4012)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-27 10:45:40 +08:00
wyike
adc99bf390 Feat: optimize some logic of topology resource-tree (#4003)
* format

finish tests

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

* add comments

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

no lint

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

* add pvc

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

* go mod tidy

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

* fix panic bug

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

fix panic

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-05-26 22:17:20 +08:00
barnettZQG
1ada3fb467 Fix: optimized the version comparison (#4001)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-26 19:30:19 +08:00
barnettZQG
f3d4db686d Fix: add some default permissions about the configuration (#3998)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-26 17:21:23 +08:00
Somefive
1815dd4962 Feat: upgrade cluster-gateway version (#3986)
* Feat: upgrade cluster-gateway version

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

* Fix: multicluster test unstable

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-26 17:20:28 +08:00
Somefive
5cfc2878b7 Feat: support impersonation for application in apiserver (#3985)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-05-26 16:42:30 +08:00
StevenLeiZhang
c80b8c0502 Fix: add Target fail by fetch terraform-provider error (#3988)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-26 15:45:22 +08:00
StevenLeiZhang
dc8f558d8a Fix: delete Project fail (#3981)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-05-26 11:30:54 +08:00
qiaozp
46bdc8025e Fix: don't update version file when publish alpha/beta version (#3989)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-05-26 11:30:29 +08:00
Jianbo Sun
9244efe813 Feat: build docker image(oamdev/vela-cli) for vela-cli (#3976)
fixes #1392

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

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-05-26 10:27:31 +08:00
barnettZQG
4288b216e2 Fix: initialize kube config multiple times (#3984)
* Fix: initialize kube config multiple times

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

* Fix: e2e test case

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-05-26 10:19:05 +08:00
wyike
dae0358bc0 Feat: mechanism to let user add relationship mapping rule by configmap (#3968)
* WIP add some code

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

small fix

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

fix all tests

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

* add comment

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

fix ci

delete useless code

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

go mod vendor

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

* fix failed test

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

* more test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-05-25 16:44:46 +08:00
Xiangbo Ma
dfb33e0ea7 Fix: kustomize not read environment variables (#3970)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-05-25 11:22:35 +08:00
wyike
1d82378053 Fix: velaql appliedResource bug and add e2e-test (#3965)
* fix bug and add e2e-test

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

* fix comments

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

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

* Fix: code style

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

* Fix: change the comment

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

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

* bump kubectl sdk version

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

* bump kubectl sdk version

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

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

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

* Feat: add tests for discover

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

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

refactor code

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

finish all tests

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

resolve confilict

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

revert code

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

fix golint error

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

fix checkdiff

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

* add more test for pod status

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

* cue fmt

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

* add filter

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

* fix comments

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

fix comments

* fix

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

fix log error

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

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

* Fix: code style

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

* Fix: code style

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

* Fix: fix the lint errors

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

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

* modity hint

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

* revert

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

workflow substep develop

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

Feat: support step group with substep in the workflow

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

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

* Using a fake client now for offline mode

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

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

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

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

* Style: make the change reviewable

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

* Fix: test

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

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

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

* fix copyright

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

* Upgrade terraform controller api version

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

* add one more tests

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

* fix two unit-tests

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

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

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

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

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

* replace the implementation with libary google/go-containerregistry

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

* address comments

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

* add more testcases

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

* fix UT

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

Also prettify output

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

* Feat: show addon dependencies in `addon status`

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

* Style: adjust `addon status` output

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

* Style: remove spaces in `addon status` output

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

* Fix: truncate string if available versions too long

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

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

* Perf: avoid unnecessary network requests to improve performance

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

* Feat: do not display remote info for local addons

Limit Description length when using `addon list`

Use simpler method to get addon info

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

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

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

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

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

* Test: add tests for generateAddonInfo

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

* Test: add tests for generateAddonInfo and FindWholeAddonPackagesFromRegistry

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

* Style: format code

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

* Test: correct unnecessarily focused tests

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

* Style: remove unused code blocks

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

* Refactor: remove unnecessary output to stdout

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

* Test: remove added registry after tests has been completed

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

* Test: new RegistryDataStore every test, to avoid panics

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

* Test: fix failing tests due to incorrect registry name

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

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

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

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

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

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

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

* Refactor: rename GetAddonWholePackage to GetDetailedAddon as per wonderflow

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

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

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

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

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

* chore: run make reviewable

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

* Test: fix configmap being already existed

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

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

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

* Style: fix golangci-lint issues

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

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

* Fix: update the env workflow after deleting a component

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

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

* make the if example more clear

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

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

* Chore: refactor

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

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

* Feat: add auto-detect for kubeconfig identity

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

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

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

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

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

* Fix: format the cue script of the deploy step

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

* Fix: unit test case

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

* Fix: error words

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

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

* use patchOutputs instead of outputs in patch

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

* fix typo

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

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

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

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

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

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

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

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

* make reviewable changes

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

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

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

* Style: revert incorrect auto-formatting

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

* Refactor: change original variable name to avoid confusions

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

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

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

* Refactor: use more concise method to check length

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

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

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

* Refactor: simplify testing logic by removing unneeded looping

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

* Style: add missing license header

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

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

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

* fix check-diff

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

* fix CI

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

* fix CI

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

* fix UT

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

* revert some changes

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

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

* refactors e2e_core sh

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

* refactors cleanup sh

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

* refactors header-chk sh

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

* refactors installdef sh

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

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

handle publishversion case

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

* add test

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

add test

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

lint code

Signed-off-by: cezhang <c1zhang.dev@gmail.com>
2022-05-07 12:07:26 +08:00
Xiangbo Ma
93841b479a Feat: Add example doc for controlPlaneOnly (#3810)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-05-06 14:33:52 +08:00
dependabot[bot]
94a82ce18d Chore(deps): Bump github.com/containerd/containerd from 1.5.4 to 1.5.10 (#3815)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.5.4 to 1.5.10.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.5.4...v1.5.10)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-05 19:11:28 +08:00
Jianbo Sun
6f927d326b Chore: add governance file and refer to the community repo (#3814)
* Chore: update docs

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

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

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

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

* tidy

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

* tidy

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

* tidy without compat

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

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

* update comment

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

* update readme

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

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

* Make the PR reviewable

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

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

* Chore: sync the cli binaries to OSS

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

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

* test int

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

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

* Fix: change the unit test case

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

* Fix: change the unit test case

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

* Feat: add an API to change the definition status

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

* Fix: change the e2e test case

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

* Fix: change cache key

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

* Fix: change the error words

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

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

* fix e2e test

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

* remain log

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

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

fix several issue

fix bug

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

fix unit-test

* add more tests

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

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

* check if upgrade

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

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

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

* fix

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

* add UTs

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

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

fix pointer

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

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

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

* fix CI

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

* fix CI

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

* change imports order

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

* change imported libraries order again

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

* fix CI

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

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

* upgrade kind version

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

* rollback 1.22

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

* bump up kruise

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

* with sha

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

* try fix ci

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

* use 1.22

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

* remove sah

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

* revert kind

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

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

* tidy the code

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

* add suite test

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

* add example docs and update the field

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

* fix lint

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

* change the name to dependency

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Co-authored-by: DESKTOP-FV8IFEC\10690 <1069029381@qq.com>
2022-04-22 15:53:20 +08:00
wyike
c126a5b272 fix several issues (#3729)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-22 15:47:08 +08:00
wyike
3eb1f53606 specify staticcheck version (#3726)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix the workflow

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

fix

try to fix

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

fix make file

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

fix makefile

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-22 14:16:15 +08:00
Tianxin Dong
426b22d2e5 Feat: add log provider (#3711)
* Feat: add log provider

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

* fix lift

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

* fix vet

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

* fix rebase vet

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

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

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

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

* Feat(wait suspend): optimize wait suspend

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

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

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

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

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

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

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

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

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

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

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

* Feat(wait suspend): change solution to add suspendState

Signed-off-by: ArenaSu <704427617@qq.com>

* Feat(wait suspend): change durationWaiting to duration and add isPatch to gcResourceTrackers

Signed-off-by: ArenaSu <704427617@qq.com>
2022-04-22 11:40:13 +08:00
wyike
81d479aedf Fix: change systemInfo some fields (#3715)
* add some field an calculate workflow step

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix the calculate job cannot start issue

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix comments

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-22 10:18:28 +08:00
Lei Chu
25e33cdd6d Fix: embed.FS filepath that follow the unix style file path when running on windows (#3718)
* fix: "builtin-apply-component.cue: file does not exist"

Signed-off-by: lei.chu <1062186165@qq.com>

* fix: "builtin-apply-component.cue: file does not exist"

Signed-off-by: lei.chu <1062186165@qq.com>
2022-04-21 14:31:53 +08:00
qiaozp
900653a2da Feat: vela def gen-api command (#3699)
* Feat: vela def go-gen command

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Add unittest

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* lint

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* header

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Add test case

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* more test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add optional prefix, add omitempty in json tag

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* lint

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* lint

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-04-20 18:08:24 +08:00
StevenLeiZhang
e3612ac352 Fix: vela-core does not report error, when component depends on invalid component (#3636)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-04-20 13:37:34 +08:00
Diego Pinheiro
62fb10625d Fix: Addressing CVEs (#3708)
* fix - patching vuln go mod

Signed-off-by: Diego Milhomes Pinheiro <diego.milhomes@ORA-7869.local>
Signed-off-by: s4rd1nh4 <diego.milhomes@gmail.com>

* fix - addressing cves

Signed-off-by: Diego Milhomes Pinheiro <diego.milhomes@ORA-7869.local>
Signed-off-by: s4rd1nh4 <diego.milhomes@gmail.com>

* fix - cves

Signed-off-by: Diego Milhomes Pinheiro <diego.milhomes@ORA-7869.local>
Signed-off-by: s4rd1nh4 <diego.milhomes@gmail.com>

* fix - cves

Signed-off-by: Diego Milhomes Pinheiro <diego.milhomes@ORA-7869.local>
Signed-off-by: s4rd1nh4 <diego.milhomes@gmail.com>
2022-04-20 09:54:49 +08:00
Somefive
571e154af3 Fix: bind env to system namespace (#3706)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-19 20:55:59 +08:00
wyike
2ac4ddad03 Feat: calculate systemInfo everyday periodically and store them in datastore (#3689)
* add framework

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

add

finish the framework

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

finish test manually

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

add update time

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

adding test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

finish test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

abs

fix test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* move start func to leader election call back funcs

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* resolve the recycle import problecm

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix issue

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix ci
2022-04-19 10:24:54 +08:00
Somefive
c5e1855a55 Feat: support disable legacy gc upgrade operation (#3694)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-18 17:05:47 +08:00
Zheng Xi Zhou
cb4a9ea1a8 Fix: set provider name as the config name (#3687)
- For VelaUX, hidden a provider name (users don't need to manual set it). Used
the application/component name (config name) to be the provider name.
- Store description of a config to the annotation of the config application

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-18 16:47:51 +08:00
Tianxin Dong
21216055fb Feat: add vela debug command (#3580)
* Feat: add debug configmap if debug policy is specified

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: add vela debug command

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* make code reviewable

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix sonartype lift

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix cue string

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: display better for debug

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* tidy the go mod

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: add debug test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* change uitable vendor

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* add more tests

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* pass resource keeper from handler

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix lint

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix rebase

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Pending test temporary

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-18 11:06:14 +08:00
Michiel Stigter
eb60d94a06 Feat: Expose optimizeDisableComponentRevision in helm chart (#3470)
* Feat: Expose optimizeDisableComponentRevision in helm chart

Signed-off-by: michiel <michiel.stigter@springer.com>

* Feat: Expose optimizeDisableComponentRevision in helm chart

Signed-off-by: michiel <michiel.stigter@springer.com>

* Feat: Expose optimizeDisableComponentRevision in helm chart

Signed-off-by: michiel <michiel.stigter@springer.com>

* Feat: Expose optimizeDisableComponentRevision in helm chart

Signed-off-by: michiel <michiel.stigter@springer.com>

* Feat: Add all the other possible optimization params to the helm-values.

Taken from: https://kubevela.io/docs/platform-engineers/system-operation/performance-finetuning#advanced-optimization

Signed-off-by: michiel <michiel.stigter@springer.com>
2022-04-15 17:48:14 +08:00
Somefive
8998537dc8 Fix: rt resource key compare mismatch local cluster (#3681)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-15 16:13:07 +08:00
barnettZQG
4ddfe32fc4 Fix: can not query the instance list for the app with apply once policy (#3670)
* Fix: can not query the instance list for the app with apply once policy

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: change the test case about ListResourcesInApp

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-15 14:38:01 +08:00
wyike
28e2284284 mock an addon to fix flaky test (#3665)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-15 10:30:05 +08:00
Tianxin Dong
62ecc70ade Fix: fix token invalid after the server restarted (#3658)
* Fix: fix token invalid after the server restarted

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix lint

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Pending test temporary

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Pending test temporary

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-14 22:25:43 +08:00
Somefive
5857aa8790 Fix: vela status tree show cluster alias & raw format (#3659)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-14 19:35:47 +08:00
ZhongsJie
49646ddc8e Feat: enhance storage trait to support multi-mountToEnv config Signed-off-by: Shijie Zhong <zhongsjie@cmbchina.com> (#3657)
Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
2022-04-14 19:34:12 +08:00
Jianbo Sun
707905d877 Fix: add label from inner system in CR can prevent sync (#3655)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-04-14 19:32:53 +08:00
barnettZQG
7d3ef0595a Fix: duplicately list pods in velaQL (#3650)
* Fix: duplicately list pods in velaQL

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: the create time of synced app is empty

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-14 17:43:54 +08:00
Zheng Xi Zhou
af6dc4bda3 Fix: failed to deploy application when no there is no avaiable (#3652)
When there are configs, but not in the project where the appliation
is about to deploy, the sync application will hit an issue. It will
lead to block the deploy of an application.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-14 17:25:34 +08:00
Zheng Xi Zhou
f44bd7c6dd Fix: refine the config sync logic (#3602)
* Fix: refine config management

- Refine the config sync logics

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* address comments

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-14 13:03:59 +08:00
wyike
eaec8348d9 Fix: try to fix CVE (#3641)
* try to fix cve

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* add parse input func

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix lint

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix lint

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* use santize

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-14 10:03:15 +08:00
wyike
2849dfc1fb Fix: clear info when addon version cannot meet require (#3642)
* first

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

version miss match erro for addon

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

add log

* add test for this

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

small fix
2022-04-14 10:02:47 +08:00
Somefive
d657ea4daf Feat: rework vela up to support specified revision (#3634)
* Feat: rework vela up to support specified revision

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add legacy compatibility

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: fix test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-13 22:20:07 +08:00
Zhiyu Wang
68500b3f17 Fix: verify password valid (#3545)
Signed-off-by: Zhiyu Wang <zhiyuwang.newbis@gmail.com>
2022-04-13 19:39:00 +08:00
Somefive
c33eaa0609 Fix: enhance vela status tree print (#3639)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-13 17:46:55 +08:00
Somefive
7a0d2b552b Feat: support alias in cluster (#3630)
* Feat: support alias in cluster

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test for cluster alias

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-13 13:58:35 +08:00
Zheng Xi Zhou
385b2462e9 Feat: refine config creation and provide config list (#3637)
- Make the api of creation a config to be async
- In listing config page, show the status of a config

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-13 13:45:41 +08:00
Kunshuai Zhu
0c35753530 Feat: allow select resource by resource type for gc policy (#3598)
* Feat: allow select resource by resource type for gc policy

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Modify match label key

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Unified label key

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>
2022-04-12 18:51:07 +08:00
Somefive
0e97aa2291 Feat: vela status --tree (#3609)
* Feat: vela status --tree

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: support show not-deployed clusters

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add tests

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add multicluster e2e coverage

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: minor fix

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-12 17:58:45 +08:00
Tianxin Dong
7fcb89906c Fix: fix dex login with existed email (#3623)
* Fix: fix dex login with existed email

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* add dex connector check

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* unset users' alias

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-12 16:29:21 +08:00
Somefive
86ef2d68e0 Fix: flags for controller (#3627)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-12 16:12:50 +08:00
wyike
2e57be1022 Feat: support basic auth private helm repo (#3595)
* support auth

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* add test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix check diff

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix test

fix

add comments

fix test

* add tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix

add more test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* add more test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* extract set auth info as a global func

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* return bcode

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-12 14:33:44 +08:00
Gallardot
ad01f3062a Feat: add HealthProbe for sidecar (#3629)
* Feat: add HealthProbe for sidecar

Signed-off-by: Gallardot <tttick@163.com>

* Feat: add HealthProbe for sidecar

Signed-off-by: Gallardot <tttick@163.com>
2022-04-12 13:21:51 +08:00
Somefive
b6fac3f4d5 Fix: cli default switch on feature flags (#3625)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-11 20:40:13 +08:00
Min Kim
2eb7826070 bump cluster-gateway to 1.3.2 (#3619)
Signed-off-by: yue9944882 <291271447@qq.com>
2022-04-11 19:31:51 +08:00
Zheng Xi Zhou
5f7371815c Feat: add api of listing configs for project when creating a target (#3581)
* Feat: add api of listing configs for project

In a project, list configs by its type

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* address comments

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix ci

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* add query parameter definition

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update pkg/apiserver/rest/webservice/project.go

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-11 19:05:18 +08:00
wyike
d6b96fee5a Fix: add e2e apiserver test for addon (#3607)
* add e2e apiserver test for addon

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

delete comment

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix

* fix test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* close the reponse body

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* cover list enabled addon

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix e2e test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix test

* fix test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-11 17:46:46 +08:00
Jianbo Sun
85c673a574 Fix: reuse chart values in vela install (#3616)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-04-11 09:50:18 +08:00
qiaozp
7e6d9ccc73 Fix: vela logs without specified resource name (#3605)
* Fix: vela logs without specified resource name

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add unittest

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-04-08 17:22:05 +08:00
Avery
e65dcf12db add sorting for properties, outputs, writeSecretRefParameters in vela def doc-gen (#3593)
Signed-off-by: Nicola115 <2225992901@qq.com>
2022-04-08 15:27:35 +08:00
Diego Pinheiro
fd5faed71a Chore: Nominate s4rd1nh4 as a Reviewer member (#3603)
Signed-off-by: GitHub <noreply@github.com>
2022-04-08 13:21:45 +08:00
Zheng Xi Zhou
b1823084af Fix: add terraform aws provider without AWS_SESSION_TOKEN (#3590)
* Fix: add terraform aws provider without AWS_SESSION_TOKEN

Fix #3589 and refine prompts for cli

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-07 13:41:29 +08:00
namo
83fe4a160e Feat(lang): add addons gitlab support (#3543)
* add addons gitlab support

Signed-off-by: Namo <lgj112113@163.com>

* add addons gitlab support

Signed-off-by: Namo <lgj112113@163.com>

* test file edit

Signed-off-by: Namo <lgj112113@163.com>

* typo edit

Signed-off-by: Namo <lgj112113@163.com>

* notes edit

Signed-off-by: Namo <lgj112113@163.com>

* move third party imports block

Signed-off-by: Namo <lgj112113@163.com>

* code format edit

Signed-off-by: Namo <lgj112113@163.com>

* notes edit

Signed-off-by: Namo <lgj112113@163.com>

* create addon registry bug fix

Signed-off-by: Namo <lgj112113@163.com>

* add gitlab addon registry bug fix

Signed-off-by: Namo <lgj112113@163.com>

* add addon gitlab support test file

Signed-off-by: Namo <lgj112113@163.com>

* add addon gitlab support test note edit

Signed-off-by: Namo <lgj112113@163.com>

* add addon gitlab branch support and fix bug

Signed-off-by: Namo <lgj112113@163.com>

* addon gitlab registry repo name invalid

Signed-off-by: Namo <lgj112113@163.com>

Co-authored-by: Namo <lgj112113@163.com>
2022-04-07 11:05:14 +08:00
Somefive
8af3dec0df Fix: add feature-gates to command-line args (#3591)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-04-06 17:00:44 +08:00
Tianxin Dong
edebcc6c59 Fix: fix refresh code expired bcode (#3582)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-06 14:36:05 +08:00
Jianbo Sun
32382ba6be Chore: add new code flow for kubevela milestone (#3586)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-04-06 13:34:30 +08:00
Zheng Xi Zhou
46ef6f9df4 Fix: add response struct to config deletion api (#3579)
Added an empty struct in the API of config deletion

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-06 13:32:49 +08:00
Jianbo Sun
aea98ff5bf Chore: try fix lint (#3571)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-04-06 10:19:53 +08:00
wyike
c093676575 aglin config secret label (#3576)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix not update label

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix addon cannot update label bug

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

revert
2022-04-01 16:59:15 +08:00
wyike
ed05b4b035 aglin config secret label (#3574)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-04-01 16:13:12 +08:00
Zheng Xi Zhou
3aa4412a0f Fix: remove config image registry (#3572)
Temporarily removed image registry config

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-04-01 01:07:43 +08:00
wyike
ef4b9816e1 fix bug (#3569)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix bugs

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix

fix
2022-04-01 01:04:29 +08:00
Tianxin Dong
1c5aab1852 Fix: fix dex config field (#3568)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-04-01 00:51:17 +08:00
Zheng Xi Zhou
966dbc1c74 Feat: add config management apis (#3562)
* Feat: add config management apis

Added some APIs for config management

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix check-diff

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix ci issue

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix config sync

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix static check

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix sync

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Fix: sync config bug

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-04-01 00:15:03 +08:00
qiaozp
4eafb46c87 Chore: bump test k8s to 1.20 (#3567)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-03-31 22:12:55 +08:00
Tianxin Dong
a97a4d0ed7 Feat: add update dex config in apiserver (#3548)
* Feat: add update dex config in apiserver

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* use get connectors to get dex connectors

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* lint the code

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: seperate dex config from a component to an application

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: use dex config from secret

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix not found

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix restart dex

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix system info

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix restart

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-31 18:42:18 +08:00
Jianbo Sun
77c02f9eec Chore: add video records in readme for chinese community call (#3565)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-31 18:05:22 +08:00
Jianbo Sun
3157efd421 Chore: refine chart readme and notes (#3563)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-31 17:33:06 +08:00
wyike
8ff93b33e2 Feat: add helm repo list endpoint (#3564)
* add helm repo list

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix commit

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix comments

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* build swagger

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-31 17:18:54 +08:00
qiaozp
c6b9abe4c4 Chore: bump k8s version contraint (#3560)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-03-31 16:42:14 +08:00
Somefive
150ef6e99e Fix: livediff minor bug (#3558)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-31 13:13:55 +08:00
wyike
0ada407fbe optimize the ux of addon (#3557)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix

fix
2022-03-31 10:24:20 +08:00
Somefive
c4af1ba643 Fix: topology use original resource namespace when not specify (#3554)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-30 19:52:10 +08:00
qiaozp
de84421487 Feat: add name param in vela logs (#3556)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-03-30 17:56:59 +08:00
yangs
38a8a7f88a Fix: fix the componentDefinition webservice parameter error (#3553)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-03-30 15:55:49 +08:00
Xiangbo Ma
b4ddf0e4c3 Feat: a new ComponentDefinition cron-task Signed-off-by: Xiangbo Ma <maxiangboo@cmbchina.com> (#3541)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-03-30 13:27:21 +08:00
wyike
47050c90b6 Fix: cli addon multicluster bug (#3547)
* fix addon multicluster bug

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

delete useless test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

asd

asd

* fix test race condition

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-29 23:03:57 +08:00
barnettZQG
685d73a20c Feat: support with metadata as context render cue file in the addon (#3549)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-29 22:13:56 +08:00
Somefive
dde8a8e4c0 Fix: addon support empty components (#3542)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-29 16:42:43 +08:00
Min Kim
943af3ddf6 bump cluster-gateway to v1.3.0 (#3540)
Signed-off-by: yue9944882 <291271447@qq.com>
2022-03-29 16:18:38 +08:00
Somefive
a5c2edf777 Feat: allow select resource by component name for gc policy (#3539)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-29 14:00:50 +08:00
wyike
83d8022ce9 quick fix addon registry (#3537)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-29 12:40:25 +08:00
Zheng Xi Zhou
6d63014c6f Feat: support config management (#3430)
* Feat: componentDefinitions for Config management

Added ComponentDefinitions for config management
- helm chart repository
- image registry
- Dex connector
- Terraform provider

Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>
Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update vela-templates/definitions/internal/component/config-image-registry.cue

Co-authored-by: Jianbo Sun <wonderflow@icloud.com>

* address comments again

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>
Co-authored-by: Jianbo Sun <wonderflow@icloud.com>
2022-03-29 10:28:07 +08:00
Jianbo Sun
d3fbd5fd45 Fix: addon API panic and override workflow step for addon installation (#3533)
* Fix: addon API panic

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: use policy to deploy addon

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: use create or update app instead of patch apply on addon update

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: unit test

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-29 02:37:57 +08:00
barnettZQG
b0202ebf14 Fix: change the default permission name (#3531)
* Fix: change default permission name

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: the addon api bug

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: set local cluster name

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-28 23:37:25 +08:00
Tianxin Dong
295164229d Fix: optimize err for auth in apiserver (#3526)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-28 22:35:56 +08:00
Jianbo Sun
ba09cf5c2e Fix: fix migrate data duplicate in list API and add cluster info in addon status (#3528)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-28 22:30:35 +08:00
Somefive
099e25a552 Fix: enhance ref object to support health check for deployment (#3529)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-28 22:13:51 +08:00
Min Kim
b2f5b69380 chore: bump cluster-register (#3514)
Signed-off-by: yue9944882 <291271447@qq.com>
2022-03-28 21:57:44 +08:00
Zheng Xi Zhou
5d61cee3f6 Fix: support multiple-tenant cloud resources (#3305)
* Fix: support multiple-tenant cloud resources

Split terraform-xxx to two parts, the original addon will only install
definitions, and the provider object will be created by `vela provider`

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* continue

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* continue 0302

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* support `vela provider list`

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* generate a configmap in an addon terraform-xxx

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix listing providers

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* support add a provider

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* support delete a provider

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* support legacy providers

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-03-28 21:55:33 +08:00
Somefive
2af198bda7 Docs: add feature docs for multi-cluster and application revision (#3530)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-28 21:47:57 +08:00
wyike
161d2646cb Feat: helm repo as addon registry to support addon's multi-version (#3523)
* versioned registry impl
add more test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix ci

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix ui

fix

fix

fix

modify addon registry
2022-03-28 21:25:38 +08:00
Avery
4f8e7506f9 Fix: fix bugs in vela def doc-gen from local file (#3490)
* fix bugs in using local filepath as markdown filename; fix bugs in parseLocalFile

Signed-off-by: Nicola115 <2225992901@qq.com>

* ignore control character mismatch between lc.TerraformConfiguration and raw text

Signed-off-by: Nicola115 <2225992901@qq.com>

* goimports

Signed-off-by: Nicola115 <2225992901@qq.com>

* store remote and local in MarkDownReference struct

Signed-off-by: Nicola115 <2225992901@qq.com>

* gofmt

Signed-off-by: Nicola115 <2225992901@qq.com>

* fix too many argument bugs in generate.go:45

Signed-off-by: Nicola115 <2225992901@qq.com>

* fix invalid comment

Signed-off-by: Nicola115 <2225992901@qq.com>
2022-03-28 20:57:24 +08:00
Somefive
160ef64855 Feat: support livediff for referred object (#3525)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-28 17:52:33 +08:00
Guangzhe Huang
905c49eb81 Fix: fix undefined field error in email workflowstep (#3522)
Signed-off-by: huanggze <gzhuang2014@gmail.com>
2022-03-28 16:14:13 +08:00
Somefive
c4a8fcf29c Feat: rework referred objects for version (#3446)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-28 16:09:12 +08:00
Somefive
e72690bade Fix: ignore kubebuilder generated file in code coverage (#3524)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-28 16:08:59 +08:00
barnettZQG
044c4bf73c Feat: add RBAC support (#3493)
* Feat: add the rbac data model

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add some api about the project

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add CRUD about the project and the project user

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add CRUD about the role and perm check filter function

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: update swagger config

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add default roles and perm policies

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add perm check filter for all webservice

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: change the method that find project name

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: query applications and envs by user perm

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: support get login user info

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: change default permissions

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: change PermPolicy to Permission

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add some unit test and fix the e2e test error

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: change some comment word

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: e2e api path error

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-28 16:03:11 +08:00
Somefive
795231ceb5 Feat: add revision command (#3506)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-28 14:47:47 +08:00
Min Kim
3f621e57b2 bugfix: helm install cluster-gateway be compatible w/ existing APIService w/o annoation (#3512)
Signed-off-by: yue9944882 <291271447@qq.com>
2022-03-28 11:52:47 +08:00
Somefive
9fc992ea3e Fix: concurrent write to controller revision (#3520)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-27 19:56:25 +08:00
Tianxin Dong
c2f5175fd1 Fix: fix parse token error validate (#3507)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-25 22:34:32 +08:00
Kunshuai Zhu
a7d3cd5d1a Chore: Nominate JooKS-me as a Reviewer member (#3508)
Signed-off-by: zhukunshuai <jookunshuai@gmail.com>
2022-03-25 18:04:11 +08:00
yangs
ccfab6ce7f Feat: add health check for componentdefinition task (#3509)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-03-25 16:21:57 +08:00
Tianxin Dong
03cd0d144a Feat: add login handle for apiserver (#3471)
* Feat: add login handle for apiserver

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix go lint

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: clean up code and add user in ctx

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: fix swagger conflict

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: add auth in apiserver e2e test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: nit fix for apiserver e2e test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-24 17:59:09 +08:00
Somefive
741544c00c Feat: rework apprev (#3498)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-24 14:40:19 +08:00
Jianbo Sun
723a5d83ca Fix: vela status --endpoint format (#3502)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-24 09:47:15 +08:00
StevenLeiZhang
8af5afa5dc Fix: api-server fail to start, when multi-cluster is disabled (#3501)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-03-23 20:46:29 +08:00
Tianxin Dong
aaa1db8760 Fix: fix workflow cli must have workflow in spec (#3469)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-23 17:16:39 +08:00
Jianbo Sun
c5baa1cae9 Feat: support specify cluster in addon installation (#3497)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-23 14:33:15 +08:00
Wei (段少)
eda7e6c5a0 Chore: Nomiante Daniel as a Maintainer (#3491)
Signed-off-by: BinaryHB0916 <davidduan0916@gmail.com>
2022-03-23 09:49:38 +08:00
Jianbo Sun
e5fd150cd5 Fix: add client validation and severside dry run for vela dry-run (#3485)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-22 16:39:36 +08:00
barnettZQG
d041d8c35d Feat: support delete the readonly application (#3492)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-22 15:49:55 +08:00
wyike
345e4c8144 fix disable addon check several bugs (#3488)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-22 10:06:16 +08:00
Jianbo Sun
9a8ec5d797 Fix: delete app won't be synced in UI (#3487)
* Fix: delete app won't be synced in UI

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: cache should be ignored in app meta not exist

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-22 10:04:10 +08:00
Jianbo Sun
d9a676a688 Feat: add page index for env list API (#3482)
* Feat: add page index for env list API

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: add check for target create without namespace or name

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: adress commnets

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-21 19:28:28 +08:00
Jianbo Sun
9a3ad7ef84 Feat: add readOnly for velaux application which is synced from CR (#3479)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-21 16:33:29 +08:00
朱晓兵
9671e3b232 Fix(context): add support for context.appLables and context.appAnnotations (#3463) (#3468)
* Fix(context): add support for context.appLables and context.appAnnotations (#3463)

Signed-off-by: zxbyoyoyo <596908030@qq.com>
Signed-off-by: 朱晓兵 <596908030@qq.com>

* Fix: unit test

Signed-off-by: 朱晓兵 <596908030@qq.com>

* Fix: recover deleted field

Signed-off-by: 朱晓兵 <596908030@qq.com>
2022-03-21 12:02:30 +08:00
Jianbo Sun
0c97f8311c Chore: Nominate fourierr as a Reviewer member (#3475)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-21 12:01:39 +08:00
wyike
a6460d67b6 Feat: check if an addon is been used while disabling. (#3457)
* first commit

add more tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix ci

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix ci

fix test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fetch only definitions from registry for lagacy addon app

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix ci

* fix error test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-21 10:38:56 +08:00
Tianxin Dong
3ea2ac6d0f Feat: add user management apis (#3458)
* Feat: add user management apis

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: add e2e test and some nit fix

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: add password validate

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: add email modification in update user

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: fix user detail to user base

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: fix test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: fix rebase

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: add password check in create user

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: fix bcode confilt

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-19 15:51:32 +08:00
wyike
13c420dada Fix: optimize helm repository logic put cache lower layer and return bcode when error (#3466)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-18 18:36:19 +08:00
Jianbo Sun
6354912bba Feat: sync application from CR to data store (#3428)
* Feat: sync application from CR to data store

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Feature: address comments

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Feat: add migrate database feature to avoid max 63 charactor in kubeapi storage

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* update the sync data

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-18 09:55:15 +08:00
barnettZQG
5209be6da9 Feat: add the conditions for ui schema spec (#3461)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-18 09:52:58 +08:00
maxiangbo
8f9908e723 Feat: support the mountPath of trait-storage-secret is optional (#3462)
* Feat: support the mountPath parameter of trait-storage-secret is optional Signed-off-by: maxiangbo maxiangboo@cmbchina.com

Signed-off-by: fourierr <maxiangboo@qq.com>

* Feat: support the mountPath parameter of trait-storage is optional Signed-off-by: maxiangbo maxiangboo@cmbchina.com

Signed-off-by: fourierr <maxiangboo@qq.com>
2022-03-17 20:04:57 +08:00
Evan Li
296c82344b Fix(workflow): correct terraform component health check (#3456)
Closes: #3355
Signed-off-by: Evan Li <evan.li97@outlook.com>
2022-03-16 20:30:50 +08:00
Somefive
2d19454a35 Feat: enhance labels & annotations trait (#3454)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-16 17:50:12 +08:00
maxiangbo
f67d2db0d1 Fix: trait env and storage conflict Signed-off-by: maxiangbo maxiangboo@cmbchina.com (#3452)
Signed-off-by: fourierr <maxiangboo@qq.com>
2022-03-16 15:14:18 +08:00
Avery
3634ad6f18 Fix: enable provider elastic (#3453)
* enable provider ec

Signed-off-by: Nicola115 <2225992901@qq.com>

* rename provider ec as elastic

Signed-off-by: Nicola115 <2225992901@qq.com>
2022-03-16 15:07:25 +08:00
Tianxin Dong
6c5a40d768 Feat: add dex login in apiserver (#3417)
* Feat: add dex login in apiserver

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* resolve comments

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: get dex config from secret

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: delete cache for dex config

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ci

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-16 14:37:41 +08:00
wyike
c91a7ac273 Feat(apiserver): helm apiserver webservice (list chart, list version, extract helm values) (#3398)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-16 11:42:08 +08:00
barnettZQG
b437cf4310 Feat: support query the policy definitions (#3445)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-16 10:56:53 +08:00
Sunghoon Kang
040d5e1776 Chore: fix issue-commands workflow (#3451)
It seems that the `issue-commands` workflow keeps failing.

This commit fixes the `issue-commands` workflow by bumping up the
action version and replacing `npm install` with `npm ci` for
reproducibility.

Refs: https://github.com/oam-dev/kubevela-github-actions/pull/11

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>
2022-03-16 10:12:58 +08:00
barnettZQG
7bec3506f5 Feat: add auto clear data function for the memory cache (#3439)
* Feat: add auto clear data function for the memory cache

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add memory cache store

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add some test case for the utils package

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-15 19:14:20 +08:00
Jianbo Sun
efc1597317 Nominate devholic as as a Review member (#3444)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-03-15 16:45:26 +08:00
Kunshuai Zhu
38665e319d Feat: poll multi-cluster metrics and export to prometheus (#3429)
* Feat: poll multi-cluster metrics and export to prometheus

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* pass context to polling loop

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* move metrics definition to montitor/metrics/multicluster.go

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* remove pod usage metric and make reviewable

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* revert the change of GetClusterMetricsFromMetricsAPI

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* revert the change of GetClusterMetricsFromMetricsAPI

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Separate the polling logic into a function

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* add start menber function

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* make refreshPeriod a menber var

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* fix typo

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>
2022-03-15 13:03:10 +08:00
barnettZQG
1e0f329304 Feat: add component definiton in the detail component response body (#3437)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-15 11:57:16 +08:00
Sunghoon Kang
1300a980f0 Feat: reconcile app with scoped permissions (#3434)
* Refactor: refactor multi cluster round trippers

Before adding more RoundTrippers, it would be better to expose common
logic in the utility package.

This commit exports `tryCancelRequest` at `utils` package, and make
`secretMultiClusterRoundTripper` implement `RoundTripperWrapper`
interface to allow chaining multiple round trippers.

Refs #3432

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Feat: reconcile app with scoped permissions

Currently, all Application resources are reconciled by the Roles bound
to the controller service account. This behavior gives us the power to
manage resources across multiple namespaces. However, this behavior can
be problematic in the soft-multitenancy environment.

This commit adds `serviceAccountName` to ApplicationSepc to reconcile
Application with the given service account for reconciling Application
with scoped permissions.

Refs #3432

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Refactor: extract context setter as method

https://github.com/oam-dev/kubevela/pull/3434#discussion_r825561603

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Feat: use annotation instead of spec

https://github.com/oam-dev/kubevela/issues/3432#issuecomment-1066460269

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Refactor: unify service account setter caller

https://github.com/oam-dev/kubevela/pull/3434#discussion_r825853612

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Refactor: rename GetServiceAccountName

https://github.com/oam-dev/kubevela/pull/3434#discussion_r826514565

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>
2022-03-15 11:55:50 +08:00
Zheng Xi Zhou
b6b81c336e Fix: add generate JDBC connection workflowDefintion (#3360)
* Fix: add generate JDBC connection workflowDefintion

Added a WorkflowDefinition

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* format .cue definition

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-03-15 10:53:22 +08:00
Somefive
e2275efe56 Feat: local virtual cluster + namespace in topology (#3436)
* Feat: virtual cluster local + namespace

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: refactor some names

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-15 10:06:36 +08:00
Somefive
c054ee32b1 Fix: use clusterLabelSelector as default (#3438)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-14 19:30:52 +08:00
Somefive
19424cfaa4 Fix: add state keep for healthy suspend (#3426)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-14 14:38:43 +08:00
Rimond
a5fb09814e Fix(docs): rollout example error (#3427)
* modify docs errors

Signed-off-by: liming.jlm <liming.jlm@alibaba-inc.com>

* modify the incorrect file name

Signed-off-by: liming.jlm <liming.jlm@alibaba-inc.com>

Co-authored-by: liming.jlm <liming.jlm@alibaba-inc.com>
2022-03-14 13:13:05 +08:00
Hongchao Deng
c1b116b360 Chore: update CODEOWNERS to promote barnettZQG and leejanee (#3435)
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
2022-03-14 10:22:57 +08:00
Shukun Zhang
3af893950e add vela status --endpoint into the tips for vela up (#3433)
Co-authored-by: zhangshukun <zhangshukun.7@bytedance.com>
2022-03-14 09:39:11 +08:00
barnettZQG
20583e089a Feat: support query applied resources by velaQL (#3423)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-11 21:22:58 +08:00
qiaozp
96f8e4dc4c Feat: support preventing component from garbage collection (#3424)
* Feat: support preventing component from garbage collect

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Chore: add doc for changes

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Chore: add comments

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Chore: change json tag

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-03-11 17:32:21 +08:00
wyike
68e2634911 add more test for complicated semver check (#3425)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-11 16:19:32 +08:00
Zheng Xi Zhou
c06dbf3142 Feat: upgrade API version for Terraform Controller (#3396)
* Upgrade API version for Terraform Controller

- Change json tag of spec.Region to `customRegion` in Configuration https://github.com/oam-dev/kubevela/issues/3384
- Use .status.observedGeneration to make Terraform outputs is latest https://github.com/oam-dev/terraform-controller/pull/269

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix ci

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-03-11 16:13:30 +08:00
Somefive
598de21f67 Feat: add support for json-patch and json-merge-patch (#3406)
* Feat: add support for json-patch and json-merge-patch

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add e2e test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: refactor json-patch field

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-11 14:57:50 +08:00
wyike
b13132ceba Feat: helm chart keep fluxcd addon while delete (#3404)
* keep fluxcd addon will delete

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-11 14:46:28 +08:00
Somefive
70408e4712 Feat: support vela cluster labels add/del to manage cluster labels (#3413)
* Feat: add vela cluster label command

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add vela cluster label command to help manage cluster labels

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add e2e test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: use vela cluster labels

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-11 14:13:17 +08:00
Somefive
b975c313c3 Fix: add parallelism params for deploy step (#3411)
* Fix: add parallelism params for deploy step

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add e2e test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-11 13:20:12 +08:00
Somefive
a8dfc99ec9 Fix: pend registry test (#3420)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-11 11:35:40 +08:00
Zheng Xi Zhou
ca8d66471a Feat: add @evanli18 as one Reviewer (#3402)
Fix #3330

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-03-10 20:25:47 +08:00
Somefive
d5e8b68ad2 Fix: rework parallel execution for ApplyComponents and ResourceKeeper Dispatch (#3407)
* Fix: applyComponents lock and rework parallel execution

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: rename

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-10 16:43:22 +08:00
Somefive
d8f95c9cf8 Feat: support multicluster service in application status (#3387)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-10 10:21:56 +08:00
maxiangbo
52f3636a2d Feat: support gitee repository in addon registry (#3393)
* Feat: support gitee repository in addon registry
Signed-off-by: fourierr <maxiangboo@163.com>

* Feat: support gitee repository in addon registry
Signed-off-by: maxiangbo <maxiangboo@cmbchina.com>

Signed-off-by: fourierr <maxiangboo@yeah.net>

* Feat: support gitee repository in addon registry Signed-off-by: maxiangbo <maxiangboo@cmbchina.com>

* Feat: support gitee repository in addon registry Signed-off-by: maxiangbo <maxiangboo@cmbchina.com>

Signed-off-by: fourierr <maxiangboo@qq.com>

Co-authored-by: fourierr <maxiangboo@yeah.net>
2022-03-10 10:11:45 +08:00
Diego Pinheiro
04db938ffa fix - rename docs example dir (#3408)
Signed-off-by: GitHub <noreply@github.com>
2022-03-10 10:02:46 +08:00
Somefive
f9635de027 Fix: auto deploy spec missing (#3386)
* Fix: auto deploy spec missing

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: modify test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-09 11:28:52 +08:00
Diego Pinheiro
d5ad037173 Fix: Helm Chart values.yaml typo (#3403)
* fix - typo

Signed-off-by: GitHub <noreply@github.com>

* fix - typo helm values

Signed-off-by: GitHub <noreply@github.com>
2022-03-09 11:18:46 +08:00
barnettZQG
600b3a7044 Feat: make the component list is in reverse order (#3350)
* Feat: update api doc

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: make the component list is in reverse order.

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: update swagger config

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-08 17:59:22 +08:00
Avery
7bc34b8dd9 Feat: support def doc-gen <LocalFile.yaml> and corresponding functions (#3368)
* add doc-gen --local <LocalFile> and corresponding functions

Signed-off-by: Nicola115 <2225992901@qq.com>

* go format

Signed-off-by: Nicola115 <2225992901@qq.com>

* refactor the usage of vela def doc-gen from local file; refactor the function GenerateReferenceDoc

Signed-off-by: Nicola115 <2225992901@qq.com>

* gofmt and goimports

Signed-off-by: Nicola115 <2225992901@qq.com>

* update prompts info

Signed-off-by: Nicola115 <2225992901@qq.com>

* remove parseLocalDefinition struct, using ComponentDefinition instead

Signed-off-by: Nicola115 <2225992901@qq.com>

* standardize the function ParseLocalFile

Signed-off-by: Nicola115 <2225992901@qq.com>

* add unit test for ParseLocalFile

Signed-off-by: Nicola115 <2225992901@qq.com>

* remove redundant functions

Signed-off-by: Nicola115 <2225992901@qq.com>

* remove redundant lines and do goimports formatting

Signed-off-by: Nicola115 <2225992901@qq.com>
2022-03-08 16:58:39 +08:00
Tianxin Dong
bef24bdf22 Fix: separate waiting and failed backoff time and make them configurable (#3362)
* Fix: separate waiting and failed backoff time and make them configurable

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* change var name in chart values

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ci

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-08 16:04:19 +08:00
Zhiyu Wang
bed1fb373e Fix: The generated swagger.json is malformed. (#3372) (#3373)
Signed-off-by: Zhiyu Wang <zhiyuwang.newbis@gmail.com>
2022-03-08 15:48:05 +08:00
Somefive
b5ce5df9c5 Fix: remove deprecated rt field in app status (#3388)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-08 15:40:31 +08:00
Somefive
6e73c52116 Feat: enhance container related traits (#3359)
* Feat: enhance env trait

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: enhance container image trait

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add command trait

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-08 15:40:04 +08:00
Kunshuai Zhu
0b0ed60b42 Feat: init multi-cluster metrics management (#3365)
* Feat: init multi-cluster metrics management

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Refactor and add metrics collection for metrics-server

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Modify comment

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Fix staticcheck

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Fix some error

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Fix

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>
2022-03-08 14:20:36 +08:00
Somefive
aeaa199982 Fix: remove useless envbinding crd (#3379)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-08 13:40:05 +08:00
qiaozp
751aed0098 Fix: install definition script (#3376)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-03-08 12:26:25 +08:00
Somefive
17ee4268e2 Fix: upgrade dependency to fix alerts (#3378)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-07 14:16:40 +08:00
Somefive
7a30ec61d6 Fix: remove unused variable (#3377)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-07 11:57:59 +08:00
Somefive
de81c24f42 Feat: support standalone style multi-cluster (#3223)
* Feat: ref component

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: support topology and override

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add support for external policy and workflow

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add admission control

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: disable cross namespace ref object

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: refactor

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: support labelSelector in ref-objects

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add pre approve for deploy step

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: refactor

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: support comp/trait type in override policy even not used by prototype

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: support regex match for patch component name

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: labelSelector not work for cluster

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: ref workflow contains external policy

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: revision test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: parallel apply components

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add test for oam provider

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: service ref-comp & indirect trait ns

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: align namespace setting for chart

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add strict unmarshal and reformat

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: merge with cluster rework

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: patch trait-def

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: apply components + load dynamic component

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test for loadPoliciesInOrder

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add test for open merge

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: reformat & add test for step generator

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test for parse override policy related defs

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test for multicluster provider (expandTopology and overrideConfiguration)

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add admission test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: revert trait status pass in component status

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test for dependency in workflowstep & standalone multicluster test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add check for ref and steps in WorkflowStep & enhance ref-objects scheme check

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-03-07 10:21:00 +08:00
dependabot[bot]
93425889ef Chore(deps): Bump github.com/containerd/containerd from 1.4.12 to 1.4.13 (#3364)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.4.12 to 1.4.13.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.4.12...v1.4.13)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-04 09:43:04 +08:00
old prince
91c6458f35 Fix:deploy application api return value (#3358) 2022-03-03 18:27:13 +08:00
wyike
1cb4426e4b fix windows bug (#3351)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-03 14:43:40 +08:00
Sunghoon Kang
3399742709 Fix: clone request if round tripper modifies it (#3354)
Currently, multicluster round trippers are modifying request directly.
However, golang documentation says `RoundTrip` should not modify the
request.

This commit fixes round trippers to clone the request before the
modification.

https://pkg.go.dev/net/http#RoundTripper

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>
2022-03-03 14:42:24 +08:00
c1_zh
4ec919e009 Feat: Addon yaml files discovery logic improvement (#3356)
Signed-off-by: cezhang <c1zhang.dev@gmail.com>
2022-03-03 13:12:23 +08:00
StevenLeiZhang
dfd316ef7b Fix: Position of parameter is always changing on addon's details page. (#3345)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-03-02 20:46:13 +08:00
Kingram
7f20b7c5be Fix: Fix the inaccurate judgment of ready status (#3317)
* fix: Fix the inaccurate judgment of ready status

Signed-off-by: kingram <kingram@163.com>

* fix: solve inaccurate isHealth

Signed-off-by: kingram <kingram@163.com>

* fix: update readyReplicas type

Signed-off-by: kingram <kingram@163.com>
2022-03-02 13:17:55 +08:00
wyike
12f63dcae5 fix hard code service account name in test (#3346)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-03-02 12:20:05 +08:00
barnettZQG
342b853315 Feat: add api for delete component (#3341)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-03-01 22:13:24 +08:00
Tianxin Dong
d6cf2cdd2f Fix: add process context in workflow (#3318)
* Fix: add process context in workflow

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* add context data in process context

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* delete usesless func

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* use multi cluster ctx in process ctx

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* remove debug log

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-02-28 10:30:55 +08:00
Tianxin Dong
b8fd610523 Feat: add helm chart doc and make command (#3331)
* Feat: add helm chart doc and make command

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix makefile and add generate helm doc in release ci

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-02-28 10:03:23 +08:00
Wei (段少)
4a58af76cf Update: Nominee Wei as a maintainer (#3326) 2022-02-24 14:52:52 +08:00
StevenLeiZhang
b54ddf4c1c Fix: The order of status displayed by vela ls is not correct (#3302)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-02-23 14:50:04 +08:00
wyike
ca486be4eb Fix: addon store&show complicated parameter (#3310)
* fix

fix complicate args storage

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* wrap logic in func and add mock test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

solve confict

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix
2022-02-23 14:35:18 +08:00
barnettZQG
13b1e85442 Feat: add style and immutable parameters for uischema (#3309)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-23 14:23:07 +08:00
wyike
16414a0d9f Feat: addon support version check (#3304)
* addon support version check

add more tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* add kubernetes tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* add more tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* reorgnize the check logic

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix addon error bug in apiserver

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix comments

fix test

* add err addon bcode

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix comments

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-02-23 12:17:31 +08:00
Somefive
7059c8df79 Feat: rework cluster to align velaux and cli (#3299)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-02-22 15:48:22 +08:00
Jian.Li
fb831345f0 Fix: Let versioned controller uses a separate election locker in one cluster. (#3298)
* versioned leader election id

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* modify GenerateLeaderElectionID

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* add license header

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>
2022-02-21 19:54:49 +08:00
Tianxin Dong
170debf3ae Fix: change seldon service from istio to ambassador (#3278)
* Fix: change seldon service from istio to ambassador

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix lint

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* get service name form sdep

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-02-20 13:06:24 +08:00
wyike
015f3cf72b Feat: vela can set default namespace and user can enable fluxcd addon by default (#3280)
* vela default namespace and enable addon by default

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix lint

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix cli error

fix comments

* add tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-02-18 17:23:50 +08:00
yangs
67e88ffbaf Fix(charts): the qps and brust of reconcile client configurable (#3289)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-02-18 16:27:37 +08:00
Zheng Xi Zhou
37a523cbf7 Fix: not steady unit test (#3293)
The UT `TestGetOpenAPISchemaFromTerraformComponentDefinition` won't
succeed 100%. The required variables in the generated isn't in the expected
order all the time.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-02-18 15:15:10 +08:00
Jianbo Sun
42837ef162 Fix: make e2e CI more stable in vela show case (#3292)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-02-18 15:06:28 +08:00
Nash Tsai
1e022999a8 Refactor: refactor Helm chart with unnecessary 'systemDefinitionNames` value (#3267)
* refactor: refactor Helm chart with unnecessary 'systemDefinitionNamespace' value

* Revert "refactor: refactor Helm chart with unnecessary 'systemDefinitionNamespace' value"

This reverts commit 2ae764737f.

* Fix: Helm chart's 'Values.systemDefinitionNamespace' have default value of '.Release.Namespace' if unspecified.

* fix: fixed vela cli  referenced '{{.Values.systemDefinitionNamespace}}'

Co-authored-by: yungcheng.tyc <yungcheng.tyc@alibaba-inc.com>
2022-02-18 14:05:38 +08:00
Rui Jiang
8a1d0107b9 concurrent reconciles configurable (#3285)
Signed-off-by: jrkeen <jrkeen@hotmail.com>
2022-02-18 11:05:00 +08:00
Jianbo Sun
d3500b6d7c Chore: remove useless controller args to avoid confusion (#3284)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-02-17 19:13:40 +08:00
朱晓兵
debd9f2b40 Feat: add api for app compare、reset、dryrun (#3136)
* Feat: add api for app compare or reset

Signed-off-by: zxbyoyoyo <596908030@qq.com>

* Fix: fix lint

Signed-off-by: zxbyoyoyo <596908030@qq.com>

* Fix: fix lint

Signed-off-by: zxbyoyoyo <596908030@qq.com>

* Fix: fix imports

Signed-off-by: zxbyoyoyo <596908030@qq.com>
2022-02-17 13:58:48 +08:00
Zheng Xi Zhou
8eaa438631 Feat: add @wangwang as one Reviewer (#3268)
https://github.com/oam-dev/kubevela/issues/3261

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-02-16 19:46:24 +08:00
StevenLeiZhang
7102d7ad20 Fix: vela status api can not return customized arguments of addon (#3275)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-02-16 19:23:51 +08:00
Tianxin Dong
7b42515818 Fix: add DisableUpdateAnnotation for addon (#3260)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-02-16 15:27:22 +08:00
Tianxin Dong
7ee4b14a88 Feat: add seldon virtual service support in endpoints (#3259)
* Feat: add seldon virtual service support in endpoints

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-02-16 14:25:34 +08:00
barnettZQG
3d0b9b7c71 Feat: rollout controller is disabled by default (#3250)
* Feat: rollout controller is disabled by default

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: change rollout image pull policy

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: remove controller from the rollout addon in testdata

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: rollout controller is disabled by default

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: extended waiting time for the addon mock server

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-16 14:25:04 +08:00
Kunshuai Zhu
4bae08c2e2 Fix: Optimize error msg of addon enable/upgrade local path (#3222)
* Optimize error msg of addon enable/upgrade local path

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Fix and add unit test

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* Run make reviewable to include all changes

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* remove test case for windows

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>

* fix unit test.

Signed-off-by: zhukunshuai <jookunshuai@gmail.com>
2022-02-16 14:20:37 +08:00
Zheng Xi Zhou
46fce3262e Fix: properties table of cloud resource doc is broken (#3256)
If one column of a table contianers multiple line of a json
struct, it will break the table.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-02-16 11:03:11 +08:00
Zheng Xi Zhou
46967daf11 Fix: fixed required items for a Terraform ComponentDefinition (#3257)
If a Terraform variable is required, the item in OpenAPI schema
is required.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-02-15 18:53:40 +08:00
Wei (段少)
2fd8b7bc52 Feat: update owners_aliases (#3246)
* Update: ownerer-aliases

* Fix: keep up bootstrap-contributors

* Fix: reformat

* Fix: inherit all the maintainers from who maintain controller
2022-02-15 15:59:40 +08:00
Wei (段少)
a9e511d3a8 Feat: update logo to .svg (#3254) 2022-02-15 15:29:09 +08:00
Wei (段少)
37fb45bab8 Feat: update community.md (#3248) 2022-02-14 18:41:19 +08:00
barnettZQG
4a29776e8e Fix: registry don't have enough info to build a reader (#3237)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-14 18:04:34 +08:00
yangs
65522cabdb Fix: fix panic when user disable create apprevision (#3244)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-02-14 17:54:41 +08:00
Avery
d145487b96 Add cli support for provider gcp and baidu. (#3242)
Signed-off-by: Nicola115 <2225992901@qq.com>
2022-02-14 16:40:18 +08:00
wyike
7523576905 Feat: support complicated addon parameter (#3232)
* support complicated addon parameter

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix: go mod tidy

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-02-14 14:02:16 +08:00
barnettZQG
5b356af7dc Fix: can not collector pod list with rollout trait (#3225)
* Fix: can not collector pod list with rollout trait

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: cue format error

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: default values and optional parameters cannot coexist

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-14 13:05:01 +08:00
wangcanfengxs
72a434134a Fix: remove duplicative route in application webservice. (#3236)
Signed-off-by: wangcanfeng <wangcanfeng@corp.netease.com>

Co-authored-by: wangcanfeng <wangcanfeng@corp.netease.com>
2022-02-14 13:03:58 +08:00
barnettZQG
5ab9f0986e Feat: remove the duplicate command (#3228)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-14 10:35:31 +08:00
barnettZQG
9fe9f98e30 Fix: apply crd error that the annotations too lang (#3231)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-14 10:33:50 +08:00
barnettZQG
fee4a3f2b8 Fix: the definition namespace is empty (#3227)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-11 19:56:29 +08:00
Shaw Ho
f0cbe816a6 Fix: ControllerRevision typo (#3214)
Signed-off-by: Xiaoxi He <xxhe@alauda.io>
2022-02-10 15:43:11 +08:00
Somefive
d7261cd965 Fix: disable cochange for apprev when def changes (#3217)
* Fix: disable cochange for apprev when def changes

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-02-10 11:40:46 +08:00
barnettZQG
17794e4ce1 Fix: upgrade package github.com/docker/cli for CVE-2021-41092 (#3216)
* Fix: upgrade package github.com/docker/cli for CVE-2021-41092

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Chore: change go version to 1.17

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Chore: change go mod

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: change install cue shell

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-09 19:18:40 +08:00
barnettZQG
15418a6523 Feat: the golang version upgrade to 1.7 (#3208)
* Feat: the golang version upgrade to 1.7

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: install expat lib

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-09 15:17:50 +08:00
barnettZQG
fa1409f974 Fix: fix flag conflict (#3211)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-09 15:17:04 +08:00
Jianbo Sun
3157e65d8a Feat: Add image scan for vela core (#3210)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-02-09 14:00:12 +08:00
barnettZQG
f6eea78ec8 Feat: support install and uninstall vela core (#3181)
* Feat: support install and uninstall vela core

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: support upgrade crd

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: support set reuse args

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: apply CRD before install or upgrade

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-02-09 11:48:38 +08:00
Zheng Xi Zhou
24f147a72c Fix: support more Terraform variable types (#3204)
Support Any, set and some complicated variable types

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-02-08 18:48:38 +08:00
Jianbo Sun
7395994bdd Feat: add componentName in context for traitDefinition (#3200)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-02-08 16:26:16 +08:00
yangs
91125c6fec Feat: dispatch manifests in concurrent (#3060)
* Feat: dispatch manifests in concurrent

Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

* Fix: merge workflow pkg convert to pkg util

Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-02-08 16:25:57 +08:00
Jianbo Sun
0d8a9fc0de Chore: remove hack/website as docs moved to kubevela.io repo (#3197)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-02-08 16:24:26 +08:00
Jian.Li
68ada429f0 Feat: application support controller requirement (#3192)
* application controller version control

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* modify command arg name

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>
2022-02-08 15:44:38 +08:00
Zheng Xi Zhou
2c41ee9c3c Fix: add unit test for getting Terraform Configuration from remote git (#3193)
Add another unit test when the configuration of Terraform locates
in a subpath of a git remote repository

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-02-08 10:16:13 +08:00
Chazza
53198a9d9d Add nodeselector to jobs (#2811)
Signed-off-by: Chazza <github@whalecoiner.com>

Co-authored-by: Chazza <charlie@whalecoiner.com>
2022-02-08 09:36:51 +08:00
Somefive
7e102d70e0 Fix: error msg in webhook too complicated to read (#3169)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-01-27 16:09:23 +08:00
Jianbo Sun
ce25bd9985 Chore: add changelog of v1.2.x (#3167)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-26 11:23:01 +08:00
Oliver Otte
225b59156f Fix: Use systemDefinitionNamespace core Helm Chart (#3163)
Use value in Addon Registry CM and the Test Application

Signed-off-by: Oliver Otte <otte@gonicus.de>
2022-01-25 19:16:38 +08:00
Jianbo Sun
a73a4c64c2 Fix: krew install template of kubectl-vela.exe (#3162)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-25 18:46:05 +08:00
Tianxin Dong
614472b95a Feat: support vela show for workflow step definition (#3140)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-01-25 15:03:38 +08:00
zeed-w-beez
8b350a7258 Fix: add context parameters into the error message (#3145)
Signed-off-by: zeed-w-beez <zeed.w.zhao@gmail.com>
2022-01-25 13:27:26 +08:00
wyike
8d13c3c7bc fix: vela addnon enable cannot support = (#3156)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-01-25 13:22:45 +08:00
wyike
2da60419fc Feat: addon parameter support ui-shcema (#3154)
* Feat: addon parameter support ui-shcema

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix ci

* add more tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-01-25 10:43:38 +08:00
Zheng Xi Zhou
7895560675 Fix: retrieve Terraform variables from variables.tf (#3149)
* Fix: retrieve Terraform variables from variables.tf

If Terraform modules/resources are stored in remote git repos, get
variables from file `varialbes.tf`, or from `main.tf`.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-24 11:52:07 +08:00
Zheng Xi Zhou
75dc45ced6 Fix: add providerRef in generated ComponentDefinition (#3142)
If the provider is not provider, append the providerRef section in
the generated ComponentDefinition

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-24 10:27:37 +08:00
Sunghoon Kang
665e2b6340 Feat: extend gateway trait to set class in spec (#3138)
* Feat: extend gateway trait to set class in spec

`kubernetes.io/ingress.class` annotation is deprecated in favor of
`.spec.ingressClassName`. However, there is no way to set it through
the gateway trait for now.

This commit extends the gateway trait by adding `classInSpec` to
parameter. Forcing the use of `.spec.ingressClassName` makes sense, but
some ingress controllers (including old versions) may not recognize
this field. Therefore, set default value of `classInSpec` to `false`
for backward compatibility.

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Chore: update classInSpec usage

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>
2022-01-23 10:11:47 +08:00
Tianxin Dong
cb7bc0e7f4 Fix: handle workflow cache reconcile (#3128)
* Fix: handle workflow cache reconcile

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix return and move backoff to memory

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* handle failed to patch case

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* add store in err case

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* make reviewable

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* do cleanup in ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-01-22 15:54:17 +08:00
Sunghoon Kang
4ad8913bbd Fix: prioritize namespace flag for vela up (#3135)
* Fix: prioritize namespace flag for `vela up`

Currently, CLI applies application to `default` namespace when there is
no explicit namespace in application spec, even if the namespace flag
is set.

This commit fixes issue by overriding the namespace if the namespace
flag is set.

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>

* Test: add test cases for overriding namespaces

Signed-off-by: Sunghoon Kang <hoon@linecorp.com>
2022-01-21 10:22:25 +08:00
Zheng Xi Zhou
947455adb9 Fix: support generate Terraform ComponentDefinition from local HCL file (#3132)
Besides generating a Terraform ComponentDefinition from a remote git repo,
support generate one from local HCL file

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-20 14:15:22 +08:00
Jian.Li
354e92cfbd Fix: workflow skip executing all steps occasionally (#3025)
* fix asi

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* fix lint

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* add trace tag

* add args for this feature

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* enable-asi-compatibility

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>
2022-01-19 16:07:19 +08:00
StevenLeiZhang
7bdd3dd6e8 add imagePullSecrets for helm templates to support private docker registry (#3122)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-01-19 12:59:21 +08:00
Tianxin Dong
408c893cff Feat: add port name in webservice (#3110)
* Feat: add port name in webservice

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix port name in container

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* generate port name if not specified

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-01-18 18:59:48 +08:00
Zheng Xi Zhou
dd9ec2325a Fix: add app samples for Terraform definition (#3118)
Added application samples for all Terraform typed ComponentDefinition,
and also localize the title for AWS and AZure

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-18 18:08:30 +08:00
chwetion
951506b79b fix revision will change when add new trait with skiprevisionaffect to application (#3032)
Signed-off-by: chwetion <chwetion@foxmail.com>

Co-authored-by: chwetion <chwetion@foxmail.com>
2022-01-18 13:40:30 +08:00
Somefive
14b1354a68 Feat: support wild match for env patch (#3111)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-01-18 12:58:50 +08:00
qiaozp
bd2e574007 Fix: trait/comp command output without a new line (#3112)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-01-18 12:46:59 +08:00
chwetion
438a9fe7a5 Feat: add JFrog webhook trigger (#3104)
* add jfrog webhook to update application image

Signed-off-by: chwetion <chwetion@foxmail.com>

* edit jfrog default request header

Signed-off-by: chwetion <chwetion@foxmail.com>

Co-authored-by: chwetion <chwetion@foxmail.com>
2022-01-18 10:25:28 +08:00
Somefive
12f392cd92 Fix: rollout workload namespace not aligned with rollout (#3107)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-01-17 20:06:27 +08:00
StevenLeiZhang
af27e6a776 ignore vela-system, which is specified in needNamespace for addon metadata information (#3109)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-01-17 20:02:05 +08:00
StevenLeiZhang
f57815a5bf ignore files under the addon path of github addon registry (#3099)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2022-01-17 20:01:46 +08:00
Somefive
69527b257c Feat: support external revision in patch component (#3106)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-01-17 19:29:28 +08:00
barnettZQG
d88d4d8eca Fix: clear old data in mongodb unit test case (#3103)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-17 19:06:29 +08:00
Zheng Xi Zhou
4e881b44af Fix: support generate cloud resource docs in Chinese (#3079)
* Fix: support generate cloud resource docs in Chinese

`vela def doc-gen` will also generate Chinese cloud resource docs

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Continue the development

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* add ut

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* add ut and fix linting issue

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Address comments

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Fix `Should not use dot imports. (ST1001) ` issue

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* add copyright

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-17 16:18:59 +08:00
wyike
800b50cf0b fix acr image no version (#3100)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-01-17 16:09:21 +08:00
Jianbo Sun
3d9e1c7d80 Fix: use personel token of vela-bot instead of github token for homebrew update (#3096)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-17 11:45:01 +08:00
barnettZQG
fccc5df25e Fix: can't query data from the MongoDB (#3095)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-17 11:25:09 +08:00
yangsoon
6cee468743 Feat: add more performance optimization and prometheus metrics for controller (#3086)
* Feat: add more prometheus metrics

Signed-off-by: yangsoon <yangsoonlx@gmail.com>

* Feat: add detail gc rt duration metrics

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add monitor to client

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add all cache object

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Fix: watch job

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add deleg client

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add optimize for rt list and disable controllerrevision

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add apprev disable optimize

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Fix: optimize log

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add time recorder for app ctrl

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add in-memory workflow context

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add reconcile-reduction & random-pick-gc & optimize rt record

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: add optimize for healthcheck & resourcetracker trigger

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: refactor

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: record the resource-tracker number by informer event-handler

Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

* Feat: add promethus collect annotation in template

Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

* Fix: command line comment bug

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: rename args and remove legacy controller metrics

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: make code reviewable

Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

* Chore: optimize flag descriptions

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: break optimize package

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: gc policy test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Co-authored-by: Yin Da <yd219913@alibaba-inc.com>
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-01-14 15:18:02 +08:00
wyike
102a155194 fix lost create time and spell error (#3089)
Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-14 15:10:56 +08:00
wyike
f39a3fb792 Feat: system information collection logic in apiserver (#3082)
* Feat: userInfoCollection

Signed-off-by: wangyike <wangyike_wyk@163.com>

* Signed-off-by: wangyike <wangyike_wyk@163.com>

change enable/disable to update interface

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-14 10:16:31 +08:00
Somefive
8b5d7ed395 Feat: reset re-sync time (#3008)
* Feat: set resync

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: rename re-sync period

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: refactor return value

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-01-13 20:12:54 +08:00
wyike
5b1c47c918 cue template health check skipStandard workload and fix test diverge (#3087)
Signed-off-by: wangyike <wangyike_wyk@163.com>

add annotation

Signed-off-by: wangyike <wangyike_wyk@163.com>

set skipStandardworkload in wl

Signed-off-by: wangyike <wangyike_wyk@163.com>

add annotation

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-13 19:08:43 +08:00
Jianbo Sun
c298c98f25 Fix: vela logs for namespace get from CLI and add container name args (#3084)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-12 21:22:42 +08:00
Jianbo Sun
7f7a9dcac0 Feat: vela up support read from stdin && refine CLI output && fix vela addon command (#3080)
* Feat: vela up support read from stdin

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: addon name missed in output and fix test

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Chore: refine CLI output

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

Fix: add retry-on conflict on CLI

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-12 17:43:08 +08:00
barnettZQG
b4732ed275 Feat: add cluster name in service endpoint (#3076)
* Feat: add cluster name in service endpoint

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: add cli unit test

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-12 14:44:22 +08:00
chwetion
bfbdb85503 Feat: add DockerHub webhook trigger (#3081)
* add dockerhub webhook to update application image

Signed-off-by: chwetion <chwetion@foxmail.com>

* fix e2e webhook response return value

Signed-off-by: chwetion <chwetion@foxmail.com>

* add e2e for dockerhub webhook

Signed-off-by: chwetion <chwetion@foxmail.com>

Co-authored-by: chwetion <chwetion@foxmail.com>
2022-01-12 11:37:06 +08:00
Zheng Xi Zhou
f41e0a3bb5 Fix: change vela def gen-doc to vela def doc-gen (#3078)
* Fix: change `vela def gen-doc` to `vela def doc-gen`

Address the comments to change the command line name

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix CI

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2022-01-12 11:35:41 +08:00
Jianbo Sun
19a542ff11 Feat: support vela up from remote url file (#3075)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-11 17:28:45 +08:00
wyike
d64c78db47 Feat: addon enable support local dir for install offline (#3066)
* local reader

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix lint

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix comments and add test

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-11 11:29:10 +08:00
Kingram
ceb95229cd Feat: add Harbor webhook trigger (#3065)
* Feat: add harbor webhook trigger (#3029)

Signed-off-by: kingram <kingram@163.com>

* resolve comments

Signed-off-by: kingram <kingram@163.com>

* fix: add comments

Signed-off-by: kingram <kingram@163.com>
2022-01-10 21:26:43 +08:00
barnettZQG
ece47b5961 Fix: change namespace for the service-endpoints-view velaQL (#3071)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-10 21:25:07 +08:00
Basuotian
8be11a7e7e Feat: Add Lark support for notification (#3053) (#3059)
Signed-off-by: Shuai Tian <tians1@xiaopeng.com>

Co-authored-by: Shuai Tian <tians1@xiaopeng.com>
2022-01-10 19:42:06 +08:00
Zheng Xi Zhou
b354d2faa9 Fix: generate Terraform ComponentDefinition by vela cli (#3067)
* Fix: generate Terraform ComponentDefinition by vela cli

Support generate Terraform typed ComponentDefinition by `vela def init`

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-10 19:12:32 +08:00
Jianbo Sun
3af323365b Chore: refine CLI help message and docs (#3068)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-10 17:45:20 +08:00
Jianbo Sun
6a512c02a6 Chore: add autogen CLI reference doc script (#3063)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-10 15:28:04 +08:00
Minglong Song
b30ca0c8a2 Fix: Do not fiter event triggered by resync for application controller (#3064)
Signed-off-by: songminglong <1247768069@qq.com>
2022-01-10 14:48:58 +08:00
Zheng Xi Zhou
1a50dd76b5 Fix: generate docs for Terraform ComponentDefinition (#3051)
* Fix: generate docs for Terraform ComponentDefinition

Generated kubevela.io docs for Terraform typed ComponentDefinition
with `vela def gen-doc xxx` cli.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Refactor code

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* add ut

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* add ut

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* refine cloud resource title

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-10 14:08:48 +08:00
Zheng Xi Zhou
b17abe0081 Fix: add cue binary requirement in Development doc (#3062)
* Fix: add cue binary requirement in Development doc

If the version of cue binary is less than v0.3.0, like v0.2.0, `make reviewable`
will fail due to issue: "make: *** [fmt] Error 1". As `make reviewable` is a
required step for code contribution, add this prerequiste in the doc.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Update contribute/developer-guide.md

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>

Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com>
2022-01-10 13:01:46 +08:00
Jianbo Sun
12a106fcfe Fix: migrate test from crd v1beta1 to v1 (#3061)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-10 10:25:35 +08:00
barnettZQG
53d3ff6915 Fix: security alerts (#3058)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-07 16:27:23 +08:00
barnettZQG
d4762e09cd Feat: support query endpoints in status command and speed up CLI response (#3052)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-07 15:49:27 +08:00
Tianxin Dong
578aae6482 Fix: fix component definition status message (#3054)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-01-06 23:12:29 +08:00
Zheng Xi Zhou
96485ea0db Fix: when a provider is set in ComponentDefinition, it should look for the provider (#3047)
* Fix: when a provider is set in ComponentDefinition, it should look for the provider

Fixed the issue "The error message is not correct when AWS provider is not available"

Fix #3046

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-06 19:02:03 +08:00
Tianxin Dong
251c440453 Feat: add ACR webhook trigger (#3044)
* Feat: add ACR webhook trigger

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* resolve comments

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* change to interface

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix payload types

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-01-06 17:31:02 +08:00
wyike
770894412a Chore: deprecate appDeployment related logic (#3050)
* deperecated appDeployment

Signed-off-by: wangyike <wangyike_wyk@163.com>

* delete more code

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-06 16:24:09 +08:00
Tianxin Dong
4d6c0eb9d5 Fix: reset step status to stopped if the workflow is terminated (#3049)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-01-06 15:15:28 +08:00
wyike
53081d043b Chore: deprecate and delete approllout related code (#3040)
* Fex: delete useles approllout related code

Signed-off-by: wangyike <wangyike_wyk@163.com>

fix failed test

Signed-off-by: wangyike <wangyike_wyk@163.com>

Fix: failed e2e test

Signed-off-by: wangyike <wangyike_wyk@163.com>

fix-test

Signed-off-by: wangyike <wangyike_wyk@163.com>

fix test

Signed-off-by: wangyike <wangyike_wyk@163.com>

fix e2e-test

Signed-off-by: wangyike <wangyike_wyk@163.com>

fix e2e rollout test

Signed-off-by: wangyike <wangyike_wyk@163.com>

* delete useless test code

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix failed unit-test

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-06 14:33:11 +08:00
Jianbo Sun
8495465087 Refactor: refine cli commands && align kubectl-vela with vela && use getnamespaceAndEnv for all (#3048)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-06 13:29:02 +08:00
qiaozp
5f31b9aad0 Feat: add test for registry name in addon response (#2858)
* add test for registry name when list addon

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* revert

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-01-06 11:48:34 +08:00
barnettZQG
9f2e43756e Feat: support query service endpoints by velaql (#3036)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2022-01-06 00:35:46 +08:00
Zheng Xi Zhou
8033279751 Fix: Generate doc for Terraform typed ComponentDefinition (#3041)
* Fix: Generate doc for Terraform typed ComponentDefinition

When the configuration of a Terraform Typed ComponentDefinition is in
remote Git, generate the properties for it. And generated outputs for
all Terraform ComponentDefinition

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-05 19:45:30 +08:00
chwetion
070b313897 Feat: support application trigger deletion (#3037)
* support application trigger deletion

Signed-off-by: chwetion <chwetion@foxmail.com>

* add unit test for deleting application trigger

Signed-off-by: chwetion <chwetion@foxmail.com>

Co-authored-by: chwetion <chwetion@foxmail.com>
2022-01-05 14:25:24 +08:00
wyike
c170cecd34 fix addon panic bug (#3026)
Signed-off-by: wangyike <wangyike_wyk@163.com>

Fix lint

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-05 13:40:51 +08:00
Somefive
acac0554f3 Fix: filter managedfields update events (#3043)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2022-01-05 13:30:58 +08:00
wyike
1bceea29be Fix: helm addon demo issues (#3033)
* helm-port-forward

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix several issues

Signed-off-by: wangyike <wangyike_wyk@163.com>

* Fix comments

Signed-off-by: wangyike <wangyike_wyk@163.com>
2022-01-04 15:57:57 +08:00
Jianbo Sun
3066cde46b Fix: fix vela show --web that can not show elems (#3039)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-04 15:57:24 +08:00
Jianbo Sun
15be6bc388 Fix: check error when client not created (#3038)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-01-04 14:52:35 +08:00
qiaozp
ac6b125b7f Fix: error case is not tested when generate api schema (#3035)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2022-01-04 11:14:57 +08:00
Zheng Xi Zhou
24c00fc99b Fix: don't skip health check for observability in single cluster (#3031)
* Fix: don't skip health check for observability in single cluster

When there is no clusters, users use cli to enable observability,
we use workflow `apply-application-in-parallel` to enable the addon.
This workflow will skip health check and the addon won't become ready.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* Fix CI issue

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-04 11:13:09 +08:00
barnettZQG
f468814371 Feat: add uischema manage command (#3021)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-30 14:38:00 +08:00
barnettZQG
a1b1d4a6f8 Fix: trigger webbook bug (#3024)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-30 14:37:40 +08:00
Tianxin Dong
82453b45f5 Fix: fix webhook definition (#3022)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-30 10:11:19 +08:00
Tianxin Dong
72a00b57e6 Feat: add webhook token in application (#2970)
* Feat: add webhook token in application

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* resolve comments

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: change update cm to commit context

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* refactor the code

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix json merge

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* add create and update time

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-30 10:10:34 +08:00
Jamie
ff4b10f0ee Fix: op.#Task couldn't work, debug task.cue and fix bugs (#3005)
Signed-off-by: yunjiazhong <yunjiazhong@tencent.com>

Co-authored-by: yunjiazhong <yunjiazhong@tencent.com>
2021-12-29 19:26:27 +08:00
Somefive
746eb0dbe4 Feat: support logs for velaql (#3011)
* Feat: support logs for velaql

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: extend parameter

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-28 20:49:56 +08:00
Somefive
a33d1e488a Feat: gc process ignore cluster not exists (#3007)
* Feat: gc process ignore cluster not exists

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Feat: gc process ignore cluster not exists

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-28 13:12:23 +08:00
Somefive
0d6173c1ca Fix: pending deprecated test (#3009)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-28 13:12:09 +08:00
barnettZQG
00a80b9ecb Feat: add request logging for the apiserver (#3012)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-28 11:41:53 +08:00
barnettZQG
8284581e0c Feat: set GOPROXY build arg (#3004)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-28 10:26:07 +08:00
Tianxin Dong
8a5759949a Fix: fix notfication properties for schema (#3006) 2021-12-27 20:00:26 +08:00
Zheng Xi Zhou
820db96eae Fix: change Grafana service type and remove domain parameter (#2996)
* Fix: change Grafana service type and remove domain parameter

Use Grafana service's external IP to visit the dashboard and
remove the prameter domain

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* address CI issues

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix api issue

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix ci

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix ci

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-12-26 20:38:19 +08:00
barnettZQG
4d69027300 Feat: check target where create and update env (#3003)
* Feat: check target where create and update env

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: list applications by env

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-25 14:20:36 +08:00
wyike
5210800cac Fix: add registryName into addon list (#2993)
* Fix: add registryName into addon list

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix congig map

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix several comments

Signed-off-by: wangyike <wangyike_wyk@163.com>

* small fix

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-25 12:37:23 +08:00
wyike
66881c13d3 Fix: more app info in addon status (#3000)
Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-25 11:01:59 +08:00
Jianbo Sun
5648c56cf5 Refactor: align velaux env and CLI env, they both use K8s namespace as (#2975)
* Refactor: use createOrUpdateNamespace as a common util function

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Feat: add ENV webservice handelr

* Fix: fix Env usecase logic

* Feat: Add Delete Env API

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: filter empty addon data

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Feat: split makefiels and make it clear

* Feat: add k8s utils test

* Feat: Add env update interface

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Feat: change env implementation

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: minor fix

* Revert "Fix: minor fix"

This reverts commit 9cafefa65a.

* Fix: use appusecase as parameter

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Refactor: align CLI vela env with new env design

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: minor fix

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Feat: add page index and alias of env

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: fix tests and licence header

* Fix: fix makefile and add default target

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: update build swagger.json

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: change update env api

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: list env with alias

* Feat: add log to env delete

* Fix: can not get app status

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: support update workflow and refactor code

* Fix: lint

* Fix: remove swagger check

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: fix cli vela delete

* Fix: update test

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: update test

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* Fix: app deploy unit test case

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: SortOrderDescending is not effective

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: e2e test case

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Feat: support default project/target/env

* Fix: make test and add swagger

* Fix: use separated datasource for unit test

* Fix: app rollback bug

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: fix e2e test

* Fix: kubeapi driver sort bug

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: e2e test

* Fix: api e2e test

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: e2e test fix

* Fix: try fix e2e test

* Fix: api e2e test

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-25 10:36:54 +08:00
Min Kim
27252f32de idempotent conditional apiservice deletion (#2997)
Signed-off-by: yue9944882 <291271447@qq.com>
2021-12-24 18:36:21 +08:00
Somefive
775faee96f Chore: add welcome logo in helm install notes (#2994)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-24 16:15:28 +08:00
qiaozp
e818921a87 Fix: return reasonable error make multi-registry work (#2995)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-24 16:06:07 +08:00
wyike
551992e8f2 fix panic bug of addon enable (#2985)
Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-24 11:12:26 +08:00
wyike
e519c6142a Chore: delete useless test (#2984)
* delete useless test

Signed-off-by: wangyike <wangyike_wyk@163.com>

* delete healthscope related test

Signed-off-by: wangyike <wangyike_wyk@163.com>

* small fix

Signed-off-by: wangyike <wangyike_wyk@163.com>

* remove useless report

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-23 18:13:00 +08:00
wyike
3198693ad7 Fix: cli addon registry style small fix (#2980)
* small fix

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix comments

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-23 14:37:22 +08:00
Tianxin Dong
88aa6c0e83 Fix: change update cm to commit context (#2979)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-23 11:45:56 +08:00
Zheng Xi Zhou
8b82a79d1d Fix: vela port-forward supports Addon Observability (#2977)
* Fix: vela port-forward supports Addon Observability

Support port forwarding service of Addon Observability in
multiple clusters

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* fix CI issues

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-12-22 21:08:00 +08:00
wyike
14a57fc656 vela cli support oss path and cli upgrade an addon (#2976)
Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-22 19:31:20 +08:00
Zheng Xi Zhou
d7ee46134d Fix: lowercase the key name in API response (#2978) 2021-12-22 18:14:34 +08:00
Jian.Li
6e5e26c19d fix message invalid (#2968)
Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>
2021-12-22 12:47:27 +08:00
Zheng Xi Zhou
8750fc8fab Fix: implement addons/observability/status API (#2966)
* Fix: implement addons/observability/status API

Return all domains and the IPs from all clusters. And
provider the way to visit the console of observability

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* add unit tests

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-12-22 10:54:46 +08:00
qiaozp
7ed293e27e Fix: list addon will always return non-nil err (#2967)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-22 09:28:10 +08:00
Somefive
36ad77493c Fix: resource policy test flaky (#2969)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-22 09:27:21 +08:00
qiaozp
9317bb1cab Refactor: addon cache mechanism and code architecture (#2956)
* Refactor: fix addon cache and code

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

* basic trim

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Fix list OSS bucket addon's meta

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* rename listAddonMeta func

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix enable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* rename and trim cache func call

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* remove same source code, use Registry to implement Source interface. Keep the compatibility of DeployTo fields.

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* complete github reader

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix read from github, fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* header

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* rename function, restore test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* try CI

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* sort out functions name. add detail test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* filter directory without metadata.yaml in oss

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add GitHub reader unit test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* clean up

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* header

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add cache arg

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* change field name

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* build swagger

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* some json tag, revert cache logic

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-12-21 09:31:37 +08:00
barnettZQG
2543b7b510 Fix: can not find target name in pod list (#2936)
* Fix: can not find target name in pod list

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: set create time for init trait

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-20 18:51:21 +08:00
qiaozp
7ef8cea7ce Chore: remove addons stored in configmap (#2951)
Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-20 17:21:03 +08:00
wyike
ae06ddacac Feat: addon compability code for 1.1 (#2961)
Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-20 14:34:45 +08:00
Somefive
db189f7527 Fix: optimize resourcetracker upgrade (#2959)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-20 13:05:53 +08:00
Tianxin Dong
9599e2da9d Docs: update some outdated content in workflow doc (#2962)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-20 11:35:22 +08:00
Tianxin Dong
6c4b7699b9 Fix: nit fix for workflow (#2957)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-20 11:00:07 +08:00
Tianxin Dong
add5d40bfc Feat: add init secret demo (#2955)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-18 14:31:18 +08:00
Somefive
2f7b20d8b8 Fix: amend fix for log sanitize (#2953)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-18 10:16:36 +08:00
Tianxin Dong
b85be11324 Feat: add workflow stability mechanism doc (#2960)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-18 10:11:38 +08:00
Zheng Xi Zhou
d11d171be8 Fix: enable Observability in runtime clusters (#2886)
* Fix: enable Observability in runtime clusters

Enabled add-on observability in runtime clusters. In each cluster, a sub-domain
will be allocated to the cluste

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>


* Fix:add workflow step definition and ut

Added a new workflow step definition `apply-application-in-parallel`,
and added more unit tests
2021-12-17 23:04:54 +08:00
Somefive
cb0e88d590 Fix: nil pointer aliyun sdk (#2954)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-17 15:15:23 +08:00
Tianxin Dong
f0d95c566f Fix: fix notification definition to show better (#2952)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-17 01:09:56 +08:00
Somefive
0a2a41046c Fix: ack dashboard url (#2932)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-16 21:25:43 +08:00
yangsoon
b57db36dd3 Fix: velaql compatible with v1.2.0-beta version (#2946)
Signed-off-by: yangsoon <yangsoonlx@gmail.com>
2021-12-16 21:15:07 +08:00
Tianxin Dong
f5e04a5575 Fix: fix apiserver snake case (#2944)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-16 21:14:25 +08:00
Somefive
4e91e3ab8d Fix: workflow step definition for ui (#2948)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-16 21:10:09 +08:00
Somefive
478d134778 Feat: upgrade cluster-gateway (#2941)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-16 21:06:02 +08:00
Somefive
5f2085b470 Feat: support parallel apply in deploy2env (#2938)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-16 21:05:23 +08:00
Somefive
416fc45999 Fix: security alert (#2945)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-16 21:03:54 +08:00
Jian.Li
133a89be3f Fix: deprecate CRD discovery for CUE import in Definition to prevent memory leak and OOM crash (#2925)
* Pause test case

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* fix lint

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* diable discover the open api of the CRD

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>

* fix definition test cases

Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>
2021-12-16 17:53:15 +08:00
yangsoon
3b1f097807 Fix: change catlog helm repo path to https://charts.kubevela.net/example (#2942)
Signed-off-by: yangsoon <yangsoonlx@gmail.com>
2021-12-16 15:17:00 +08:00
wyike
e49dec5a3a Feat(cli): app status more info (#2937)
* Feat(cli): app status more info

Signed-off-by: wangyike <wangyike_wyk@163.com>

* more info

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix: delete invisible check

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-16 11:12:06 +08:00
Somefive
f15d748251 Feat: add cluster alias to dt (#2929)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-15 16:33:45 +08:00
barnettZQG
e17f6b931a Feat: support specified existing namespace while creating a project (#2931)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-15 14:42:18 +08:00
Somefive
a3bf61fa4f Feat: set multicluster enabled by default (#2930)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-15 12:11:28 +08:00
Tianxin Dong
655c2615e1 Feat: add workflow reconciling backoff time and failed limit times (#2881)
* Feat: add workflow failed after retries

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: add workflow reconcile backoff time

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix lint

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* make reviewable

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* resolve some comments

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* add tests

* fix rebase

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix status

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix requeue time interval

* resolve comments

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* change time to pointer

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix pointer test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* change time to cm

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* resolve comments and add e2e test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-15 11:33:33 +08:00
Somefive
4dc213469a Feat: add compatibility code for new rt (#2920)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-14 21:27:47 +08:00
yangsoon
03d79db919 Fix: fix sync-api CI (#2923)
Signed-off-by: yangsoon <yangsoonlx@gmail.com>
2021-12-14 17:25:24 +08:00
qiaozp
0fc65eb787 Feat: add mock server (#2911)
* add mock server

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* use mock server

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* complate terraform-alibaba addon

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* move to test dir

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* complete terraform

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add back oss

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* remove useless readme

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-14 14:52:10 +08:00
yangsoon
6d536a84d7 Feat: refactor velaql provider with new ResourceTracker architecture (#2915)
* Feat: refactor velaql with new ResourceTracker architecture

Signed-off-by: yangsoon <yangsoonlx@gmail.com>

* Feat: concurrently request the pod created by helm

Signed-off-by: yangsoon <yangsoonlx@gmail.com>
2021-12-14 13:09:40 +08:00
wyike
f5f5ff514f Feat: cli manage addon registry and apiserver addon status return app status info (#2910)
* Fix: cli add addon registry

add more detail info for addon workflow info

Signed-off-by: wangyike <wangyike_wyk@163.com>

* fix: set app status in addon status directly

Signed-off-by: wangyike <wangyike_wyk@163.com>

* add e2e test

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-13 19:47:32 +08:00
qiaozp
a67b7e90d0 Feat: add path argument to addon oss source (#2907)
* add path

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* pending test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* license

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* keep compatible

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-13 19:43:15 +08:00
Somefive
a89bb69a62 Fix: add design docs for ResourceTracker (#2909)
* Fix: enhance rt logic and add docs

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Fix: test conflict

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-13 19:41:42 +08:00
Min Kim
c5c664f316 pin ocm images version to v0.5.0 (#2900)
Signed-off-by: yue9944882 <291271447@qq.com>
2021-12-13 17:57:45 +08:00
qiaozp
53006b4137 Fix: move addon api to pkg/addon (#2905)
* move addon api to pkg/addon

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* license

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-13 17:47:53 +08:00
barnettZQG
f47ae0e498 Feat: support automatically creating scaler trait for webservice component (#2908)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-10 15:04:31 +08:00
Somefive
b622cbdb7f Feat: ResourceTracker new architecture (#2849)
* Feat: new rt

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>

* Fix: add publish version

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-10 15:00:03 +08:00
qiaozp
94f32a317d Feat: support addon definition in cue format (#2896)
* move def func to pkg

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* split def schema render

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* render CUE definition

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-09 20:31:19 +08:00
Min Kim
b483840987 honor existing cluster-gateway installation if exists (#2904)
Signed-off-by: yue9944882 <291271447@qq.com>
2021-12-09 15:59:16 +08:00
Jian.Li
3e81fdf008 remove InsecureSkipVerify (#2903)
Signed-off-by: Jian.Li <lj176172@alibaba-inc.com>
2021-12-09 09:20:49 +08:00
barnettZQG
ad4b44696a Feat: add the project api (#2899)
* Feat: add the project api

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: fix e2e test bug

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-08 19:08:35 +08:00
barnettZQG
1563c582bc Feat: support additional properties parameter (#2880)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-08 17:46:45 +08:00
Jian.Li
3f2e76c75a Feat: HTTP Provider requires adding certificate chain from secret (#2771)
* http support load tls certs

* fix: TLS MinVersion too low
2021-12-08 11:39:04 +08:00
wyike
f7ebbf4fa0 Fix: create vela namespace (#2893)
Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-08 09:12:37 +08:00
Somefive
330c3e269c Fix: kubeconfig tmp file security (#2894)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
2021-12-08 09:12:07 +08:00
Snyk bot
41e6a895a1 fix: hack/website/Dockerfile to reduce vulnerabilities (#2857)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-DEBIAN9-CURL-1585151
- https://snyk.io/vuln/SNYK-DEBIAN9-GLIBC-356851
- https://snyk.io/vuln/SNYK-DEBIAN9-GLIBC-356851
- https://snyk.io/vuln/SNYK-DEBIAN9-GLIBC-356851
- https://snyk.io/vuln/SNYK-DEBIAN9-GLIBC-356851

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-12-07 18:07:19 +08:00
Jianbo Sun
e8f2b79721 Fix: use specific cli release download folder (#2889)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-12-07 17:53:04 +08:00
qiaozp
2947da2611 Fix: OSS read data race (#2875)
* Fix: read oss addon prefix bug

This bug is about list OSS bucket by prefix which will cause confusion between `terraform` and `terraform-alibaba`

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix data race

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix channel block

add test

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* reviewable

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-07 16:17:11 +08:00
Tianxin Dong
4b07f1d000 Feat: support generate definition schema from terraform remote (#2860) 2021-12-07 15:50:04 +08:00
wyike
99757814ab Feat: algin addon cli and apiserver (#2867)
Feat: cli aligin with apiserver

Fix comments

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-07 15:11:52 +08:00
Jianbo Sun
ecd7f62f89 Chore: add more frequency on CI image clean job && delete rollout-test image (#2883)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-12-06 16:37:34 +08:00
qiaozp
a62724fbd7 Fix: addon timeout is not acturally tracked (#2863)
* Fix: addon timeout is not acturally tracked,  better addon enable fail message

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add namespace

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* change wording

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-06 12:33:52 +08:00
Tianxin Dong
33ffc00c2e Fix: fix webservice and worker def (#2865) 2021-12-06 11:21:41 +08:00
Zheng Xi Zhou
bf03c82bc7 Fix: support displaying logs for Terraform typed applications (#2879)
Refined the logic to display logs for Terraform typed applications,
and upated the namespace of the pod running Terraform jobs

Fix https://github.com/oam-dev/kubevela/issues/2670

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-12-03 18:31:30 +08:00
yangsoon
a528431d63 Feat: add trait service-account (#2878)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-12-03 18:24:50 +08:00
Jianbo Sun
fb5716cc13 Feat: add vela apiserver release into github workflow (#2877)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-12-03 17:01:50 +08:00
Min Kim
589480af62 idempotent cluster join: filter out the clusters not yet accepted (#2859)
Signed-off-by: yue9944882 <291271447@qq.com>
2021-12-03 14:17:38 +08:00
Jianbo Sun
b8640222c8 Fix: mark test chart image in a fixed tag to avoid changed by release action (#2873)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-12-03 13:05:28 +08:00
Tianxin Dong
56f300846c Fix: fix sync from status version instead of anno (#2870)
* Fix: fix workflow sort

* fix sync from status

* fix lint

* fix apply

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix lint

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix ut

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2021-12-03 11:22:55 +08:00
qiaozp
95c2b8ce04 Fix: query addon status api 500 because of secret (#2866)
* Fix: query addon status api 500 because of secret

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Fix: enable addon failed because the file name of the cue template is used as the component name

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Fix: fix several oss read problem

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix lint

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* use oss test endpoint

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix ut

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-03 10:59:46 +08:00
Tianxin Dong
9b7286d6f5 Fix: fix workflow apserver sort and rollback status (#2862)
* Fix: fix workflow apiserver sort and rollback status

* fix ut
2021-12-02 20:04:53 +08:00
barnettZQG
27e1dd4a1b Fix: cloud resource type applications could not be identified (#2856)
* Fix: cloud resource type applications could not be identified

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: the cloud app properties can not set empty region value

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-02 17:11:50 +08:00
Zheng Xi Zhou
7d341c4bd3 Fix: pass on properties of Terraform typed application to Configuration (#2847)
* Fix: pass on properties of Terraform typed application to Configuration

Pass on properties like `writeConnectionSecretRef`, `Region` and `providerRef`
to Configuration.

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>

* revert definitions

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2021-12-02 15:45:50 +08:00
Chwetion
59b458404e Feat: add deleting phase for apiserver application status model (#2854)
Signed-off-by: chwetion <chwetion@foxmail.com>

Co-authored-by: chwetion <chwetion@foxmail.com>
2021-12-02 10:16:27 +08:00
qiaozp
a6ef0644ff Feat: oss suppurt for addon (#2848)
* Add OSS source support for addon

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add unit test for pkg/addon

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* fix lint

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* add license

Signed-off-by: qiaozp <chivalry.pp@gmail.com>
2021-12-01 19:15:48 +08:00
Min Kim
d56a1e534b alternatively using the original endpoint from the hub kubeconfig as registry endpoint (#2751)
Signed-off-by: yue9944882 <291271447@qq.com>

upgrade cluster-register to v1.0.2

Signed-off-by: yue9944882 <291271447@qq.com>

improve logging

Signed-off-by: yue9944882 <291271447@qq.com>
2021-12-01 14:47:26 +08:00
Tianxin Dong
374c3cd3e0 Fix: reset record status when a new one is created (#2846)
* Fix: reset record status when a new one is created

* skip the new created one
2021-12-01 10:52:07 +08:00
wyike
163415479b Feat: list enabled addon from cluster interface and update addon (#2832)
make reviewable

lint

Feat: interface for update addon

nit import

fix comments

fix status args return

Signed-off-by: wangyike <wangyike_wyk@163.com>
2021-12-01 10:27:26 +08:00
barnettZQG
4294cc8a98 Feat: automatically populate the provider and region configuration for cloud app (#2841)
* Feat: automatically populate the provider and region configuration for cloud app.

* Fix: fix e2e test bug

* Fix: component name and type inconsistency

* Fix: fix unit test bug

* Fix: fix unit test bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-12-01 10:26:33 +08:00
Zheng Xi Zhou
5630c02d7f Fix: add more fields for Terraform types definitions in api schema (#2836)
* Fix: add more fields for Terraform types definitions in api schema

Added `writeConnectionStringSecrecto`, `region` and `deleteResoruce`
fields for Terraform types definitions in OpenAPI schema

* fix ci issue

* fix header
2021-12-01 10:03:08 +08:00
Tianxin Dong
8dad1eadb4 Feat: add alias in list record api (#2833) 2021-11-30 19:04:42 +08:00
Zheng Xi Zhou
c588f85438 Fix: sync status of Terraform typed components to application (#2844)
Synchronized the status of an Terraform typed components to .status.
services of the application

Signed-off-by: zzxwill <zzxwill@gmail.com>
2021-11-30 17:49:59 +08:00
朱晓兵
13c0b08081 Fix: update envBinding related workflow bug (#2831)
* Fix: fix update envBinding related workflow bug

* Fix: support cloudresource step

* Fix: add unit test

* Fix: add unit test

* Fix: add unit test

* unit test

Co-authored-by: zhuxiaobing <zhuxiaobing@lixiang.com>
2021-11-30 17:24:29 +08:00
Tianxin Dong
52ac570faa Feat: add filter in list definitions (#2835)
* Feat: add filter in list definitions

* add workload type
2021-11-30 16:53:01 +08:00
Jian.Li
ec105cbb02 Fix: application conditions confusion. (#2834)
* fix condition confusion

* fix test cases
2021-11-30 16:43:27 +08:00
Wei (段少)
f8e1ddc52c Add up CII Best Practices badge (#2843) 2021-11-30 15:13:56 +08:00
barnettZQG
2abd98301f Feat: remove apiserver component from the chart (#2838)
Co-authored-by: barnettZQG <yiyun.pro>
2021-11-30 12:42:18 +08:00
yangsoon
13b07674f1 Fix: fix flaky e2e-test of apiserver (#2840)
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-11-30 10:37:52 +08:00
Somefive
f9ecc02417 Feat: rework rt (#2797) 2021-11-29 16:14:30 +08:00
Tianxin Dong
d1f56743cc Feat: add core definitions (#2664)
* Feat: add components and storage api-oriented defs

* add some examples

* change the dir

* resolve comments

* make reviewable

* fix example

* add labels and annotations in component

* add config map ref key in env

* add more traits

* add wfstep defs and rename

* fmt the cue

* re-struct all the definitions

* revert deprecated defs and add webhook def

* delete useless network trait

* fix generated tab

* fix indent

* fix webservice

* add labels

* comment webservice and worker's health check

* fix retainkeys

* fix webservice and worker's health check

* add suspend def which will be replaced by internal def

* fix cli and add labels

* fix script

* add ignore

* fix healthscope example
2021-11-29 15:02:16 +08:00
wyike
6184b6e0e6 Feat: install helm addon schema (#2815)
Fix: fix bug

Fix: rebase bug

fix rebase -i master

rename func
2021-11-29 13:24:52 +08:00
Zheng Xi Zhou
ac2169e2fa Fix: upgrade terraform controller to v0.2.10 (#2827)
- Clean RBAC
- Generate Job/Pod/ConfigMap/Secret in the namespace of a Configuration
- Fix: The secret generated by Terraform won't regenerate after it's manually deleted
- Fix status ProvisioningAndChecking
- The Kubernetes backend should keep consistent
- Override Region of a provider in Configuration
- Set region to spec.region
2021-11-29 10:38:27 +08:00
barnettZQG
96a9fb7d9e Feat: support auto creating workflow step for cloud app (#2826)
* Feat: support auto creating workflow step for cloud app

* Fix: fix unit test bug

* Fix: fix component cant not find bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-29 10:20:15 +08:00
Zheng Xi Zhou
92335eca17 Fix: support exposing cloud resource identifier and console url (#2825)
* Fix: support exposing cloud resource identifier and console url

To help users quickly navigate to the instance in the web console, exposing
necessary information in ComponentDefinition and convert them to Configuration

* fix ci

* Check whether wl.FullTemplate.ComponentDefinition is nil before getting annotations
2021-11-28 17:21:12 +08:00
yangsoon
23bceb9f9c Fix: velaql miss query the resources created by the old application version (#2824)
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-11-27 13:57:48 +08:00
qiaozp
b05deeca55 Feat: add addon invisible field (#2820)
* Feat: add addon invisible field

* reviewable
2021-11-27 13:06:45 +08:00
Zheng Xi Zhou
7bdf4c176b Fix: install Terraform and apply the support for a provider in one jump (#2778)
* Fix: install Terraform and apply the support for a provider in one jump

- Fix issue: addon name should not include forward-slash "/" cloud-resource fix addon name should not include forward-slash "/" #2588
- Install terraform and the provider in one jump. Instead of installing terraform
and terraform-xxx in two steps
2021-11-26 23:01:11 +08:00
Tianxin Dong
334ef864da Feat: add alias in workflow step status (#2821)
* Feat: add alias in workflow step status

* fix lint

* add revision
2021-11-26 20:35:04 +08:00
Somefive
f5fc822a3e Fix legacy resourcetracker not garbage collect while previousRT is empty or equals currentRT (#2817) 2021-11-26 17:48:17 +08:00
Somefive
dd84700657 Fix: health check appRev label bug (#2816)
* Fix: healthscope failed since appRevision is not set && rollout controller amend appRevision to workload since compRev does not have this one

* Fix: test
2021-11-26 17:47:43 +08:00
Somefive
782025507c Fix: health check do not check resource in correct namespace while ns is override by envbinding (#2818) 2021-11-26 16:04:44 +08:00
Tianxin Dong
bab241e969 Feat: add more logs in workflow sync (#2806) 2021-11-26 15:34:25 +08:00
Jianbo Sun
27c4dd1bc5 Fix: don't invoke docker command if not exist (#2813)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-11-26 13:54:44 +08:00
Zheng Xi Zhou
41f384e36b Fix: addon name should not add prefix resources (#2808)
* Fix: addon name should not add prefix `resources`

- Adding prefix `resources will hit issues as:
'unable to parse requirement: invalid label value:
"resources-prometheus-server-register-grafana-datasource-5576f7f6b4":
      at key: "controller.oam.dev/component": must be no more than 63 characters'
- This won't avoid the name confliction with other components

* address comments
2021-11-25 21:01:56 +08:00
qiaozp
2be261e3f7 Feat: optimize addon enable experience (#2677)
* Feat: better addon enable experience

* better

* Update references/cli/addon.go

typo

Co-authored-by: yangsoon <yangsoonlx@gmail.com>

Co-authored-by: yangsoon <yangsoonlx@gmail.com>
2021-11-25 14:08:20 +08:00
qiaozp
b279df0451 Fix: add lock to avoid addon concurrency read error (#2803)
* make read func table driven

* add mutex

* fix
2021-11-25 11:50:29 +08:00
Zheng Xi Zhou
bbb1c1767e Fix: remove .cue suffix from the component name of observability (#2796)
If the component name has a suffix `.cue`, it will hit issue of not
match a DNS name
2021-11-25 11:06:08 +08:00
Zheng Xi Zhou
40f100ec27 Fix: support naming a terraform provider (#2794)
* Fix: support naming a terraform provider

Support set the name for a terraform provider.

Fix #2595

* Style: format

Co-authored-by: Yin Da <yd219913@alibaba-inc.com>
2021-11-25 10:32:30 +08:00
Tianxin Dong
6f90155ccd Feat: add workflow rollback cli (#2795)
* Feat: add workflow rollback cli

* fix ci
2021-11-24 21:34:44 +08:00
Zheng Xi Zhou
216a95a2dd Fix: the way to renderCUETemplate for terraform provider is wrong (#2798)
Fixed the probelm of renderring cue template for terraform provider
after #2788
2021-11-24 21:34:06 +08:00
Somefive
d1f70def0e Fix: healthscope support envbinding (namespace) (#2783)
* Fix: healthscope support envbinding (namespace)

* Fix: ensure healthscope not patch status when application workflow is still running
2021-11-24 21:26:06 +08:00
yangsoon
65f8614fd8 Feat: vela delete add wait and force option (#2747) 2021-11-24 21:00:03 +08:00
wyike
66e8398ab8 Fix: add back missed commit and add tests (#2781)
* Fix: missed commit

Test: add test

* Fix: add e2e test addon rely on core feature

fix test

Fix: e2e-test

* Fix: create vela-system namespace when cluster join

fix

* Fix: fix comments add args in command
2021-11-24 20:59:08 +08:00
Tianxin Dong
f1eef83809 Feat: add workflow name for frontend (#2787) 2021-11-24 20:18:27 +08:00
barnettZQG
99d473df2a Feat: translate the object type to Group (#2786)
* Feat:  translate the object type to Group

* Fix: fix unit test bug

* Fix: fix workflow do not delete after delete env bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-24 20:17:40 +08:00
Jian.Li
da251f1cb6 Fix: lookupByScript don't support import (#2788)
* fix lookupByScript

* fix lint
2021-11-24 19:57:54 +08:00
Zheng Xi Zhou
14770dff0d Fix: arguments map[string]string doesn't support observability's args (#2790)
* Fix: arguments map[string]string doesn't support observability's args

As there are bool typed arguments, the current arguments type doesn't
support.
2021-11-24 19:52:59 +08:00
Zheng Xi Zhou
4b72954c86 Fix: addon with arguments could not be installed (#2789)
With the fix #2766 to install addon without arguments, fix the issue of
installing addons with arguments.
2021-11-24 19:52:13 +08:00
yangsoon
3d2fcacb5a Feat: built in gc policy to application (#2575) 2021-11-24 15:38:13 +08:00
Zheng Xi Zhou
e5a86ef537 Fix: the first addon should not be example (#2793)
As addon example has been removed, the first addon on should not
be `example`
2021-11-24 13:44:55 +08:00
yangsoon
ec5e2b4660 Fix: clean up the view api (#2779) 2021-11-24 11:09:50 +08:00
barnettZQG
8c276e226b Fix: fix update component and list workflow bug (#2782)
* Fix: fix update component and list workflow bug (#2763)

* Fix: fix update component and list workflow bug

* Fix: change e2e test case

* Fix: change e2e case

Co-authored-by: barnettZQG <yiyun.pro>

* Fix: fix sync controller revision (#2772)

Co-authored-by: Tianxin Dong <dongtianxin.tx@alibaba-inc.com>
Co-authored-by: barnettZQG <yiyun.pro>
2021-11-23 19:30:54 +08:00
Jianbo Sun
8bcffb92bf Merge pull request #2769 from oam-dev/merge
Feat: Merge APIServer Into Master
2021-11-23 10:08:01 +08:00
Zheng Xi Zhou
2e417641cd Revert "Fix: install Terraform and apply the support for a provider in a jump (#2718)" (#2773)
This reverts commit 3bf365322b.
2021-11-22 11:48:49 -05:00
Zheng Xi Zhou
3bf365322b Fix: install Terraform and apply the support for a provider in a jump (#2718) 2021-11-23 00:08:37 +08:00
yangsoon
6dff9ab679 Fix: fix compatibility test 2021-11-22 23:21:17 +08:00
Yin Da
395b594b84 Fix: fix package test 2021-11-22 22:02:49 +08:00
yangsoon
cee66fd03f Fix: remove useless test 2021-11-22 21:46:49 +08:00
Hongchao Deng
5c46aa2f7f fix header 2021-11-22 19:07:13 +08:00
Hongchao Deng
cf4aaf51c8 fix imports 2021-11-22 18:47:47 +08:00
Hongchao Deng
5e9d51997f fix err check 2021-11-22 18:26:26 +08:00
Hongchao Deng
367ed23eea fix gofmt 2021-11-22 18:22:55 +08:00
Yin Da
4f2bf29a65 Fix: upgrade aliyun provider for terraform controller 2021-11-22 17:58:04 +08:00
qiaozp
eece41c03c fix import (#2770)
Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
2021-11-22 17:49:26 +08:00
Hongchao Deng
8699346401 Merge branch 'apiserver' into merge 2021-11-22 17:27:40 +08:00
Hongchao Deng
e5aba94cd1 Merge branch 'apiserver' into merge 2021-11-22 17:25:50 +08:00
qiaozp
2b8a89d9fa Fix: get addon omit uiSchema (#2768) 2021-11-22 17:13:05 +08:00
qiaozp
58293dcf20 Feat: check addon dependencies when enable (#2741) 2021-11-22 17:12:55 +08:00
Zheng Xi Zhou
5b7b7138e2 Fix: enable addon without arguments (#2766)
If an addon like `fluxcd` doesn't need arguments to be enabled, we
should not parse the arugments
2021-11-22 16:30:11 +08:00
Tianxin Dong
47a565d00d Fix: controllerrevision can not be updated (#2764) 2021-11-22 10:58:23 +08:00
Jianbo Sun
a67bd24967 Feat: support user defined image registry (#2623)
* Feat: support user defined image registry

* Feat: add test app image repo into values
2021-11-22 10:56:36 +08:00
wyike
4ad27e9bcd Fix: (#2761)
1. load component in arrary, so apply them in order addon's needNamespace will be apply firstly
2. apply application  in controle plane will be first workflowStep
3. bigger application reconcile timeout context get avoid of time out
2021-11-21 21:03:41 +08:00
qiaozp
1ea26865aa Fix: lint apiserver code, fix panic (#2755)
* lint code

* fix error judge
try

* fix multicluster enable panic

* add err log

* fix can not get parameter

* debug

* try ci

* debug

* debug

* debug

* debugo

Co-authored-by: barnettZQG <576501057@qq.com>
2021-11-21 18:09:19 +08:00
朱晓兵
51b6e8b459 Fix: fix envbinding related workflow logic,add unit test (#2758)
* Fix: fix envbinding related workflow logic,add unit test

* Fix: bcode field

* Update envbinding.go

Co-authored-by: zhuxiaobing <zhuxiaobing@lixiang.com>
Co-authored-by: barnettZQG <576501057@qq.com>
2021-11-21 17:27:35 +08:00
barnettZQG
4799cbf6cc Feat: workflow support update (#2760)
* Feat: workflow support update

* Fix: fix recycle bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-21 16:43:10 +08:00
yangsoon
99ffe80eb4 Feat: component-pod-view support filter resource by cluster name and cluster namespace (#2754) 2021-11-21 14:56:01 +08:00
Tianxin Dong
32103f53fc Feat: add list application records api (#2757)
* Feat: add list application records api

* remove workflow checker

* Update envbinding.go

Co-authored-by: barnettZQG <576501057@qq.com>
2021-11-21 10:45:03 +08:00
barnettZQG
8181b4d266 Fix: fix the envbinding can not be deleted bug (#2756)
* Fix: fix the envbinding can not be deleted bug

* Fix: fix target must be interface or implement error

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-21 10:15:15 +08:00
barnettZQG
adcb7bd65e Feat: support update component and query app statistics info (#2746)
* Feat: change swagger config

* Feat: support update component and query app statistics info

* Fix: fix workflow list bug

* Fix: fix test bug

* Fix: fix e2e test bug

* Feat: change workflow api

* Fix: fix app deploy e2e test bug

* Fix: change e2e test

* Fix: fix workflow bug

* Fix: fix deploy bug

* Fix: fix selector bug

* Feat: support recycle env

* Fix: debug e2e

* Fix: fix e2e case bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-20 19:50:36 +08:00
Somefive
34aa74ff48 Feat: envbinding support cloud resource deploy and share (#2734)
* Feat: envbinding support cloud resource deploy and bind

* Fix: change bind-cloud-resource to share-cloud-resource
2021-11-20 13:07:27 +08:00
Tianxin Dong
ff405cd62a Feat: add workflow record actions (#2733)
* Feat: add application revision actions

* refactor workflow record and application revision

* generate doc

* fix rebase

* fix rebase

* delete comment

* fix comment

* delete suspend status

* use apply instead of update

* find latest comlete revision if the revision is not specified

* delete name

* fix primary key
2021-11-20 13:05:52 +08:00
qiaozp
54eb662959 Feat: add definitions to addon detail API, fix addon cache, async download files (#2738)
* add definition to addon detail API

* change little

* tmp

* fix cache

* fix import
2021-11-20 12:24:35 +08:00
qiaozp
b38aa1cdf0 Fix: Align -n command argument (#2719)
* add namespace flag

fix

fix test

fix tests

* try test

* try test

* fix tests
2021-11-19 18:00:03 +08:00
wyike
36f5bbc973 Fix: addon spell issue (#2748)
Fix: small issue
2021-11-19 17:57:50 +08:00
Somefive
1a2c964dac Fix: enhance cluster api (#2742) 2021-11-19 15:39:54 +08:00
dependabot[bot]
aa2a0e94bf Chore(deps): Bump github.com/containerd/containerd from 1.4.11 to 1.4.12 (#2744)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.4.11 to 1.4.12.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.4.11...v1.4.12)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-19 11:12:00 +08:00
朱晓兵
ffd25a4cbf Feat: refactor envbinding for adapt policy placement (#2731)
* Feat: refactor envbinding for adapt policy placement

* Fix: refactor envbinding logic

* Fix: fix some bug

* Fix: fix unit test

* Fix: fix unit test

* Fix: fix unit test

* Fix: fix unit test

* Fix: fix unit test ...

* Fix: fix unit test

Co-authored-by: zhuxiaobing <zhuxiaobing@lixiang.com>
2021-11-19 10:37:40 +08:00
Jian.Li
d954bbac00 Fix: applied-resources overflow (#2740)
* fix applied-resources overflow

* add test cases
2021-11-18 20:04:21 +08:00
Hongchao Deng
b6a14e435b Feat: EnableAddon supports runtime cluster (#2739)
* Feat: EnableAddon supports runtime cluster

If use runtime cluster mode, the definitions will be applied to control plane k8s directly, not included in the Application object.

* add owner

* comment
2021-11-18 17:32:14 +08:00
qiaozp
575ecc3136 fix istio (#2691) 2021-11-18 12:50:34 +08:00
qiaozp
bade23cecf Feat: add addon arguments API (#2732)
* temp

* test

* move to status
2021-11-18 12:24:01 +08:00
yangsoon
530f158795 Feat: velaql support query the resources created by helmrelease (#2726)
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-11-18 11:53:38 +08:00
Tianxin Dong
2fc0f1cd2b Feat: add app revision list and detail api (#2722)
* Feat: add app revision list and detail api

* add envName and status filter

* make swagger doc

* revert ui-schema
2021-11-17 15:29:36 +08:00
Somefive
ba4a28fa0d Feat: cherry-pick #2720 into apiserver: support list runtime cluster (#2730)
* Feat: support list runtime cluster (#2720)

* Fix: style
2021-11-17 15:12:06 +08:00
wyike
0555623b3e Feat: add triat alias description time (#2727)
* Feat: add triat alias description time

* Fix: remove modle
2021-11-17 13:06:30 +08:00
Somefive
55070033eb Feat: support list runtime cluster (#2720) 2021-11-17 09:45:03 +08:00
lowkeyrd
b3423116bf add alicloud sls resources (#2701) 2021-11-16 22:50:18 +08:00
yangsoon
0673bc9cd5 Fix: fix workflowstep depends-on-app (#2723)
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-11-16 22:48:26 +08:00
barnettZQG
1465aba177 Fix: fix build bug (#2724)
* Fix: fix build bug

* Fix: change api spec

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-16 21:31:24 +08:00
qiaozp
061c061867 Feat: add redis definition (#2507) 2021-11-16 20:12:22 +08:00
Zheng Xi Zhou
7a0670113f Fix: allow external cloud resources to be kept when Application is deleted (#2698)
* Fix: allow external cloud resources to be kept when Application is deleted

Provide an option for users whether to keep provisioned cloud resources when Terraform-typed Application is deleted.

Fix #2697

* delete file

* upgrade release version of Terraform controller

* fix ci
2021-11-16 19:33:21 +08:00
Tianxin Dong
c42ea7c948 Feat: add record status sync (#2627)
* Feat: add record status sync

* fix typo

* optimize the code

* fix the port

* fix go mod

* fix rebase
2021-11-16 14:47:13 +08:00
barnettZQG
ba1f8e4793 Feat: change the model to support multiple environments (#2721)
* Feat: change swagger config

* Feat: change the model to support multiple environments.

* Feat: support query targets by namespace

* Fix: fix definition unit test case

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-16 14:45:49 +08:00
qiaozp
15795fbe25 Fix: observability installation (#2676)
* fix observability installation

* fix nil pointer

* fix nil pointer

* remove asset, build in trait
2021-11-16 13:56:39 +08:00
wyike
43aa05673e Feat: manage trait (#2702)
* Feat: manage trait

fix test

* fix test
2021-11-15 21:04:03 +08:00
qiaozp
1c7e0c054d Fix: add detail cache, fix uiSchema (#2716)
* add detail cache, fix uischema

* remove
2021-11-15 17:17:07 +08:00
Zheng Xi Zhou
3df47d74f1 Fix: stop installing golangci-lint each time (#2712)
When golangci-lint doesn't locate in $PATH, it will be installed in
$GOBIN every single time.
2021-11-15 15:02:48 +08:00
qiaozp
27490c4bce Refactor: refactor addon for later reusing code in CLI (#2708)
* refactor addon for later reuse code in CLI

* fix import
2021-11-15 12:16:32 +08:00
朱晓兵
4eb9cc114e Feat: add delivery-target API (#2703)
* Feat: add delivery-target API

* Fix: for unit test

Co-authored-by: zhuxiaobing <zhuxiaobing@lixiang.com>
2021-11-15 10:28:41 +08:00
Tianxin Dong
b3014c2f62 Fix: fix backport script (#2699) 2021-11-12 22:34:12 +08:00
Zheng Xi Zhou
b10e4a05a0 Fix: add Alibaba Cloud ASK (#2700)
Added Serverless Kubernetes (ASK) for Alibaba Cloud
2021-11-12 22:33:40 +08:00
barnettZQG
e1c64540f4 Feat: change api spec (#2695)
* Feat: change api spec

* Feat: change DeployEvent to ApplicationRevision

* Fix: fix test bug

* Fix: fix unit test bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-12 17:19:34 +08:00
yangsoon
722ed480e9 Feat: add more views (#2689)
Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2021-11-12 14:34:26 +08:00
barnettZQG
3e68f8a83b Feat: change model name (#2688)
* Feat: change mode name

* Fix: fix e2e test bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-12 11:58:13 +08:00
Jian.Li
0803b45faf Feat: output log with structured tag & add step duration metrics (#2683)
* debug task

* metrics

* trace context

* add step_duration metrics

* add readme docs
2021-11-12 11:48:41 +08:00
wyike
b0577a979a Fix: fix delete a component from application not delete workload (#2680)
lint

Fix: error test

Fix: fix e2e rollout

Fix comment
2021-11-12 11:45:45 +08:00
Zheng Xi Zhou
4e9e88e4a5 Fix: pushing to ACR won't succeed all the way (#2685)
* Fix: pushing to ACR won't succeed all the way

Use action `docker/login-action` instead of `docker/login-action` to
login in ACR

* poc

* manual login

* manual push

* cat

* format

* echo

* dockerfile

* docker build

* v0.9.9

* domain

* poc

* formal

* buildx

* split acr and dockerhub

* finalizer

* fix

* final
2021-11-12 11:45:24 +08:00
Somefive
cee3630ead Feat: upgrade cluster gateway to support remote debug (#2673) 2021-11-12 11:44:18 +08:00
Somefive
6f641caadc Fix: cluster url (#2675) 2021-11-12 11:43:46 +08:00
Zheng Xi Zhou
53d380ff41 Fix: application status.services doesn't include Terraform typed components (#2643)
* Fix: application status.services doesn't include Terraform typed components

Function aggregateHealthStatus() which is used to retrieve components status, was
abandoned. All unit-tests of it was abandoned too. Fixed it and restore all the unit
tests.
2021-11-11 14:07:46 +08:00
yangsoon
8a3b7b6a05 Feat: add query provider and get view template from configmap (#2619) 2021-11-11 13:40:14 +08:00
lowkeyrd
4291e7c7ba Docs: add vpc and vswitch cloud resource templates of alicloud (#2663)
* add vpc and vswitch cloud resources of alicloud

* modified by make reviewable
2021-11-10 16:49:10 +08:00
qiaozp
49ba77c0d3 Feat: add addon registry update API (#2671)
* add addon registry update API

* add detailed cache, fix cache bug

* use PUT

* add Reads

* use UpdateAddonRegistryRequest
2021-11-10 12:41:29 +08:00
Somefive
fd66e6a228 Fix: revision namespace override (#2550) 2021-11-09 23:36:43 +08:00
Somefive
f3899e38ef Feat: multicluster vela status/exec/port-forward (#2662)
* Fix: vela status from app.status.services

* Feat: refine cli and support terraform logs

* Feat: support remote exec

* Feat: port-forward support multicluster

* Fix: vela status+port-forward test

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-11-09 19:08:47 +08:00
Maciej Gwizdała
d945eb35df Feat: Add Terraform Azure Storage Account (#2646)
* Feat: Add Terraform Azure Storage Account

* Fix: Added resource group creation for tests

* Feat: Added EOF for tf azure storage account

Co-authored-by: Maciej Gwizdała <maciej.gwizdala-ext@leica-geosystems.com>
2021-11-09 15:15:28 +08:00
Somefive
7103f8ff52 Feat: merge master into apiserver (#2660)
* Feat(rollout): fill rolloutBatches if empty when scale up/down (#2569)

* Feat: fill rolloutBatches if empty

* Fix: fix unit-test

* Test: add more test

Fix: lint

Fix: fix lint

* Update release.yml (#2537)

* Feat: add registry, merge registry and cap center (#2528)

* Feat: add registry command

* Refactor: comp/trait command combine with registry

* Feat: refactor `vela comp/trait`

* Fix: import

* Fix: fix if type is autodetects.core.oam.dev

* Fix: fix list from url

* Fix: test

* Feat: add test

* Fix: remove dup test

* Fix: test

* Fix: test

* Fix: fix label filter

* Fix: reviewable

* Fix test

* fix personal repo in test

* Fix test

* Fix test

* add some boundary check

* reviewable

* Fix: fix nocalhost trait (#2577)

* fix incorrect addon status (#2576)

* Fix(cli): client-side throttling in vela CLI (#2581)

* fix cli throttling

* fix import

* set to a lower value

* remove addon with no defs (#2574)

* Feat: vela logs support multicluster (#2593)

* Feat: add basic multiple cluster logs

* fix context

* Fix select style

* Fix select style

* remove useless env

* fix naming

* Feat: vela cluster support use ocm to join/list/detach cluster (#2599)

* Feat: add render component and apply component remaining (#2587)

* Feat: add render component and apply component remaining

* fix ut

* fix e2e

* allow import package in custom status cue template (#2585)

Co-authored-by: chwetion <chwetion@foxmail.com>

* Fix: abnormal aux name (#2612)

* Feat: store workflow step def properties in cm (#2592)

* Fix: fix notification def

* Feat: store workflow step def properties in cm

* fix ci

* fix data race

* Fix: change Initializer to Application for addon Observability (#2615)

In this doc, updated the Observability implementation from initializer
to Application. I also store definitions as it's not well stored in
vela-templates/addons/observability

* Fix: fix backport param (#2611)

* Fix: add owner reference in workflow context cm (#2573)

* Fix: add owner reference in workflow context cm

* fix ci

* delete useless test case

* Fix: op.delete bugs (#2622)

* Fix: op.delete some bugs

* Fix: app status update error

Fix: make reviewable

* Fix: show reconcile error log (#2626)

* Feat: add reconcile timeout configuration for vela-core (#2630)

* Fix: patch status retry while conflict happens (#2629)

* Fix: allow definition schema cm can be same name in different definition type (#2618)

* Fix: fix definition schema cm name

* fix ut

* fix ut

* fix show

* add switch default case

* Feat: remove envbinding policy into workflow (#2556)

Fix: add more test

* Feat: add vela prob to test cluster (#2635)

* Fix: upgrade stern lib to avoid panic for vela logs (#2650)

* Fix: filter loggable workload in vela logs (#2651)

* Fix: filter loggable workload in vela logs

* reviewable

* Feat: add vela exec for multi cluster (#2299)

fix

support vela exec

* Fix: health check will check for multiclusters (#2645)

* Fix: minor fix for vela cli printing (#2655)

* Fix: minor fix for vela cli printing

* add dockerfile go mod cache

* Feat: support apiserver-related multicluster features (#2625)

* Feat: remove envbinding policy into workflow

Feat: add support for env change (env gc)

Fix: fix rollout timeout setting bug

* Feat: support disable trait and env without workflow

* Fix: add hint for replaced value

Co-authored-by: wyike <wangyike_wyk@163.com>
Co-authored-by: basefas <basefas@hotmail.com>
Co-authored-by: qiaozp <47812250+chivalryq@users.noreply.github.com>
Co-authored-by: Tianxin Dong <dongtianxin.tx@alibaba-inc.com>
Co-authored-by: yangsoon <yangsoonlx@gmail.com>
Co-authored-by: Chwetion <137953601@qq.com>
Co-authored-by: chwetion <chwetion@foxmail.com>
Co-authored-by: Jian.Li <74582607+leejanee@users.noreply.github.com>
Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com>
Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-11-09 13:06:55 +08:00
Hongchao Deng
3505c379d2 Fix: cache IsExpired() (#2669) 2021-11-09 12:39:36 +08:00
wyike
629cc67c6a Fix: load component can set parameter (#2661)
Fix: fix fmt
2021-11-09 10:51:10 +08:00
Zheng Xi Zhou
84315ff0e6 Fix: push docker images to Alibaba Cloud ACR (#2601)
* Fix: push docker images to Alibaba Cloud ACR

Added Github action to push docker images to Alibaba Cloud ACR

* Fix: change acr domain
2021-11-09 10:46:06 +08:00
barnettZQG
738b416ec2 Fix: fix can not create first app env plan bug (#2665)
* Fix: fix can not create first app env plan bug

* Fix: fix test bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-09 09:47:41 +08:00
qiaozp
39e8bc0b98 add addon parameter openAPI schema (#2666) 2021-11-08 10:13:04 -05:00
Somefive
64ab932c6d Feat: support apiserver-related multicluster features (#2625)
* Feat: remove envbinding policy into workflow

Feat: add support for env change (env gc)

Fix: fix rollout timeout setting bug

* Feat: support disable trait and env without workflow

* Fix: add hint for replaced value
2021-11-08 10:11:50 -05:00
Hongchao Deng
976da6f35a Feat: add local cache of addons to avoid Github limit (#2558)
* Feat: add local cache of addons to avoid Github limit

comment

* comment
2021-11-08 20:04:08 +08:00
qiaozp
b98cec127e add addon template reading (#2648)
render definition into application

new format

fix cue render

fix one bad registry make all addon unusable
2021-11-08 16:34:03 +08:00
barnettZQG
eb258fae66 Feat: support ui schema (#2647)
* Docs: change swagger api config

* Docs: change swagger api config

* Docs: change swagger api config

* Feat: support ui schema

* Fix: distinguish between structs and arrays

* Feat: support build swagger config

* Feat: support update ui schema

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-08 14:13:22 +08:00
Jianbo Sun
fede2235a9 Fix: minor fix for vela cli printing (#2655)
* Fix: minor fix for vela cli printing

* add dockerfile go mod cache
2021-11-07 17:25:52 +08:00
Jianbo Sun
4ca68f2030 Fix: health check will check for multiclusters (#2645) 2021-11-07 11:50:27 +08:00
Jianbo Sun
e5745bb3f3 Feat: add vela exec for multi cluster (#2299)
fix

support vela exec
2021-11-07 08:54:48 +08:00
qiaozp
3e9b702328 Fix: filter loggable workload in vela logs (#2651)
* Fix: filter loggable workload in vela logs

* reviewable
2021-11-06 17:31:50 +08:00
Jianbo Sun
f7dc9934b1 Fix: upgrade stern lib to avoid panic for vela logs (#2650) 2021-11-06 17:23:37 +08:00
Jianbo Sun
c448ba0956 Feat: add vela prob to test cluster (#2635) 2021-11-06 11:28:11 +08:00
Tianxin Dong
5590c3d7b5 Fix: fix apiserver definition schema struct (#2644)
* Fix: fix apiserver definition schema struct

* use open api schema
2021-11-05 21:54:31 +08:00
Hongchao Deng
c821f2a929 Feat: rewrite Addon API to support new format (#2605)
* Feat: rewrite Addon API to support new format

fix test

fix

fix

add registry query parameter

skip enable test

add Definition meta

fix

fix ext

add cue rendering

return component name

update swagger.json

refactor addon cue/yaml tmpl to addonElementFile

apply app in enable

fix cue parse

comment

swagger

enable test

update

fix bug

fix cue render

fix apply fail, decode object

fix disable addon, todo: fix status api

* avoid to render a whole addon when check status

* fix

* fix

* add label

* remove todo

* fluxcd

* fix args

* add all path to addon component name

* reorder test

* add addon application prefix

* add

* add ns when test

* fix

Co-authored-by: qiaozp <chivalry.pp@gmail.com>
2021-11-05 17:39:31 +08:00
Somefive
bf3a1cddf9 Feat: remove envbinding policy into workflow (#2556)
Fix: add more test
2021-11-05 17:29:05 +08:00
Tianxin Dong
50cfe0c68f Fix: allow definition schema cm can be same name in different definition type (#2618)
* Fix: fix definition schema cm name

* fix ut

* fix ut

* fix show

* add switch default case
2021-11-05 16:07:04 +08:00
Somefive
9e73f5dee6 Fix: patch status retry while conflict happens (#2629) 2021-11-05 15:21:28 +08:00
barnettZQG
df5bc2727e Feat: supports setting environment differences for application plan (#2624)
* Feat: supports setting environment differences for application plan

* Feat: update swagger config

* Feat: CRUD of application env binding plan

* Style: change code style

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-05 10:42:18 +08:00
Tianxin Dong
cd686fbb24 Fix: fix definition schema struct (#2632)
* Fix: fix definition schema struct

* add more fields
2021-11-05 10:32:54 +08:00
Somefive
d2672cea48 Feat: add reconcile timeout configuration for vela-core (#2630) 2021-11-04 20:48:06 +08:00
Jianbo Sun
d8007d823d Fix: show reconcile error log (#2626) 2021-11-04 19:01:22 +08:00
wyike
f5b06f855a Fix: op.delete bugs (#2622)
* Fix: op.delete some bugs

* Fix: app status update error

Fix: make reviewable
2021-11-04 16:40:02 +08:00
Somefive
2337c82c3d Feat: add create ack api (#2596) 2021-11-04 16:39:32 +08:00
Tianxin Dong
e8969e4d17 Feat: add definition API (#2602)
* Feat: add definition API

* fix struct

* fix e2e

* optimize the code

* fix return

* fix const
2021-11-04 16:38:34 +08:00
Tianxin Dong
844479c7b5 Fix: add owner reference in workflow context cm (#2573)
* Fix: add owner reference in workflow context cm

* fix ci

* delete useless test case
2021-11-04 14:19:35 +08:00
Tianxin Dong
1438247aaf Fix: fix backport param (#2611) 2021-11-04 12:51:26 +08:00
Zheng Xi Zhou
356c6240bf Fix: change Initializer to Application for addon Observability (#2615)
In this doc, updated the Observability implementation from initializer
to Application. I also store definitions as it's not well stored in
vela-templates/addons/observability
2021-11-03 17:29:48 +08:00
barnettZQG
8e874bc3a9 Feat: change application to applicationplan (#2616)
* Feat: change application to applicationplan

* Feat: update swagger config

* Feat: change api spec

* Fix : fix e2e test case

Co-authored-by: barnettZQG <yiyun.pro>
2021-11-03 17:25:37 +08:00
Tianxin Dong
117b9937f3 Feat: store workflow step def properties in cm (#2592)
* Fix: fix notification def

* Feat: store workflow step def properties in cm

* fix ci

* fix data race
2021-11-03 15:31:12 +08:00
Jian.Li
a5361b2deb Fix: abnormal aux name (#2612) 2021-11-03 15:19:32 +08:00
Chwetion
df3061f4c1 allow import package in custom status cue template (#2585)
Co-authored-by: chwetion <chwetion@foxmail.com>
2021-11-03 12:14:51 +08:00
Tianxin Dong
637ec6273f Feat: add render component and apply component remaining (#2587)
* Feat: add render component and apply component remaining

* fix ut

* fix e2e
2021-11-02 19:22:27 +08:00
yangsoon
7ba10d6864 Feat: vela cluster support use ocm to join/list/detach cluster (#2599) 2021-11-02 17:20:00 +08:00
qiaozp
aa0190c03d Feat: vela logs support multicluster (#2593)
* Feat: add basic multiple cluster logs

* fix context

* Fix select style

* Fix select style

* remove useless env

* fix naming
2021-11-02 14:45:15 +08:00
Hongchao Deng
5f09faeff0 Fix: delete addon registry (#2594)
* Fix: delete addon registry

* add validate Git should not be empty

* fix token could be nil

* GitSource Repo url is a must
2021-11-02 11:30:30 +08:00
Somefive
90e5fd9ed6 Fix: add fixes to cluster api (#2597) 2021-11-02 09:49:52 +08:00
qiaozp
5d9e3437a3 remove addon with no defs (#2574) 2021-11-01 20:58:09 +08:00
barnettZQG
9519d2443a Feat: add alias field and fix some code bug (#2589)
* Feat: add alias field and fix some code bug

* Fix: fix alias check rule bug

* Fix: fix addon e2e test bug

Co-authored-by: barnettZQG <yiyun.pro>
2021-10-31 18:23:55 +08:00
qiaozp
b904f4fc0e Fix(cli): client-side throttling in vela CLI (#2581)
* fix cli throttling

* fix import

* set to a lower value
2021-10-29 15:07:15 +08:00
Tianxin Dong
6666c3a2bb Feat: add workflow record api (#2567)
* Feat: add workflow record api

* resolve comments

* add count function
2021-10-29 10:39:50 +08:00
qiaozp
68af605e75 fix incorrect addon status (#2576) 2021-10-28 20:41:43 +08:00
Tianxin Dong
1dc7647788 Fix: fix nocalhost trait (#2577) 2021-10-28 20:40:41 +08:00
qiaozp
f7e2123707 Feat: add registry, merge registry and cap center (#2528)
* Feat: add registry command

* Refactor: comp/trait command combine with registry

* Feat: refactor `vela comp/trait`

* Fix: import

* Fix: fix if type is autodetects.core.oam.dev

* Fix: fix list from url

* Fix: test

* Feat: add test

* Fix: remove dup test

* Fix: test

* Fix: test

* Fix: fix label filter

* Fix: reviewable

* Fix test

* fix personal repo in test

* Fix test

* Fix test

* add some boundary check

* reviewable
2021-10-28 20:26:08 +08:00
basefas
a8494d1bee Update release.yml (#2537) 2021-10-28 17:54:51 +08:00
wyike
7647ef9662 Feat(rollout): fill rolloutBatches if empty when scale up/down (#2569)
* Feat: fill rolloutBatches if empty

* Fix: fix unit-test

* Test: add more test

Fix: lint

Fix: fix lint
2021-10-28 17:50:28 +08:00
Jianbo Sun
3edb71891b Merge pull request #2572 from Somefive/apiserver_merge_master
Refactor: merge master
2021-10-28 17:30:54 +08:00
Yin Da
0fedad7cd2 Merge branch 'master' into apiserver 2021-10-28 15:19:03 +08:00
yangsoon
edf42074b9 Feat: add velaql webservice (#2532) 2021-10-28 12:05:12 +08:00
Tianxin Dong
828acd95fa Feat: add email support in webhook notification (#2535)
* Feat: add email support in webhook notification

* Fix: change sender and receiver to from and to

* fix the variable name

* fix wait return
2021-10-28 10:59:17 +08:00
Tianxin Dong
7e5dac7c98 Fix: fix backport command (#2557) 2021-10-27 14:18:37 +08:00
Somefive
9563391952 Fix: add local cluster & fix query parameter default value bug (#2561) 2021-10-27 11:37:47 +08:00
Tianxin Dong
b3f60b4b73 Feat: add cluster in read or apply object (#2551) 2021-10-27 10:05:57 +08:00
wyike
f48da214e3 Feat: health scope controller support check trait-managing workload (#2527)
* Feat: health scope controller support trait manage-workload

* Test: add multi-cluster and health policy e2e-test

Fix: e2e-test

lint

Fix: all e2e-test

Fix: modify port back

middle commit

middle pr

Fix: e2e-rollout-test

make reviewable

defet to rollout apply gvk annotation

fix e2e

* Update test/e2e-multicluster-test/multicluster_rollout_test.go

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>

Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
2021-10-26 19:51:53 +08:00
Yu Yicai
4dd18d1fc3 Feat: add nocalhost dev config trait definition (#2545)
* Feat: add nocalhost dev config trait definition

* Feat: add nocalhost dev config trait example

add nocalhost dev config trait example in `docs/examples/nocalhost`

Signed-off-by: yuyicai <yuyicai@hotmail.com>
2021-10-26 19:28:25 +08:00
Hongchao Deng
3ebc94394c Feat: addon service impl (#2515)
* Feat: addon service impl

* get addon from git/configmap

* add ListAddonRegistries

* add GetAddonModel

* add CreateAddonRegistry and bcode/addon.go

* add applyAddonData

* update

* Fix: getAddonFromGit

* Fix: getAddonFromGit, remove trailing .git

* add comment

* add enable/disable/status impl

* add deleteAddonRegistry and check dup addon

* read addon without accessing database

* change to query parameter, add addon detail

* Feat: add addon readme for apiserver

* Make enable/disable/status runnable

* chore: fix bcode

* Fix: refactor parse to util

* Fix: refactor addonutil to pkg

* add addon test for create and delete addon registry

* fix version prefix

* add post func

* add enable/disable test

* add provider aws readme

* done testing

* fix comment and refactor statusAddon

* move enable/disable logic to usecase

* add GITHUB_TOKEN env

* Fix: Add github token support and use it in test

* add license

Co-authored-by: qiaozp <chivalry.pp@gmail.com>
2021-10-26 17:52:34 +08:00
barnettZQG
964a12bb44 Feat: support manage multiple workflows in one application. (#2533)
* Docs: change swagger json

* Feat: support manage multiple workflows in one application.

* Docs: update swagger doc

* Fix: fix code bug

* Update pkg/apiserver/rest/webservice/workflow.go

Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>

Co-authored-by: barnettZQG <yiyun.pro>
Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>
2021-10-26 17:50:30 +08:00
Tianxin Dong
605fb58a3c Fix: pass on octokit error to make the check consistent (#2549) 2021-10-26 12:09:14 +08:00
Zheng Xi Zhou
7482388c84 Fix: CVE-2021-42836 (#2548)
CVE-2021-42836
GJSON before 1.9.3 allows a ReDoS (regular expression denial of service) attack.
2021-10-26 12:01:20 +08:00
Zheng Xi Zhou
e9ac4bb62f Fix: add another output CLUSTER_ID for Alibaba Cloud ack (#2543)
To support sub-path of a git repo which stores HCLs, also update the dependency
of Terraform controller
2021-10-24 10:02:39 +08:00
Zheng Xi Zhou
17dbf6de7e Fix: enable to allocate public connection string (#2530)
Also expose the connection string
2021-10-24 10:00:42 +08:00
yuyicai
b2fb9fc618 Fix: #2534 can't exit make when error occurs in curl (#2540)
- use `curl -sS` to show error
- use `set -eo pipefail` to exit `make` when error occurs in `curl`
2021-10-24 09:59:24 +08:00
Zheng Xi Zhou
cf039e27e5 Fix: format canary rollout manifests (#2542)
Formated canaray rollout manifests and changed orders for some traits
of a component to make it clear to see the difference between first-deploy.yaml
and rollout-v2.yaml, between rollout-v2.yaml and rollback.yaml
2021-10-24 09:58:32 +08:00
Jian.Li
dfbe65c9c0 Feat: Commit step-generate data without success (#2539)
* Feat: commit without success

* Feat: add test case
2021-10-23 11:25:50 +08:00
Somefive
accf0138f8 Feat: apiserver cluster api (#2526)
* Fix: multicluster api

* Feat: add apiserver cluster api & fix codecov

* Feat: add pod capacity and resourceused stat

* Feat: add cloud cluster manage

* Test: add test for cloud cluster

* Test: pending cloud resource api

* Style: refactor

* Fix: apiserver e2e test

* Fix: fix application usecase policy bug

* Style: add returns for cluster api

* Feat: add provider detail info & add cache & add rollback protection

* Style: refactor

* Style: add error code
2021-10-23 00:29:43 +08:00
barnettZQG
f0b91ef8d6 Feat: added environment binding capabilities to the application creation API. (#2523)
* Feat: add env binding support in app create api

* Feat: add query component types api

Co-authored-by: barnettZQG <yiyun.pro>
2021-10-23 00:29:43 +08:00
barnettZQG
b85dda35f3 Feat: add namesapce create and list api (#2514)
Co-authored-by: barnettZQG <yiyun.pro>
2021-10-23 00:29:43 +08:00
yangsoon
c7f9cdcbbf Feat: add the oam application api in apiserver (#2492)
* Feat: oam application api in apiserver

* Feat: enable unit-test and e2e-test
2021-10-23 00:29:42 +08:00
barnettZQG
d2dc9a8da7 Feat: application operation API implementation (#2478)
* Feat: application operation API implementation

* Docs: update swagger json

* Docs: update swagger config

* Feat: improve application management API implementation and testing

* Style: change code style

* Style: change some code style

Co-authored-by: barnettZQG <yiyun.pro>
2021-10-23 00:29:42 +08:00
Tianxin Dong
952af10a4b Fix: check pr title instead of commit msg (#2541) 2021-10-23 00:28:59 +08:00
Zheng Xi Zhou
e56a67acf5 Fix: support terraform/provider-aws addon (#2520)
Also added some componentdefinitions for AWS cloud resource
2021-10-22 00:02:35 +08:00
Tianxin Dong
cc292fe666 Feat: add list and delete kube provider (#2531) 2021-10-21 19:50:09 +08:00
Jian.Li
99f1743d25 Not update resource if render hash equal. (#2522)
* Feat: not apply if render hash not change

* Fix: generateRenderHash panic
2021-10-19 20:34:25 +08:00
qiaozp
f62deca440 Feat: add helm type component definition custom status (#2499) 2021-10-19 17:53:54 +08:00
Tianxin Dong
9d33b74278 Fix(cli): use flag instead of env in workflow cli (#2512) 2021-10-19 17:34:30 +08:00
Tianxin Dong
cf055a8331 Docs: update webhook example with url in secret (#2521) 2021-10-19 17:33:52 +08:00
Jian.Li
9fea82fd7b Feat: Record workflow execution state (#2479)
* Feat: workflow status add timestamp

* Feat: add workflow recorder

* Fix: finish state process

* Fix: test cases

* Fix: revert comments history->recorder

* Feat: omitempty execution time

* Fix: workflow_test.go

* Feat: add application test case for record

* Feat: terminate record

* Feat: trigger only by anno

* Feat: remove initializers CRD
2021-10-19 11:43:06 +08:00
Tianxin Dong
dcb677f976 Feat: support secret in webhook notification (#2509) 2021-10-19 10:42:40 +08:00
Zheng Xi Zhou
d1e814e7af Fix: aws/azure Terraform provider are broken (#2513)
Removed built-in aws/azure Terraform providers, and fix azure
mariadb definition issue.

Fix #2475
2021-10-19 10:15:35 +08:00
Tianxin Dong
d82f8e3cc6 Fix: fix the backport label permission to read (#2504) 2021-10-18 11:46:21 +08:00
Tianxin Dong
d8c9105a3a Test: add conversion test (#2497)
* Test: add conversion test

* Fix: make code reviewable
2021-10-18 11:46:01 +08:00
qiaozp
5b7b74c072 Feat: add imagePullPolicy/imagePullSecret to task def (#2503) 2021-10-18 11:13:52 +08:00
yangsoon
efea09db49 Feat: upgrade the image of kube-webhook-certgen (#2495) 2021-10-15 17:38:29 +08:00
Somefive
8336f5ae9c Fix: rework apiserver code coverage (#2489) 2021-10-15 15:37:19 +08:00
Tianxin Dong
e2ce40a551 Feat: add export config and secret def (#2484)
* Feat: add export config and secret def

* Fix: change the def name and optimize the example

* Fix: fix the name in def
2021-10-15 15:25:41 +08:00
Tianxin Dong
13c24e5697 Fix: fix label trigger from startWith to contains (#2496) 2021-10-15 15:24:32 +08:00
Tianxin Dong
17b840f402 Feat: add label backport in github action (#2494) 2021-10-15 13:24:44 +08:00
qiaozp
49bfeee53d Refactor: remove initializer (#2491) 2021-10-15 11:25:26 +08:00
Tianxin Dong
1801471099 Fix: add libgit2 support for gitops (#2477)
* Fix: add libgit2 support for gitops

* Fix: resolve rebase
2021-10-14 20:56:37 +08:00
Kinso
9d1ffd4c4b Fix(application): nil pointer for component properties (#2481)
Co-authored-by: kinsolee <lijingzhao@forchange.tech>
2021-10-14 19:17:50 +08:00
wyike
89eaf502fa Test: add e2e-test for multi-cluster rollout (#2472)
* Test: add e2e-test guarantee multi-cluster rollout

* Fix: install rollout runtime chart

add cluster name in dockerfile

Fix: build image error

enable all test

Fix: add rollout chart

add shebang

fix image repo
2021-10-14 18:27:50 +08:00
Tianxin Dong
56a8b0c002 Feat: add read object step def (#2480) 2021-10-14 18:23:43 +08:00
qiaozp
8c4af1d69c Refactor: addon migrate to application (#2444)
* Refactor: addon migrate to application

* Refactor: change test for addon

* Fix: golint

* Fix: add annotation const

* Refactor: make CLI compatible

* Fix: go-lint
2021-10-14 18:21:49 +08:00
Jianbo Sun
7ef800573a Fix: make nginx class to be default value and allow pvc trait to attach more than once (#2466)
* Fix: make nginx class to be default value

* Fix: allow pvc trait to attach more than once
2021-10-13 17:18:02 +08:00
wyike
4956d0e4e1 Fix: compatibility bug (#2467)
make reivwable
2021-10-13 16:58:41 +08:00
Tianxin Dong
85c887d3e4 Fix: change raw extension to pointer (#2451)
* Fix: change raw extension to pointer

* Test: fix ut
2021-10-13 16:16:53 +08:00
Zheng Xi Zhou
a4a1c39bbb Fix: refine Terraform Azure mariadb ComponentDefinition (#2465)
Added outputs for Azure mariadb and refine the variables
2021-10-13 15:43:52 +08:00
Jianbo Sun
f9ffb9e240 Chore: add example for env patch and fix e2e flaky (#2462) 2021-10-13 15:39:50 +08:00
barnettZQG
c3eaa74ee7 Feat: add BatchAdd function and entity index support (#2454)
Co-authored-by: barnettZQG <yiyun.pro>
2021-10-13 10:01:06 +08:00
Shaw Ho
75ba05f738 Fix: wrong log print format (#2430) 2021-10-12 19:27:11 +08:00
Jian.Li
8935a87c59 Fix: Closure Bug In newValue (#2437)
* Fix: new value bug

* Fix: strategyUnify Bug

* Fix: e2e error
2021-10-12 19:05:03 +08:00
Tianxin Dong
287c895daf Fix: fix unhandled err (#2423)
* Fix: fix unhandled err

refer to https://lift.sonatype.com/result/bhamail/kubevela/01FFT7CSVNCPF6808ZM856V3HN?tab=results

* Test: fix panic err
2021-10-12 14:36:09 +08:00
basefas
96c52ab2fc Chore: add homebrew bump (#2434)
* Chore:  add homebrew bump

* Chore: update token
2021-10-12 12:52:40 +08:00
barnettZQG
0d036e7449 Feat: initialize the Apiserver framework (#2417)
* Feat: add kubeapi and mongodb datastore implementation

* Style: change kubeapi import code style

* Style: change mongodb package import code style

* Style: add some comment

* Style: change databasePrefix to tableNamePrefix

* Chore: install mongodb in unit-test job

* Chore: install mongodb in compatibility-test job

* Feat: add apiserver e2e test case

* Docs: change developer guide doc

* Feat: use common.Scheme

Co-authored-by: barnettZQG <yiyun.pro>
2021-10-12 11:53:24 +08:00
Somefive
2e20f4862f Fix: update ingress class (#2445) 2021-10-11 20:48:39 +08:00
Zheng Xi Zhou
5865a69576 Fix: add Chart icon and url (#2441)
* Fix: add Chart icon and url

Added an icon and url for KubeVela chart

* Fix: remove local logo file and use a web image
2021-10-11 20:27:56 +08:00
wyike
9c76b2f3ac Fix: race condition of cloneset and statefulSet rollout plugin (#2394)
* Fix: clonset and stateful set

* Fix: e2e-test race condition
2021-10-11 15:47:20 +08:00
Somefive
472ed3a146 Feat: add support for envbinding with namespace selector (#2432)
* Feat: add support for envbinding with namespace selector

* Fix: service account kubeconfig e2e-test

* Docs: add comments to explain functions

* Docs: add envbinding example
2021-10-11 14:52:01 +08:00
Tianxin Dong
f06980c5f4 Fix: fix depends on app built-in step (#2429) 2021-10-09 18:48:53 +08:00
barnettZQG
f70133e5e6 Fix: fix apiserver 1.1.3 not available bug (#2425)
* Fix: fix apiserver 1.1.3 not available bug

* Feat: change apiserver image repository

* Fix(helm chart): fix startup args for apiserver

Co-authored-by: barnettZQG <yiyun.pro>
2021-10-09 16:50:02 +08:00
Somefive
bcd7f3e340 Feat: add secure tls for cluster-gateway (#2426) 2021-10-09 15:23:25 +08:00
Tianxin Dong
c049f497fb Feat: add apply raw built in workflow steps (#2420)
* Feat: add apply raw built in workflow steps

* Feat: add apply raw example

* Fix: change the name to apply object

* Fix: example server name
2021-10-09 12:20:32 +08:00
Jianbo Sun
8b98caaa40 Chore(deps): bump github.com/containerd/containerd from 1.4.8 to 1.4.11 (#2419) 2021-10-09 11:10:50 +08:00
Somefive
46e22cc203 Feat: multicluster support ServiceAccountToken (#2356)
* Feat: support serviceaccount in multicluster

* Fix: add compatibility & support sa

* Fix: add multicluster sa test

* Fix: add test for upgrade func

* Style: format
2021-10-08 14:45:04 +08:00
Jianbo Sun
426fe5cc11 Chore: add chaneglog and add backport github action and change the pull request template (#2410) 2021-10-08 13:35:04 +08:00
Somefive
a3f48425be Feat: use #ApplyComponent for EnvBinding (#2382)
* Feat: use #ApplyComponent in EnvBinding

* Fix: application test compRev control by resourcetracker

* Fix: add more detail in error info
2021-10-08 13:11:14 +08:00
qiaozp
a574fc0fbf Refactor(cli): Refactor vela env, deprecate vela config (#2037)
* Refactor(cli): cut env to namespace, use application to save

Signed-off-by: qiaozp <chivalry.pp@gmail.com>

* Fix: test

* Fix: typo
2021-10-08 13:10:47 +08:00
Lei Zhang (Harry)
0396d8d8bf Docs: add CD system README (#2411) 2021-10-08 13:10:22 +08:00
Zheng Xi Zhou
b8894b7a44 Fix: support terraform/provider-azure addon (#2402)
Also added some componentdefinitions for Azure cloud resource
2021-10-08 11:35:52 +08:00
Lei Zhang (Harry)
5767d16169 Docs: use graph to explain vela in README (#2404) 2021-10-02 15:06:58 +08:00
GingoBang
83eec87da6 Refactor: change rollout's json tag (#2314)
* Refactor: set rollout as a pointer reference

see issue #2289 for more details

Closes #2289

* Refactor: set rollout as a pointer reference
see issue #2289 for more details

Closes #2289
2021-10-02 10:19:41 +08:00
Somefive
5704c3b83c Fix: fix multicluster coverage bug (#2401) 2021-10-01 08:25:56 +08:00
Reeta Singh
6647a11c86 Chore: deprecate containerized workload (#2330)
* Feat(trait): annotation and labels trait should also affect the workload object along with pod

* Feat(trait): annotation and labels trait should also affect the workload object along with pod

* Feat(trait): annotation and labels trait should also affect the workload object along with pod

* Feat(trait): annotation and labels trait should also affect the workload object along with pod

* Chore: deprecate containerized workload

* Chore: deprecate containerized workload

* Chore: run make reviewable as per review comment

* Chore: fix import

* Chore: merge with master

* Chore: merge with master

* Chore: remove references for containerized workload

* Chore: fix failiing e2e test

* Chore: fix failing e2e test

* Chore: fix failing e2e test

* Chore: fix failing e2e test

* Chore: fix e2e tests

* Chore: fix e2e tests

* Chore: fix e2e tests

* Chore: fix e2e tests

* Chore: fix e2e tests

* Chore: merge with upstream

Co-authored-by: Reeta Singh <reetas@twitter.com>
2021-09-30 16:06:29 +08:00
2159 changed files with 225826 additions and 92275 deletions

43
.github/CODEOWNERS vendored
View File

@@ -1,36 +1,37 @@
# This file is a github code protect rule follow the codeowners https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners#example-of-a-codeowners-file
* @hongchaodeng @wonderflow @leejanee
design/ @hongchaodeng @resouer @wonderflow
* @barnettZQG @wonderflow @leejanee @Somefive @jefree-cat @FogDong
design/ @barnettZQG @leejanee @wonderflow @Somefive @jefree-cat @FogDong
# Owner of Core Controllers
pkg/controller/core.oam.dev @Somefive @FogDong @barnettZQG @wonderflow
# Owner of Standard Controllers
pkg/controller/standard.oam.dev @wangyikewxgm @barnettZQG @wonderflow
# Owner of CUE
pkg/cue @leejanee @FogDong
pkg/stdlib @leejanee @FogDong
pkg/cue @leejanee @FogDong @Somefive
pkg/stdlib @leejanee @FogDong @Somefive
# Owner of Workflow
pkg/workflow @leejanee @FogDong
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
pkg/controller/core.oam.dev/v1alpha2/core/policies/policydefinition @yangsoon @Somefive
pkg/controller/core.oam.dev/v1alpha2/core/components/componentdefinition @yangsoon @zzxwill
pkg/controller/core.oam.dev/v1alpha2/core/traits/traitdefinition @yangsoon @zzxwill
# Owner of health scope controller
pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope @captainroy-hy @zzxwill
pkg/controller/common/rollout/ @wangyikewxgm @wonderflow
runtime/rollout @wangyikewxgm @wonderflow
# Owner of vela templates
vela-templates/ @Somefive @barnettZQG @wonderflow
vela-templates/ @Somefive @barnettZQG @wonderflow @FogDong
# Owner of vela CLI
references/cli/ @Somefive @zzxwill
references/cli/ @Somefive @zzxwill @StevenLeiZhang @charlie0129 @chivalryq
# Owner of vela APIServer
pkg/apiserver/ @barnettZQG @yangsoon
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

@@ -1,36 +1,37 @@
<!--
Thank you for sending a pull request! Here are some tips:
1. If this is your first time, please read our contribution guide at https://github.com/oam-dev/kubevela/blob/master/CONTRIBUTING.md
2. Ensure you include and run the appropriate tests as part of your Pull Request.
3. In a new feature or configuration option, an update to the documentation is necessary. Everything related to the documentation is under the docs folder in the root of the repository.
4. If the Pull Request is a work in progress, make use of GitHub's "Draft PR" feature and mark it as such.
5. If you can not merge your Pull Request due to a merge conflict, Rebase it. This gets it in sync with the master branch.
6. Name your PR as "<FeatureArea>: Describe your change", e.g. Application: Add health check for application.
If it's a fix or feature relevant for the changelog describe the user impact in the title.
The PR title is used to auto-generate the changelog for issues marked with the "add to changelog" label.
-->
**What this PR does / why we need it**:
**Which issue(s) this PR fixes**:
### Description of your changes
<!--
- Automatically closes linked issue when the Pull Request is merged.
Usage: "Fixes #<issue number>", or "Fixes (paste link of issue)"
Briefly describe what this pull request does. We love pull requests that resolve an open KubeVela issue. If yours does, you
can uncomment the below line to indicate which issue your PR fixes, for example
"Fixes #500":
-->
Fixes #
**Special notes for your reviewer**:
I have:
- [ ] Read and followed KubeVela's [contribution process](https://github.com/kubevela/kubevela/blob/master/contribute/create-pull-request.md).
- [ ] [Related Docs](https://github.com/kubevela/kubevela.io) updated properly. In a new feature or configuration option, an update to the documentation is necessary.
- [ ] Run `make reviewable` to ensure this PR is ready for review.
- [ ] Added `backport release-x.y` labels to auto-backport this PR if necessary.
### How has this code been tested
<!--
Before reviewers can be confident in the correctness of this pull request, it
needs to tested and shown to be correct. Briefly describe the testing that has
already been done or which is planned for this change.
-->
### Special notes for your reviewer
<!--
Be sure to direct your reviewers'
attention to anything that needs special consideration.
-->

8
.github/bot.md vendored
View File

@@ -1,9 +1,9 @@
### GitHub & kubevela automation
The bot is configured via [issue-commands.json](https://github.com/oam-dev/kubevela/blob/master/.github/workflows/issue-commands.json)
and some other GitHub [workflows](https://github.com/oam-dev/kubevela/blob/master/.github/workflows).
The bot is configured via [issue-commands.json](https://github.com/kubevela/kubevela/blob/master/.github/issue-commands.json)
and some other GitHub [workflows](https://github.com/kubevela/kubevela/blob/master/.github/workflows).
By default, users with write access to the repo is allowed to use the comments,
the [userlist](https://github.com/oam-dev/kubevela/blob/master/.github/comment.userlist)
the [userlist](https://github.com/kubevela/kubevela/blob/master/.github/comment.userlist)
file is for adding additional members who do not have access and want to contribute to the issue triage.
Comment commands:
@@ -14,7 +14,7 @@ Comment commands:
* Write the word `/area/*` in a comment, and the bot will add the corresponding label `/area/*`.
* Write the word `/priority/*` in a comment, and the bot will add the corresponding label `/priority/*`.
The `*` mention above represent a specific word. Please read the details about label category in [ISSUE_TRIAGE.md](https://github.com/oam-dev/kubevela/blob/master/ISSUE_TRIAGE.md)
The `*` mention above represent a specific word. Please read the details about label category in [ISSUE_TRIAGE.md](https://github.com/kubevela/kubevela/blob/master/ISSUE_TRIAGE.md)
Label commands:

10
.github/pr-title-checker-config.json vendored Normal file
View File

@@ -0,0 +1,10 @@
{
"LABEL": {
"name": "title-needs-formatting",
"color": "EEEEEE"
},
"CHECKS": {
"prefixes": ["Fix: ", "Feat: ", "Docs: ", "Test: ", "Chore: ", "CI: ", "Perf: ", "Refactor: ", "Revert: ", "Style: ", "Test: ",
"Fix(", "Feat(", "Docs(", "Test(", "Chore(", "CI(", "Perf(", "Refactor(", "Revert(", "Style(", "Test(", "[Backport"]
}
}

198
.github/workflows/apiserver-test.yml vendored Normal file
View File

@@ -0,0 +1,198 @@
name: VelaUX APIServer Test
on:
push:
branches:
- master
- release-*
- apiserver
tags:
- v*
workflow_dispatch: { }
pull_request:
branches:
- master
- release-*
- apiserver
env:
# Common versions
GO_VERSION: '1.19'
permissions:
contents: read
jobs:
detect-noop:
runs-on: ubuntu-20.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
continue-on-error: true
apiserver-unit-tests:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
submodules: true
- name: Cache Go Dependencies
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Install ginkgo
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y golang-ginkgo-dev
- name: Start MongoDB
uses: supercharge/mongodb-github-action@538a4d2a1041920c47630172445cb688592d6e51 # 1.8.0
with:
mongodb-version: '5.0'
# TODO need update action version to resolve node 12 deprecated.
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@ff52bff1bae252239223476e5ab0d71d6ba02343
with:
version: 3.1.0
kubebuilderOnly: false
kubernetesVersion: v1.21.2
- name: Run api server unit test
run: make unit-test-apiserver
- name: Upload coverage report
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: apiserver-unittests
name: codecov-umbrella
apiserver-e2e-tests:
runs-on: aliyun
needs: [ detect-noop ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ["v1.20","v1.24"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
- name: Set up Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
submodules: true
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Tear down K3d if exist
run: |
k3d cluster delete || true
k3d cluster delete worker || true
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Setup K3d (Hub)
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
- name: Setup K3d (Worker)
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-name: worker
k3d-args: --kubeconfig-update-default=false --network=k3d-k3s-default ${{ env.EGRESS_ARG }}
- name: Kind Cluster (Worker)
run: |
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: Load image to k3d cluster
run: make image-load
- name: Cleanup for e2e tests
run: |
make vela-cli
make e2e-cleanup
make e2e-setup-core
bin/vela addon enable fluxcd
bin/vela addon enable vela-workflow --override-definitions
timeout 600s bash -c -- 'while true; do kubectl get ns flux-system; if [ $? -eq 0 ] ; then break; else sleep 5; fi;done'
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-core,app.kubernetes.io/instance=kubevela -n vela-system --timeout=600s
kubectl wait --for=condition=Ready pod -l app=source-controller -n flux-system --timeout=600s
kubectl wait --for=condition=Ready pod -l app=helm-controller -n flux-system --timeout=600s
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-workflow -n vela-system --timeout=600s
- name: Run api server e2e test
run: |
export ALIYUN_ACCESS_KEY_ID=${{ secrets.ALIYUN_ACCESS_KEY_ID }}
export ALIYUN_ACCESS_KEY_SECRET=${{ secrets.ALIYUN_ACCESS_KEY_SECRET }}
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
make e2e-apiserver-test
- name: Stop kubevela, get profile
run: make end-e2e-core
- name: Upload coverage report
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/e2e-profile.out, /tmp/e2e_apiserver_test.out
flags: apiserver-e2etests
name: codecov-umbrella
- name: Clean e2e profile
run: rm /tmp/e2e-profile.out
- name: Cleanup image
if: ${{ always() }}
run: make image-cleanup

28
.github/workflows/back-port.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: Backport
on:
pull_request_target:
types:
- closed
permissions:
contents: read
jobs:
# align with crossplane's choice https://github.com/crossplane/crossplane/blob/master/.github/workflows/backport.yml
open-pr:
runs-on: ubuntu-20.04
if: github.event.pull_request.merged
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
fetch-depth: 0
- name: Open Backport PR
uses: zeebe-io/backport-action@2ee900dc92632adf994f8e437b6d16840fd61f58
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}

103
.github/workflows/chart.yml vendored Normal file
View File

@@ -0,0 +1,103 @@
name: Publish Chart
on:
push:
tags:
- "v*"
workflow_dispatch: { }
permissions:
contents: read
env:
BUCKET: ${{ secrets.OSS_BUCKET }}
ENDPOINT: ${{ secrets.OSS_ENDPOINT }}
ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
ARTIFACT_HUB_REPOSITORY_ID: ${{ secrets.ARTIFACT_HUB_REPOSITORY_ID }}
jobs:
publish-charts:
env:
HELM_CHARTS_DIR: charts
HELM_CHART: charts/vela-core
MINIMAL_HELM_CHART: charts/vela-minimal
LEGACY_HELM_CHART: legacy/charts/vela-core-legacy
VELA_ROLLOUT_HELM_CHART: runtime/rollout/charts
LOCAL_OSS_DIRECTORY: .oss
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@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Get git revision
id: vars
shell: bash
run: |
echo "git_revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Install Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78
with:
version: v3.4.0
- name: Setup node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '14'
- name: Generate helm doc
run: |
make helm-doc-gen
- name: Prepare legacy chart
run: |
rsync -r $LEGACY_HELM_CHART $HELM_CHARTS_DIR
rsync -r $HELM_CHART/* $LEGACY_HELM_CHART --exclude=Chart.yaml --exclude=crds
- name: Prepare vela chart
run: |
rsync -r $VELA_ROLLOUT_HELM_CHART $HELM_CHARTS_DIR
- name: Get the version
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
- name: Tag helm chart image
run: |
image_tag=${{ steps.get_version.outputs.VERSION }}
chart_version=${{ steps.get_version.outputs.VERSION }}
sed -i "s/latest/${image_tag}/g" $HELM_CHART/values.yaml
sed -i "s/latest/${image_tag}/g" $MINIMAL_HELM_CHART/values.yaml
sed -i "s/latest/${image_tag}/g" $LEGACY_HELM_CHART/values.yaml
sed -i "s/latest/${image_tag}/g" $VELA_ROLLOUT_HELM_CHART/values.yaml
chart_smever=${chart_version#"v"}
sed -i "s/0.1.0/$chart_smever/g" $HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $MINIMAL_HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $LEGACY_HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $VELA_ROLLOUT_HELM_CHART/Chart.yaml
- name: Install ossutil
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
- name: Configure Alibaba Cloud OSSUTIL
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT} -c .ossutilconfig
- name: sync cloud to local
run: ./ossutil --config-file .ossutilconfig sync oss://$BUCKET/core $LOCAL_OSS_DIRECTORY
- name: add artifacthub stuff to the repo
run: |
rsync $HELM_CHART/README.md $LEGACY_HELM_CHART/README.md
rsync $HELM_CHART/README.md $VELA_ROLLOUT_HELM_CHART/README.md
sed -i "s/ARTIFACT_HUB_REPOSITORY_ID/$ARTIFACT_HUB_REPOSITORY_ID/g" hack/artifacthub/artifacthub-repo.yml
rsync hack/artifacthub/artifacthub-repo.yml $LOCAL_OSS_DIRECTORY
- name: Package helm charts
run: |
helm package $HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $MINIMAL_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $LEGACY_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $VELA_ROLLOUT_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm repo index --url https://$BUCKET.$ENDPOINT/core $LOCAL_OSS_DIRECTORY
- name: sync local to cloud
run: |
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

@@ -4,27 +4,34 @@ on:
push:
branches: [ master, release-* ]
permissions:
contents: read
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read # for github/codeql-action/init to get workflow details
security-events: write # for github/codeql-action/autobuild to send a status report
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Initialize CodeQL
uses: github/codeql-action/init@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Autobuild
uses: github/codeql-action/autobuild@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37

View File

@@ -1,13 +1,22 @@
name: Lint Commit Messages
on: [push, pull_request]
name: PR Title Checker
on:
pull_request:
types:
- opened
- edited
- synchronize
- labeled
- unlabeled
permissions:
pull-requests: read
jobs:
commitlint:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: thehanimo/pr-title-checker@v1.3.5
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
with:
helpURL: https://github.com/oam-dev/kubevela/blob/master/contribute/create-pull-request.md#commit-message-format
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pass_on_octokit_error: true
configuration_path: ".github/pr-title-checker-config.json"

40
.github/workflows/core-api-test.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: core-api-test
on:
pull_request:
paths:
- 'apis/**'
- 'pkg/oam/**'
- "hack/apis/**"
branches:
- master
- release-*
permissions:
contents: read
jobs:
core-api-test:
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.19
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
env:
GO_VERSION: '1.19'
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Test build kubevela-core-api
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
COMMIT_ID: ${{ github.sha }}
run: |
bash ./hack/apis/clientgen.sh
bash ./hack/apis/sync.sh test

47
.github/workflows/definition-lint.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
name: Definition-Lint
on:
push:
branches:
- master
- release-*
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
permissions:
contents: read
env:
# Common versions
GO_VERSION: '1.19'
jobs:
definition-doc:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
submodules: true
- name: Setup K3d
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
with:
version: v1.20
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Definition Doc generate check
run: |
go build -o docgen hack/docgen/def/gen.go
./docgen --type=comp --force-example-doc --path=./comp-def-check.md
./docgen --type=trait --force-example-doc --path=./trait-def-check.md
./docgen --type=wf --force-example-doc --path=./wf-def-check.md
./docgen --type=policy --force-example-doc --path=./policy-def-check.md

View File

@@ -5,45 +5,57 @@ on:
branches:
- master
- release-*
tags:
- v*
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
permissions:
contents: read
env:
# Common versions
GO_VERSION: '1.16'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
GO_VERSION: '1.19'
jobs:
detect-noop:
permissions:
actions: write
runs-on: ubuntu-20.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v3.3.0
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
continue-on-error: true
e2e-multi-cluster-tests:
runs-on: aliyun
needs: detect-noop
needs: [ detect-noop ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ["v1.20","v1.24"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: ${{ env.GO_VERSION }}
@@ -51,44 +63,61 @@ jobs:
run: |
go get -v -t -d ./...
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
- name: Tear down K3d if exist
run: |
k3d cluster delete || true
k3d cluster delete worker || true
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Setup K3d (Hub)
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
with:
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
- name: Setup Kind Cluster (Worker)
- name: Setup K3d (Worker)
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-name: worker
k3d-args: --kubeconfig-update-default=false --network=k3d-k3s-default ${{ env.EGRESS_ARG }}
- name: Generating internal worker kubeconfig
run: |
kind delete cluster --name worker
kind create cluster --image kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4 --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:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4
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 vela-cli
make e2e-cleanup
make e2e-setup-core
make e2e-setup-core-auth
make setup-runtime-e2e-cluster
- name: Run e2e multicluster tests
run: make e2e-multicluster-test
run: |
export PATH=$(pwd)/bin:$PATH
make e2e-multicluster-test
- name: Stop kubevela, get profile
run: make end-e2e-core
- name: Upload coverage report
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/e2e-profile.out,/tmp/e2e_multicluster_test.out

View File

@@ -5,45 +5,57 @@ on:
branches:
- master
- release-*
tags:
- v*
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
permissions:
contents: read
env:
# Common versions
GO_VERSION: '1.16'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
GO_VERSION: '1.19'
jobs:
detect-noop:
permissions:
actions: write
runs-on: ubuntu-20.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v3.3.0
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
continue-on-error: true
e2e-rollout-tests:
runs-on: aliyun
needs: detect-noop
needs: [ detect-noop ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ["v1.20","v1.24"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: ${{ env.GO_VERSION }}
@@ -51,33 +63,35 @@ jobs:
run: |
go get -v -t -d ./...
- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ env.KIND_VERSION }}
skipClusterCreation: true
- name: Setup Kind Cluster
- name: Tear down K3d if exist
run: |
kind delete cluster
kind create cluster --image kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4
kubectl version
kubectl cluster-info
k3d cluster delete || true
k3d cluster delete worker || true
- name: Load Image to kind cluster
run: make kind-load
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Run Make
run: make
- name: Setup K3d
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
- name: Run Make Manager
run: make manager
- name: Load image to k3d cluster
run: make image-load image-load-runtime-cluster
- name: Prepare for e2e tests
run: |
make vela-cli
make e2e-cleanup
make e2e-setup
helm lint ./charts/vela-core
make e2e-setup-core
make setup-runtime-e2e-cluster
helm test -n vela-system kubevela --timeout 5m
- name: Run e2e tests
@@ -87,15 +101,15 @@ jobs:
run: make end-e2e
- name: Upload coverage report
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/e2e-profile.out,/tmp/oam-e2e-profile.out
files: /tmp/e2e-profile.out
flags: e2e-rollout-tests
name: codecov-umbrella
- name: Clean e2e profile
run: rm /tmp/e2e-profile.out /tmp/oam-e2e-profile.out
run: rm /tmp/e2e-profile.out
- name: Cleanup image
if: ${{ always() }}

View File

@@ -5,45 +5,57 @@ on:
branches:
- master
- release-*
tags:
- v*
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
permissions:
contents: read
env:
# Common versions
GO_VERSION: '1.16'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
GO_VERSION: '1.19'
jobs:
detect-noop:
permissions:
actions: write
runs-on: ubuntu-20.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v3.3.0
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
continue-on-error: true
e2e-tests:
runs-on: aliyun
needs: detect-noop
needs: [ detect-noop ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ["v1.20","v1.24"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: ${{ env.GO_VERSION }}
@@ -51,38 +63,44 @@ 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:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4
kubectl version
kubectl cluster-info
k3d cluster delete || true
k3d cluster delete worker || true
- name: Load Image to kind cluster
run: make kind-load
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Setup K3d
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
- name: Load image to k3d cluster
run: make image-load
- name: Run Make
run: make
- name: Run Make Manager
run: make manager
- name: Prepare for e2e tests
run: |
make e2e-cleanup
make e2e-setup
helm lint ./charts/vela-core
make e2e-setup-core
helm test -n vela-system kubevela --timeout 5m
- name: Run api e2e tests
run: make e2e-api-test
- name: Run addons e2e tests
run: make e2e-addon-test
- name: Run e2e tests
run: make e2e-test
@@ -90,15 +108,15 @@ jobs:
run: make end-e2e
- name: Upload coverage report
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/e2e-profile.out,/tmp/oam-e2e-profile.out
files: /tmp/e2e-profile.out
flags: e2etests
name: codecov-umbrella
- name: Clean e2e profile
run: rm /tmp/e2e-profile.out /tmp/oam-e2e-profile.out
run: rm /tmp/e2e-profile.out
- name: Cleanup image
if: ${{ always() }}

View File

@@ -11,11 +11,13 @@ on:
- master
- release-*
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
env:
# Common versions
GO_VERSION: '1.16'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
jobs:
@@ -23,61 +25,17 @@ jobs:
runs-on: ubuntu-20.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
permissions:
actions: write
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v3.3.0
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
compatibility-test:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
submodules: true
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Install ginkgo
run: |
sudo apt-get install -y golang-ginkgo-dev
- name: Setup Kind Cluster
uses: engineerd/setup-kind@v0.5.0
with:
version: ${{ env.KIND_VERSION }}
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@v1.2
with:
version: 3.1.0
kubebuilderOnly: false
kubernetesVersion: v1.21.2
- name: Run Make compatibility-test
run: make compatibility-test
- name: Clean up testdata
run: make compatibility-testdata-cleanup
continue-on-error: true
staticcheck:
runs-on: ubuntu-20.04
@@ -86,27 +44,17 @@ jobs:
steps:
- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
submodules: true
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Install StaticCheck
run: GO111MODULE=off go get honnef.co/go/tools/cmd/staticcheck
- name: Static Check
run: staticcheck ./...
run: make staticcheck
- name: License Header Check
run: make check-license-header
@@ -115,26 +63,27 @@ jobs:
runs-on: ubuntu-20.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
steps:
- name: Setup Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
submodules: true
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
# This action uses its own setup-go, which always seems to use the latest
# stable version of Go. We could run 'make lint' to ensure our desired Go
# version, but we prefer this action because it leaves 'annotations' (i.e.
# it comments on PRs to point out linter violations).
- name: Lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@07db5389c99593f11ad7b44463c2d4233066a9b1 # v3.3.0
with:
version: ${{ env.GOLANGCI_VERSION }}
@@ -145,30 +94,125 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '14'
- name: Cache Go Dependencies
uses: actions/cache@v2
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Check code formatting
run: go install golang.org/x/tools/cmd/goimports && make fmt
- name: Run cross-build
run: make cross-build
- name: Check Diff
run: make check-diff
run: |
export PATH=$(pwd)/bin/:$PATH
make check-diff
- name: Cleanup binary
run: make build-cleanup
check-windows:
runs-on: windows-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: ${{ env.GO_VERSION }}
- name: Cache Go Dependencies
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Run Build CLI
run: make vela-cli
- name: Run CLI for version
shell: cmd
run: |
move .\bin\vela .\bin\vela.exe
.\bin\vela.exe version
check-core-image-build:
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
- name: Build Test for vela core
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
check-apiserver-image-build:
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
- name: Build Test for apiserver
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
with:
context: .
file: Dockerfile.apiserver
platforms: linux/amd64,linux/arm64
check-cli-image-build:
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
- name: Build Test for CLI
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
with:
context: .
file: Dockerfile.cli

View File

@@ -5,20 +5,77 @@ on:
issue_comment:
types: [created]
permissions:
contents: read
jobs:
main:
runs-on: ubuntu-latest
bot:
runs-on: ubuntu-20.04
steps:
- name: Checkout Actions
uses: actions/checkout@v2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
repository: "oam-dev/kubevela-github-actions"
path: ./actions
ref: v0.4.1
- name: Install Actions
run: npm install --production --prefix ./actions
ref: v0.4.2
- name: Setup Node.js
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '14'
cache: 'npm'
cache-dependency-path: ./actions/package-lock.json
- name: Install Dependencies
run: npm ci --production --prefix ./actions
- name: Run Commands
uses: ./actions/commands
with:
token: ${{secrets.VELA_BOT_TOKEN}}
configPath: issue-commands
backport:
runs-on: ubuntu-22.04
if: github.event.issue.pull_request && contains(github.event.comment.body, '/backport')
permissions:
issues: write
pull-requests: write
steps:
- name: Extract Command
id: command
uses: xt0rted/slash-command-action@bf51f8f5f4ea3d58abc7eca58f77104182b23e88
with:
repo-token: ${{ secrets.VELA_BOT_TOKEN }}
command: backport
reaction: "true"
reaction-type: "eyes"
allow-edits: "false"
permission-level: read
- name: Handle Command
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0
env:
VERSION: ${{ steps.command.outputs.command-arguments }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const version = process.env.VERSION
let label = "backport release-" + version
if (version.includes("release")) {
label = "backport " + version
}
// Add our backport label.
github.issues.addLabels({
// Every pull request is an issue, but not every issue is a pull request.
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [label]
})
console.log("Added '" + label + "' label.")
- name: Checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
fetch-depth: 0
- name: Open Backport PR
uses: zeebe-io/backport-action@2ee900dc92632adf994f8e437b6d16840fd61f58
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}

View File

@@ -9,13 +9,16 @@ on:
branches:
- master
- release-*
-
permissions:
contents: read
jobs:
license_check:
runs-on: ubuntu-latest
name: Check for unapproved licenses
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:

View File

@@ -8,17 +8,19 @@ on:
workflow_dispatch: {}
env:
BUCKET: ${{ secrets.OSS_BUCKET }}
ENDPOINT: ${{ secrets.OSS_ENDPOINT }}
ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
ARTIFACT_HUB_REPOSITORY_ID: ${{ secrets.ARTIFACT_HUB_REPOSITORY_ID }}
permissions:
contents: read
jobs:
publish-images:
publish-core-images:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Get the version
id: get_version
run: |
@@ -26,30 +28,37 @@ jobs:
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
VERSION=latest
fi
echo ::set-output name=VERSION::${VERSION}
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
- name: Get git revision
id: vars
shell: bash
run: |
echo "::set-output name=git_revision::$(git rev-parse --short HEAD)"
echo "git_revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Login ghcr.io
uses: docker/login-action@v1
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login docker.io
uses: docker/login-action@v1
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- name: Login Alibaba Cloud ACR
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: ${{ secrets.ACR_DOMAIN }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
- uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
with:
driver-opts: image=moby/buildkit:master
- uses: docker/build-push-action@v2
name: Build & Pushing
- uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
name: Build & Pushing vela-core for Dockerhub, GHCR and ACR
with:
context: .
file: Dockerfile
@@ -61,11 +70,94 @@ jobs:
build-args: |
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
GOPROXY=https://proxy.golang.org
tags: |-
ghcr.io/${{ github.repository }}/vela-core:${{ steps.get_version.outputs.VERSION }}
docker.io/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
- uses: docker/build-push-action@v2
name: Build & Pushing runtime rollout
ghcr.io/${{ github.repository_owner }}/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
- uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
name: Build & Pushing CLI for Dockerhub, GHCR and ACR
with:
context: .
file: Dockerfile.cli
labels: |-
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
build-args: |
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
GOPROXY=https://proxy.golang.org
tags: |-
docker.io/oamdev/vela-cli:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository_owner }}/oamdev/vela-cli:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/vela-cli:${{ steps.get_version.outputs.VERSION }}
publish-addon-images:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Get the version
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
VERSION=latest
fi
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
- name: Get git revision
id: vars
shell: bash
run: |
echo "git_revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Login ghcr.io
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login docker.io
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login Alibaba Cloud ACR
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: ${{ secrets.ACR_DOMAIN }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
- uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
with:
driver-opts: image=moby/buildkit:master
- uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
name: Build & Pushing vela-apiserver for Dockerhub, GHCR and ACR
with:
context: .
file: Dockerfile.apiserver
labels: |-
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
build-args: |
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
GOPROXY=https://proxy.golang.org
tags: |-
docker.io/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository_owner }}/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }}
- uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
name: Build & Pushing runtime rollout Dockerhub, GHCR and ACR
with:
context: .
file: runtime/rollout/Dockerfile
@@ -77,92 +169,11 @@ jobs:
build-args: |
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
GOPROXY=https://proxy.golang.org
tags: |-
ghcr.io/${{ github.repository }}/vela-rollout:${{ steps.get_version.outputs.VERSION }}
docker.io/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
publish-charts:
env:
HELM_CHARTS_DIR: charts
HELM_CHART: charts/vela-core
MINIMAL_HELM_CHART: charts/vela-minimal
LEGACY_HELM_CHART: legacy/charts/vela-core-legacy
OAM_RUNTIME_HELM_CHART: charts/oam-runtime
VELA_ROLLOUT_HELM_CHART: runtime/rollout/charts
LOCAL_OSS_DIRECTORY: .oss/
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- name: Get git revision
id: vars
shell: bash
run: |
echo "::set-output name=git_revision::$(git rev-parse --short HEAD)"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0
- name: Prepare legacy chart
run: |
rsync -r $LEGACY_HELM_CHART $HELM_CHARTS_DIR
rsync -r $HELM_CHART/* $LEGACY_HELM_CHART --exclude=Chart.yaml --exclude=crds
- name: Prepare vela chart
run: |
rsync -r $VELA_ROLLOUT_HELM_CHART $HELM_CHARTS_DIR
- uses: oprypin/find-latest-tag@v1
with:
repository: oam-dev/kubevela
releases-only: true
id: latest_tag
- name: Tag helm chart image
run: |
latest_repo_tag=${{ steps.latest_tag.outputs.tag }}
sub="."
major="$(cut -d"$sub" -f1 <<<"$latest_repo_tag")"
minor="$(cut -d"$sub" -f2 <<<"$latest_repo_tag")"
patch="0"
current_repo_tag="$major.$minor.$patch"
image_tag=${GITHUB_REF#refs/tags/}
chart_version=$latest_repo_tag
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
image_tag=latest
chart_version=${current_repo_tag}-nightly-build
fi
sed -i "s/latest/${image_tag}/g" $HELM_CHART/values.yaml
sed -i "s/latest/${image_tag}/g" $MINIMAL_HELM_CHART/values.yaml
sed -i "s/latest/${image_tag}/g" $LEGACY_HELM_CHART/values.yaml
sed -i "s/latest/${image_tag}/g" $OAM_RUNTIME_HELM_CHART/values.yaml
sed -i "s/latest/${image_tag}/g" $VELA_ROLLOUT_HELM_CHART/values.yaml
chart_smever=${chart_version#"v"}
sed -i "s/0.1.0/$chart_smever/g" $HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $MINIMAL_HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $LEGACY_HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $OAM_RUNTIME_HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $VELA_ROLLOUT_HELM_CHART/Chart.yaml
- name: Install ossutil
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
- name: Configure Alibaba Cloud OSSUTIL
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT} -c .ossutilconfig
- name: sync cloud to local
run: ./ossutil --config-file .ossutilconfig sync oss://$BUCKET/core $LOCAL_OSS_DIRECTORY
- name: add artifacthub stuff to the repo
run: |
rsync README.md $HELM_CHART/README.md
rsync README.md $LEGACY_HELM_CHART/README.md
rsync README.md $OAM_RUNTIME_HELM_CHART/README.md
rsync README.md $VELA_ROLLOUT_HELM_CHART/README.md
sed -i "s/ARTIFACT_HUB_REPOSITORY_ID/$ARTIFACT_HUB_REPOSITORY_ID/g" hack/artifacthub/artifacthub-repo.yml
rsync hack/artifacthub/artifacthub-repo.yml $LOCAL_OSS_DIRECTORY
- name: Package helm charts
run: |
helm package $HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $MINIMAL_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $LEGACY_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $OAM_RUNTIME_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $VELA_ROLLOUT_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm repo index --url https://$BUCKET.$ENDPOINT/core $LOCAL_OSS_DIRECTORY
- name: sync local to cloud
run: ./ossutil --config-file .ossutilconfig sync $LOCAL_OSS_DIRECTORY oss://$BUCKET/core -f
ghcr.io/${{ github.repository_owner }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
publish-capabilities:
env:
@@ -171,7 +182,7 @@ jobs:
CAPABILITY_ENDPOINT: oss-cn-beijing.aliyuncs.com
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Install ossutil
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
- name: Configure Alibaba Cloud OSSUTIL
@@ -179,6 +190,6 @@ jobs:
- name: sync capabilities bucket to local
run: ./ossutil --config-file .ossutilconfig sync oss://$CAPABILITY_BUCKET $CAPABILITY_DIR
- name: rsync all capabilites
run: rsync vela-templates/registry/auto-gen/* $CAPABILITY_DIR
run: rsync vela-templates/registry/auto-gen/* $CAPABILITY_DIR
- name: sync local to cloud
run: ./ossutil --config-file .ossutilconfig sync $CAPABILITY_DIR oss://$CAPABILITY_BUCKET -f
run: ./ossutil --config-file .ossutilconfig sync $CAPABILITY_DIR oss://$CAPABILITY_BUCKET -f

View File

@@ -4,126 +4,92 @@ on:
push:
tags:
- "v*"
workflow_dispatch: {}
workflow_dispatch: { }
env:
BUCKET: ${{ secrets.CLI_OSS_BUCKET }}
ENDPOINT: ${{ secrets.CLI_OSS_ENDPOINT }}
ACCESS_KEY: ${{ secrets.CLI_OSS_ACCESS_KEY }}
ACCESS_KEY_SECRET: ${{ secrets.CLI_OSS_ACCESS_KEY_SECRET }}
permissions:
contents: read
jobs:
publish-cli:
build:
permissions:
contents: write
actions: read
checks: write
issues: read
packages: write
pull-requests: read
repository-projects: read
statuses: read
runs-on: ubuntu-latest
env:
VELA_VERSION: ${{ github.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: goreleaser
steps:
- name: Checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: 1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Tag helm chart image
run: |
sed -i 's/latest/${{ steps.get_version.outputs.VERSION }}/g' charts/vela-core/values.yaml
sed -i 's/0.1.0/${{ steps.get_version.outputs.VERSION }}/g' charts/vela-core/Chart.yaml
- name: Run cross-build
run: make cross-build
- name: Run compress binary
run: make compress
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.2.2
- name: Upload Vela Linux amd64 tar.gz
uses: actions/upload-release-asset@v1.0.2
go-version: 1.19
cache: true
- uses: goreleaser/goreleaser-action@9754a253a8673b0ea869c2e863b4e975497efd0c # v4.1.1
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-linux-amd64.tar.gz
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Vela Linux amd64 zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-linux-amd64.zip
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Vela MacOS tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-darwin-amd64.tar.gz
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Vela MacOS zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-darwin-amd64.zip
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Vela Windows tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-windows-amd64.tar.gz
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Vela Windows zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/vela/vela-windows-amd64.zip
asset_name: vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela Linux amd64 tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-linux-amd64.tar.gz
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela Linux amd64 zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-linux-amd64.zip
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-linux-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela MacOS tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-darwin-amd64.tar.gz
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela MacOS zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-darwin-amd64.zip
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela Windows tar.gz
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-windows-amd64.tar.gz
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz
asset_content_type: binary/octet-stream
- name: Upload Kubectl-Vela Windows zip
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/kubectl-vela/kubectl-vela-windows-amd64.zip
asset_name: kubectl-vela-${{ steps.get_version.outputs.VERSION }}-windows-amd64.zip
asset_content_type: binary/octet-stream
- name: Upload Checksums
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./_bin/sha256sums.txt
asset_name: sha256sums.txt
asset_content_type: text/plain
distribution: goreleaser
version: 1.14.1
args: release --rm-dist --timeout 60m
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Since goreleaser haven't supported aliyun OSS, we need to upload the release manually
- name: Get version
run: echo "VELA_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Install ossutil
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
- name: Configure Alibaba Cloud OSSUTIL
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT}
- name: split files to be upload
run: mkdir -p ./dist/files_upload && mv ./dist/*.tar.gz ./dist/files_upload && mv ./dist/*.zip ./dist/files_upload
- name: sync local to cloud
run: ./ossutil --config-file .ossutilconfig sync ./dist/files_upload oss://$BUCKET/binary/vela/${{ env.VELA_VERSION }}
- name: sync the latest version file
if: ${{ !contains(env.VELA_VERSION,'alpha') && !contains(env.VELA_VERSION,'beta') }}
run: |
LATEST_VERSION=$(curl -fsSl https://static.kubevela.net/binary/vela/latest_version)
verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
verlte ${{ env.VELA_VERSION }} $LATEST_VERSION && echo "${{ env.VELA_VERSION }} <= $LATEST_VERSION, skip update" && exit 0
echo ${{ env.VELA_VERSION }} > ./latest_version
./ossutil --config-file .ossutilconfig cp -u ./latest_version oss://$BUCKET/binary/vela/latest_version
upload-plugin-homebrew:
permissions:
contents: write
actions: read
checks: write
issues: read
packages: write
pull-requests: read
repository-projects: read
statuses: read
needs: build
runs-on: ubuntu-latest
name: upload-sha256sums
steps:
- name: Checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Update kubectl plugin version in krew-index
uses: rajatjindal/krew-release-bot@v0.0.38
uses: rajatjindal/krew-release-bot@3320c0b546b5d2320613c46762bd3f73e2801bdc # v0.0.38
- name: Update Homebrew formula
uses: dawidd6/action-homebrew-bump-formula@02e79d9da43d79efa846d73695b6052cbbdbf48a # v3.8.3
with:
token: ${{ secrets.HOMEBREW_TOKEN }}
formula: kubevela
tag: ${{ github.ref }}
revision: ${{ github.sha }}
force: false

60
.github/workflows/scorecards.yml vendored Normal file
View File

@@ -0,0 +1,60 @@
name: Scorecards supply-chain security
on:
schedule:
# Weekly on Saturdays.
- cron: '30 1 * * 6'
push:
branches: [ master ]
# Declare default permissions as read only.
permissions: read-all
jobs:
analysis:
name: Scorecards analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Used to receive a badge. (Upcoming feature)
id-token: write
actions: read
contents: read
steps:
- name: "Checkout code"
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@937ffa90d79c7d720498178154ad4c7ba1e4ad8c # tag=v2.1.0
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecards on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
# Publish the results for public repositories to enable scorecard badges. For more details, see
# https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories, `publish_results` will automatically be set to `false`, regardless
# of the value entered here.
publish_results: true
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
with:
sarif_file: results.sarif

View File

@@ -7,25 +7,27 @@ on:
tags:
- "v*"
permissions:
contents: read
env:
GO_VERSION: '1.19'
jobs:
sync-core-api:
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v1
env:
GO_VERSION: '1.16'
GOLANGCI_VERSION: 'v1.38'
- name: Set up Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Sync to kubevela-core-api Repo
env:
@@ -34,4 +36,4 @@ jobs:
COMMIT_ID: ${{ github.sha }}
run: |
bash ./hack/apis/clientgen.sh
bash ./hack/apis/sync.sh
bash ./hack/apis/sync.sh sync

View File

@@ -1,7 +1,11 @@
name: Timed Task
on:
schedule:
- cron: '0 * * * *'
- cron: '* * * * *'
permissions:
contents: read
jobs:
clean-image:
runs-on: aliyun

33
.github/workflows/trivy-scan.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: "Trivy Scan"
on:
pull_request:
branches: [ master ]
permissions:
contents: read
jobs:
images:
name: Image Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Build Vela Core image from Dockerfile
run: |
docker build --build-arg GOPROXY=https://proxy.golang.org -t docker.io/oamdev/vela-core:${{ github.sha }} .
- name: Run Trivy vulnerability scanner for vela core
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/oamdev/vela-core:${{ github.sha }}'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'

View File

@@ -5,33 +5,36 @@ on:
branches:
- master
- release-*
workflow_dispatch: {}
workflow_dispatch: { }
pull_request:
branches:
- master
- release-*
permissions:
contents: read
env:
# Common versions
GO_VERSION: '1.16'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.7.0'
GO_VERSION: '1.19'
jobs:
detect-noop:
permissions:
actions: write # for fkirc/skip-duplicate-actions to skip or stop workflow runs
runs-on: ubuntu-20.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v3.3.0
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
continue-on-error: true
unit-tests:
runs-on: ubuntu-20.04
@@ -40,34 +43,37 @@ jobs:
steps:
- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
with:
submodules: true
- name: Cache Go Dependencies
uses: actions/cache@v2
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Install ginkgo
run: |
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y golang-ginkgo-dev
- name: Setup Kind Cluster
uses: engineerd/setup-kind@v0.5.0
- name: Setup K3d
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
with:
version: ${{ env.KIND_VERSION }}
version: v1.20
github-token: ${{ secrets.GITHUB_TOKEN }}
# TODO need update action version to resolve node 12 deprecated.
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@v1.2
uses: RyanSiu1995/kubebuilder-action@ff52bff1bae252239223476e5ab0d71d6ba02343
with:
version: 3.1.0
kubebuilderOnly: false
@@ -77,9 +83,9 @@ jobs:
run: make test
- name: Upload coverage report
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unittests
flags: core-unittests
name: codecov-umbrella

13
.gitignore vendored
View File

@@ -1,4 +1,4 @@
# Binaries for programs and plugins
# Binaries for programs and docgen
*.exe
*.exe~
*.dll
@@ -7,6 +7,7 @@
bin
_bin
e2e/vela
vela
# Test binary, build with `go test -c`
*.test
@@ -32,6 +33,7 @@ vendor/
# Vscode files
.vscode
.history
pkg/test/vela
config/crd/bases
@@ -41,8 +43,15 @@ references/cmd/cli/fake/source.go
references/cmd/cli/fake/chart_source.go
charts/vela-core/crds/_.yaml
.test_vela
tmp/
.vela/
# check docs
git-page/
git-page/
# e2e rollout runtime image build
runtime/rollout/e2e/tmp
vela.json
dist/

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

76
.goreleaser.yaml Normal file
View File

@@ -0,0 +1,76 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
builds:
- id: vela-cli
binary: vela
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
main: ./references/cmd/cli/main.go
ldflags:
- -s -w -X github.com/oam-dev/kubevela/version.VelaVersion={{ .Version }} -X github.com/oam-dev/kubevela/version.GitRevision=git-{{.ShortCommit}}
env:
- CGO_ENABLED=0
- id: kubectl-vela
binary: kubectl-vela
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
main: ./cmd/plugin/main.go
ldflags:
- -s -w -X github.com/oam-dev/kubevela/version.VelaVersion={{ .Version }} -X github.com/oam-dev/kubevela/version.GitRevision=git-{{.ShortCommit}}
archives:
- format: tar.gz
id: vela-cli-tgz
wrap_in_directory: '{{ .Os }}-{{ .Arch }}'
builds:
- vela-cli
name_template: '{{ trimsuffix .ArtifactName ".exe" }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}'
files: [ LICENSE, README.md ]
- format: zip
id: vela-cli-zip
builds:
- vela-cli
wrap_in_directory: '{{ .Os }}-{{ .Arch }}'
name_template: '{{ trimsuffix .ArtifactName ".exe" }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}'
files: [ LICENSE, README.md ]
- format: tar.gz
id: plugin-tgz
builds:
- kubectl-vela
wrap_in_directory: '{{ .Os }}-{{ .Arch }}'
name_template: '{{ trimsuffix .ArtifactName ".exe" }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}'
files: [ LICENSE, README.md ]
- format: zip
id: plugin-zip
builds:
- kubectl-vela
wrap_in_directory: '{{ .Os }}-{{ .Arch }}'
name_template: '{{ trimsuffix .ArtifactName ".exe" }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}'
files: [ LICENSE, README.md ]
checksum:
name_template: 'sha256sums.txt'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

View File

@@ -33,8 +33,8 @@ spec:
arch: amd64
{{addURIAndSha "https://github.com/oam-dev/kubevela/releases/download/{{ .TagName }}/kubectl-vela-{{ .TagName }}-windows-amd64.zip" .TagName }}
files:
- from: "*/kubectl-vela.exe"
to: "."
- from: "*/kubectl-vela"
to: "kubectl-vela.exe"
- from: "*/LICENSE"
to: "."
bin: "kubectl-vela.exe"

260
CHANGELOG/CHANGELOG-1.0.md Normal file
View File

@@ -0,0 +1,260 @@
# v1.0.7
This is a minor fix for release-1.0, please refer to release-1.1.x for the latest feature.
1. Fix podDisruptive field for inner traits #1844
# v1.0.6
1. fix bug: When the Component contains multiple traits of the same type, the status of the trait in the Application is reported incorrectly (#1731) (#1743)
2. Fix terraform component can't work normally, generate OpenAPI JSON schema for Terraform Component (#1738) (#1753)
3. Improve the logging system #1735 #1758
4. add ConcurrentReconciles for setting the concurrent reconcile number of the controller #1775
# v1.0.5
1. Fix Terraform application status issue (#1611)
2. application supports specifying different versions of Definition (#1597)
3. Enable Dynamic Admission Control for Application (#1619)
4. Update inner samples for "vela show xxx --web" (#1616)
5. fix empty rolloutBatch will panic whole controller bug (#1646)
6. Use stricter syntax check for CUE (#1643)
7. make ResourceTracker to own cluster-scope resource (#1634)
8. update docs
# v1.0.4
## Upgrade to this release
**Please update Application CRD to upgrade from v1.0.3 to this release**
```
kubectl apply -f https://raw.githubusercontent.com/kubevela/kubevela/master/charts/vela-core/crds/core.oam.dev_applications.yaml
```
**Check the upgrade docs to upgrade from other release: https://kubevela.io/docs/advanced-install#upgrade**
## Changelog
1. add more PVC volume traits and docs (#1524)
2. automatically sync vela api code to the repo([kubevela-core-api](https://github.com/oam-dev/kubevela-core-api)) on release, you can use this repo as import package for kubevela integration (#1523)
3. fix cue template of worker and ingress with more accurate error info (#1532)
4. add critical path k8s event for Application (#1463)
5. support K8s Deployment for AppRollout #1539 #1557
6. vela cli: enable "vela show" to support namespaced capability (#1521)
7. Add scpoe reference in Application object `status.Service` (#1540)
8. vela cli: `vela show` support list the parameter of ComponentDefinition created by helm charts (#1543)
9. Add revision mechanism for Component/Trait Definition and default revision histroy will keep 20 revisions #1531
10. fix CRD for legacy K8s cluser(<=1.14) (#1531)
11. fix duplate key in kubevela chart webhook yaml (#1571)
12. Check whether parameter.cmd is nill for `sidecar` trait (#1575)
13. add e2e-test into test coverage report (#1553)
14. support krew install for kubectl vela plugin #1582
15. fix controller cannot start due to the format error of the third-party CRD (#1584)
16. use accelerate domain for helm chart repo to speed up for global users (#1585)
17. embed rollout in an application, now you can use rolloutPlan in Application (#1568)
18. Support server-side Terraform as cloud resource provider #1519
# v1.0.3
More end user guide was added in `Application Deployment` section.
1. add helm test to verify the chart of KubeVela have been installed successfully (#1415)
2. fix bug which Component/TraitDefinition won't work when contains “`_|_`” in value (#1450)
3. add volumes definition in worker/webservice (#1459)
4. Remove local kind binary dependency #1458
5. ignore error not found when deleting resourceTracker (#1462)
6. add context.appRevisionNum as runtime context (#1466)
7. implement cli `vela system live-diff` to check diff before upgrade (#1419)
8. add webhook validation on CUE template outputs name (#1460)
9. Fix helm chart about wrong webhook policy (#1483)
10. Remove trait-injector from controller options (#1490)
12. add app name as label for AppRevision (#1488)
13. Introduce vela as a kubectl plugin (#1485)
14. update status of appContext by patch to avoid resourceVersion conflict error (#1500)
15. add workloadDefinitionRef to application status.services (#1471)
16. Add garbage collection mechanism for AppRevision, it will only keep 10 revisions by default (#1501)
17. Remove AGE in definition crd print columns (#1509)
# v1.0.2
1. remove no used ingress notes in KubeVela charts (#1405)
2. fix import inner package in the format of third party package path and add docs (#1412 #1417)
3. vela cli support use "vela system cue-packages" to list cue-package (#1417)
4. Fix bug that the registered k8s built-in gvk does not exist in third party package path (#1414)
5. Fix bug that patchKey not work when strategyUnify function not work with close call (#1430)
6. add podDisruptive to traitdefinition to notify wether a trait update will cause restart of pod or not (#1192)
7. Add a new cloneset scale controller (#1301)
8. Support garbage collection for across-namespace workloads and traits (#1421)
9. Add short name for crds && Remove redundant and ambiguous short names #1434
10. Refresh built-in packages when component/trait definition are registered (#1402)
**You should upgrade following CRDs to upgrade from v1.0.1, all CRDs changes are backward compatible**:
```
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_resourcetrackers.yaml
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/standard.oam.dev_rollouttraits.yaml
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_traitdefinitions.yaml
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_applications.yaml
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_approllouts.yaml
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml
```
# v1.0.1
There are some fixes contained for release v1.0.0:
1. add initial finalizer and abandon support for app rollout, you can revert quickly now(#1362)
2. fix vela show fail to get component definition (#1366)
3. fix application context controller should not own application object (#1370)
4. fix: "system-definition-namespace" chart args not work in vela chart (#1371)
5. fix resources created in different namespace can not be updated (#1374)
6. fix automatically generate schema for helm values fail in array list value (#1375)
7. upgrade API version of mutate/validate webhook to v1 (#1383)
8. fix webhook not work by helm install kubevela without cert-manager #1267
7. remove create cert-manager issuer in vela CLI env command (#1267)
8. refine CRD print results: add additional print column and short Name for CRD (#1377)
Many other docs improvements.
Thanks for all the contributors!
# v1.0.0
We're excited to announce the release of KubeVela 1.0.0! 🎉🎉🎉🎉
Thanks to all the new and existing contributors who helped make this release happen!
You may already noticed the awesome community has shipped a brand new KubeVela website https://kubevela.io ! 🎉🎉
If you're new to KubeVela, feel free to start with its [getting started page](https://kubevela.io/docs/quick-start) and learning about [its core concepts](https://kubevela.io/docs/concepts). The full feature of vela is explained in [platform builder guide](https://kubevela.io/docs/platform-engineers/overview).
For existing adopters, please follow the [installing](https://kubevela.io/docs/install) or [upgrading](https://kubevela.io/docs/install#upgrade) KubeVela to version 1.0.0.
## Acknowledgements ❤️
Thanks to everyone who made this release possible!
@captainroy-hy @sunny0826 @leejanee @yangsoon @wangyikewxgm @hongchaodeng @zzxwill @ryanzhang-oss @resouer @wonderflow @hprotzek @vnzongzna @majian159 @Cweiping @mengjiao-liu @kushthedude @unknwon @Ghostbaby @mosesyou @dylandee @wangkai1994 @LeoLiuYan @just-do1 @hoopoe61 @Incubator4th @TomorJM @hahchenchen @zeed-w-beez @allenhaozi @mason1kwok @kinsolee @shikanon @96RadhikaJadhav
# What's New
## API version upgraded to `v1beta1`
All user facing APIs have been upgraded to `v1beta1`, you could learn more details in the [API Changes](#API-Changes) section below.
## `ComponentDefinition`
The [`ComponentDefinition`](https://kubevela.io/docs/platform-engineers/definition-and-templates) now takes the responsibility of defining encapsulation and abstraction for your app components. And you are free to choose to use Helm chart or CUE to define them. This leaves `WorkloadDefinition` focusing on declaring workload characteristic such as `replicable`, `childResource` etc, so the `spec.schematic` field in `WorkloadDefinition` could be deprecated in next few releases.
## Application Versioning and Progressive Rollout
* A rolling style upgrade was supported by the object called [`AppRollout`](https://kubevela.io/docs/rollout/rollout/). It can help you to upgrade an Application from source revision to the target and support Blue/Green, Canary and A/B testing rollout strategy.
* Multi-Version, Multi-Cluster Application Deployment was supported by the object called [`AppDeployment`](https://kubevela.io/docs/rollout/appdeploy). It can help you to deploy multiple revision apps to multiple clusters with leverage of Service Mesh.
## Visualization Enhancement
KubeVela now automatically generates Open-API-v3 Schema for all the definition abstractions including CUE, Helm and raw Kubernetes resource templates. You can integrate KubeVela with your own dashboard and [generate forms from definitions](https://kubevela.io/docs/platform-engineers/openapi-v3-json-schema) at ease!
## Application Abstraction
There're several major updates on the `Application` abstraction itself:
* [Helm based abstraction](https://kubevela.io/docs/helm/component) was supported with few [limitations](https://kubevela.io/docs/helm/known-issues). In other words, you can now declare any existing Helm chart as an app component in KubeVela. The most exciting part is the trait system of KubeVela works seamlessly with the Helm based components, yes, just [attach trait](https://kubevela.io/docs/helm/trait) to it!
* [Raw Kubernetes resource templates](https://kubevela.io/docs/kube/component) was still supported, that's simpler but less powerful comparing to [the CUE way](https://kubevela.io/docs/cue/component). Of course, the trait system also [works seamless](https://kubevela.io/docs/kube/trait) with it.
## CUE Template Enhancement
* [Runtime information context](https://kubevela.io/docs/cue/component#full-available-information-in-cue-context) was supported, you could use this information to render the resources in CUE template.
* [Data passing](https://kubevela.io/docs/cue/advanced#data-passing) was supported during CUE rendering. Specifically, the `context.output` contains the rendered workload API resource and the `context.outputs.<xx>` contains all the other rendered API resources.
* [K8s API resources are now built-in packages](https://kubevela.io/docs/cue/basic#import-kube-package): the K8s built-in API including CRD will be discovered by KubeVela and automatically built as CUE packages, you can use it in your CUE template. This is very helpful in validation especially on writing new CUE templates.
* [Dry-run Application](https://kubevela.io/docs/platform-engineers/debug-test-cue) was supported along with a debug and test guide for building CUE template. You can create CUE based definitions with confidence now!
* [Deploy resources in different namespaces](https://kubevela.io/docs/cue/cross-namespace-resource/) was supported now, you can specify namespace in your CUE template.
## Declare and Consume Cloud Resources
* [Declare and consume cloud resources](https://kubevela.io/docs/platform-engineers/cloud-services/) were supported now in KubeVela, you can easily register cloud resources by `ComponentDefinition` and bind the service into the applications.
## A brand new website
We have upgraded our website [kubevela.io](https://github.com/oam-dev/kubevela.io) based on "Docusaurus". All docs is automatically generated from [KubeVela](https://github.com/oam-dev/kubevela/tree/master/docs) while the blogs are on [kubevela.io/blogs](https://github.com/oam-dev/kubevela.io/tree/main/blog).
# Changes
## API Changes
1. Change definition from cluster scope to namespace scope #1085 the cluster scope CRD was still compatible.
2. Application Spec changes.
- `spec.components[x].settings` in v1alpha2 was changed to `spec.components[x].properties` in v1beta1
- `spec.components[x].traits[x].name` in v1alpha2 was changed to `spec.components[x].traits[x].type` in v1beta1
Example of the v1alpha2 Spec:
```
apiVersion: core.oam.dev/v1alpha2
kind: Application
metadata:
name: first-vela-app
spec:
components:
- name: express-server
type: webservice
settings:
...
traits:
- name: ingress
properties:
...
```
Example of the v1beta1 Spec:
```
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: first-vela-app
spec:
components:
- name: express-server
type: webservice
properties:
...
traits:
- type: ingress
properties:
...
```
## Deprecation
1. route/autoscaler/metrics these three traits and their controllers were moved out from the vela core. #1172 You could still find and use them from https://github.com/oam-dev/catalog.
2. the dashboard was deprecated in KubeVela and we will merge these features and create a new in [velacp](https://github.com/oam-dev/velacp) soon.
3. vela CLI will only support run/modify an app from appfile by using `vela up`, so some other commands related were deprecated, such as `vela svc deploy`, `vela <trait> ...`
## Other Notable changes
1. `prometheus` and `certmanager` CRD are not required in installation #1005
2. Parent overrides child when annotation/labels conflicts && one revision will apply once only in force mode && AC.status CRD updated #1109
3. `ApplicationRevision` CRD Object was introduced as revision of Application #1214
4. KubeVela chart image pull policy was changed to `Always` from `IfNotPresent` #1228
5.` Application` Controller will use `AppContext` to manage the resources generation #1245, in other word, you can run KubeVela `Application Controller` without any `v1apha2 Object`.
6. The regular time for all events automatically sync changed from 5min to 1 hour #1285
7. `vela system dry-run` will print raw K8s resources in a better format #1246
# Known Issues
1. Built-in CUE package was not supported now for K8s Cluster v1.20, we will support in the next release. #1313
2. Resources created in different namespace from application will only be garbage collected (GC) when the application deleted, an update will not trigger GC for now, we will fix it in the next release. #1339
Thanks again to all the contributors!

243
CHANGELOG/CHANGELOG-1.1.md Normal file
View File

@@ -0,0 +1,243 @@
# v1.1.3
## What's Changed
* Fix: remove ocm addon enable in Makefile by @Somefive in https://github.com/oam-dev/kubevela/pull/2327
* Chore(cli): remove useless deploy.yaml by @chivalryq in https://github.com/oam-dev/kubevela/pull/2335
* Fix: do not override the workload name if its specified by @FogDong in https://github.com/oam-dev/kubevela/pull/2336
* Fix: remove appcontext CRD and controller by @wonderflow in https://github.com/oam-dev/kubevela/pull/2270
* Feat: add revisionHistoryLimit to helm chart by @haugom in https://github.com/oam-dev/kubevela/pull/2343
* Chore: deprecate 'vela dashboard' apiserver by @chivalryq in https://github.com/oam-dev/kubevela/pull/2341
* Chore: remove e2e-api-test in rollout test to speed up by @chivalryq in https://github.com/oam-dev/kubevela/pull/2345
* Docs: rollout demo by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2348
* Feat: add vela minimal chart by @FogDong in https://github.com/oam-dev/kubevela/pull/2340
* Fix: runc security issue by @Somefive in https://github.com/oam-dev/kubevela/pull/2350
* Docs: add a WeChat QR code by @barnettZQG in https://github.com/oam-dev/kubevela/pull/2351
* Feat: Initialize api for vela dashboard and CLI by @barnettZQG in https://github.com/oam-dev/kubevela/pull/2339
* Fix(helm chart): fix startup args for apiserver by @yangsoon in https://github.com/oam-dev/kubevela/pull/2362
* Fix: dockerfile e2e test command lack environment configuration by @Somefive in https://github.com/oam-dev/kubevela/pull/2231
* Feat: inputs support setting value in array by @leejanee in https://github.com/oam-dev/kubevela/pull/2358
* Feat: support rollout controller for StatefulSet by @whichxjy in https://github.com/oam-dev/kubevela/pull/1969
* Fix: delete deprecated vela dashboard in e2e setup by @FogDong in https://github.com/oam-dev/kubevela/pull/2379
* Fix: try fix CI unit test by @wonderflow in https://github.com/oam-dev/kubevela/pull/2376
* Feat: Addon REST API by @hongchaodeng in https://github.com/oam-dev/kubevela/pull/2369
* Fix: fix built in workflow steps by @FogDong in https://github.com/oam-dev/kubevela/pull/2378
* Feat: add vela minimal in make manifests by @FogDong in https://github.com/oam-dev/kubevela/pull/2389
* Chore(deps): bump go.mongodb.org/mongo-driver from 1.3.2 to 1.5.1 by @wonderflow in https://github.com/oam-dev/kubevela/pull/2391
* Fix: use aliyun oss istio chart by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2392
* Support remote git repo for Terraform configuration by @zzxwill in https://github.com/oam-dev/kubevela/pull/2337
* Feat: add inputs test cases and optimize code by @leejanee in https://github.com/oam-dev/kubevela/pull/2388
* Fix: pass owner to workload if rollout failed by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2397
* Feat: bootstrap multicluster testing by @Somefive in https://github.com/oam-dev/kubevela/pull/2368
* Feat(workflow): add depends on in workflow by @FogDong in https://github.com/oam-dev/kubevela/pull/2387
* Fix: make the name of Terraform credential secret same to component name by @zzxwill in https://github.com/oam-dev/kubevela/pull/2399
* Fix: revision GC in workflow mode by @FogDong in https://github.com/oam-dev/kubevela/pull/2355
* Fix: Applied Resources Statistics Error by @leejanee in https://github.com/oam-dev/kubevela/pull/2398
# v1.1.2
This is a bug fix release.
Since the big v1.1.1 release, many users had given it try for our new features. We sincerely appreciate your enthusiasm and amazing feedback.
There are some small issues found by our users and we have fixed them. Most notably:
- The Charts of addons (prometheus, etc.) are moved to OSS to provide better accessibility and network speed.
- The FluxCD and Terraform addons are not enabled by default. Users can install them via `vela addon enable ...`.
We have located more small issues around templates as well and fixed them, and decided a bug fix release ASAP.
Users are highly recommended to use the v1.1.2 release instead. We want to thank all of our users sincerely! ❤️ ❤️ ❤️
## What's Changed
* Fix(rollout): improve rollback experience by @hongchaodeng in https://github.com/oam-dev/kubevela/pull/2294
* Fix: fix typo by @hughxia in https://github.com/oam-dev/kubevela/pull/2317
* Fix: fix cluster-gateway image tag in chart by @Somefive in https://github.com/oam-dev/kubevela/pull/2318
* Fix: workflow example by @leejanee in https://github.com/oam-dev/kubevela/pull/2323
* Fix: fix multicluster values bug by @Somefive in https://github.com/oam-dev/kubevela/pull/2326
* Fix(helm): Do not install fluxcd and terraform by default by @yangsoon in https://github.com/oam-dev/kubevela/pull/2328
* Fix: move charts from github repo to Alibaba Cloud OSS repo by @zzxwill in https://github.com/oam-dev/kubevela/pull/2324
* Fix: add comments and adjust helm typed component's spec by @zzxwill in https://github.com/oam-dev/kubevela/pull/2332
* Fix: fix multicluster template bug by @Somefive in https://github.com/oam-dev/kubevela/pull/2333
* Feat: add args for init-contianer and sidecar by @Gallardot in https://github.com/oam-dev/kubevela/pull/2331
# v1.1.1
Users are highly recommended to use the v1.1.2 release instead.
# Changes since v1.1.0
1. rollout trait change IncreaseFirst to DecreaseFirst (#2142)
2. Feat(definition): add built-in dingtalk workflow step definition (#2152)
3. Fix(dryrun): add default name and namespace in dry run (#2150)
4. Docs: fix typo about workflow rollout (#2163)
5. Fix: traitdefinition controller reconcile in a infinite loop (#2157)
6. Refactor: change the ownerReference of configMap which store the parameter for each revision to definitionRevision (#2164)
7. Fix: add fluxcd dashbaords (#2130)
8. Feat: modify apply component cue action to support skipWorkload trait (#2167)
9. Trait: Add TraitDefinition for PVC (#2158)
10. initilize KubeVela codeowner file (#2178)
11. Feat(cue): support access components artifacts in cue template context (#2161)
12. Feat(addon): add default enable addon (#2172)
13. Feat(envbinding): add resourceTracker for envBinding (#2179)
14. Fix: align all CUE template keyword to use parameter (#2181)
15. Feat: add vela live-diff , dry-run, cue-packages into vela commands (#2182)
16. Fix: move Terraform defintions charts/vela-core/templates/definitions (#2176)
17. Fix: add patchkey to volumes (#2191)
18. Feat(workflow): add depends-on workflow step definition (#2190)
19. Feat: add pprof (#2192)
20. Feat: add more registry traits as internal ones (#2184)
21. Fix: support more Terraform variable types (#2194)
22. Fix: update help message of ingress trait (#2198)
23. Refactor(#2185): remove unused config options in Makefile (#2200)
24. Docs: update environment design (#2199)
25. Fix: modify service-binding with more accurate type (#2209)
26. Feat(healthscope): add health-scope-binding policy and e2e test for health scope (#2205)
27. Feat(workflow): support dingding and slack in webhook notification (#2213)
28. Feat(workflow): add apply application workflow step definition (#2186)
29. Feat(workflow): input.ParameterKey described like paths notation (#2214)
30. Fix(upgrade): upgrade controller-tools from 0.2 to 0.6.2 (#2215)
31. Fix(app): When only the policy is specified, the resources in the app need to be rendered and created (#2197)
32. Feat(workflow): outputs support script notation (#2218)
33. Fix(addon): rename clonset-service to clonse (#2219)
34. Feat(workflow): Add op.#Task action (#2220)
35. Fix(webhook): only check the uniqueness of component names under the same namespace (#2222)
36. Feat(apiserver): add apiserver service to helm chart (#2225)
37. Fix: add flag --label to filer components and traits (#2217)
38. Fix(addons): remove kruise addon (#2226)
39. Feat: add pressure-test parameter optimize (#2230)
40. Fix: align the envbind-app name with the original application name (#2232)
41. Feat(workflow): add status check for workflow mutil-env deploy (#2229)
42. Refactor: move from io/ioutil to io and os package (#2234)
43. Feat(trait): annotation and labels trait should also affect the workload object along with pod (#2237)
44. Feat(app): show health status from HealthScope in application (#2228)
45. Fix: kustomize json patch trait definition (#2239)
46. Docs: canary rollout demo (rollout part only) (#2177)
47. Feat: vela show annotations display undefined should be refined (#2244)
48. Feat: support code-generator and sync to kubevela-core-api (#2174)
49. Feat: add image auto update for gitops (#2251)
50. Fix: fix the output DB_PASSWORD for rds definition (#2267)
51. Fix: add alibaba eip cloud resource (#2268)
52. Refactor application code to make it run as Dag workflow (#2236)
53. Fix: remove podspecworkload controller and CRD (#2269)
54. Feat: add more options for leader election configuration to avoid pressure on apiserver
55. Feat: istio addon and use case demo (#2276)
56. Fix: patch any key using retainKeys strategy (#2280)
57. Fix: add exponential backoff wait time for workflow reconciling (#2279)
58. Refactor: change field exportKey to valueFrom (#2284)
59. Fix(helm): enable apiserver by default (#2249)
60. Feat: alibaba provider addon (#2243)
61. Support MultiCluster EnvBinding with cluster-gateway (#2247)
62. Fix: fix apply application workflow step (#2288)
63. Fix: fix alibaba cloud rds module (#2293)
64. Feat: add commit msg in kustomize (#2296)
65. Feat: allow user specify alibaba provider addon's region (#2297)
66. Fix: generate service in canary-traffic trait (#2300)
67. Fix: imagePullSecrets error from cloneset (#2305)
68. Fix: add application logging dashboard (#2301)
69. Feat: Make applicationComponent can be modified in step (#2304)
70. Fix: generate service in canary-traffic trait (#2307)
# v1.1.0
Note: the documents (https://kubevela.io/) for v1.1.0 is still WIP, so we mark it as pre-release. The ETA for documents is next 2 weeks.
We would like to extend our thanks to all [the new and existing contributors](https://github.com/oam-dev/kubevela/graphs/contributors) who helped make this release happen.
Please follow the guide to [install](https://kubevela.io/docs/next/getting-started/quick-install) or [upgrade](https://kubevela.io/docs/next/platform-engineers/advanced-install/) KubeVela to version v1.1.0.
## What's New
- **Hybrid Environment App Delivery Control plane**
- In the new release, we have fully upgraded KubeVela to a multi-cluster/hybrid-cloud/multi-cloud app delivery control plane with leverage of OAM as the consistent app delivery model across clouds and infrastructures.
- **Workflow**
- KubeVela has added a Workflow mechanism that empowers users to glue any operational tasks to customize the control logic to build more complex operations. Workflow is modular by design and each module is mainly composed in CUE -- so you can define complex operations in a declarative, data-driven manner.
- **Environment**
- KubeVela added an Initializer which allow users to define what constructs the environment. The environment Initialized by the Initilizer could contain different kinds of resources include K8s cluster, system components, policies and almost everything. Of course, you can destry an environment very easily with the help of Initializer.
- **Out of Box Addons**
- With the help of Initilizer, KubeVela has support lots of out of box addons. You can list/enable/disable them by `vela addon` command. Each addon is an Initializer that deloy the CRD Controllers and other resources related.
- **Cloud Resources Support**
- We also support terraform to provision almost every cloud resources and pass through to other components defined in KubeVela application.
- **Tools to edit and manage X-Definition**
- We also provide the `vela def` tool sets to provide unified CUE based capability to manage X-Definition.
- **Others**
- Allow specify name for component revision auto-generated by Application. Allow specify name for auto generated Definition revision.
- Controller runtime dependency upgrade that can compatible with Kubernetes v1.21 . KubeVela support Kubernetes v1.18~v1.21.
- Other details you could read changelog in the release history.
## Change log since v1.1-rc2
1. fix configmap patchkey bug (#2080)
2. Merge velacp to apiserver branch in oam repo (#2039) (#2127) (#2087)
3. support rollout controller seprated and install as helm chart in runtime cluster (#2075)
4. fix bug that KubeVela can not be installed in specified namespace (#2083)
5. enable vela def to use import decl (#2084)
6. enhance envbinding: support apply resources to cluster (#2093)
7. Add obsevability addon (#2091)
8. Feat(vela): add vela workflow suspend command (#2108)
9. feat(def): add built-in workflow definitions (#2094)
10. Feat(vela): add vela workflow resume command (#2114)
11. upgrade openkruise version to v0.9.0 (#2076)
12. Fix(workflow): set workload name in configmap if the name is not specified (#2119)
13. helm component support OSS bucket (#2104)
14. add rollout demo with Workflow (#2121)
15. Support script as parameter and make the WorkflowStepDefinition more universal (#2124)
16. fix(cli) fix bug when vela show componetdefinition's workload type is AutoDetectWorkloadDefinition (#2125)
17. Fix(workflow): set the namespace to app's ns if it's not specified (#2133)
18. fix specify external revision bug (#2126)
19. add CUE-based health check in HealthScope controller (#1956)
20. Feat(addon): Add source and patch to kustomize definition (#2138)
21. Feat(vela): add vela workflow terminate and restart command (#2131)
# v1.1.0-rc.2
1. Allow users to specify component revision name in Application (#1929) the new field `externalRevision` can specify the revision name.
```
kind: Application
spec:
components:
- name: mycomp
type: webservice
externalRevision: my-revision-v1
properties:
...
```
2. Add more workflow demo and fix some demos #2042 #2059 #2060 #2064
3. Add cloneset ComponentDefinition into kruise addon (#2050)
4. definitions support specify the revision name (#2044), you can specify the name by adding an annotation `definitionrevision.oam.dev/name`
```
apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
name: worker
annotations:
# you can specify the revision name in annotations
definitionrevision.oam.dev/name: "1.1.3"
spec:
...
```
5. fix definition controller log error cause by openapi schema generation error (#2063)
6. Add add-on input go-template implementation (#2049)
# v1.1.0-rc.1
1. Workflow support specify Order Steps by Field Tag (#2022)
2. support application policy (#2011)
3. add OCM multi cluster demo (#1992)
4. Fix(volume): seperate volume to trait (#2027)
5. allow application skip gc resource and leave workload ownerReference controlled by rollout(#2024)
6. Store component parameters in context (#2030)
7. Allow specify chart values for helm trait(#2033)
8. workflow support http provider (#2029)
9. Use vela def commands to replace mergedef.sh for internal definition generation (#2031)
# Other release histories
Refer to https://github.com/oam-dev/kubevela/releases

205
CHANGELOG/CHANGELOG-1.2.md Normal file
View File

@@ -0,0 +1,205 @@
# v1.2.2
## What's Changed
* Feat: add JFrog webhook trigger by @chwetion in https://github.com/oam-dev/kubevela/pull/3104
* Fix: trait/comp command output without a new line by @chivalryq in https://github.com/oam-dev/kubevela/pull/3112
* Feat: support wild match for env patch by @Somefive in https://github.com/oam-dev/kubevela/pull/3111
* Fix: fix revision will change when add new trait with skiprevisionaffect to application by @chwetion in https://github.com/oam-dev/kubevela/pull/3032
* Fix: add app samples for Terraform definition by @zzxwill in https://github.com/oam-dev/kubevela/pull/3118
* Feat: add port name in webservice by @FogDong in https://github.com/oam-dev/kubevela/pull/3110
* Fix: add imagePullSecrets for helm templates to support private docker registry by @StevenLeiZhang in https://github.com/oam-dev/kubevela/pull/3122
* Fix: workflow skip executing all steps occasionally by @leejanee in https://github.com/oam-dev/kubevela/pull/3025
* Fix: support generate Terraform ComponentDefinition from local HCL file by @zzxwill in https://github.com/oam-dev/kubevela/pull/3132
* Fix: prioritize namespace flag for `vela up` by @devholic in https://github.com/oam-dev/kubevela/pull/3135
* Fix: handle workflow cache reconcile by @FogDong in https://github.com/oam-dev/kubevela/pull/3128
* Feat: extend gateway trait to set class in spec by @devholic in https://github.com/oam-dev/kubevela/pull/3138
* Fix: add providerRef in generated ComponentDefinition by @zzxwill in https://github.com/oam-dev/kubevela/pull/3142
* Fix: retrieve Terraform variables from variables.tf by @zzxwill in https://github.com/oam-dev/kubevela/pull/3149
* Feat: addon parameter support ui-shcema by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/3154
* Fix: vela addnon enable cannot support '=' by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/3156
* Fix: add context parameters into the error message by @zeed-w-beez in https://github.com/oam-dev/kubevela/pull/3145
* Feat: support vela show for workflow step definition by @FogDong in https://github.com/oam-dev/kubevela/pull/3140
## New Contributors
* @devholic made their first contribution in https://github.com/oam-dev/kubevela/pull/3135
**Full Changelog**: https://github.com/oam-dev/kubevela/compare/v1.2.1...v1.2.2
# v1.2.1
## What's Changed
* Fix: can't query data from the MongoDB by @barnettZQG in https://github.com/oam-dev/kubevela/pull/3095
* Fix: use personal token of vela-bot instead of github token for homebrew update by @wonderflow in https://github.com/oam-dev/kubevela/pull/3096
* Fix: acr image no version by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/3100
* Fix: support generate cloud resource docs in Chinese by @zzxwill in https://github.com/oam-dev/kubevela/pull/3079
* Fix: clear old data in mongodb unit test case by @barnettZQG in https://github.com/oam-dev/kubevela/pull/3103
* Feat: support external revision in patch component by @Somefive in https://github.com/oam-dev/kubevela/pull/3106
* Fix: file under the path of github addon registry is not ignored by @StevenLeiZhang in https://github.com/oam-dev/kubevela/pull/3099
* Fix: Vela is crashed, when disabling addon, which needs namespace vela-system by @StevenLeiZhang in https://github.com/oam-dev/kubevela/pull/3109
* Fix: rollout workload namespace not aligned with rollout by @Somefive in https://github.com/oam-dev/kubevela/pull/3107
## New Contributors
* @StevenLeiZhang made their first contribution in https://github.com/oam-dev/kubevela/pull/3099
**Full Changelog**: https://github.com/oam-dev/kubevela/compare/v1.2.0...v1.2.1
# v1.2.0
❤️ KubeVela v1.2.0 released ! ❤️
Docs have been updated about the release at https://kubevela.io/docs/next/ .
**Changelog Between v1.2.0-rc.2~v1.2.0**: https://github.com/oam-dev/kubevela/compare/v1.2.0-rc.2...v1.2.0
## What's New
### UI Console Supported
Check how to use the GUI by this [how-to document](https://kubevela.io/docs/next/how-to/dashboard/application/create-application).
**GUI frontend code repo is here: https://github.com/oam-dev/velaux**
**API Server Code is here: https://github.com/oam-dev/kubevela/tree/master/pkg/apiserver**
We also add a [VelaQL](https://kubevela.io/docs/next/platform-engineers/system-operation/velaql) feature that could allow apiserver to interact with K8s Object in an extended way.
### Addon System
We add a new addon system in v1.2, this helps KubeVela install it's extension including more than X-Definition files.
The community has already supported some built-in addons herehttps://github.com/oam-dev/catalog/tree/master/addons , there're also some experimental addons here https://github.com/oam-dev/catalog/tree/master/experimental/addons
You can learn how to use it [from docs](https://kubevela.io/docs/next/how-to/cli/addon/addon).
You can [build and contribute](https://kubevela.io/docs/next/platform-engineers/addon/intro) your own addons.
### CI/CD Integration
You can use triggers to integrate with different CI and image registry systems on VelaUX.
* Feat: add ACR webhook trigger for CI/CD (#3044)
* Feat: add Harbor image registry webhook trigger for CI/CD (#3065)
* Feat: add DockerHub webhook trigger for CI/CD (#3081)
### Cloud Resources Enhancement
* Feature: support terraform/provider-azure addon by @zzxwill in https://github.com/oam-dev/kubevela/pull/2402
* Fix: aws/azure Terraform provider are broken by @zzxwill in https://github.com/oam-dev/kubevela/pull/2513 , https://github.com/oam-dev/kubevela/pull/2520 , https://github.com/oam-dev/kubevela/pull/2465
* Feat: Add Terraform Azure Storage Account by @maciejgwizdala in https://github.com/oam-dev/kubevela/pull/2646
* Docs: add vpc and vswitch cloud resource templates of alicloud by @lowkeyrd in https://github.com/oam-dev/kubevela/pull/2663
* Fix: allow external cloud resources to be kept when Application is deleted by @zzxwill in https://github.com/oam-dev/kubevela/pull/2698
* Feat: add alibaba cloud redis definition by @chivalryq in https://github.com/oam-dev/kubevela/pull/2507
* Feat: envbinding support cloud resource deploy and share by @Somefive in https://github.com/oam-dev/kubevela/pull/2734
* Fix: support naming a terraform provider by @zzxwill in https://github.com/oam-dev/kubevela/pull/2794
### Multi-Cluster Enhancement
* Feat: multicluster support ServiceAccountToken by @Somefive in https://github.com/oam-dev/kubevela/pull/2356
* Feat: add secure tls for cluster-gateway by @Somefive in https://github.com/oam-dev/kubevela/pull/2426
* Feat: add support for envbinding with namespace selector by @Somefive in https://github.com/oam-dev/kubevela/pull/2432
* Feat: upgrade cluster gateway to support remote debug by @Somefive in https://github.com/oam-dev/kubevela/pull/2673
* Feat: set multicluster enabled by default by @Somefive in #2930
### Workflow Enhancement
* Feat: add apply raw built in workflow steps by @FogDong in https://github.com/oam-dev/kubevela/pull/2420
* Feat: add read object step def by @FogDong in https://github.com/oam-dev/kubevela/pull/2480
* Feat: add export config and secret def for workflow by @FogDong in https://github.com/oam-dev/kubevela/pull/2484
* Feat: support secret in webhook notification by @FogDong in https://github.com/oam-dev/kubevela/pull/2509
* Feat: Record workflow execution state by @leejanee in https://github.com/oam-dev/kubevela/pull/2479
* Fix(cli): use flag instead of env in workflow cli by @FogDong in https://github.com/oam-dev/kubevela/pull/2512
* Not update resource if render hash equal. by @leejanee in https://github.com/oam-dev/kubevela/pull/2522
* Feat: add email support in webhook notification by @FogDong in https://github.com/oam-dev/kubevela/pull/2535
* Feat: add render component and apply component remaining by @FogDong in https://github.com/oam-dev/kubevela/pull/2587
* Feat: add list application records api by @FogDong in https://github.com/oam-dev/kubevela/pull/2757
* Feat: component-pod-view support filter resource by cluster name and cluster namespace by @yangsoon in https://github.com/oam-dev/kubevela/pull/2754
* Feat: workflow support update by @barnettZQG in https://github.com/oam-dev/kubevela/pull/2760
* Feat: add workflow reconciling backoff time and failed limit times by @FogDong in #2881
### Component/Trait Enhancement
* Feat: add health check and custom status for helm type component by @chivalryq in https://github.com/oam-dev/kubevela/pull/2499
* Feat: add nocalhost dev config trait definition by @yuyicai in https://github.com/oam-dev/kubevela/pull/2545
* Feat(rollout): fill rolloutBatches if empty when scale up/down by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2569
* Feat: allow import package in custom status cue template by @Chwetion in https://github.com/oam-dev/kubevela/pull/2585
* Feat: add trait service-account by @yangsoon in https://github.com/oam-dev/kubevela/pull/2878
* Fix: add ingress class as arguments by @Somefive in https://github.com/oam-dev/kubevela/pull/2445
* Fix: add libgit2 support for gitops by @FogDong in https://github.com/oam-dev/kubevela/pull/2477
* Fix: make nginx class to be default value and allow pvc trait to attach more than once by @wonderflow in https://github.com/oam-dev/kubevela/pull/2466
* Feat: add imagePullPolicy/imagePullSecret to task def by @chivalryq in https://github.com/oam-dev/kubevela/pull/2503
### Vela CLI Enhancement
* Feat: add vela prob to test cluster by @wonderflow in https://github.com/oam-dev/kubevela/pull/2635
* Feat: vela logs support multicluster by @chivalryq in https://github.com/oam-dev/kubevela/pull/2593
* Feat: vela-cli support use ocm to join/list/detach cluster by @yangsoon in https://github.com/oam-dev/kubevela/pull/2599
* Feat: add vela exec for multi cluster by @wonderflow in https://github.com/oam-dev/kubevela/pull/2299
* Feat: multicluster vela status/exec/port-forward by @Somefive in https://github.com/oam-dev/kubevela/pull/2662
* Fix: support `-n` flag for all commands to specify namespace by @chivalryq in https://github.com/oam-dev/kubevela/pull/2719
* Feat: vela delete add wait and force options by @yangsoon in https://github.com/oam-dev/kubevela/pull/2747
* Feat: add workflow rollback cli by @FogDong in https://github.com/oam-dev/kubevela/pull/2795
* Refactor: refine cli commands && align kubectl-vela with vela && use getnamespaceAndEnv for all by @wonderflow in #3048
### Overall Enhancements
* Feat: ResourceTracker new architecture by @Somefive in https://github.com/oam-dev/kubevela/pull/2849
* New Resource Management Model: Garbage Collection and Resource State Keeper [Desigin Doc](https://github.com/oam-dev/kubevela/blob/master/design/vela-core/resourcetracker_design.md)
* Feat: output log with structured tag & add step duration metrics by @leejanee in https://github.com/oam-dev/kubevela/pull/2683
* Feat: support user defined image registry that allows private installation by @wonderflow in https://github.com/oam-dev/kubevela/pull/2623
* Feat: add a built in garbage-collect policy to application by @yangsoon in https://github.com/oam-dev/kubevela/pull/2575
* Feat: health scope controller support check trait-managing workload by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2527
* Chore: add homebrew bump to support `brew install kubevela` by @basefas in https://github.com/oam-dev/kubevela/pull/2434
* Chore: Update release action to support build binaries for more platform by @basefas in https://github.com/oam-dev/kubevela/pull/2537
* Feat: add reconcile timeout configuration for vela-core by @Somefive in https://github.com/oam-dev/kubevela/pull/2630
* Chore: push docker images to Alibaba Cloud ACR by @zzxwill in https://github.com/oam-dev/kubevela/pull/2601
## What's Changed/Deprecated
* Deprecated: containerized workload by @reetasingh in https://github.com/oam-dev/kubevela/pull/2330
* Deprecated: initializer CRD controller by @chivalryq in https://github.com/oam-dev/kubevela/pull/2491
* Deprecated: remove envbinding controller, use #ApplyComponent for EnvBinding by @Somefive in https://github.com/oam-dev/kubevela/pull/2556 , https://github.com/oam-dev/kubevela/pull/2382
* Deprecated(cli): CLI vela config by @chivalryq in https://github.com/oam-dev/kubevela/pull/2037
* Deprecated: remove addon with no definitions by @chivalryq in https://github.com/oam-dev/kubevela/pull/2574
* Refactor: remove apiserver component from the chart, users should use velaux addon instead by @barnettZQG in https://github.com/oam-dev/kubevela/pull/2838
* Refactor: all addons are migrated from initializer to application objects by @chivalryq in https://github.com/oam-dev/kubevela/pull/2444
* Refactor: change rollout's json tag so the status of rollout will be optional by @GingoBang in https://github.com/oam-dev/kubevela/pull/2314
* Deprecated: deprecate CRD discovery for CUE import in Definition to prevent memory leak and OOM crash (#2925)
* Deprecated: delete approllout related code #3040
* Deprecate: delete appDeployment related logic #3050
## Bugfix
* Feat: rework resource tracker to solve bugs by @Somefive in https://github.com/oam-dev/kubevela/pull/2797
* Fix: change raw extension to pointer by @FogDong in https://github.com/oam-dev/kubevela/pull/2451
* Fix: show reconcile error log by @wonderflow in https://github.com/oam-dev/kubevela/pull/2626
* Fix: Closure Bug In newValue by @leejanee in https://github.com/oam-dev/kubevela/pull/2437
* Fix: resourceTracker compatibility bug by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2467
* Fix(application): nil pointer for component properties by @kinsolee in https://github.com/oam-dev/kubevela/pull/2481
* Fix: Commit step-generate data without success by @leejanee in https://github.com/oam-dev/kubevela/pull/2539
* Fix(cli): client-side throttling in vela CLI by @chivalryq in https://github.com/oam-dev/kubevela/pull/2581
* Fix: fix delete a component from application not delete workload by @wangyikewxgm in https://github.com/oam-dev/kubevela/pull/2680
* Fix: lookupByScript don't support `import` by @leejanee in https://github.com/oam-dev/kubevela/pull/2788
* Fix: resourcetracker do not garbage collect legacyRTs correctly by @Somefive in https://github.com/oam-dev/kubevela/pull/2817
* Fix: application conditions confusion. by @leejanee in https://github.com/oam-dev/kubevela/pull/2834
## New Contributors
* @GingoBang made their first contribution in https://github.com/oam-dev/kubevela/pull/2314
* @basefas made their first contribution in https://github.com/oam-dev/kubevela/pull/2434
* @yuyicai made their first contribution in https://github.com/oam-dev/kubevela/pull/2540
* @maciejgwizdala made their first contribution in https://github.com/oam-dev/kubevela/pull/2646
* @lowkeyrd made their first contribution in https://github.com/oam-dev/kubevela/pull/2663
* @zxbyoyoyo made their first contribution in https://github.com/oam-dev/kubevela/pull/2703
* @yue9944882 made their first contribution in https://github.com/oam-dev/kubevela/pull/2751
* @snyk-bot made their first contribution in https://github.com/oam-dev/kubevela/pull/2857
* @yunjianzhong made their first contribution in https://github.com/oam-dev/kubevela/pull/3005
* @songminglong made their first contribution in https://github.com/oam-dev/kubevela/pull/3064
* @basuotian made their first contribution in https://github.com/oam-dev/kubevela/pull/3059
* @K1ngram4 made their first contribution in https://github.com/oam-dev/kubevela/pull/3065
**Full Changelog**: https://github.com/oam-dev/kubevela/compare/v1.1.3...v1.2.0

13
CHANGELOG/README.md Normal file
View File

@@ -0,0 +1,13 @@
# CHANGELOGs
## Development release
- [CHANGELOG-1.2.md](./CHANGELOG-1.2.md)
## Current release
- [CHANGELOG-1.1.md](./CHANGELOG-1.1.md)
## Older releases
- [CHANGELOG-1.0.md](./CHANGELOG-1.0.md)

View File

@@ -1,66 +1,3 @@
# CONTRIBUTING Guide
## About KubeVela
KubeVela project is initialized and maintained by the cloud native community since day 0 with [bootstrapping contributors from 8+ different organizations](https://github.com/oam-dev/kubevela/graphs/contributors).
We intend for KubeVela to have an open governance since the very beginning and donate the project to neutral foundation as soon as it's released.
To help us create a safe and positive community experience for all, we require all participants to adhere to the [Code of Conduct](./CODE_OF_CONDUCT.md).
This document is a guide to help you through the process of contributing to KubeVela.
## Become a contributor
You can contribute to KubeVela in several ways. Here are some examples:
* Contribute to the KubeVela codebase.
* Contribute to the [KubeVela docs](https://github.com/oam-dev/kubevela.io).
* Report and triage bugs.
* Develop community CRD operators as workload or trait and contribute to [catalog](https://github.com/oam-dev/catalog).
* Write technical documentation and blog posts, for users and contributors.
* Organize meetups and user groups in your local area.
* Help others by answering questions about KubeVela.
For more ways to contribute, check out the [Open Source Guides](https://opensource.guide/how-to-contribute/).
### Report bugs
Before submitting a new issue, try to make sure someone hasn't already reported the problem.
Look through the [existing issues](https://github.com/oam-dev/kubevela/issues) for similar issues.
Report a bug by submitting a [bug report](https://github.com/oam-dev/kubevela/issues/new?assignees=&labels=kind%2Fbug&template=bug_report.md&title=).
Make sure that you provide as much information as possible on how to reproduce the bug.
Follow the issue template and add additional information that will help us replicate the problem.
#### Security issues
If you believe you've found a security vulnerability, please read our [security policy](https://github.com/oam-dev/kubevela/blob/master/SECURITY.md) for more details.
### Suggest enhancements
If you have an idea to improve KubeVela, submit an [feature request](https://github.com/oam-dev/kubevela/issues/new?assignees=&labels=kind%2Ffeature&template=feature_request.md&title=%5BFeature%5D).
### Triage issues
If you don't have the knowledge or time to code, consider helping with _issue triage_. The community will thank you for saving them time by spending some of yours.
Read more about the ways you can [Triage issues](/contribute/triage-issues.md).
### Answering questions
If you have a question and you can't find the answer in the [documentation](https://kubevela.io/docs/),
the next step is to ask it on the [github discussion](https://github.com/oam-dev/kubevela/discussions).
It's important to us to help these users, and we'd love your help. You can help other KubeVela users by answering [their questions](https://github.com/oam-dev/kubevela/discussions).
### Your first contribution
Unsure where to begin contributing to KubeVela? Start by browsing issues labeled `good first issue` or `help wanted`.
- [Good first issue](https://github.com/oam-dev/kubevela/labels/good%20first%20issue) issues are generally straightforward to complete.
- [Help wanted](https://github.com/oam-dev/kubevela/labels/help%20wanted) issues are problems we would like the community to help us with regardless of complexity.
If you're looking to make a code change, see how to set up your environment for [local development](contribute/developer-guide.md).
When you're ready to contribute, it's time to [Create a pull request](/contribute/create-pull-request.md).
Please refer to https://kubevela.io/docs/contributor/overview for details.

View File

@@ -1,20 +1,26 @@
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16-alpine as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine@sha256:a9b24b67dc83b3383d22a14941c2b2b2ca6a103d805cac6820fd1355943beaf1 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# It's a proxy for CN developer, please unblock it if you have network issue
ARG GOPROXY
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
COPY cmd/core/main.go main.go
COPY cmd/apiserver/main.go cmd/apiserver/main.go
# Copy the go source for building core
COPY cmd/core/ cmd/core/
COPY apis/ apis/
COPY pkg/ pkg/
COPY version/ version/
COPY references/ references/
# Build
ARG TARGETARCH
@@ -22,26 +28,20 @@ ARG VERSION
ARG GITVERSION
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
-o manager-${TARGETARCH} main.go
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
-o apiserver-${TARGETARCH} cmd/apiserver/main.go
-o manager-${TARGETARCH} cmd/core/main.go
# Use alpine as base image due to the discussion in issue #1448
# You can replace distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-alpine:latest}
# This is required by daemon connnecting with cri
RUN apk add --no-cache ca-certificates bash
FROM ${BASE_IMAGE:-alpine:3.15@sha256:cf34c62ee8eb3fe8aa24c1fab45d7e9d12768d945c3f5a6fd6a63d901e898479}
# This is required by daemon connecting with cri
RUN apk add --no-cache ca-certificates bash expat
WORKDIR /
ARG TARGETARCH
COPY --from=builder /workspace/manager-${TARGETARCH} /usr/local/bin/manager
COPY --from=builder /workspace/apiserver-${TARGETARCH} /usr/local/bin/apiserver
COPY entrypoint.sh /usr/local/bin/

48
Dockerfile.apiserver Normal file
View File

@@ -0,0 +1,48 @@
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine@sha256:a9b24b67dc83b3383d22a14941c2b2b2ca6a103d805cac6820fd1355943beaf1 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 for building apiserver
COPY cmd/apiserver/ cmd/apiserver/
COPY apis/ apis/
COPY pkg/ pkg/
COPY version/ version/
COPY references/ references/
# Build
ARG TARGETARCH
ARG VERSION
ARG GITVERSION
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
-o apiserver-${TARGETARCH} cmd/apiserver/main.go
# Use alpine as base image due to the discussion in issue #1448
# You can replace distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
FROM ${BASE_IMAGE:-alpine:3.15@sha256:cf34c62ee8eb3fe8aa24c1fab45d7e9d12768d945c3f5a6fd6a63d901e898479}
# This is required by daemon connecting with cri
RUN apk add --no-cache ca-certificates bash expat
WORKDIR /
ARG TARGETARCH
COPY --from=builder /workspace/apiserver-${TARGETARCH} /usr/local/bin/apiserver
COPY entrypoint.sh /usr/local/bin/
ENTRYPOINT ["entrypoint.sh"]
CMD ["apiserver"]

43
Dockerfile.cli Normal file
View File

@@ -0,0 +1,43 @@
ARG BASE_IMAGE
# Build the cli binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine@sha256:a9b24b67dc83b3383d22a14941c2b2b2ca6a103d805cac6820fd1355943beaf1 as builder
ARG GOPROXY
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
COPY apis/ apis/
COPY pkg/ pkg/
COPY version/ version/
COPY references/ references/
# Build
ARG TARGETARCH
ARG VERSION
ARG GITVERSION
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH:-amd64} \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
-o vela-${TARGETARCH} ./references/cmd/cli/main.go
# Use alpine as base image due to the discussion in issue #1448
# You can replace distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
FROM ${BASE_IMAGE:-alpine:3.15@sha256:cf34c62ee8eb3fe8aa24c1fab45d7e9d12768d945c3f5a6fd6a63d901e898479}
# This is required by daemon connecting with cri
RUN apk add --no-cache ca-certificates bash expat
WORKDIR /
ARG TARGETARCH
COPY --from=builder /workspace/vela-${TARGETARCH} /bin/vela
ENTRYPOINT ["/bin/vela"]

View File

@@ -1,5 +1,6 @@
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16-alpine as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine@sha256:a9b24b67dc83b3383d22a14941c2b2b2ca6a103d805cac6820fd1355943beaf1 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
@@ -17,6 +18,7 @@ COPY cmd/ cmd/
COPY apis/ apis/
COPY pkg/ pkg/
COPY version/ version/
COPY references/ references/
# Build
ARG TARGETARCH
@@ -24,8 +26,8 @@ ARG VERSION
ARG GITVERSION
RUN apk add gcc musl-dev libc-dev ;\
GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go test -c -o manager-${TARGETARCH} -cover -covermode=atomic -coverpkg ./... .
GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go test -c -o manager-${TARGETARCH} -cover -covermode=atomic -coverpkg ./... .
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
@@ -35,10 +37,10 @@ RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
# You can replace distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-alpine:latest}
# This is required by daemon connnecting with cri
RUN apk add --no-cache ca-certificates bash
FROM ${BASE_IMAGE:-alpine:3.15@sha256:cf34c62ee8eb3fe8aa24c1fab45d7e9d12768d945c3f5a6fd6a63d901e898479}
# This is required by daemon connecting with cri
RUN apk add --no-cache ca-certificates bash expat
WORKDIR /

1
GOVERNANCE.md Normal file
View File

@@ -0,0 +1 @@
Refer to https://github.com/kubevela/community/blob/main/GOVERNANCE.md

View File

@@ -71,7 +71,7 @@ To get started with issue triage and finding issues that haven't been triaged yo
### Browse unlabeled issues
The easiest and straight forward way of getting started and finding issues that haven't been triaged is to browse
[unlabeled issues](https://github.com/oam-dev/kubevela/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and starting from
[unlabeled issues](https://github.com/kubevela/kubevela/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and starting from
the bottom and working yourself to the top.
### Subscribe to all notifications
@@ -95,7 +95,7 @@ to guide contributors to provide standard information that must be included for
### Standard issue information that must be included
Given a certain [issue template]([template](https://github.com/oam-dev/kubevela/issues/new/choose)) have been used
Given a certain [issue template]([template](https://github.com/kubevela/kubevela/issues/new/choose)) have been used
by the issue author or depending how the issue is perceived by the issue triage responsible, the following should
help you understand what standard issue information that must be included.
@@ -219,7 +219,7 @@ There's a minor typo/error/lack of information that adds a lot of confusion for
### Support requests and questions
1. Kindly and politely direct the issue author to the [github discussion](https://github.com/oam-dev/kubevela/discussions)
1. Kindly and politely direct the issue author to the [github discussion](https://github.com/kubevela/kubevela/discussions)
and explain that issue is mainly used for tracking bugs and feature requests.
If possible, it's usually a good idea to add some pointers to the issue author's question.
2. Close the issue and label it with `type/question`.

295
Makefile
View File

@@ -1,108 +1,39 @@
# Vela version
VELA_VERSION ?= master
# Repo info
GIT_COMMIT ?= git-$(shell git rev-parse --short HEAD)
GIT_COMMIT_LONG ?= $(shell git rev-parse HEAD)
VELA_VERSION_KEY := github.com/oam-dev/kubevela/version.VelaVersion
VELA_GITVERSION_KEY := github.com/oam-dev/kubevela/version.GitRevision
LDFLAGS ?= "-s -w -X $(VELA_VERSION_KEY)=$(VELA_VERSION) -X $(VELA_GITVERSION_KEY)=$(GIT_COMMIT)"
GOBUILD_ENV = GO111MODULE=on CGO_ENABLED=0
GOX = go run github.com/mitchellh/gox
TARGETS := darwin/amd64 linux/amd64 windows/amd64
DIST_DIRS := find * -type d -exec
TIME_LONG = `date +%Y-%m-%d' '%H:%M:%S`
TIME_SHORT = `date +%H:%M:%S`
TIME = $(TIME_SHORT)
BLUE := $(shell printf "\033[34m")
YELLOW := $(shell printf "\033[33m")
RED := $(shell printf "\033[31m")
GREEN := $(shell printf "\033[32m")
CNone := $(shell printf "\033[0m")
INFO = echo ${TIME} ${BLUE}[ .. ]${CNone}
WARN = echo ${TIME} ${YELLOW}[WARN]${CNone}
ERR = echo ${TIME} ${RED}[FAIL]${CNone}
OK = echo ${TIME} ${GREEN}[ OK ]${CNone}
FAIL = (echo ${TIME} ${RED}[FAIL]${CNone} && false)
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
# Image URL to use all building/pushing image targets
VELA_CORE_IMAGE ?= vela-core:latest
VELA_CORE_TEST_IMAGE ?= vela-core-test:$(GIT_COMMIT)
VELA_RUNTIME_ROLLOUT_IMAGE ?= vela-runtime-rollout:latest
include makefiles/const.mk
include makefiles/dependency.mk
include makefiles/release.mk
include makefiles/develop.mk
include makefiles/build.mk
include makefiles/e2e.mk
.DEFAULT_GOAL := all
all: build
# Run tests
test: vet lint staticcheck
go test -coverprofile=coverage.txt ./pkg/... ./cmd/...
go test ./references/appfile/... ./references/cli/... ./references/common/... ./references/plugins/...
test: unit-test-core test-cli-gen
@$(OK) unit-tests pass
test-cli-gen:
mkdir -p ./bin/doc
go run ./hack/docgen/cli/gen.go ./bin/doc
unit-test-core:
go test -coverprofile=coverage.txt $(shell go list ./pkg/... ./cmd/... ./apis/... | grep -v apiserver | grep -v applicationconfiguration)
go test $(shell go list ./references/... | grep -v apiserver)
unit-test-apiserver:
go test -gcflags=all=-l -coverprofile=coverage.txt $(shell go list ./pkg/... ./cmd/... | grep -E 'apiserver|velaql')
# Build vela cli binary
build: fmt vet lint staticcheck vela-cli kubectl-vela
build: vela-cli kubectl-vela
@$(OK) build succeed
vela-cli:
$(GOBUILD_ENV) go build -o bin/vela -a -ldflags $(LDFLAGS) ./references/cmd/cli/main.go
kubectl-vela:
$(GOBUILD_ENV) go build -o bin/kubectl-vela -a -ldflags $(LDFLAGS) ./cmd/plugin/main.go
doc-gen:
rm -r docs/en/cli/*
go run hack/docgen/gen.go
PWD := $(shell pwd)
cross-build:
rm -rf _bin
go get github.com/mitchellh/gox@v0.4.0
$(GOBUILD_ENV) $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/vela/{{.OS}}-{{.Arch}}/vela" -osarch='$(TARGETS)' ./references/cmd/cli
$(GOBUILD_ENV) $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/kubectl-vela/{{.OS}}-{{.Arch}}/kubectl-vela" -osarch='$(TARGETS)' ./cmd/plugin
$(GOBUILD_ENV) $(GOX) -ldflags $(LDFLAGS) -parallel=2 -output="_bin/apiserver/{{.OS}}-{{.Arch}}/apiserver" -osarch="$(TARGETS)" ./cmd/apiserver
build-cleanup:
rm -rf _bin
compress:
( \
echo "\n## Release Info\nVERSION: $(VELA_VERSION)" >> README.md && \
echo "GIT_COMMIT: $(GIT_COMMIT_LONG)\n" >> README.md && \
cd _bin/vela && \
$(DIST_DIRS) cp ../../LICENSE {} \; && \
$(DIST_DIRS) cp ../../README.md {} \; && \
$(DIST_DIRS) tar -zcf vela-{}.tar.gz {} \; && \
$(DIST_DIRS) zip -r vela-{}.zip {} \; && \
cd ../kubectl-vela && \
$(DIST_DIRS) cp ../../LICENSE {} \; && \
$(DIST_DIRS) cp ../../README.md {} \; && \
$(DIST_DIRS) tar -zcf kubectl-vela-{}.tar.gz {} \; && \
$(DIST_DIRS) zip -r kubectl-vela-{}.zip {} \; && \
cd .. && \
sha256sum vela/vela-* kubectl-vela/kubectl-vela-* > sha256sums.txt \
)
# Run against the configured Kubernetes cluster in ~/.kube/config
run:
go run ./cmd/core/main.go --application-revision-limit 5
run-apiserver:
go run ./cmd/apiserver/main.go
# Run go fmt against code
fmt: goimports installcue
go fmt ./...
$(GOIMPORTS) -local github.com/oam-dev/kubevela -w $$(go list -f {{.Dir}} ./...)
$(CUE) fmt ./vela-templates/definitions/internal/*
$(CUE) fmt ./vela-templates/definitions/deprecated/*
$(CUE) fmt ./vela-templates/definitions/registry/*
$(CUE) fmt ./pkg/stdlib/pkgs/*
$(CUE) fmt ./pkg/stdlib/op.cue
@@ -117,7 +48,7 @@ staticcheck: staticchecktool
lint: golangci
$(GOLANGCILINT) run ./...
reviewable: manifests fmt vet lint staticcheck
reviewable: manifests fmt vet lint staticcheck helm-doc-gen
go mod tidy
# Execute auto-gen code commands and ensure branch is clean.
@@ -126,205 +57,79 @@ check-diff: reviewable
git diff --quiet || ($(ERR) please run 'make reviewable' to include all changes && false)
@$(OK) branch is clean
# Build the docker image
docker-build:
docker build --build-arg=VERSION=$(VELA_VERSION) --build-arg=GITVERSION=$(GIT_COMMIT) -t $(VELA_CORE_IMAGE) .
# Build the runtime docker image
docker-build-runtime-rollout:
docker build --build-arg=VERSION=$(VELA_VERSION) --build-arg=GITVERSION=$(GIT_COMMIT) -t $(VELA_RUNTIME_ROLLOUT_IMAGE) -f runtime/rollout/Dockerfile .
# Push the docker image
docker-push:
docker push $(VELA_CORE_IMAGE)
e2e-setup-core:
sh ./hack/e2e/modify_charts.sh
helm upgrade --install --create-namespace --namespace vela-system --set image.pullPolicy=IfNotPresent --set image.repository=vela-core-test --set applicationRevisionLimit=5 --set dependCheckWait=10s --set image.tag=$(GIT_COMMIT) --set multicluster.enabled=true --wait kubevela ./charts/vela-core
kubectl wait --for=condition=Available deployment/kubevela-vela-core -n vela-system --timeout=180s
build-swagger:
go run ./cmd/apiserver/main.go build-swagger ./docs/apidoc/swagger.json
e2e-setup:
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.9.0/kruise-chart.tgz --set featureGates="PreDownloadImageForInPlaceUpdate=true"
sh ./hack/e2e/modify_charts.sh
helm upgrade --install --create-namespace --namespace vela-system --set image.pullPolicy=IfNotPresent --set image.repository=vela-core-test --set applicationRevisionLimit=5 --set dependCheckWait=10s --set image.tag=$(GIT_COMMIT) --wait kubevela ./charts/vela-core
helm upgrade --install --create-namespace --namespace oam-runtime-system --set image.pullPolicy=IfNotPresent --set image.repository=vela-core-test --set dependCheckWait=10s --set image.tag=$(GIT_COMMIT) --wait oam-runtime ./charts/oam-runtime
bin/vela addon enable fluxcd
bin/vela addon enable terraform
ginkgo version
ginkgo -v -r e2e/setup
timeout 600s bash -c -- 'while true; do kubectl get ns flux-system; if [ $$? -eq 0 ] ; then break; else sleep 5; fi;done'
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-core,app.kubernetes.io/instance=kubevela -n vela-system --timeout=600s
kubectl wait --for=condition=Ready pod -l app=source-controller -n flux-system --timeout=600s
kubectl wait --for=condition=Ready pod -l app=helm-controller -n flux-system --timeout=600s
e2e-api-test:
# Run e2e test
ginkgo -v -skipPackage capability,setup,application -r e2e
ginkgo -v -r e2e/application
e2e-test:
# Run e2e test
ginkgo -v --skip="rollout related e2e-test." ./test/e2e-test
@$(OK) tests pass
e2e-rollout-test:
ginkgo -v --focus="rollout related e2e-test." ./test/e2e-test
@$(OK) tests pass
e2e-multicluster-test:
go test -v -coverpkg=./... -coverprofile=/tmp/e2e_multicluster_test.out ./test/e2e-multicluster-test
@$(OK) tests pass
compatibility-test: vet lint staticcheck generate-compatibility-testdata
# Run compatibility test with old crd
COMPATIBILITY_TEST=TRUE go test -race ./pkg/...
@$(OK) compatibility-test pass
generate-compatibility-testdata:
mkdir -p ./test/compatibility-test/testdata
go run ./test/compatibility-test/convert/main.go ./charts/vela-core/crds ./test/compatibility-test/testdata
compatibility-testdata-cleanup:
rm -f ./test/compatibility-test/testdata/*
e2e-cleanup:
# Clean up
rm -rf ~/.vela
image-cleanup:
# Delete Docker image
ifneq (, $(shell which docker))
# Delete Docker images
ifneq ($(shell docker images -q $(VELA_CORE_TEST_IMAGE)),)
docker rmi -f $(VELA_CORE_TEST_IMAGE)
endif
end-e2e-core:
sh ./hack/e2e/end_e2e_core.sh
ifneq ($(shell docker images -q $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE)),)
docker rmi -f $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE)
endif
end-e2e:
sh ./hack/e2e/end_e2e.sh
endif
# load docker image to the kind cluster
kind-load:
# 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; }
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
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
# Run against the configured Kubernetes cluster in ~/.kube/config
core-run: fmt vet manifests
go run ./cmd/core/main.go
# Run against the configured Kubernetes cluster in ~/.kube/config with debug logs
core-debug-run: fmt vet manifests
go run ./cmd/core/main.go --log-debug=true
# Install CRDs and Definitions of Vela Core into a cluster, this is for develop convenient.
core-install: manifests
kubectl apply -f hack/namespace.yaml
kubectl apply -f charts/vela-core/crds/
@$(OK) install succeed
# Uninstall CRDs and Definitions of Vela Core from a cluster, this is for develop convenient.
core-uninstall: manifests
kubectl delete -f charts/vela-core/crds/
# Generate manifests e.g. CRD, RBAC etc.
manifests: installcue kustomize
go generate $(foreach t,pkg apis,./$(t)/...)
# TODO(yangsoon): kustomize will merge all CRD into a whole file, it may not work if we want patch more than one CRD in this way
$(KUSTOMIZE) build config/crd -o config/crd/base/core.oam.dev_applications.yaml
./hack/crd/cleanup.sh
go run ./hack/crd/dispatch/dispatch.go config/crd/base charts/vela-core/crds charts/oam-runtime/crds runtime/ charts/vela-minimal/crds
go run ./hack/crd/dispatch/dispatch.go config/crd/base charts/vela-core/crds runtime/ charts/vela-minimal/crds
rm -f config/crd/base/*
./vela-templates/gen_definitions.sh
go run ./vela-templates/gen_addons.go
GOLANGCILINT_VERSION ?= v1.38.0
HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
HOSTARCH := $(shell uname -m)
ifeq ($(HOSTARCH),x86_64)
HOSTARCH := amd64
endif
golangci:
ifeq (, $(shell which golangci-lint))
@{ \
set -e ;\
echo 'installing golangci-lint-$(GOLANGCILINT_VERSION)' ;\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) $(GOLANGCILINT_VERSION) ;\
echo 'Install succeed' ;\
}
GOLANGCILINT=$(GOBIN)/golangci-lint
else
GOLANGCILINT=$(shell which golangci-lint)
endif
.PHONY: staticchecktool
staticchecktool:
ifeq (, $(shell which staticcheck))
@{ \
set -e ;\
echo 'installing honnef.co/go/tools/cmd/staticcheck ' ;\
GO111MODULE=off go get honnef.co/go/tools/cmd/staticcheck ;\
}
STATICCHECK=$(GOBIN)/staticcheck
else
STATICCHECK=$(shell which staticcheck)
endif
.PHONY: goimports
goimports:
ifeq (, $(shell which goimports))
@{ \
set -e ;\
GO111MODULE=off go get -u golang.org/x/tools/cmd/goimports ;\
}
GOIMPORTS=$(GOBIN)/goimports
else
GOIMPORTS=$(shell which goimports)
endif
.PHONY: installcue
installcue:
ifeq (, $(shell which cue))
@{ \
set -e ;\
GO111MODULE=off go get -u cuelang.org/go/cmd/cue ;\
}
CUE=$(GOBIN)/cue
else
CUE=$(shell which cue)
endif
KUSTOMIZE_VERSION ?= 3.8.2
.PHONY: kustomize
kustomize:
ifeq (, $(shell kustomize version | grep $(KUSTOMIZE_VERSION)))
@{ \
set -e ;\
echo 'installing kustomize-v$(KUSTOMIZE_VERSION) into $(GOBIN)' ;\
curl -s https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh | bash -s $(KUSTOMIZE_VERSION) $(GOBIN);\
echo 'Install succeed' ;\
}
KUSTOMIZE=$(GOBIN)/kustomize
else
KUSTOMIZE=$(shell which kustomize)
endif
check-license-header:
./hack/licence/header-check.sh
def-install:
./hack/utils/installdefinition.sh
helm-doc-gen: helmdoc
readme-generator -v charts/vela-core/values.yaml -r charts/vela-core/README.md
readme-generator -v charts/vela-minimal/values.yaml -r charts/vela-minimal/README.md

12
OWNERS
View File

@@ -1,12 +0,0 @@
approvers:
- kubevela-controller
- kubevela-devex
- kubevela-dashboard-approver
reviewers:
- kubevela-controller
- oam-spec
- kubevela-dashboard-reviewer
members:
- community-collaborators

View File

@@ -1,44 +1 @@
aliases:
kubevela-devex:
- hongchaodeng
- wonderflow
kubevela-dashboard-approver:
- zzxwill
- hongchaodeng
kubevela-dashboard-reviewer:
- sunny0826
- hanxie-crypto
kubevela-controller:
- resouer
- wonderflow
- hongchaodeng
- zzxwill
- ryanzhang-oss
- captainroy-hy
oam-spec: # inherit from https://github.com/oam-dev/spec/blob/master/OWNERS.md
- hongchaodeng
- resouer
community-collaborators:
- Fei-Guo
- szihai
bootstrap-contributors: # thank you for bootstrapping KubeVela at the very early stage!
- xiaoyuaiheshui
- Ghostbaby
- wenxinnnnn
- silenceper
- erdun
- sunny0826
- mosesyou
- artursouza
- wonderflow
- hongchaodeng
- ryanzhang-oss
- woshilanren11
- hanxie-crypto
- zzxwill
The owner file has been migrated to the community repo, please refer to https://github.com/kubevela/community/blob/main/OWNERS.md

View File

@@ -1,63 +1,98 @@
![Build status](https://github.com/oam-dev/kubevela/workflows/E2E/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/oam-dev/kubevela)](https://goreportcard.com/report/github.com/oam-dev/kubevela)
<div style="text-align: center">
<p align="center">
<img src="https://raw.githubusercontent.com/kubevela/kubevela.io/main/docs/resources/KubeVela-03.png">
<br><br>
<i>Make shipping applications more enjoyable.</i>
</p>
</div>
![Build status](https://github.com/kubevela/kubevela/workflows/Go/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/kubevela/kubevela)](https://goreportcard.com/report/github.com/kubevela/kubevela)
![Docker Pulls](https://img.shields.io/docker/pulls/oamdev/vela-core)
[![codecov](https://codecov.io/gh/oam-dev/kubevela/branch/master/graph/badge.svg)](https://codecov.io/gh/oam-dev/kubevela)
[![LICENSE](https://img.shields.io/github/license/oam-dev/kubevela.svg?style=flat-square)](/LICENSE)
[![Releases](https://img.shields.io/github/release/oam-dev/kubevela/all.svg?style=flat-square)](https://github.com/oam-dev/kubevela/releases)
[![TODOs](https://img.shields.io/endpoint?url=https://api.tickgit.com/badge?repo=github.com/oam-dev/kubevela)](https://www.tickgit.com/browse?repo=github.com/oam-dev/kubevela)
[![codecov](https://codecov.io/gh/kubevela/kubevela/branch/master/graph/badge.svg)](https://codecov.io/gh/kubevela/kubevela)
[![LICENSE](https://img.shields.io/github/license/kubevela/kubevela.svg?style=flat-square)](/LICENSE)
[![Releases](https://img.shields.io/github/release/kubevela/kubevela/all.svg?style=flat-square)](https://github.com/kubevela/kubevela/releases)
[![TODOs](https://img.shields.io/endpoint?url=https://api.tickgit.com/badge?repo=github.com/kubevela/kubevela)](https://www.tickgit.com/browse?repo=github.com/kubevela/kubevela)
[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2Foam_dev)](https://twitter.com/oam_dev)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kubevela)](https://artifacthub.io/packages/search?repo=kubevela)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4602/badge)](https://bestpractices.coreinfrastructure.org/projects/4602)
![E2E status](https://github.com/kubevela/kubevela/workflows/E2E%20Test/badge.svg)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/kubevela/kubevela/badge)](https://api.securityscorecards.dev/projects/github.com/kubevela/kubevela)
![logo](https://raw.githubusercontent.com/oam-dev/kubevela.io/main/docs/resources/KubeVela-03.png)
## Introduction
*Make shipping applications more enjoyable.*
KubeVela is a modern application delivery platform that makes deploying and operating applications across today's hybrid, multi-cloud environments easier, faster and more reliable.
# KubeVela
![kubevela](docs/resources/what-is-kubevela.png)
KubeVela is a modern application platform that makes deploying and managing applications across today's hybrid, multi-cloud environments easier and faster.
## Highlights
## Features
KubeVela practices the "render, orchestrate, deploy" workflow with below highlighted values added to existing ecosystem:
**Application Centric** - KubeVela introduces [Open Application Model (OAM)](https://oam.dev/) as the consistent yet higher level API to capture a full deployment of microservices on top of hybrid environments. Placement strategy, traffic shifting and rolling update are declared at application level. No infrastructure level concern, simply deploy.
* Deployment as Code
**Programmable Workflow** - KubeVela leverages [CUE](https://cuelang.org/) to implement its model layer. This allows you to declare application deployment workflow as a DAG, with all steps and application's needs glued together in programmable approach. No restrictions, natively extensible.
Declare your deployment plan as workflow, run it automatically with any CI/CD or GitOps system, extend or re-program the workflow steps with CUE. No add-hoc scripts, no dirty glue code, just deploy. The deployment workflow in KubeVela is powered by [Open Application Model](https://oam.dev/).
**Runtime Agnostic** - KubeVela works as an application delivery control plane that is fully runtime agnostic. It can deploy and manage any application components including containers, cloud functions, databases, or even EC2 instances across hybrid environments, following the workflow you defined.
* Built-in security and compliance building blocks
Choose from the wide range of LDAP integrations we provided out-of-box, enjoy multi-cluster authorization that is fully automated, pick and apply fine-grained RBAC modules and customize them per your own supply chain requirements.
* Multi-cloud/hybrid-environments app delivery as first-class citizen
Progressive rollout across test/staging/production environments, automatic canary, blue-green and continuous verification, rich placement strategy across clusters and clouds, fully managed cloud environments provision.
## Getting Started
- [Introduction](https://kubevela.io/docs)
- [Installation](https://kubevela.io/docs/install)
- [Design Your First Deployment Plan](https://kubevela.io/docs/quick-start)
* [Introduction](https://kubevela.io/docs)
* [Installation](https://kubevela.io/docs/install)
* [Deploy Your Application](https://kubevela.io/docs/quick-start)
## Documentation
Full documentation is available on the [KubeVela website](https://kubevela.io/).
## Blog
Official blog is available on [KubeVela blog](https://kubevela.io/blog).
## Community
- Slack: [CNCF Slack](https://slack.cncf.io/) #kubevela channel (*English*)
- Gitter: [oam-dev](https://gitter.im/oam-dev/community) (*English*)
We want your contributions and suggestions!
One of the easiest ways to contribute is to participate in discussions on the Github Issues/Discussion, chat on IM or the bi-weekly community calls.
For more information on the community engagement, developer and contributing guidelines and more, head over to the [KubeVela community repo](https://github.com/kubevela/community).
### Contact Us
Reach out with any questions you may have and we'll make sure to answer them as soon as possible!
- Slack: [CNCF Slack kubevela channel](https://cloud-native.slack.com/archives/C01BLQ3HTJA) (*English*)
- [DingTalk Group](https://page.dingtalk.com/wow/dingtalk/act/en-home): `23310022` (*Chinese*)
- Wechat Group (*Chinese*): Broker wechat to add you into the user group.
<img src="https://static.kubevela.net/images/barnett-wechat.jpg" width="200" />
- Bi-weekly Community Call: [Meeting Notes](https://docs.google.com/document/d/1nqdFEyULekyksFHtFvgvFAYE-0AMHKoS3RMnaKsarjs)
### Community Call
Every two weeks we host a community call to showcase new features, review upcoming milestones, and engage in a Q&A. All are welcome!
- Bi-weekly Community Call:
- [Meeting Notes](https://docs.google.com/document/d/1nqdFEyULekyksFHtFvgvFAYE-0AMHKoS3RMnaKsarjs).
- [Video Records](https://www.youtube.com/channel/UCSCTHhGI5XJ0SEhDHVakPAA/videos).
- Bi-weekly Chinese Community Call:
- [Video Records](https://space.bilibili.com/180074935/channel/seriesdetail?sid=1842207).
## Talks and Conferences
| Engagement | Link |
|:-----------|:------------|
| 🎤 Talks | - [KubeVela - The Modern App Delivery System in Alibaba](https://docs.google.com/presentation/d/1CWCLcsKpDQB3bBDTfdv2BZ8ilGGJv2E8L-iOA5HMrV0/edit?usp=sharing) |
| 🌎 KubeCon | - [ [NA 2020] Standardizing Cloud Native Application Delivery Across Different Clouds](https://www.youtube.com/watch?v=0yhVuBIbHcI) <br> - [ [EU 2021] Zero Pain Microservice Development and Deployment with Dapr and KubeVela](https://sched.co/iE4S) |
| 📺 Conferences | - [Dapr, Rudr, OAM: Mark Russinovich presents next gen app development & deployment](https://www.youtube.com/watch?v=eJCu6a-x9uo) <br> - [Mark Russinovich presents "The Future of Cloud Native Applications with OAM and Dapr"](https://myignite.techcommunity.microsoft.com/sessions/82059)|
Check out [KubeVela videos](https://kubevela.io/videos/talks/en/oam-dapr) for these talks and conferences.
## Contributing
Check out [CONTRIBUTING](./CONTRIBUTING.md) to see how to develop with KubeVela.
Check out [CONTRIBUTING](https://kubevela.io/docs/contributor/overview) to see how to develop with KubeVela.
## Report Vulnerability
Security is a first priority thing for us at KubeVela. If you come across a related issue, please send email to security@mail.kubevela.io .
## Code of Conduct
KubeVela adopts [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).

View File

@@ -1,11 +1,11 @@
/*
Copyright 2019 The Crossplane Authors.
Copyright 2022 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,5 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package workloads provides workloads related controllers.
package workloads
package common
const (
// Group api group name
Group = "core.oam.dev"
)

View File

@@ -17,12 +17,20 @@ limitations under the License.
package common
import (
"encoding/json"
"errors"
types "github.com/oam-dev/terraform-controller/api/types/crossplane-runtime"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
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"
)
// Kube defines the encapsulation in raw Kubernetes resource format
@@ -109,6 +117,29 @@ type Terraform struct {
// +kubebuilder:default:=hcl
// +kubebuilder:validation:Enum:=hcl;json;remote
Type string `json:"type,omitempty"`
// Path is the sub-directory of remote git repository. It's valid when remote is set
Path string `json:"path,omitempty"`
// WriteConnectionSecretToReference specifies the namespace and name of a
// Secret to which any connection details for this managed resource should
// be written. Connection details frequently include the endpoint, username,
// and password required to connect to the managed resource.
// +optional
WriteConnectionSecretToReference *types.SecretReference `json:"writeConnectionSecretToRef,omitempty"`
// ProviderReference specifies the reference to Provider
ProviderReference *types.Reference `json:"providerRef,omitempty"`
// DeleteResource will determine whether provisioned cloud resources will be deleted when CR is deleted
// +kubebuilder:default:=true
DeleteResource bool `json:"deleteResource,omitempty"`
// Region is cloud provider's region. It will override the region in the region field of ProviderReference
Region string `json:"customRegion,omitempty"`
// GitCredentialsSecretReference specifies the reference to the secret containing the git credentials
GitCredentialsSecretReference *corev1.SecretReference `json:"gitCredentialsSecretReference,omitempty"`
}
// A WorkloadTypeDescriptor refer to a Workload Type
@@ -157,12 +188,10 @@ type Status struct {
HealthPolicy string `json:"healthPolicy,omitempty"`
}
// ApplicationPhase is a label for the condition of a application at the current time
// ApplicationPhase is a label for the condition of an application at the current time
type ApplicationPhase string
const (
// ApplicationRollingOut means the app is in the middle of rolling out
ApplicationRollingOut ApplicationPhase = "rollingOut"
// ApplicationStarting means the app is preparing for reconcile
ApplicationStarting ApplicationPhase = "starting"
// ApplicationRendering means the app is rendering
@@ -175,32 +204,42 @@ const (
ApplicationWorkflowSuspending ApplicationPhase = "workflowSuspending"
// ApplicationWorkflowTerminated means the app's workflow is terminated
ApplicationWorkflowTerminated ApplicationPhase = "workflowTerminated"
// ApplicationWorkflowFinished means the app's workflow is finished
ApplicationWorkflowFinished ApplicationPhase = "workflowFinished"
// ApplicationWorkflowFailed means the app's workflow is failed
ApplicationWorkflowFailed ApplicationPhase = "workflowFailed"
// ApplicationRunning means the app finished rendering and applied result to the cluster
ApplicationRunning ApplicationPhase = "running"
// ApplicationUnhealthy means the app finished rendering and applied result to the cluster, but still unhealthy
ApplicationUnhealthy ApplicationPhase = "unhealthy"
// ApplicationDeleting means application is being deleted
ApplicationDeleting ApplicationPhase = "deleting"
)
// WorkflowState is a string that mark the workflow state
type WorkflowState string
const (
// WorkflowStateInitializing means the workflow is in initial state
WorkflowStateInitializing WorkflowState = "Initializing"
// WorkflowStateTerminated means workflow is terminated manually, and it won't be started unless the spec changed.
WorkflowStateTerminated WorkflowState = "terminated"
WorkflowStateTerminated WorkflowState = "Terminated"
// WorkflowStateSuspended means workflow is suspended manually, and it can be resumed.
WorkflowStateSuspended WorkflowState = "suspended"
// WorkflowStateFinished means workflow is running successfully, all steps finished.
WorkflowStateFinished WorkflowState = "finished"
WorkflowStateSuspended WorkflowState = "Suspended"
// WorkflowStateSucceeded means workflow is running successfully, all steps finished.
WorkflowStateSucceeded WorkflowState = "Succeeded"
// WorkflowStateFinished means workflow is end.
WorkflowStateFinished WorkflowState = "Finished"
// WorkflowStateExecuting means workflow is still running or waiting some steps.
WorkflowStateExecuting WorkflowState = "executing"
WorkflowStateExecuting WorkflowState = "Executing"
// WorkflowStateSkipping means it will skip this reconcile and let next reconcile to handle it.
WorkflowStateSkipping WorkflowState = "Skipping"
)
// ApplicationComponentStatus record the health status of App component
type ApplicationComponentStatus struct {
Name string `json:"name"`
Env string `json:"env,omitempty"`
Name string `json:"name"`
Namespace string `json:"namespace,omitempty"`
Cluster string `json:"cluster,omitempty"`
Env string `json:"env,omitempty"`
// WorkloadDefinition is the definition of a WorkloadDefinition, such as deployments/apps.v1
WorkloadDefinition WorkloadGVK `json:"workloadDefinition,omitempty"`
Healthy bool `json:"healthy"`
@@ -209,6 +248,12 @@ type ApplicationComponentStatus struct {
Scopes []corev1.ObjectReference `json:"scopes,omitempty"`
}
// Equal check if two ApplicationComponentStatus are equal
func (in ApplicationComponentStatus) Equal(r ApplicationComponentStatus) bool {
return in.Name == r.Name && in.Namespace == r.Namespace &&
in.Cluster == r.Cluster && in.Env == r.Env
}
// ApplicationTraitStatus records the trait health status
type ApplicationTraitStatus struct {
Type string `json:"type"`
@@ -232,31 +277,6 @@ type RawComponent struct {
Raw runtime.RawExtension `json:"raw"`
}
// WorkflowStepStatus record the status of a workflow step
type WorkflowStepStatus 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"`
SubSteps *SubStepsStatus `json:"subSteps,omitempty"`
}
// WorkflowSubStepStatus record the status of a workflow step
type WorkflowSubStepStatus 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"`
}
// AppStatus defines the observed state of Application
type AppStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
@@ -267,8 +287,6 @@ type AppStatus struct {
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
Rollout AppRolloutStatus `json:"rollout,omitempty"`
Phase ApplicationPhase `json:"status,omitempty"`
// Components record the related Components created by Application Controller
@@ -277,9 +295,6 @@ type AppStatus struct {
// Services record the status of the application services
Services []ApplicationComponentStatus `json:"services,omitempty"`
// ResourceTracker record the status of the ResourceTracker
ResourceTracker *corev1.ObjectReference `json:"resourceTracker,omitempty"`
// Workflow record the status of workflow
Workflow *WorkflowStatus `json:"workflow,omitempty"`
@@ -289,41 +304,42 @@ type AppStatus struct {
// AppliedResources record the resources that the workflow step apply.
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"`
// +kubebuilder:pruning:PreserveUnknownFields
Status *runtime.RawExtension `json:"status,omitempty"`
}
// WorkflowStatus record the status of workflow
type WorkflowStatus struct {
AppRevision string `json:"appRevision,omitempty"`
Mode WorkflowMode `json:"mode"`
AppRevision string `json:"appRevision,omitempty"`
Mode string `json:"mode"`
Phase workflowv1alpha1.WorkflowRunPhase `json:"status,omitempty"`
Message string `json:"message,omitempty"`
Suspend bool `json:"suspend"`
SuspendState string `json:"suspendState,omitempty"`
Suspend bool `json:"suspend"`
Terminated bool `json:"terminated"`
Finished bool `json:"finished"`
ContextBackend *corev1.ObjectReference `json:"contextBackend,omitempty"`
Steps []WorkflowStepStatus `json:"steps,omitempty"`
ContextBackend *corev1.ObjectReference `json:"contextBackend,omitempty"`
Steps []workflowv1alpha1.WorkflowStepStatus `json:"steps,omitempty"`
StartTime metav1.Time `json:"startTime,omitempty"`
// +nullable
EndTime metav1.Time `json:"endTime,omitempty"`
}
// SubStepsStatus record the status of workflow steps.
type SubStepsStatus struct {
StepIndex int `json:"stepIndex,omitempty"`
Mode WorkflowMode `json:"mode,omitempty"`
Steps []WorkflowSubStepStatus `json:"steps,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 make the controller stop the workflow and report error in `message`.
WorkflowStepPhaseFailed WorkflowStepPhase = "failed"
// WorkflowStepPhaseStopped will make the controller stop the workflow.
WorkflowStepPhaseStopped WorkflowStepPhase = "stopped"
// WorkflowStepPhaseRunning will make the controller continue the workflow.
WorkflowStepPhaseRunning WorkflowStepPhase = "running"
)
// DefinitionType describes the type of DefinitionRevision.
// +kubebuilder:validation:Enum=Component;Trait;Policy;WorkflowStep
type DefinitionType string
@@ -342,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"`
@@ -369,7 +375,7 @@ type AppRolloutStatus struct {
type ApplicationTrait struct {
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
}
// ApplicationComponent describe the component of application
@@ -379,11 +385,11 @@ type ApplicationComponent struct {
// ExternalRevision specified the component revisionName
ExternalRevision string `json:"externalRevision,omitempty"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs StepInputs `json:"inputs,omitempty"`
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"`
@@ -392,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.
@@ -436,19 +430,176 @@ 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 string = "debug"
)
// OAMObjectReference defines the object reference for an oam resource
type OAMObjectReference struct {
Component string `json:"component,omitempty"`
Trait string `json:"trait,omitempty"`
Env string `json:"env,omitempty"`
}
// Equal check if two references are equal
func (in OAMObjectReference) Equal(r OAMObjectReference) bool {
return in.Component == r.Component && in.Trait == r.Trait && in.Env == r.Env
}
// AddLabelsToObject add labels to object if properties are not empty
func (in OAMObjectReference) AddLabelsToObject(obj client.Object) {
labels := obj.GetLabels()
if labels == nil {
labels = map[string]string{}
}
if in.Component != "" {
labels[oam.LabelAppComponent] = in.Component
}
if in.Trait != "" {
labels[oam.TraitTypeLabel] = in.Trait
}
if in.Env != "" {
labels[oam.LabelAppEnv] = in.Env
}
obj.SetLabels(labels)
}
// NewOAMObjectReferenceFromObject create OAMObjectReference from object
func NewOAMObjectReferenceFromObject(obj client.Object) OAMObjectReference {
if labels := obj.GetLabels(); labels != nil {
return OAMObjectReference{
Component: labels[oam.LabelAppComponent],
Trait: labels[oam.TraitTypeLabel],
Env: labels[oam.LabelAppEnv],
}
}
return OAMObjectReference{}
}
// ClusterObjectReference defines the object reference with cluster.
type ClusterObjectReference struct {
Cluster string `json:"cluster,omitempty"`
Creator ResourceCreatorRole `json:"creator,omitempty"`
Cluster string `json:"cluster,omitempty"`
Creator string `json:"creator,omitempty"`
corev1.ObjectReference `json:",inline"`
}
// Equal check if two references are equal
func (in ClusterObjectReference) Equal(r ClusterObjectReference) bool {
return in.APIVersion == r.APIVersion && in.Kind == r.Kind && in.Name == r.Name && in.Namespace == r.Namespace && in.UID == r.UID && in.Creator == r.Creator && in.Cluster == r.Cluster
}
// RawExtensionPointer is the pointer of raw extension
type RawExtensionPointer struct {
RawExtension *runtime.RawExtension
}
// MarshalJSON may get called on pointers or values, so implement MarshalJSON on value.
// http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go
func (re RawExtensionPointer) MarshalJSON() ([]byte, error) {
if re.RawExtension == nil {
return nil, nil
}
if re.RawExtension.Raw == nil {
// TODO: this is to support legacy behavior of JSONPrinter and YAMLPrinter, which
// expect to call json.Marshal on arbitrary versioned objects (even those not in
// the scheme). pkg/kubectl/resource#AsVersionedObjects and its interaction with
// kubectl get on objects not in the scheme needs to be updated to ensure that the
// objects that are not part of the scheme are correctly put into the right form.
if re.RawExtension.Object != nil {
return json.Marshal(re.RawExtension.Object)
}
return []byte("null"), nil
}
// TODO: Check whether ContentType is actually JSON before returning it.
return re.RawExtension.Raw, nil
}
// ApplicationConditionType is a valid value for ApplicationCondition.Type
type ApplicationConditionType int
const (
// ParsedCondition indicates whether the parsing is successful.
ParsedCondition ApplicationConditionType = iota
// RevisionCondition indicates whether the generated revision is successful.
RevisionCondition
// PolicyCondition indicates whether policy processing is successful.
PolicyCondition
// RenderCondition indicates whether render processing is successful.
RenderCondition
// WorkflowCondition indicates whether workflow processing is successful.
WorkflowCondition
// RolloutCondition indicates whether rollout processing is successful.
RolloutCondition
// ReadyCondition indicates whether whole application processing is successful.
ReadyCondition
)
var conditions = map[ApplicationConditionType]string{
ParsedCondition: "Parsed",
RevisionCondition: "Revision",
PolicyCondition: "Policy",
RenderCondition: "Render",
WorkflowCondition: "Workflow",
RolloutCondition: "Rollout",
ReadyCondition: "Ready",
}
// String returns the string corresponding to the condition type.
func (ct ApplicationConditionType) String() string {
return conditions[ct]
}
// ParseApplicationConditionType parse ApplicationCondition Type.
func ParseApplicationConditionType(s string) (ApplicationConditionType, error) {
for k, v := range conditions {
if v == s {
return k, nil
}
}
return -1, errors.New("unknown condition type")
}
// ReferredObject the referred Kubernetes object
type ReferredObject struct {
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
runtime.RawExtension `json:",inline"`
}
// ReferredObjectList a list of referred Kubernetes objects
type ReferredObjectList struct {
// Objects a list of Kubernetes objects.
// +optional
Objects []ReferredObject `json:"objects,omitempty"`
}
// ContainerState defines the state of a container
type ContainerState string
const (
// ContainerRunning indicates the container is running
ContainerRunning ContainerState = "Running"
// ContainerWaiting indicates the container is waiting
ContainerWaiting ContainerState = "Waiting"
// ContainerTerminated indicates the container is terminated
ContainerTerminated ContainerState = "Terminated"
)
// ContainerStateToString convert the container state to string
func ContainerStateToString(state corev1.ContainerState) string {
switch {
case state.Running != nil:
return "Running"
case state.Waiting != nil:
return "Waiting"
case state.Terminated != nil:
return "Terminated"
default:
return "Unknown"
}
}

View File

@@ -0,0 +1,74 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package common
import (
"testing"
"github.com/stretchr/testify/require"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
func TestOAMObjectReference(t *testing.T) {
r := require.New(t)
o1 := OAMObjectReference{
Component: "component",
Trait: "trait",
Env: "env",
}
obj := &unstructured.Unstructured{}
o2 := NewOAMObjectReferenceFromObject(obj)
r.False(o2.Equal(o1))
o1.AddLabelsToObject(obj)
r.Equal(3, len(obj.GetLabels()))
o3 := NewOAMObjectReferenceFromObject(obj)
r.True(o1.Equal(o3))
o3.Component = "comp"
r.False(o3.Equal(o1))
r.True(o1.Equal(*o1.DeepCopy()))
o4 := OAMObjectReference{}
o1.DeepCopyInto(&o4)
r.True(o4.Equal(o1))
}
func TestClusterObjectReference(t *testing.T) {
r := require.New(t)
o1 := ClusterObjectReference{
Cluster: "cluster",
ObjectReference: v1.ObjectReference{Kind: "kind"},
}
o2 := *o1.DeepCopy()
r.True(o1.Equal(o2))
o2.Cluster = "c"
r.False(o2.Equal(o1))
}
func TestContainerStateToString(t *testing.T) {
r := require.New(t)
r.Equal("Waiting", ContainerStateToString(v1.ContainerState{
Waiting: &v1.ContainerStateWaiting{},
}))
r.Equal("Running", ContainerStateToString(v1.ContainerState{
Running: &v1.ContainerStateRunning{},
}))
r.Equal("Terminated", ContainerStateToString(v1.ContainerState{
Terminated: &v1.ContainerStateTerminated{},
}))
r.Equal("Unknown", ContainerStateToString(v1.ContainerState{}))
}

View File

@@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
@@ -21,7 +22,10 @@ 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"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@@ -44,7 +48,6 @@ func (in *AppRolloutStatus) DeepCopy() *AppRolloutStatus {
func (in *AppStatus) DeepCopyInto(out *AppStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
in.Rollout.DeepCopyInto(&out.Rollout)
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]v1.ObjectReference, len(*in))
@@ -57,11 +60,6 @@ func (in *AppStatus) DeepCopyInto(out *AppStatus) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.ResourceTracker != nil {
in, out := &in.ResourceTracker, &out.ResourceTracker
*out = new(v1.ObjectReference)
**out = **in
}
if in.Workflow != nil {
in, out := &in.Workflow, &out.Workflow
*out = new(WorkflowStatus)
@@ -77,6 +75,13 @@ func (in *AppStatus) DeepCopyInto(out *AppStatus) {
*out = make([]ClusterObjectReference, len(*in))
copy(*out, *in)
}
if in.PolicyStatus != nil {
in, out := &in.PolicyStatus, &out.PolicyStatus
*out = make([]PolicyStatus, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppStatus.
@@ -92,7 +97,11 @@ func (in *AppStatus) DeepCopy() *AppStatus {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationComponent) DeepCopyInto(out *ApplicationComponent) {
*out = *in
in.Properties.DeepCopyInto(&out.Properties)
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
if in.DependsOn != nil {
in, out := &in.DependsOn, &out.DependsOn
*out = make([]string, len(*in))
@@ -100,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 {
@@ -163,7 +172,11 @@ func (in *ApplicationComponentStatus) DeepCopy() *ApplicationComponentStatus {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationTrait) DeepCopyInto(out *ApplicationTrait) {
*out = *in
in.Properties.DeepCopyInto(&out.Properties)
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationTrait.
@@ -387,6 +400,41 @@ func (in *KubeParameter) DeepCopy() *KubeParameter {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OAMObjectReference) DeepCopyInto(out *OAMObjectReference) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAMObjectReference.
func (in *OAMObjectReference) DeepCopy() *OAMObjectReference {
if in == nil {
return nil
}
out := new(OAMObjectReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PolicyStatus) DeepCopyInto(out *PolicyStatus) {
*out = *in
if in.Status != nil {
in, out := &in.Status, &out.Status
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyStatus.
func (in *PolicyStatus) DeepCopy() *PolicyStatus {
if in == nil {
return nil
}
out := new(PolicyStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RawComponent) DeepCopyInto(out *RawComponent) {
*out = *in
@@ -403,6 +451,64 @@ func (in *RawComponent) DeepCopy() *RawComponent {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RawExtensionPointer) DeepCopyInto(out *RawExtensionPointer) {
*out = *in
if in.RawExtension != nil {
in, out := &in.RawExtension, &out.RawExtension
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawExtensionPointer.
func (in *RawExtensionPointer) DeepCopy() *RawExtensionPointer {
if in == nil {
return nil
}
out := new(RawExtensionPointer)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReferredObject) DeepCopyInto(out *ReferredObject) {
*out = *in
in.RawExtension.DeepCopyInto(&out.RawExtension)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReferredObject.
func (in *ReferredObject) DeepCopy() *ReferredObject {
if in == nil {
return nil
}
out := new(ReferredObject)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReferredObjectList) DeepCopyInto(out *ReferredObjectList) {
*out = *in
if in.Objects != nil {
in, out := &in.Objects, &out.Objects
*out = make([]ReferredObject, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReferredObjectList.
func (in *ReferredObjectList) DeepCopy() *ReferredObjectList {
if in == nil {
return nil
}
out := new(ReferredObjectList)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Revision) DeepCopyInto(out *Revision) {
*out = *in
@@ -439,7 +545,7 @@ func (in *Schematic) DeepCopyInto(out *Schematic) {
if in.Terraform != nil {
in, out := &in.Terraform, &out.Terraform
*out = new(Terraform)
**out = **in
(*in).DeepCopyInto(*out)
}
}
@@ -468,67 +574,24 @@ 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 *SubStepsStatus) DeepCopyInto(out *SubStepsStatus) {
*out = *in
if in.Steps != nil {
in, out := &in.Steps, &out.Steps
*out = make([]WorkflowSubStepStatus, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubStepsStatus.
func (in *SubStepsStatus) DeepCopy() *SubStepsStatus {
if in == nil {
return nil
}
out := new(SubStepsStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Terraform) DeepCopyInto(out *Terraform) {
*out = *in
if in.WriteConnectionSecretToReference != nil {
in, out := &in.WriteConnectionSecretToReference, &out.WriteConnectionSecretToReference
*out = new(crossplane_runtime.SecretReference)
**out = **in
}
if in.ProviderReference != nil {
in, out := &in.ProviderReference, &out.ProviderReference
*out = new(crossplane_runtime.Reference)
**out = **in
}
if in.GitCredentialsSecretReference != nil {
in, out := &in.GitCredentialsSecretReference, &out.GitCredentialsSecretReference
*out = new(v1.SecretReference)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Terraform.
@@ -551,11 +614,13 @@ func (in *WorkflowStatus) DeepCopyInto(out *WorkflowStatus) {
}
if in.Steps != nil {
in, out := &in.Steps, &out.Steps
*out = make([]WorkflowStepStatus, len(*in))
*out = make([]v1alpha1.WorkflowStepStatus, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
in.StartTime.DeepCopyInto(&out.StartTime)
in.EndTime.DeepCopyInto(&out.EndTime)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStatus.
@@ -568,41 +633,6 @@ func (in *WorkflowStatus) DeepCopy() *WorkflowStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowStepStatus) DeepCopyInto(out *WorkflowStepStatus) {
*out = *in
if in.SubSteps != nil {
in, out := &in.SubSteps, &out.SubSteps
*out = new(SubStepsStatus)
(*in).DeepCopyInto(*out)
}
}
// 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 *WorkflowSubStepStatus) DeepCopyInto(out *WorkflowSubStepStatus) {
*out = *in
}
// 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

@@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*

View File

@@ -0,0 +1,78 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
const (
// ApplyOncePolicyType refers to the type of configuration drift policy
ApplyOncePolicyType = "apply-once"
// 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"`
// +optional
Rules []ApplyOncePolicyRule `json:"rules,omitempty"`
}
// ApplyOncePolicyRule defines a single apply-once policy rule
type ApplyOncePolicyRule struct {
// +optional
Selector ResourcePolicyRuleSelector `json:"selector,omitempty"`
// +optional
Strategy *ApplyOnceStrategy `json:"strategy,omitempty"`
}
// ApplyOnceStrategy the strategy for resource path to allow configuration drift
type ApplyOnceStrategy struct {
// Path the specified path that allow configuration drift
// like 'spec.template.spec.containers[0].resources' and '*' means the whole target allow configuration drift
Path []string `json:"path"`
// ApplyOnceAffectStrategy Decide when the strategy will take effect
// like affect:onUpdate/onStateKeep/always
ApplyOnceAffectStrategy ApplyOnceAffectStrategy `json:"affect"`
}
// Type the type name of the policy
func (in *ApplyOncePolicySpec) Type() string {
return ApplyOncePolicyType
}
// FindStrategy find apply-once strategy for target resource
func (in *ApplyOncePolicySpec) FindStrategy(manifest *unstructured.Unstructured) *ApplyOnceStrategy {
if !in.Enable {
return nil
}
for _, rule := range in.Rules {
if rule.Selector.Match(manifest) {
return rule.Strategy
}
}
return nil
}

View File

@@ -0,0 +1,76 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
const (
// RefObjectsComponentType refers to the type of ref-objects
RefObjectsComponentType = "ref-objects"
)
// RefObjectsComponentSpec defines the spec of ref-objects component
type RefObjectsComponentSpec struct {
// Objects the referrers to the Kubernetes objects
Objects []ObjectReferrer `json:"objects,omitempty"`
// URLs are the links that stores the referred objects
URLs []string `json:"urls,omitempty"`
}
// ObjectReferrer selects Kubernetes objects
type ObjectReferrer struct {
// ObjectTypeIdentifier identifies the type of referred objects
ObjectTypeIdentifier `json:",inline"`
// ObjectSelector select object by name or labelSelector
ObjectSelector `json:",inline"`
}
// ObjectTypeIdentifier identifies the scheme of Kubernetes object
type ObjectTypeIdentifier struct {
// Resource is the resource name of the Kubernetes object.
Resource string `json:"resource"`
// Group is the API Group of the Kubernetes object.
Group string `json:"group"`
// LegacyObjectTypeIdentifier is the legacy identifier
// Deprecated: use resource/group instead
LegacyObjectTypeIdentifier `json:",inline"`
}
// LegacyObjectTypeIdentifier legacy object type identifier
type LegacyObjectTypeIdentifier struct {
// APIVersion is the APIVersion of the Kubernetes object.
APIVersion string `json:"apiVersion"`
// APIVersion is the Kind of the Kubernetes object.
Kind string `json:"kind"`
}
// ObjectSelector selector for Kubernetes object
type ObjectSelector struct {
// Name is the name of the Kubernetes object.
// If empty, it will inherit the application component's name.
Name string `json:"name,omitempty"`
// Namespace is the namespace for selecting Kubernetes objects.
// If empty, it will inherit the application's namespace.
Namespace string `json:"namespace,omitempty"`
// Cluster is the cluster for selecting Kubernetes objects.
// If empty, it will use the local cluster
Cluster string `json:"cluster,omitempty"`
// LabelSelector selects Kubernetes objects by labels
// Exclusive to "name"
LabelSelector map[string]string `json:"labelSelector,omitempty"`
// DeprecatedLabelSelector a deprecated alias to LabelSelector
// Deprecated: use labelSelector instead.
DeprecatedLabelSelector map[string]string `json:"selector,omitempty"`
}

View File

@@ -17,48 +17,63 @@
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// ClusterManagementEngine represents a multi-cluster management solution
type ClusterManagementEngine string
const (
// OCMEngine represents Open-Cluster-Management multi-cluster management solution
OCMEngine ClusterManagementEngine = "ocm"
// SingleClusterEngine represents single cluster ClusterManagerEngine
SingleClusterEngine ClusterManagementEngine = "single-cluster"
// ClusterGatewayEngine represents multi-cluster management solution with cluster-gateway
ClusterGatewayEngine ClusterManagementEngine = "cluster-gateway"
// EnvBindingPolicyType refers to the type of EnvBinding
EnvBindingPolicyType = "env-binding"
)
// EnvBindingPhase is a label for the condition of a EnvBinding at the current time
type EnvBindingPhase string
// EnvTraitPatch is the patch to trait
type EnvTraitPatch struct {
Type string `json:"type"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
Disable bool `json:"disable,omitempty"`
}
const (
// EnvBindingPrepare means EnvBinding is preparing the pre-work for cluster scheduling
EnvBindingPrepare EnvBindingPhase = "preparing"
// ToApplicationTrait convert EnvTraitPatch into ApplicationTrait
func (in *EnvTraitPatch) ToApplicationTrait() *common.ApplicationTrait {
out := &common.ApplicationTrait{Type: in.Type}
if in.Properties != nil {
out.Properties = in.Properties.DeepCopy()
}
return out
}
// EnvBindingRendering means EnvBinding is rendering the apps in different envs
EnvBindingRendering EnvBindingPhase = "rendering"
// EnvComponentPatch is the patch to component
type EnvComponentPatch struct {
Name string `json:"name"`
Type string `json:"type"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
Traits []EnvTraitPatch `json:"traits,omitempty"`
ExternalRevision string `json:"externalRevision,omitempty"`
}
// EnvBindingScheduling means EnvBinding is deciding which cluster the apps is scheduled to.
EnvBindingScheduling EnvBindingPhase = "scheduling"
// EnvBindingFinished means EnvBinding finished env binding
EnvBindingFinished EnvBindingPhase = "finished"
)
// ToApplicationComponent convert EnvComponentPatch into ApplicationComponent
func (in *EnvComponentPatch) ToApplicationComponent() *common.ApplicationComponent {
out := &common.ApplicationComponent{
Name: in.Name,
Type: in.Type,
}
if in.Properties != nil {
out.Properties = in.Properties.DeepCopy()
}
if in.Traits != nil {
for _, trait := range in.Traits {
if !trait.Disable {
out.Traits = append(out.Traits, *trait.ToApplicationTrait())
}
}
}
return out
}
// EnvPatch specify the parameter configuration for different environments
type EnvPatch struct {
Components []common.ApplicationComponent `json:"components"`
Components []EnvComponentPatch `json:"components,omitempty"`
}
// NamespaceSelector defines the rules to select a Namespace resource.
@@ -82,94 +97,51 @@ type EnvSelector struct {
}
// EnvConfig is the configuration for different environments.
// Deprecated
type EnvConfig struct {
Name string `json:"name"`
Placement EnvPlacement `json:"placement,omitempty"`
Selector *EnvSelector `json:"selector,omitempty"`
Patch EnvPatch `json:"patch"`
Patch EnvPatch `json:"patch,omitempty"`
}
// AppTemplate represents a application to be configured.
type AppTemplate struct {
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
runtime.RawExtension `json:",inline"`
}
// ClusterDecision recorded the mapping of environment and cluster
type ClusterDecision struct {
Env string `json:"env"`
Cluster string `json:"cluster,omitempty"`
Namespace string `json:"namespace,omitempty"`
}
// A ConfigMapReference is a reference to a configMap in an arbitrary namespace.
type ConfigMapReference struct {
// Name of the secret.
Name string `json:"name"`
// Namespace of the secret.
Namespace string `json:"namespace,omitempty"`
}
// A EnvBindingSpec defines the desired state of a EnvBinding.
// EnvBindingSpec defines a list of envs
// Deprecated This spec is deprecated and replaced by Topology/Override Policy
type EnvBindingSpec struct {
Engine ClusterManagementEngine `json:"engine,omitempty"`
// AppTemplate indicates the application template.
AppTemplate AppTemplate `json:"appTemplate"`
Envs []EnvConfig `json:"envs"`
// OutputResourcesTo specifies the namespace and name of a ConfigMap
// which store the resources rendered after differentiated configuration
// +optional
OutputResourcesTo *ConfigMapReference `json:"outputResourcesTo,omitempty"`
}
// A EnvBindingStatus is the status of EnvBinding
// PlacementDecision describes the placement of one application instance
type PlacementDecision struct {
Cluster string `json:"cluster"`
Namespace string `json:"namespace"`
}
// String encode placement decision
func (in PlacementDecision) String() string {
if in.Namespace == "" {
return in.Cluster
}
return in.Cluster + "/" + in.Namespace
}
// 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 {
// ConditionedStatus reflects the observed status of a resource
condition.ConditionedStatus `json:",inline"`
Phase EnvBindingPhase `json:"phase,omitempty"`
ClusterDecisions []ClusterDecision `json:"clusterDecisions,omitempty"`
// ResourceTracker record the status of the ResourceTracker
ResourceTracker *corev1.ObjectReference `json:"resourceTracker,omitempty"`
}
// EnvBinding is the Schema for the EnvBinding API
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=envbind
// +kubebuilder:printcolumn:name="ENGINE",type=string,JSONPath=`.spec.engine`
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type EnvBinding struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec EnvBindingSpec `json:"spec,omitempty"`
Status EnvBindingStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// EnvBindingList contains a list of EnvBinding.
type EnvBindingList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []EnvBinding `json:"items"`
}
// SetConditions set condition for EnvBinding
func (e *EnvBinding) SetConditions(c ...condition.Condition) {
e.Status.SetConditions(c...)
}
// GetCondition gets condition from EnvBinding
func (e *EnvBinding) GetCondition(conditionType condition.ConditionType) condition.Condition {
return e.Status.GetCondition(conditionType)
Envs []EnvStatus `json:"envs"`
ClusterConnections []ClusterConnection `json:"clusterConnections"`
}

View File

@@ -0,0 +1,49 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
// +kubebuilder:object:root=true
// Policy is the Schema for the policy API
// +kubebuilder:storageversion
// +kubebuilder:resource:categories={oam}
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.type`
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Policy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties *runtime.RawExtension `json:"properties,omitempty"`
}
// +kubebuilder:object:root=true
// PolicyList contains a list of Policy
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type PolicyList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Policy `json:"items"`
}

View File

@@ -0,0 +1,82 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
const (
// GarbageCollectPolicyType refers to the type of garbage-collect
GarbageCollectPolicyType = "garbage-collect"
)
// GarbageCollectPolicySpec defines the spec of configuration drift
type GarbageCollectPolicySpec struct {
// KeepLegacyResource if is set, outdated versioned resourcetracker will not be recycled automatically
// outdated resources will be kept until resourcetracker be deleted manually
KeepLegacyResource bool `json:"keepLegacyResource,omitempty"`
// Order defines the order of garbage collect
Order GarbageCollectOrder `json:"order,omitempty"`
// Rules defines list of rules to control gc strategy at resource level
// if one resource is controlled by multiple rules, first rule will be used
Rules []GarbageCollectPolicyRule `json:"rules,omitempty"`
}
// GarbageCollectOrder is the order of garbage collect
type GarbageCollectOrder string
const (
// OrderDependency is the order of dependency
OrderDependency GarbageCollectOrder = "dependency"
)
// GarbageCollectPolicyRule defines a single garbage-collect policy rule
type GarbageCollectPolicyRule struct {
Selector ResourcePolicyRuleSelector `json:"selector"`
Strategy GarbageCollectStrategy `json:"strategy"`
}
// GarbageCollectStrategy the strategy for target resource to recycle
type GarbageCollectStrategy string
const (
// GarbageCollectStrategyNever do not recycle target resource, leave it
GarbageCollectStrategyNever GarbageCollectStrategy = "never"
// GarbageCollectStrategyOnAppDelete do not recycle target resource until application is deleted
// this means the resource will be kept even it is not used in the latest version
GarbageCollectStrategyOnAppDelete GarbageCollectStrategy = "onAppDelete"
// GarbageCollectStrategyOnAppUpdate recycle target resource when it is not inUse
GarbageCollectStrategyOnAppUpdate GarbageCollectStrategy = "onAppUpdate"
)
// Type the type name of the policy
func (in *GarbageCollectPolicySpec) Type() string {
return GarbageCollectPolicyType
}
// FindStrategy find gc strategy for target resource
func (in *GarbageCollectPolicySpec) FindStrategy(manifest *unstructured.Unstructured) *GarbageCollectStrategy {
for _, rule := range in.Rules {
if rule.Selector.Match(manifest) {
return &rule.Strategy
}
}
return nil
}

View File

@@ -0,0 +1,137 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
"testing"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"github.com/oam-dev/kubevela/pkg/oam"
)
func TestGarbageCollectPolicySpec_FindStrategy(t *testing.T) {
testCases := map[string]struct {
rules []GarbageCollectPolicyRule
input *unstructured.Unstructured
notFound bool
expectStrategy GarbageCollectStrategy
}{
"trait type rule match": {
rules: []GarbageCollectPolicyRule{{
Selector: ResourcePolicyRuleSelector{TraitTypes: []string{"a"}},
Strategy: GarbageCollectStrategyNever,
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{oam.TraitTypeLabel: "a"},
},
}},
expectStrategy: GarbageCollectStrategyNever,
},
"trait type rule mismatch": {
rules: []GarbageCollectPolicyRule{{
Selector: ResourcePolicyRuleSelector{TraitTypes: []string{"a"}},
Strategy: GarbageCollectStrategyNever,
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{}},
notFound: true,
},
"trait type rule multiple match": {
rules: []GarbageCollectPolicyRule{{
Selector: ResourcePolicyRuleSelector{TraitTypes: []string{"a"}},
Strategy: GarbageCollectStrategyOnAppDelete,
}, {
Selector: ResourcePolicyRuleSelector{TraitTypes: []string{"a"}},
Strategy: GarbageCollectStrategyNever,
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{oam.TraitTypeLabel: "a"},
},
}},
expectStrategy: GarbageCollectStrategyOnAppDelete,
},
"component type rule match": {
rules: []GarbageCollectPolicyRule{{
Selector: ResourcePolicyRuleSelector{CompTypes: []string{"comp"}},
Strategy: GarbageCollectStrategyNever,
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{oam.WorkloadTypeLabel: "comp"},
},
}},
expectStrategy: GarbageCollectStrategyNever,
},
"rule match both component type and trait type, component type first": {
rules: []GarbageCollectPolicyRule{
{
Selector: ResourcePolicyRuleSelector{CompTypes: []string{"comp"}},
Strategy: GarbageCollectStrategyNever,
},
{
Selector: ResourcePolicyRuleSelector{TraitTypes: []string{"trait"}},
Strategy: GarbageCollectStrategyOnAppDelete,
},
},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{oam.WorkloadTypeLabel: "comp", oam.TraitTypeLabel: "trait"},
},
}},
expectStrategy: GarbageCollectStrategyNever,
},
"component name rule match": {
rules: []GarbageCollectPolicyRule{{
Selector: ResourcePolicyRuleSelector{CompNames: []string{"comp-name"}},
Strategy: GarbageCollectStrategyNever,
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{oam.LabelAppComponent: "comp-name"},
},
}},
expectStrategy: GarbageCollectStrategyNever,
},
"resource type rule match": {
rules: []GarbageCollectPolicyRule{{
Selector: ResourcePolicyRuleSelector{OAMResourceTypes: []string{"TRAIT"}},
Strategy: GarbageCollectStrategyNever,
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{oam.LabelOAMResourceType: "TRAIT"},
},
}},
expectStrategy: GarbageCollectStrategyNever,
},
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
r := require.New(t)
spec := GarbageCollectPolicySpec{Rules: tc.rules}
strategy := spec.FindStrategy(tc.input)
if tc.notFound {
r.Nil(strategy)
} else {
r.Equal(tc.expectStrategy, *strategy)
}
})
}
}

View File

@@ -0,0 +1,69 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
const (
// TopologyPolicyType refers to the type of topology policy
TopologyPolicyType = "topology"
// OverridePolicyType refers to the type of override policy
OverridePolicyType = "override"
// DebugPolicyType refers to the type of debug policy
DebugPolicyType = "debug"
// ReplicationPolicyType refers to the type of replication policy
ReplicationPolicyType = "replication"
)
// TopologyPolicySpec defines the spec of topology policy
type TopologyPolicySpec struct {
// Placement embeds the selectors for choosing cluster
Placement `json:",inline"`
// Namespace is the target namespace to deploy in the selected clusters.
// +optional
Namespace string `json:"namespace,omitempty"`
}
// Placement describes which clusters to be selected in this topology
type Placement struct {
// Clusters is the names of the clusters to select.
Clusters []string `json:"clusters,omitempty"`
// ClusterLabelSelector is the label selector for clusters.
// Exclusive to "clusters"
ClusterLabelSelector map[string]string `json:"clusterLabelSelector,omitempty"`
// 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"`
}
// OverridePolicySpec defines the spec of override policy
type OverridePolicySpec struct {
Components []EnvComponentPatch `json:"components,omitempty"`
Selector []string `json:"selector,omitempty"`
}
// 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

@@ -0,0 +1,49 @@
/*
Copyright 2022 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
const (
// ReadOnlyPolicyType refers to the type of read-only policy
ReadOnlyPolicyType = "read-only"
)
// ReadOnlyPolicySpec defines the spec of read-only policy
type ReadOnlyPolicySpec struct {
Rules []ReadOnlyPolicyRule `json:"rules"`
}
// Type the type name of the policy
func (in *ReadOnlyPolicySpec) Type() string {
return ReadOnlyPolicyType
}
// ReadOnlyPolicyRule defines the rule for read-only resources
type ReadOnlyPolicyRule struct {
Selector ResourcePolicyRuleSelector `json:"selector"`
}
// FindStrategy return if the target resource is read-only
func (in *ReadOnlyPolicySpec) FindStrategy(manifest *unstructured.Unstructured) bool {
for _, rule := range in.Rules {
if rule.Selector.Match(manifest) {
return true
}
}
return false
}

View File

@@ -17,15 +17,18 @@
package v1alpha1
import (
"reflect"
"k8s.io/apimachinery/pkg/runtime/schema"
k8sscheme "k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/scheme"
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// Package type metadata.
const (
Group = "core.oam.dev"
Group = common.Group
Version = "v1alpha1"
)
@@ -35,16 +38,25 @@ var (
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
// AddToScheme is a global function that registers this API group & version to a scheme
AddToScheme = SchemeBuilder.AddToScheme
)
// EnvBinding type metadata.
// Policy meta
var (
EnvBindingKind = reflect.TypeOf(EnvBinding{}).Name()
EnvBindingGroupKind = schema.GroupKind{Group: Group, Kind: EnvBindingKind}.String()
EnvBindingKindAPIVersion = EnvBindingKind + "." + SchemeGroupVersion.String()
EnvBindingKindVersionKind = SchemeGroupVersion.WithKind(EnvBindingKind)
PolicyKind = "Policy"
PolicyGroupVersionKind = SchemeGroupVersion.WithKind(PolicyKind)
)
// Workflow meta
var (
WorkflowKind = "Workflow"
WorkflowGroupVersionKind = SchemeGroupVersion.WithKind(WorkflowKind)
)
func init() {
SchemeBuilder.Register(&EnvBinding{}, &EnvBindingList{})
SchemeBuilder.Register(&Policy{}, &PolicyList{})
SchemeBuilder.Register(&workflowv1alpha1.Workflow{}, &workflowv1alpha1.WorkflowList{})
_ = SchemeBuilder.AddToScheme(k8sscheme.Scheme)
}

View File

@@ -0,0 +1,78 @@
/*
Copyright 2022 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/utils/pointer"
stringslices "k8s.io/utils/strings/slices"
"github.com/oam-dev/kubevela/pkg/oam"
)
// ResourcePolicyRuleSelector select the targets of the rule
// if multiple conditions are specified, combination logic is AND
type ResourcePolicyRuleSelector struct {
CompNames []string `json:"componentNames,omitempty"`
CompTypes []string `json:"componentTypes,omitempty"`
OAMResourceTypes []string `json:"oamTypes,omitempty"`
TraitTypes []string `json:"traitTypes,omitempty"`
ResourceTypes []string `json:"resourceTypes,omitempty"`
ResourceNames []string `json:"resourceNames,omitempty"`
}
// Match check if current rule selector match the target resource
// If at least one condition is matched and no other condition failed (could be empty), return true
// Otherwise, return false
func (in *ResourcePolicyRuleSelector) Match(manifest *unstructured.Unstructured) bool {
var compName, compType, oamType, traitType, resourceType, resourceName string
if labels := manifest.GetLabels(); labels != nil {
compName = labels[oam.LabelAppComponent]
compType = labels[oam.WorkloadTypeLabel]
oamType = labels[oam.LabelOAMResourceType]
traitType = labels[oam.TraitTypeLabel]
}
resourceType = manifest.GetKind()
resourceName = manifest.GetName()
match := func(src []string, val string) (found *bool) {
if len(src) == 0 {
return nil
}
return pointer.Bool(val != "" && stringslices.Contains(src, val))
}
conditions := []*bool{
match(in.CompNames, compName),
match(in.CompTypes, compType),
match(in.OAMResourceTypes, oamType),
match(in.TraitTypes, traitType),
match(in.ResourceTypes, resourceType),
match(in.ResourceNames, resourceName),
}
hasMatched := false
for _, cond := range conditions {
// if any non-empty condition failed, return false
if cond != nil && !*cond {
return false
}
// if condition succeed, record it
if cond != nil && *cond {
hasMatched = true
}
}
// if at least one condition is met, return true
return hasMatched
}

View File

@@ -0,0 +1,49 @@
/*
Copyright 2022 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
const (
// SharedResourcePolicyType refers to the type of shared resource policy
SharedResourcePolicyType = "shared-resource"
)
// SharedResourcePolicySpec defines the spec of shared-resource policy
type SharedResourcePolicySpec struct {
Rules []SharedResourcePolicyRule `json:"rules"`
}
// Type the type name of the policy
func (in *SharedResourcePolicySpec) Type() string {
return SharedResourcePolicyType
}
// SharedResourcePolicyRule defines the rule for sharing resources
type SharedResourcePolicyRule struct {
Selector ResourcePolicyRuleSelector `json:"selector"`
}
// FindStrategy return if the target resource should be shared
func (in *SharedResourcePolicySpec) FindStrategy(manifest *unstructured.Unstructured) bool {
for _, rule := range in.Rules {
if rule.Selector.Match(manifest) {
return true
}
}
return false
}

View File

@@ -0,0 +1,69 @@
/*
Copyright 2022 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
"testing"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
func TestSharedResourcePolicySpec_FindStrategy(t *testing.T) {
testCases := map[string]struct {
rules []SharedResourcePolicyRule
input *unstructured.Unstructured
matched bool
}{
"shared resource rule resourceName match": {
rules: []SharedResourcePolicyRule{{
Selector: ResourcePolicyRuleSelector{ResourceNames: []string{"example"}},
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{
"name": "example",
},
}},
matched: true,
},
"shared resource rule resourceType match": {
rules: []SharedResourcePolicyRule{{
Selector: ResourcePolicyRuleSelector{ResourceTypes: []string{"ConfigMap", "Namespace"}},
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"kind": "Namespace",
}},
matched: true,
},
"shared resource rule mismatch": {
rules: []SharedResourcePolicyRule{{
Selector: ResourcePolicyRuleSelector{ResourceNames: []string{"mismatch"}},
}},
input: &unstructured.Unstructured{Object: map[string]interface{}{
"kind": "Namespace",
}},
matched: false,
},
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
r := require.New(t)
spec := SharedResourcePolicySpec{Rules: tc.rules}
r.Equal(tc.matched, spec.FindStrategy(tc.input))
})
}
}

View File

@@ -0,0 +1,49 @@
/*
Copyright 2022 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
const (
// TakeOverPolicyType refers to the type of take-over policy
TakeOverPolicyType = "take-over"
)
// TakeOverPolicySpec defines the spec of take-over policy
type TakeOverPolicySpec struct {
Rules []TakeOverPolicyRule `json:"rules"`
}
// Type the type name of the policy
func (in *TakeOverPolicySpec) Type() string {
return TakeOverPolicyType
}
// TakeOverPolicyRule defines the rule for taking over resources
type TakeOverPolicyRule struct {
Selector ResourcePolicyRuleSelector `json:"selector"`
}
// FindStrategy return if the target resource should be taken over
func (in *TakeOverPolicySpec) FindStrategy(manifest *unstructured.Unstructured) bool {
for _, rule := range in.Rules {
if rule.Selector.Match(manifest) {
return true
}
}
return false
}

View File

@@ -1,116 +0,0 @@
/*
Copyright 2021. The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// WorkflowStepPhase describes the phase of a workflow step.
type WorkflowStepPhase string
const (
// WorkflowStepPhaseSucceeded will make the controller run the next step.
WorkflowStepPhaseSucceeded WorkflowStepPhase = "succeeded"
// WorkflowStepPhaseFailed will make the controller stop the workflow and report error in `message`.
WorkflowStepPhaseFailed WorkflowStepPhase = "failed"
// WorkflowStepPhaseTerminated will make the controller terminate the workflow.
WorkflowStepPhaseTerminated WorkflowStepPhase = "terminated"
// WorkflowStepPhaseSuspending will make the controller suspend the workflow.
WorkflowStepPhaseSuspending WorkflowStepPhase = "suspending"
// WorkflowStepPhaseRunning will make the controller continue the workflow.
WorkflowStepPhaseRunning WorkflowStepPhase = "running"
)
// WorkflowStep defines how to execute a workflow step.
type WorkflowStep struct {
// Name is the unique name of the workflow step.
Name string `json:"name"`
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
Inputs common.StepInputs `json:"inputs,omitempty"`
Outputs common.StepOutputs `json:"outputs,omitempty"`
}
// A WorkflowSpec defines the desired state of a Workflow.
type WorkflowSpec struct {
Steps []WorkflowStep `json:"steps,omitempty"`
}
// A WorkflowStatus is the status of Workflow
type WorkflowStatus struct {
// ConditionedStatus reflects the observed status of a resource
condition.ConditionedStatus `json:",inline"`
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
StepIndex int `json:"stepIndex,omitempty"`
Suspend bool `json:"suspend"`
Terminated bool `json:"terminated"`
ContextBackend *corev1.ObjectReference `json:"contextBackend"`
Steps []WorkflowStepStatus `json:"steps,omitempty"`
}
// WorkflowStepStatus record the status of a workflow step
type WorkflowStepStatus struct {
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Phase WorkflowStepPhase `json:"phase,omitempty"`
// A human readable message indicating details about why the workflowStep is in this state.
Message string `json:"message,omitempty"`
// A brief CamelCase message indicating details about why the workflowStep is in this state.
Reason string `json:"reason,omitempty"`
ResourceRef corev1.ObjectReference `json:"resourceRef,omitempty"`
}
// Workflow is the Schema for the Workflow API
// +kubebuilder:object:root=true
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=workflow
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type Workflow struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec WorkflowSpec `json:"spec,omitempty"`
Status WorkflowStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// WorkflowList contains a list of Workflow.
type WorkflowList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Workflow `json:"items"`
}
// SetConditions set condition for Workflow
func (w *Workflow) SetConditions(c ...condition.Condition) {
w.Status.SetConditions(c...)
}
// GetCondition gets condition from Workflow
func (w *Workflow) GetCondition(conditionType condition.ConditionType) condition.Condition {
return w.Status.GetCondition(conditionType)
}

View File

@@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
@@ -21,121 +22,92 @@ limitations under the License.
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppTemplate) DeepCopyInto(out *AppTemplate) {
func (in *ApplyOncePolicyRule) DeepCopyInto(out *ApplyOncePolicyRule) {
*out = *in
in.RawExtension.DeepCopyInto(&out.RawExtension)
in.Selector.DeepCopyInto(&out.Selector)
if in.Strategy != nil {
in, out := &in.Strategy, &out.Strategy
*out = new(ApplyOnceStrategy)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppTemplate.
func (in *AppTemplate) DeepCopy() *AppTemplate {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplyOncePolicyRule.
func (in *ApplyOncePolicyRule) DeepCopy() *ApplyOncePolicyRule {
if in == nil {
return nil
}
out := new(AppTemplate)
out := new(ApplyOncePolicyRule)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterDecision) DeepCopyInto(out *ClusterDecision) {
func (in *ApplyOncePolicySpec) DeepCopyInto(out *ApplyOncePolicySpec) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDecision.
func (in *ClusterDecision) DeepCopy() *ClusterDecision {
if in == nil {
return nil
}
out := new(ClusterDecision)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConfigMapReference) DeepCopyInto(out *ConfigMapReference) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapReference.
func (in *ConfigMapReference) DeepCopy() *ConfigMapReference {
if in == nil {
return nil
}
out := new(ConfigMapReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvBinding) DeepCopyInto(out *EnvBinding) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvBinding.
func (in *EnvBinding) DeepCopy() *EnvBinding {
if in == nil {
return nil
}
out := new(EnvBinding)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *EnvBinding) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvBindingList) DeepCopyInto(out *EnvBindingList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]EnvBinding, len(*in))
if in.Rules != nil {
in, out := &in.Rules, &out.Rules
*out = make([]ApplyOncePolicyRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvBindingList.
func (in *EnvBindingList) DeepCopy() *EnvBindingList {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplyOncePolicySpec.
func (in *ApplyOncePolicySpec) DeepCopy() *ApplyOncePolicySpec {
if in == nil {
return nil
}
out := new(EnvBindingList)
out := new(ApplyOncePolicySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *EnvBindingList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplyOnceStrategy) DeepCopyInto(out *ApplyOnceStrategy) {
*out = *in
if in.Path != nil {
in, out := &in.Path, &out.Path
*out = make([]string, len(*in))
copy(*out, *in)
}
return nil
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplyOnceStrategy.
func (in *ApplyOnceStrategy) DeepCopy() *ApplyOnceStrategy {
if in == nil {
return nil
}
out := new(ApplyOnceStrategy)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterConnection) DeepCopyInto(out *ClusterConnection) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConnection.
func (in *ClusterConnection) DeepCopy() *ClusterConnection {
if in == nil {
return nil
}
out := new(ClusterConnection)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvBindingSpec) DeepCopyInto(out *EnvBindingSpec) {
*out = *in
in.AppTemplate.DeepCopyInto(&out.AppTemplate)
if in.Envs != nil {
in, out := &in.Envs, &out.Envs
*out = make([]EnvConfig, len(*in))
@@ -143,11 +115,6 @@ func (in *EnvBindingSpec) DeepCopyInto(out *EnvBindingSpec) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.OutputResourcesTo != nil {
in, out := &in.OutputResourcesTo, &out.OutputResourcesTo
*out = new(ConfigMapReference)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvBindingSpec.
@@ -163,16 +130,17 @@ func (in *EnvBindingSpec) DeepCopy() *EnvBindingSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvBindingStatus) DeepCopyInto(out *EnvBindingStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.ClusterDecisions != nil {
in, out := &in.ClusterDecisions, &out.ClusterDecisions
*out = make([]ClusterDecision, len(*in))
copy(*out, *in)
if in.Envs != nil {
in, out := &in.Envs, &out.Envs
*out = make([]EnvStatus, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.ResourceTracker != nil {
in, out := &in.ResourceTracker, &out.ResourceTracker
*out = new(v1.ObjectReference)
**out = **in
if in.ClusterConnections != nil {
in, out := &in.ClusterConnections, &out.ClusterConnections
*out = make([]ClusterConnection, len(*in))
copy(*out, *in)
}
}
@@ -186,6 +154,33 @@ func (in *EnvBindingStatus) DeepCopy() *EnvBindingStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvComponentPatch) DeepCopyInto(out *EnvComponentPatch) {
*out = *in
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
if in.Traits != nil {
in, out := &in.Traits, &out.Traits
*out = make([]EnvTraitPatch, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvComponentPatch.
func (in *EnvComponentPatch) DeepCopy() *EnvComponentPatch {
if in == nil {
return nil
}
out := new(EnvComponentPatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvConfig) DeepCopyInto(out *EnvConfig) {
*out = *in
@@ -213,7 +208,7 @@ func (in *EnvPatch) DeepCopyInto(out *EnvPatch) {
*out = *in
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]common.ApplicationComponent, len(*in))
*out = make([]EnvComponentPatch, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@@ -275,6 +270,99 @@ func (in *EnvSelector) DeepCopy() *EnvSelector {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvStatus) DeepCopyInto(out *EnvStatus) {
*out = *in
if in.Placements != nil {
in, out := &in.Placements, &out.Placements
*out = make([]PlacementDecision, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvStatus.
func (in *EnvStatus) DeepCopy() *EnvStatus {
if in == nil {
return nil
}
out := new(EnvStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvTraitPatch) DeepCopyInto(out *EnvTraitPatch) {
*out = *in
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvTraitPatch.
func (in *EnvTraitPatch) DeepCopy() *EnvTraitPatch {
if in == nil {
return nil
}
out := new(EnvTraitPatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GarbageCollectPolicyRule) DeepCopyInto(out *GarbageCollectPolicyRule) {
*out = *in
in.Selector.DeepCopyInto(&out.Selector)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GarbageCollectPolicyRule.
func (in *GarbageCollectPolicyRule) DeepCopy() *GarbageCollectPolicyRule {
if in == nil {
return nil
}
out := new(GarbageCollectPolicyRule)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GarbageCollectPolicySpec) DeepCopyInto(out *GarbageCollectPolicySpec) {
*out = *in
if in.Rules != nil {
in, out := &in.Rules, &out.Rules
*out = make([]GarbageCollectPolicyRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GarbageCollectPolicySpec.
func (in *GarbageCollectPolicySpec) DeepCopy() *GarbageCollectPolicySpec {
if in == nil {
return nil
}
out := new(GarbageCollectPolicySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LegacyObjectTypeIdentifier) DeepCopyInto(out *LegacyObjectTypeIdentifier) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LegacyObjectTypeIdentifier.
func (in *LegacyObjectTypeIdentifier) DeepCopy() *LegacyObjectTypeIdentifier {
if in == nil {
return nil
}
out := new(LegacyObjectTypeIdentifier)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NamespaceSelector) DeepCopyInto(out *NamespaceSelector) {
*out = *in
@@ -298,26 +386,167 @@ func (in *NamespaceSelector) DeepCopy() *NamespaceSelector {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Workflow) DeepCopyInto(out *Workflow) {
func (in *ObjectReferrer) DeepCopyInto(out *ObjectReferrer) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
out.ObjectTypeIdentifier = in.ObjectTypeIdentifier
in.ObjectSelector.DeepCopyInto(&out.ObjectSelector)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workflow.
func (in *Workflow) DeepCopy() *Workflow {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReferrer.
func (in *ObjectReferrer) DeepCopy() *ObjectReferrer {
if in == nil {
return nil
}
out := new(Workflow)
out := new(ObjectReferrer)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ObjectSelector) DeepCopyInto(out *ObjectSelector) {
*out = *in
if in.LabelSelector != nil {
in, out := &in.LabelSelector, &out.LabelSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.DeprecatedLabelSelector != nil {
in, out := &in.DeprecatedLabelSelector, &out.DeprecatedLabelSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectSelector.
func (in *ObjectSelector) DeepCopy() *ObjectSelector {
if in == nil {
return nil
}
out := new(ObjectSelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ObjectTypeIdentifier) DeepCopyInto(out *ObjectTypeIdentifier) {
*out = *in
out.LegacyObjectTypeIdentifier = in.LegacyObjectTypeIdentifier
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectTypeIdentifier.
func (in *ObjectTypeIdentifier) DeepCopy() *ObjectTypeIdentifier {
if in == nil {
return nil
}
out := new(ObjectTypeIdentifier)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OverridePolicySpec) DeepCopyInto(out *OverridePolicySpec) {
*out = *in
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]EnvComponentPatch, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OverridePolicySpec.
func (in *OverridePolicySpec) DeepCopy() *OverridePolicySpec {
if in == nil {
return nil
}
out := new(OverridePolicySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Placement) DeepCopyInto(out *Placement) {
*out = *in
if in.Clusters != nil {
in, out := &in.Clusters, &out.Clusters
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.ClusterLabelSelector != nil {
in, out := &in.ClusterLabelSelector, &out.ClusterLabelSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.DeprecatedClusterSelector != nil {
in, out := &in.DeprecatedClusterSelector, &out.DeprecatedClusterSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Placement.
func (in *Placement) DeepCopy() *Placement {
if in == nil {
return nil
}
out := new(Placement)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PlacementDecision) DeepCopyInto(out *PlacementDecision) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementDecision.
func (in *PlacementDecision) DeepCopy() *PlacementDecision {
if in == nil {
return nil
}
out := new(PlacementDecision)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Policy) DeepCopyInto(out *Policy) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy.
func (in *Policy) DeepCopy() *Policy {
if in == nil {
return nil
}
out := new(Policy)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Workflow) DeepCopyObject() runtime.Object {
func (in *Policy) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
@@ -325,31 +554,31 @@ func (in *Workflow) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowList) DeepCopyInto(out *WorkflowList) {
func (in *PolicyList) DeepCopyInto(out *PolicyList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Workflow, len(*in))
*out = make([]Policy, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowList.
func (in *WorkflowList) DeepCopy() *WorkflowList {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyList.
func (in *PolicyList) DeepCopy() *PolicyList {
if in == nil {
return nil
}
out := new(WorkflowList)
out := new(PolicyList)
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 {
func (in *PolicyList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
@@ -357,91 +586,228 @@ func (in *WorkflowList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowSpec) DeepCopyInto(out *WorkflowSpec) {
func (in *ReadOnlyPolicyRule) DeepCopyInto(out *ReadOnlyPolicyRule) {
*out = *in
if in.Steps != nil {
in, out := &in.Steps, &out.Steps
*out = make([]WorkflowStep, len(*in))
in.Selector.DeepCopyInto(&out.Selector)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadOnlyPolicyRule.
func (in *ReadOnlyPolicyRule) DeepCopy() *ReadOnlyPolicyRule {
if in == nil {
return nil
}
out := new(ReadOnlyPolicyRule)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReadOnlyPolicySpec) DeepCopyInto(out *ReadOnlyPolicySpec) {
*out = *in
if in.Rules != nil {
in, out := &in.Rules, &out.Rules
*out = make([]ReadOnlyPolicyRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowSpec.
func (in *WorkflowSpec) DeepCopy() *WorkflowSpec {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadOnlyPolicySpec.
func (in *ReadOnlyPolicySpec) DeepCopy() *ReadOnlyPolicySpec {
if in == nil {
return nil
}
out := new(WorkflowSpec)
out := new(ReadOnlyPolicySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowStatus) DeepCopyInto(out *WorkflowStatus) {
func (in *RefObjectsComponentSpec) DeepCopyInto(out *RefObjectsComponentSpec) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.ContextBackend != nil {
in, out := &in.ContextBackend, &out.ContextBackend
*out = new(v1.ObjectReference)
**out = **in
if in.Objects != nil {
in, out := &in.Objects, &out.Objects
*out = make([]ObjectReferrer, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Steps != nil {
in, out := &in.Steps, &out.Steps
*out = make([]WorkflowStepStatus, len(*in))
if in.URLs != nil {
in, out := &in.URLs, &out.URLs
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStatus.
func (in *WorkflowStatus) DeepCopy() *WorkflowStatus {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RefObjectsComponentSpec.
func (in *RefObjectsComponentSpec) DeepCopy() *RefObjectsComponentSpec {
if in == nil {
return nil
}
out := new(WorkflowStatus)
out := new(RefObjectsComponentSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowStep) DeepCopyInto(out *WorkflowStep) {
func (in *ReplicationPolicySpec) DeepCopyInto(out *ReplicationPolicySpec) {
*out = *in
in.Properties.DeepCopyInto(&out.Properties)
if in.Inputs != nil {
in, out := &in.Inputs, &out.Inputs
*out = make(common.StepInputs, len(*in))
if in.Keys != nil {
in, out := &in.Keys, &out.Keys
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Outputs != nil {
in, out := &in.Outputs, &out.Outputs
*out = make(common.StepOutputs, len(*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 WorkflowStep.
func (in *WorkflowStep) DeepCopy() *WorkflowStep {
// 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(WorkflowStep)
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 *WorkflowStepStatus) DeepCopyInto(out *WorkflowStepStatus) {
func (in *ResourcePolicyRuleSelector) DeepCopyInto(out *ResourcePolicyRuleSelector) {
*out = *in
out.ResourceRef = in.ResourceRef
if in.CompNames != nil {
in, out := &in.CompNames, &out.CompNames
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.CompTypes != nil {
in, out := &in.CompTypes, &out.CompTypes
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.OAMResourceTypes != nil {
in, out := &in.OAMResourceTypes, &out.OAMResourceTypes
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.TraitTypes != nil {
in, out := &in.TraitTypes, &out.TraitTypes
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.ResourceTypes != nil {
in, out := &in.ResourceTypes, &out.ResourceTypes
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.ResourceNames != nil {
in, out := &in.ResourceNames, &out.ResourceNames
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStepStatus.
func (in *WorkflowStepStatus) DeepCopy() *WorkflowStepStatus {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePolicyRuleSelector.
func (in *ResourcePolicyRuleSelector) DeepCopy() *ResourcePolicyRuleSelector {
if in == nil {
return nil
}
out := new(WorkflowStepStatus)
out := new(ResourcePolicyRuleSelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SharedResourcePolicyRule) DeepCopyInto(out *SharedResourcePolicyRule) {
*out = *in
in.Selector.DeepCopyInto(&out.Selector)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedResourcePolicyRule.
func (in *SharedResourcePolicyRule) DeepCopy() *SharedResourcePolicyRule {
if in == nil {
return nil
}
out := new(SharedResourcePolicyRule)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SharedResourcePolicySpec) DeepCopyInto(out *SharedResourcePolicySpec) {
*out = *in
if in.Rules != nil {
in, out := &in.Rules, &out.Rules
*out = make([]SharedResourcePolicyRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedResourcePolicySpec.
func (in *SharedResourcePolicySpec) DeepCopy() *SharedResourcePolicySpec {
if in == nil {
return nil
}
out := new(SharedResourcePolicySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TakeOverPolicyRule) DeepCopyInto(out *TakeOverPolicyRule) {
*out = *in
in.Selector.DeepCopyInto(&out.Selector)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TakeOverPolicyRule.
func (in *TakeOverPolicyRule) DeepCopy() *TakeOverPolicyRule {
if in == nil {
return nil
}
out := new(TakeOverPolicyRule)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TakeOverPolicySpec) DeepCopyInto(out *TakeOverPolicySpec) {
*out = *in
if in.Rules != nil {
in, out := &in.Rules, &out.Rules
*out = make([]TakeOverPolicyRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TakeOverPolicySpec.
func (in *TakeOverPolicySpec) DeepCopy() *TakeOverPolicySpec {
if in == nil {
return nil
}
out := new(TakeOverPolicySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TopologyPolicySpec) DeepCopyInto(out *TopologyPolicySpec) {
*out = *in
in.Placement.DeepCopyInto(&out.Placement)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologyPolicySpec.
func (in *TopologyPolicySpec) DeepCopy() *TopologyPolicySpec {
if in == nil {
return nil
}
out := new(TopologyPolicySpec)
in.DeepCopyInto(out)
return out
}

View File

@@ -54,7 +54,7 @@ type AppStatus struct {
type ApplicationTrait struct {
Name string `json:"name"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
}
// ApplicationComponent describe the component of application
@@ -87,7 +87,7 @@ type ApplicationSpec struct {
// Application is the Schema for the applications API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=app
// +kubebuilder:resource:categories={oam},shortName={app,velaapp}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="COMPONENT",type=string,JSONPath=`.spec.components[*].name`
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.spec.components[*].type`

View File

@@ -1,86 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
)
// AppRolloutSpec defines how to describe an upgrade between different apps
type AppRolloutSpec struct {
// TargetAppRevisionName contains the name of the applicationRevision that we need to upgrade to.
TargetAppRevisionName string `json:"targetAppRevisionName"`
// SourceAppRevisionName contains the name of the applicationRevision that we need to upgrade from.
// it can be empty only when the rolling is only a scale event
SourceAppRevisionName string `json:"sourceAppRevisionName,omitempty"`
// The list of component to upgrade in the application.
// We only support single component application so far
// TODO: (RZ) Support multiple components in an application
// +optional
ComponentList []string `json:"componentList,omitempty"`
// RolloutPlan is the details on how to rollout the resources
RolloutPlan v1alpha1.RolloutPlan `json:"rolloutPlan"`
// RevertOnDelete revert the rollout when the rollout CR is deleted
// It will remove the target app from the kubernetes if it's set to true
// +optional
RevertOnDelete *bool `json:"revertOnDelete,omitempty"`
}
// AppRolloutStatus defines the observed state of AppRollout
type AppRolloutStatus struct {
v1alpha1.RolloutStatus `json:",inline"`
// LastUpgradedTargetAppRevision contains the name of the app that we upgraded to
// We will restart the rollout if this is not the same as the spec
LastUpgradedTargetAppRevision string `json:"lastTargetAppRevision"`
// LastSourceAppRevision contains the name of the app that we need to upgrade from.
// We will restart the rollout if this is not the same as the spec
LastSourceAppRevision string `json:"LastSourceAppRevision,omitempty"`
}
// AppRollout is the Schema for the AppRollout API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=approllout
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="TARGET",type=string,JSONPath=`.status.rolloutStatus.rolloutTargetSize`
// +kubebuilder:printcolumn:name="UPGRADED",type=string,JSONPath=`.status.rolloutStatus.upgradedReplicas`
// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.rolloutStatus.upgradedReadyReplicas`
// +kubebuilder:printcolumn:name="BATCH-STATE",type=string,JSONPath=`.status.rolloutStatus.batchRollingState`
// +kubebuilder:printcolumn:name="ROLLING-STATE",type=string,JSONPath=`.status.rolloutStatus.rollingState`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type AppRollout struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AppRolloutSpec `json:"spec,omitempty"`
Status AppRolloutStatus `json:"status,omitempty"`
}
// AppRolloutList contains a list of AppRollout
// +kubebuilder:object:root=true
type AppRolloutList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AppRollout `json:"items"`
}

View File

@@ -20,6 +20,7 @@ import (
"fmt"
"reflect"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/conversion"
@@ -44,7 +45,7 @@ func ApplicationV1alpha2ToV1beta1(v1a2 *Application, v1b1 *v1beta1.Application)
for j, trait := range comp.Traits {
traits[j] = common.ApplicationTrait{
Type: trait.Name,
Properties: *trait.Properties.DeepCopy(),
Properties: trait.Properties.DeepCopy(),
}
}
@@ -58,13 +59,11 @@ func ApplicationV1alpha2ToV1beta1(v1a2 *Application, v1b1 *v1beta1.Application)
v1b1.Spec.Components = append(v1b1.Spec.Components, common.ApplicationComponent{
Name: comp.Name,
Type: comp.WorkloadType,
Properties: *comp.Settings.DeepCopy(),
Properties: comp.Settings.DeepCopy(),
Traits: traits,
Scopes: scopes,
})
}
// 3.2) convert Spec.RolloutPlan
v1b1.Spec.RolloutPlan = v1a2.Spec.RolloutPlan.DeepCopy()
// 4) convert Status common.AppStatus
v1b1.Status = *v1a2.Status.DeepCopy()
@@ -104,7 +103,7 @@ func (app *Application) ConvertFrom(src conversion.Hub) error {
for j, trait := range comp.Traits {
traits[j] = ApplicationTrait{
Name: trait.Type,
Properties: *trait.Properties.DeepCopy(),
Properties: trait.Properties.DeepCopy(),
}
}
@@ -115,16 +114,21 @@ func (app *Application) ConvertFrom(src conversion.Hub) error {
}
// convert component
// `.properties` -> `.settings`
var compProperties runtime.RawExtension
if comp.Properties != nil {
compProperties = *comp.Properties.DeepCopy()
}
app.Spec.Components = append(app.Spec.Components, ApplicationComponent{
Name: comp.Name,
WorkloadType: comp.Type,
Settings: *comp.Properties.DeepCopy(),
Settings: compProperties,
Traits: traits,
Scopes: scopes,
})
}
// 3.2) convert Spec.RolloutPlan
app.Spec.RolloutPlan = sourceApp.Spec.RolloutPlan.DeepCopy()
// 4) convert Status common.AppStatus
app.Status = *sourceApp.Status.DeepCopy()

View File

@@ -0,0 +1,117 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha2
import (
"fmt"
"testing"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/stretchr/testify/require"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1"
)
var app = Application{
Spec: ApplicationSpec{
Components: []ApplicationComponent{{
Name: "test-component",
WorkloadType: "worker",
Traits: []ApplicationTrait{},
Scopes: map[string]string{},
}},
},
}
type errType struct {
}
func (*errType) Hub() {}
func (*errType) DeepCopyObject() runtime.Object {
return nil
}
func (*errType) GetObjectKind() schema.ObjectKind {
return nil
}
func TestApplicationV1alpha2ToV1beta1(t *testing.T) {
r := require.New(t)
expected := &v1beta1.Application{}
ApplicationV1alpha2ToV1beta1(&app, expected)
r.Equal(expected, &v1beta1.Application{
Spec: v1beta1.ApplicationSpec{
Components: []common.ApplicationComponent{{
Name: "test-component",
Type: "worker",
Properties: &runtime.RawExtension{},
Traits: []common.ApplicationTrait{},
Scopes: map[string]string{},
}},
},
})
}
func TestConvertTo(t *testing.T) {
r := require.New(t)
expected := &v1beta1.Application{}
err := app.ConvertTo(expected)
r.NoError(err)
r.Equal(expected, &v1beta1.Application{
Spec: v1beta1.ApplicationSpec{
Components: []common.ApplicationComponent{{
Name: "test-component",
Type: "worker",
Properties: &runtime.RawExtension{},
Traits: []common.ApplicationTrait{},
Scopes: map[string]string{},
}},
},
})
errCase := &errType{}
err = app.ConvertTo(errCase)
r.Equal(err, fmt.Errorf("unsupported convertTo object *v1alpha2.errType"))
}
func TestConvertFrom(t *testing.T) {
r := require.New(t)
to := &Application{}
from := &v1beta1.Application{
Spec: v1beta1.ApplicationSpec{
Components: []common.ApplicationComponent{{
Name: "test-component",
Type: "worker",
Properties: &runtime.RawExtension{},
Traits: []common.ApplicationTrait{},
Scopes: map[string]string{},
}},
},
}
err := to.ConvertFrom(from)
r.NoError(err)
r.Equal(to.Spec, app.Spec)
errCase := &errType{}
err = app.ConvertFrom(errCase)
r.Equal(err, fmt.Errorf("unsupported ConvertFrom object *v1alpha2.errType"))
}

View File

@@ -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

@@ -19,14 +19,8 @@ limitations under the License.
package v1alpha2
import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/pkg/oam"
)
// An OperatingSystem required by a containerised workload.
@@ -359,53 +353,3 @@ type Container struct {
// +optional
ImagePullSecret *string `json:"imagePullSecret,omitempty"`
}
// A ContainerizedWorkloadSpec defines the desired state of a
// ContainerizedWorkload.
type ContainerizedWorkloadSpec struct {
// OperatingSystem required by this workload.
// +kubebuilder:validation:Enum=linux;windows
// +optional
OperatingSystem *OperatingSystem `json:"osType,omitempty"`
// CPUArchitecture required by this workload.
// +kubebuilder:validation:Enum=i386;amd64;arm;arm64
// +optional
CPUArchitecture *CPUArchitecture `json:"arch,omitempty"`
// Containers of which this workload consists.
Containers []Container `json:"containers"`
}
// A ContainerizedWorkloadStatus represents the observed state of a
// ContainerizedWorkload.
type ContainerizedWorkloadStatus struct {
condition.ConditionedStatus `json:",inline"`
// Resources managed by this containerised workload.
Resources []corev1.ObjectReference `json:"resources,omitempty"`
}
var _ oam.Workload = &ContainerizedWorkload{}
// +kubebuilder:object:root=true
// A ContainerizedWorkload is a workload that runs OCI containers.
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
type ContainerizedWorkload struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ContainerizedWorkloadSpec `json:"spec,omitempty"`
Status ContainerizedWorkloadStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ContainerizedWorkloadList contains a list of ContainerizedWorkload.
type ContainerizedWorkloadList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ContainerizedWorkload `json:"items"`
}

View File

@@ -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)
@@ -64,16 +44,6 @@ func (cm *Component) SetConditions(c ...condition.Condition) {
cm.Status.SetConditions(c...)
}
// GetCondition of this ContainerizedWorkload.
func (wl *ContainerizedWorkload) GetCondition(ct condition.ConditionType) condition.Condition {
return wl.Status.GetCondition(ct)
}
// SetConditions of this ContainerizedWorkload.
func (wl *ContainerizedWorkload) SetConditions(c ...condition.Condition) {
wl.Status.SetConditions(c...)
}
// GetCondition of this HealthScope.
func (hs *HealthScope) GetCondition(ct condition.ConditionType) condition.Condition {
return hs.Status.GetCondition(ct)

View File

@@ -21,11 +21,13 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// Package type metadata.
const (
Group = "core.oam.dev"
Group = common.Group
Version = "v1alpha2"
)
@@ -85,22 +87,6 @@ var (
ApplicationConfigurationGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationConfigurationKind)
)
// ContainerizedWorkload type metadata.
var (
ContainerizedWorkloadKind = reflect.TypeOf(ContainerizedWorkload{}).Name()
ContainerizedWorkloadGroupKind = schema.GroupKind{Group: Group, Kind: ContainerizedWorkloadKind}.String()
ContainerizedWorkloadKindAPIVersion = ContainerizedWorkloadKind + "." + SchemeGroupVersion.String()
ContainerizedWorkloadGroupVersionKind = SchemeGroupVersion.WithKind(ContainerizedWorkloadKind)
)
// ManualScalerTrait type metadata.
var (
ManualScalerTraitKind = reflect.TypeOf(ManualScalerTrait{}).Name()
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()
@@ -117,14 +103,6 @@ var (
ApplicationKindVersionKind = SchemeGroupVersion.WithKind(ApplicationKind)
)
// AppRollout type metadata.
var (
AppRolloutKind = reflect.TypeOf(AppRollout{}).Name()
AppRolloutGroupKind = schema.GroupKind{Group: Group, Kind: AppRolloutKind}.String()
AppRolloutKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
AppRolloutKindVersionKind = SchemeGroupVersion.WithKind(AppRolloutKind)
)
// ApplicationRevision type metadata
var (
ApplicationRevisionKind = reflect.TypeOf(ApplicationRevision{}).Name()
@@ -140,10 +118,7 @@ func init() {
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
SchemeBuilder.Register(&Component{}, &ComponentList{})
SchemeBuilder.Register(&ApplicationConfiguration{}, &ApplicationConfigurationList{})
SchemeBuilder.Register(&ContainerizedWorkload{}, &ContainerizedWorkloadList{})
SchemeBuilder.Register(&ManualScalerTrait{}, &ManualScalerTraitList{})
SchemeBuilder.Register(&HealthScope{}, &HealthScopeList{})
SchemeBuilder.Register(&Application{}, &ApplicationList{})
SchemeBuilder.Register(&AppRollout{}, &AppRolloutList{})
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})
}

View File

@@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
@@ -76,107 +77,6 @@ func (in *AppReference) DeepCopy() *AppReference {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRollout) DeepCopyInto(out *AppRollout) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRollout.
func (in *AppRollout) DeepCopy() *AppRollout {
if in == nil {
return nil
}
out := new(AppRollout)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AppRollout) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRolloutList) DeepCopyInto(out *AppRolloutList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]AppRollout, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutList.
func (in *AppRolloutList) DeepCopy() *AppRolloutList {
if in == nil {
return nil
}
out := new(AppRolloutList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AppRolloutList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRolloutSpec) DeepCopyInto(out *AppRolloutSpec) {
*out = *in
if in.ComponentList != nil {
in, out := &in.ComponentList, &out.ComponentList
*out = make([]string, len(*in))
copy(*out, *in)
}
in.RolloutPlan.DeepCopyInto(&out.RolloutPlan)
if in.RevertOnDelete != nil {
in, out := &in.RevertOnDelete, &out.RevertOnDelete
*out = new(bool)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutSpec.
func (in *AppRolloutSpec) DeepCopy() *AppRolloutSpec {
if in == nil {
return nil
}
out := new(AppRolloutSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRolloutStatus) DeepCopyInto(out *AppRolloutStatus) {
*out = *in
in.RolloutStatus.DeepCopyInto(&out.RolloutStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutStatus.
func (in *AppRolloutStatus) DeepCopy() *AppRolloutStatus {
if in == nil {
return nil
}
out := new(AppRolloutStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppStatus) DeepCopyInto(out *AppStatus) {
*out = *in
@@ -600,7 +500,11 @@ func (in *ApplicationSpec) DeepCopy() *ApplicationSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationTrait) DeepCopyInto(out *ApplicationTrait) {
*out = *in
in.Properties.DeepCopyInto(&out.Properties)
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationTrait.
@@ -1209,118 +1113,6 @@ func (in *ContainerResources) DeepCopy() *ContainerResources {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ContainerizedWorkload) DeepCopyInto(out *ContainerizedWorkload) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedWorkload.
func (in *ContainerizedWorkload) DeepCopy() *ContainerizedWorkload {
if in == nil {
return nil
}
out := new(ContainerizedWorkload)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ContainerizedWorkload) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ContainerizedWorkloadList) DeepCopyInto(out *ContainerizedWorkloadList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ContainerizedWorkload, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedWorkloadList.
func (in *ContainerizedWorkloadList) DeepCopy() *ContainerizedWorkloadList {
if in == nil {
return nil
}
out := new(ContainerizedWorkloadList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ContainerizedWorkloadList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ContainerizedWorkloadSpec) DeepCopyInto(out *ContainerizedWorkloadSpec) {
*out = *in
if in.OperatingSystem != nil {
in, out := &in.OperatingSystem, &out.OperatingSystem
*out = new(OperatingSystem)
**out = **in
}
if in.CPUArchitecture != nil {
in, out := &in.CPUArchitecture, &out.CPUArchitecture
*out = new(CPUArchitecture)
**out = **in
}
if in.Containers != nil {
in, out := &in.Containers, &out.Containers
*out = make([]Container, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedWorkloadSpec.
func (in *ContainerizedWorkloadSpec) DeepCopy() *ContainerizedWorkloadSpec {
if in == nil {
return nil
}
out := new(ContainerizedWorkloadSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ContainerizedWorkloadStatus) DeepCopyInto(out *ContainerizedWorkloadStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.Resources != nil {
in, out := &in.Resources, &out.Resources
*out = make([]v1.ObjectReference, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerizedWorkloadStatus.
func (in *ContainerizedWorkloadStatus) DeepCopy() *ContainerizedWorkloadStatus {
if in == nil {
return nil
}
out := new(ContainerizedWorkloadStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DataInput) DeepCopyInto(out *DataInput) {
*out = *in
@@ -1728,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

@@ -1,176 +0,0 @@
/*
Copyright 2021. The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// AppDeploymentPhase defines the phase that the AppDeployment is undergoing.
type AppDeploymentPhase string
const (
// PhaseRolling is the phase when the AppDeployment is rolling live instances from old revisions to new ones.
PhaseRolling AppDeploymentPhase = "Rolling"
// PhaseCompleted is the phase when the AppDeployment is done with reconciliation.
PhaseCompleted AppDeploymentPhase = "Completed"
// PhaseFailed is the phase when the AppDeployment has failed in reconciliation due to unexpected conditions.
PhaseFailed AppDeploymentPhase = "Failed"
)
// HTTPMatchRequest specifies a set of criterion to be met in order for the
// rule to be applied to the HTTP request. For example, the following
// restricts the rule to match only requests where the URL path
// starts with /ratings/v2/ and the request contains a custom `end-user` header
// with value `jason`.
type HTTPMatchRequest struct {
// URI defines how to match with an URI.
URI *URIMatch `json:"uri,omitempty"`
}
// URIMatch defines the rules to match with an URI.
type URIMatch struct {
Prefix string `json:"prefix,omitempty"`
}
// HTTPRule defines the rules to match and split http traffic across revisions.
type HTTPRule struct {
// Match defines the conditions to be satisfied for the rule to be
// activated. All conditions inside a single match block have AND
// semantics, while the list of match blocks have OR semantics. The rule
// is matched if any one of the match blocks succeed.
Match []*HTTPMatchRequest `json:"match,omitempty"`
// WeightedTargets defines the revision targets to select and route traffic to.
WeightedTargets []WeightedTarget `json:"weightedTargets,omitempty"`
}
// WeightedTarget defines the revision target to select and route traffic to.
type WeightedTarget struct {
// RevisionName is the name of the app revision.
RevisionName string `json:"revisionName,omitempty"`
// ComponentName is the name of the component.
// Note that it is the original component name in the Application. No need to append revision.
ComponentName string `json:"componentName,omitempty"`
// Port is the port to route traffic towards.
Port int `json:"port,omitempty"`
// Weight defines the proportion of traffic to be forwarded to the service
// version. (0-100). Sum of weights across destinations SHOULD BE == 100.
// If there is only one destination in a rule, the weight value is assumed to
// be 100.
Weight int `json:"weight,omitempty"`
}
// Traffic defines the traffic rules to apply across revisions.
type Traffic struct {
// Hosts are the destination hosts to which traffic is being sent. Could
// be a DNS name with wildcard prefix or an IP address.
Hosts []string `json:"hosts,omitempty"`
// Gateways specifies the names of gateways that should apply these rules.
// Gateways in other namespaces may be referred to by
// `<gateway namespace>/<gateway name>`; specifying a gateway with no
// namespace qualifier is the same as specifying the AppDeployment's namespace.
Gateways []string `json:"gateways,omitempty"`
// HTTP defines the rules to match and split http traffoc across revisions.
HTTP []HTTPRule `json:"http,omitempty"`
}
// AppRevision specifies an AppRevision resource to and the rules to apply to it.
type AppRevision struct {
// RevisionName is the name of the AppRevision.
RevisionName string `json:"revisionName,omitempty"`
// Placement defines the cluster placement rules for an app revision.
Placement []common.ClusterPlacement `json:"placement,omitempty"`
}
// ClusterPlacementStatus shows the placement results of a cluster.
type ClusterPlacementStatus struct {
// ClusterName indicates the name of the cluster to deploy apps to.
// If empty, it indicates the host cluster per se.
ClusterName string `json:"clusterName,omitempty"`
// Replicas indicates the replica number of an app revision to deploy to a cluster.
Replicas int `json:"replicas,omitempty"`
}
// PlacementStatus shows the cluster placement results of an app revision.
type PlacementStatus struct {
// RevisionName is the name of the AppRevision.
RevisionName string `json:"revisionName,omitempty"`
// Clusters shows cluster placement results.
Clusters []ClusterPlacementStatus `json:"clusters,omitempty"`
}
// AppDeploymentSpec defines how to describe an upgrade between different apps
type AppDeploymentSpec struct {
// Traffic defines the traffic rules to apply across revisions.
Traffic *Traffic `json:"traffic,omitempty"`
// AppRevision specifies AppRevision resources to and the rules to apply to them.
AppRevisions []AppRevision `json:"appRevisions,omitempty"`
}
// AppDeploymentStatus defines the observed state of AppDeployment
type AppDeploymentStatus struct {
// Conditions represents the latest available observations of a CloneSet's current state.
condition.ConditionedStatus `json:",inline"`
// Phase shows the phase that the AppDeployment is undergoing.
// If Phase is Rolling, no update should be made to the spec.
Phase AppDeploymentPhase `json:"phase,omitempty"`
// Placement shows the cluster placement results of the app revisions.
Placement []PlacementStatus `json:"placement,omitempty"`
}
// AppDeployment is the Schema for the AppDeployment API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=appdeploy
// +kubebuilder:subresource:status
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type AppDeployment struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AppDeploymentSpec `json:"spec,omitempty"`
Status AppDeploymentStatus `json:"status,omitempty"`
}
// AppDeploymentList contains a list of AppDeployment
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type AppDeploymentList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AppDeployment `json:"items"`
}

View File

@@ -17,12 +17,16 @@
package v1beta1
import (
"encoding/json"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
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"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
)
const (
@@ -44,29 +48,14 @@ type AppPolicy struct {
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
}
// WorkflowStep defines how to execute a workflow step.
type WorkflowStep struct {
// Name is the unique name of the workflow step.
Name string `json:"name"`
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties runtime.RawExtension `json:"properties,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs common.StepInputs `json:"inputs,omitempty"`
Outputs common.StepOutputs `json:"outputs,omitempty"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
}
// Workflow defines workflow steps and other attributes
type Workflow struct {
Steps []WorkflowStep `json:"steps,omitempty"`
Ref string `json:"ref,omitempty"`
Mode *workflowv1alpha1.WorkflowExecuteMode `json:"mode,omitempty"`
Steps []workflowv1alpha1.WorkflowStep `json:"steps,omitempty"`
}
// ApplicationSpec is the spec of Application
@@ -86,11 +75,6 @@ type ApplicationSpec struct {
Workflow *Workflow `json:"workflow,omitempty"`
// TODO(wonderflow): we should have application level scopes supported here
// RolloutPlan is the details on how to rollout the resources
// The controller simply replace the old resources with the new one if there is no rollout plan involved
// +optional
RolloutPlan *v1alpha1.RolloutPlan `json:"rolloutPlan,omitempty"`
}
// +kubebuilder:object:root=true
@@ -98,7 +82,7 @@ type ApplicationSpec struct {
// Application is the Schema for the applications API
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:resource:categories={oam},shortName=app
// +kubebuilder:resource:categories={oam},shortName={app,velaapp}
// +kubebuilder:printcolumn:name="COMPONENT",type=string,JSONPath=`.spec.components[*].name`
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.spec.components[*].type`
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.status`
@@ -144,3 +128,36 @@ func (app *Application) GetComponent(workloadType string) *common.ApplicationCom
}
return nil
}
// Unstructured convert application to unstructured.Unstructured.
func (app *Application) Unstructured() (*unstructured.Unstructured, error) {
var obj = &unstructured.Unstructured{}
app.SetGroupVersionKind(ApplicationKindVersionKind)
bt, err := json.Marshal(app)
if err != nil {
return nil, err
}
if err := obj.UnmarshalJSON(bt); err != nil {
return nil, err
}
if app.Status.Services == nil {
if err := unstructured.SetNestedSlice(obj.Object, []interface{}{}, "status", "services"); err != nil {
return nil, err
}
}
if app.Status.AppliedResources == nil {
if err := unstructured.SetNestedSlice(obj.Object, []interface{}{}, "status", "appliedResources"); err != nil {
return nil, err
}
}
if wfStatus := app.Status.Workflow; wfStatus != nil && wfStatus.Steps == nil {
if err := unstructured.SetNestedSlice(obj.Object, []interface{}{}, "status", "workflow", "steps"); err != nil {
return nil, err
}
}
return obj, nil
}

View File

@@ -17,17 +17,30 @@
package v1beta1
import (
corev1 "k8s.io/api/core/v1"
"encoding/json"
"github.com/kubevela/pkg/util/compression"
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha1"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// ApplicationRevisionSpec is the spec of ApplicationRevision
type ApplicationRevisionSpec struct {
// ApplicationRevisionCompressibleFields represents all the fields that can be compressed.
ApplicationRevisionCompressibleFields `json:",inline"`
// Compression represents the compressed components in apprev in base64 (if compression is enabled).
Compression ApplicationRevisionCompression `json:"compression,omitempty"`
}
// ApplicationRevisionCompressibleFields represents all the fields that can be compressed.
// So we can better organize them and compress only the compressible fields.
type ApplicationRevisionCompressibleFields struct {
// Application records the snapshot of the created/modified Application
Application Application `json:"application"`
@@ -52,19 +65,78 @@ type ApplicationRevisionSpec struct {
// ScopeGVK records the apiVersion to GVK mapping
ScopeGVK map[string]metav1.GroupVersionKind `json:"scopeGVK,omitempty"`
// Components records the rendered components from Application, it will contains the whole K8s CR of workload in it.
// +deprecated
Components []common.RawComponent `json:"components,omitempty"`
// Policies records the external policies
Policies map[string]v1alpha1.Policy `json:"policies,omitempty"`
// ApplicationConfiguration records the rendered applicationConfiguration from Application,
// it will contains the whole K8s CR of trait and the reference component in it.
// +kubebuilder:validation:EmbeddedResource
// Workflow records the external workflow
Workflow *workflowv1alpha1.Workflow `json:"workflow,omitempty"`
// ReferredObjects records the referred objects used in the ref-object typed components
// +kubebuilder:pruning:PreserveUnknownFields
// +deprecated
ApplicationConfiguration runtime.RawExtension `json:"applicationConfiguration,omitempty"`
ReferredObjects []common.ReferredObject `json:"referredObjects,omitempty"`
}
// ResourcesConfigMap references the ConfigMap that's generated to contain all final rendered resources.
ResourcesConfigMap corev1.LocalObjectReference `json:"resourcesConfigMap,omitempty"`
// ApplicationRevisionCompression represents the compressed components in apprev in base64.
type ApplicationRevisionCompression struct {
compression.CompressedText `json:",inline"`
}
// MarshalJSON serves the same purpose as the one in ResourceTrackerSpec.
func (apprev *ApplicationRevisionSpec) MarshalJSON() ([]byte, error) {
type Alias ApplicationRevisionSpec
tmp := &struct {
*Alias
}{}
if apprev.Compression.Type == compression.Uncompressed {
tmp.Alias = (*Alias)(apprev)
} else {
cpy := apprev.DeepCopy()
err := cpy.Compression.EncodeFrom(cpy.ApplicationRevisionCompressibleFields)
cpy.ApplicationRevisionCompressibleFields = ApplicationRevisionCompressibleFields{
// Application needs to have components.
Application: Application{Spec: ApplicationSpec{Components: []common.ApplicationComponent{}}},
}
if err != nil {
return nil, err
}
tmp.Alias = (*Alias)(cpy)
}
return json.Marshal(tmp.Alias)
}
// UnmarshalJSON serves the same purpose as the one in ResourceTrackerSpec.
func (apprev *ApplicationRevisionSpec) UnmarshalJSON(data []byte) error {
type Alias ApplicationRevisionSpec
tmp := &struct {
*Alias
}{}
if err := json.Unmarshal(data, tmp); err != nil {
return err
}
if tmp.Compression.Type != compression.Uncompressed {
err := tmp.Compression.DecodeTo(&tmp.ApplicationRevisionCompressibleFields)
if err != nil {
return err
}
tmp.Compression.Clean()
}
(*ApplicationRevisionSpec)(tmp.Alias).DeepCopyInto(apprev)
return nil
}
// ApplicationRevisionStatus is the status of ApplicationRevision
type ApplicationRevisionStatus struct {
// Succeeded records if the workflow finished running with success
Succeeded bool `json:"succeeded"`
// Workflow the running status of the workflow
Workflow *common.WorkflowStatus `json:"workflow,omitempty"`
// Record the context values to the revision.
WorkflowContext map[string]string `json:"workflowContext,omitempty"`
}
// +kubebuilder:object:root=true
@@ -72,14 +144,18 @@ type ApplicationRevisionSpec struct {
// ApplicationRevision is the Schema for the ApplicationRevision API
// +kubebuilder:storageversion
// +kubebuilder:resource:categories={oam},shortName=apprev
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
// +kubebuilder:printcolumn:name="PUBLISH_VERSION",type=string,JSONPath=`.metadata.annotations['app\.oam\.dev\/publishVersion']`
// +kubebuilder:printcolumn:name="SUCCEEDED",type=string,JSONPath=`.status.succeeded`
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ApplicationRevision struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ApplicationRevisionSpec `json:"spec,omitempty"`
Spec ApplicationRevisionSpec `json:"spec,omitempty"`
Status ApplicationRevisionStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true

View File

@@ -0,0 +1,86 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
"encoding/json"
"fmt"
"testing"
"github.com/kubevela/pkg/util/compression"
"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
func TestApplicationRevisionCompression(t *testing.T) {
// Fill data
spec := &ApplicationRevisionSpec{}
spec.Application = Application{Spec: ApplicationSpec{Components: []common.ApplicationComponent{{Name: "test-name"}}}}
spec.ComponentDefinitions = make(map[string]ComponentDefinition)
spec.ComponentDefinitions["def"] = ComponentDefinition{Spec: ComponentDefinitionSpec{PodSpecPath: "path"}}
spec.WorkloadDefinitions = make(map[string]WorkloadDefinition)
spec.WorkloadDefinitions["def"] = WorkloadDefinition{Spec: WorkloadDefinitionSpec{Reference: common.DefinitionReference{Name: "testdef"}}}
spec.TraitDefinitions = make(map[string]TraitDefinition)
spec.TraitDefinitions["def"] = TraitDefinition{Spec: TraitDefinitionSpec{ControlPlaneOnly: true}}
spec.ScopeDefinitions = make(map[string]ScopeDefinition)
spec.ScopeDefinitions["def"] = ScopeDefinition{Spec: ScopeDefinitionSpec{AllowComponentOverlap: true}}
spec.PolicyDefinitions = make(map[string]PolicyDefinition)
spec.PolicyDefinitions["def"] = PolicyDefinition{Spec: PolicyDefinitionSpec{ManageHealthCheck: true}}
spec.WorkflowStepDefinitions = make(map[string]WorkflowStepDefinition)
spec.WorkflowStepDefinitions["def"] = WorkflowStepDefinition{Spec: WorkflowStepDefinitionSpec{Reference: common.DefinitionReference{Name: "testname"}}}
spec.ReferredObjects = []common.ReferredObject{{RawExtension: runtime.RawExtension{Raw: []byte("123")}}}
testAppRev := &ApplicationRevision{Spec: *spec}
marshalAndUnmarshal := func(in *ApplicationRevision) (*ApplicationRevision, int) {
out := &ApplicationRevision{}
b, err := json.Marshal(in)
assert.NoError(t, err)
if in.Spec.Compression.Type != compression.Uncompressed {
assert.Contains(t, string(b), fmt.Sprintf("\"type\":\"%s\",\"data\":\"", in.Spec.Compression.Type))
}
err = json.Unmarshal(b, out)
assert.NoError(t, err)
assert.Equal(t, out.Spec.Compression.Type, in.Spec.Compression.Type)
assert.Equal(t, out.Spec.Compression.Data, "")
return out, len(b)
}
// uncompressed
testAppRev.Spec.Compression.SetType(compression.Uncompressed)
uncomp, uncompsize := marshalAndUnmarshal(testAppRev)
// zstd compressed
testAppRev.Spec.Compression.SetType(compression.Zstd)
zstdcomp, zstdsize := marshalAndUnmarshal(testAppRev)
// We will compare content later. Clear compression methods since it will interfere
// comparison and is verified earlier.
zstdcomp.Spec.Compression.SetType(compression.Uncompressed)
// gzip compressed
testAppRev.Spec.Compression.SetType(compression.Gzip)
gzipcomp, gzipsize := marshalAndUnmarshal(testAppRev)
gzipcomp.Spec.Compression.SetType(compression.Uncompressed)
assert.Equal(t, uncomp, zstdcomp)
assert.Equal(t, zstdcomp, gzipcomp)
assert.Less(t, zstdsize, uncompsize)
assert.Less(t, gzipsize, uncompsize)
}

View File

@@ -1,81 +0,0 @@
/*
Copyright 2021. The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
)
// AppRolloutSpec defines how to describe an upgrade between different apps
type AppRolloutSpec struct {
// TargetAppRevisionName contains the name of the applicationConfiguration that we need to upgrade to.
// Here we use an applicationConfiguration as a revision of an application, thus the name alone is suffice
TargetAppRevisionName string `json:"targetAppRevisionName"`
// SourceAppRevisionName contains the name of the applicationConfiguration that we need to upgrade from.
// it can be empty only when it's the first time to deploy the application
SourceAppRevisionName string `json:"sourceAppRevisionName,omitempty"`
// The list of component to upgrade in the application.
// We only support single component application so far
// TODO: (RZ) Support multiple components in an application
// +optional
ComponentList []string `json:"componentList,omitempty"`
// RolloutPlan is the details on how to rollout the resources
RolloutPlan v1alpha1.RolloutPlan `json:"rolloutPlan"`
// RevertOnDelete revert the failed rollout when the rollout CR is deleted
// It will revert the change back to the source version at once (not in batches)
// Default is false
// +optional
RevertOnDelete bool `json:"revertOnDelete,omitempty"`
}
// AppRollout is the Schema for the AppRollout API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=approllout
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="TARGET",type=string,JSONPath=`.status.rolloutTargetSize`
// +kubebuilder:printcolumn:name="UPGRADED",type=string,JSONPath=`.status.upgradedReplicas`
// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.upgradedReadyReplicas`
// +kubebuilder:printcolumn:name="BATCH-STATE",type=string,JSONPath=`.status.batchRollingState`
// +kubebuilder:printcolumn:name="ROLLING-STATE",type=string,JSONPath=`.status.rollingState`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type AppRollout struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AppRolloutSpec `json:"spec,omitempty"`
Status common.AppRolloutStatus `json:"status,omitempty"`
}
// AppRolloutList contains a list of AppRollout
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type AppRolloutList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AppRollout `json:"items"`
}

View File

@@ -1,64 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// ClusterSpec defines the desired state of Cluster
type ClusterSpec struct {
// KubeconfigSecretRef specifies the reference to the secret
// that contains the kubeconfig in field `config`.
KubeconfigSecretRef LocalSecretReference `json:"kubeconfigSecretRef,omitempty"`
}
// LocalSecretReference is a reference to a secret within the enclosing
// namespace.
type LocalSecretReference struct {
// Name of a secret within the enclosing namespace.
Name string `json:"name"`
}
// ClusterStatus defines the observed state of Cluster
type ClusterStatus struct {
}
// +kubebuilder:object:root=true
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Cluster is the Schema for the clusters API
type Cluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ClusterSpec `json:"spec,omitempty"`
Status ClusterStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ClusterList contains a list of Cluster
type ClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Cluster `json:"items"`
}

View File

@@ -17,7 +17,6 @@
package v1beta1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
@@ -121,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
@@ -139,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"`
@@ -155,11 +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
// ControlPlaneOnly defines which cluster is dispatched to
// +optional
SkipRevisionAffect bool `json:"skipRevisionAffect,omitempty"`
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
@@ -257,32 +278,3 @@ type ScopeDefinitionList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []ScopeDefinition `json:"items"`
}
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// An ResourceTracker represents a tracker for track cross namespace resources
// +kubebuilder:resource:scope=Cluster,categories={oam},shortName=tracker
type ResourceTracker struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Status ResourceTrackerStatus `json:"status,omitempty"`
}
// ResourceTrackerStatus define the status of resourceTracker
type ResourceTrackerStatus struct {
TrackedResources []corev1.ObjectReference `json:"trackedResources,omitempty"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ResourceTrackerList contains a list of ResourceTracker
type ResourceTrackerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ResourceTracker `json:"items"`
}

View File

@@ -1,100 +0,0 @@
/*
Copyright 2021. The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// InitializerPhase is a label for the condition of a initializer at the current time
type InitializerPhase string
const (
// InitializerCheckingDependsOn means the initializer is checking the status of dependent Initializer
InitializerCheckingDependsOn InitializerPhase = "checkingDependsOn"
// InitializerInitializing means the initializer is initializing
InitializerInitializing InitializerPhase = "initializing"
// InitializerSuccess means the initializer successfully initialized the environment
InitializerSuccess InitializerPhase = "success"
)
// DependsOn refer to an object which Initializer depends on
type DependsOn struct {
Ref corev1.ObjectReference `json:"ref"`
}
// A InitializerSpec defines the desired state of a Initializer.
type InitializerSpec struct {
// AppTemplate indicates the application template to render and deploy an system application.
AppTemplate Application `json:"appTemplate"`
// DependsOn indicates the other initializers that this depends on.
// It will not apply its components until all dependencies exist.
DependsOn []DependsOn `json:"dependsOn,omitempty"`
}
// InitializerStatus is the status of Initializer
type InitializerStatus struct {
// ConditionedStatus reflects the observed status of a resource
condition.ConditionedStatus `json:",inline"`
Phase InitializerPhase `json:"status,omitempty"`
// The generation observed by the Initializer controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration"`
}
// +kubebuilder:object:root=true
// Initializer is the Schema for the Initializer API
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=init
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.status`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Initializer struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec InitializerSpec `json:"spec,omitempty"`
Status InitializerStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// InitializerList contains a list of Initializer.
type InitializerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Initializer `json:"items"`
}
// SetConditions set condition for Initializer
func (i *Initializer) SetConditions(c ...condition.Condition) {
i.Status.SetConditions(c...)
}
// GetCondition gets condition from Initializer
func (i *Initializer) GetCondition(conditionType condition.ConditionType) condition.Condition {
return i.Status.GetCondition(conditionType)
}

View File

@@ -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"`
@@ -43,6 +44,9 @@ type PolicyDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
condition.ConditionedStatus `json:",inline"`
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
ConfigMapRef string `json:"configMapRef,omitempty"`
// LatestRevision of the component definition
// +optional
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
@@ -61,7 +65,7 @@ func (d *PolicyDefinition) GetCondition(conditionType condition.ConditionType) c
// +kubebuilder:object:root=true
// PolicyDefinition is the Schema for the policydefinitions API
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=policy
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=def-policy
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +genclient

View File

@@ -20,12 +20,15 @@ import (
"reflect"
"k8s.io/apimachinery/pkg/runtime/schema"
k8sscheme "k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/scheme"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// Package type metadata.
const (
Group = "core.oam.dev"
Group = common.Group
Version = "v1beta1"
)
@@ -96,14 +99,6 @@ var (
ApplicationKindVersionKind = SchemeGroupVersion.WithKind(ApplicationKind)
)
// AppRollout type metadata.
var (
AppRolloutKind = reflect.TypeOf(AppRollout{}).Name()
AppRolloutGroupKind = schema.GroupKind{Group: Group, Kind: AppRolloutKind}.String()
AppRolloutKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
AppRolloutKindVersionKind = SchemeGroupVersion.WithKind(AppRolloutKind)
)
// ApplicationRevision type metadata
var (
ApplicationRevisionKind = reflect.TypeOf(ApplicationRevision{}).Name()
@@ -128,30 +123,6 @@ var (
ResourceTrackerKindVersionKind = SchemeGroupVersion.WithKind(ResourceTrackerKind)
)
// AppDeployment type metadata.
var (
AppDeploymentKind = reflect.TypeOf(AppDeployment{}).Name()
AppDeploymentGroupKind = schema.GroupKind{Group: Group, Kind: AppDeploymentKind}.String()
AppDeploymentKindAPIVersion = AppDeploymentKind + "." + SchemeGroupVersion.String()
AppDeploymentKindVersionKind = SchemeGroupVersion.WithKind(AppDeploymentKind)
)
// Cluster type metadata.
var (
ClusterKind = reflect.TypeOf(Cluster{}).Name()
ClusterGroupKind = schema.GroupKind{Group: Group, Kind: ClusterKind}.String()
ClusterKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
ClusterKindVersionKind = SchemeGroupVersion.WithKind(ClusterKind)
)
// Initializer type metadata.
var (
InitializerKind = reflect.TypeOf(Initializer{}).Name()
InitializerGroupKind = schema.GroupKind{Group: Group, Kind: InitializerKind}.String()
InitializerKindAPIVersion = InitializerKind + "." + SchemeGroupVersion.String()
InitializerKindVersionKind = SchemeGroupVersion.WithKind(InitializerKind)
)
func init() {
SchemeBuilder.Register(&ComponentDefinition{}, &ComponentDefinitionList{})
SchemeBuilder.Register(&WorkloadDefinition{}, &WorkloadDefinitionList{})
@@ -161,12 +132,9 @@ func init() {
SchemeBuilder.Register(&DefinitionRevision{}, &DefinitionRevisionList{})
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
SchemeBuilder.Register(&Application{}, &ApplicationList{})
SchemeBuilder.Register(&AppRollout{}, &AppRolloutList{})
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})
SchemeBuilder.Register(&AppDeployment{}, &AppDeploymentList{})
SchemeBuilder.Register(&Cluster{}, &ClusterList{})
SchemeBuilder.Register(&ResourceTracker{}, &ResourceTrackerList{})
SchemeBuilder.Register(&Initializer{}, &InitializerList{})
_ = SchemeBuilder.AddToScheme(k8sscheme.Scheme)
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource

View File

@@ -0,0 +1,353 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
"encoding/json"
"reflect"
"strings"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/kubevela/pkg/util/compression"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/interfaces"
velatypes "github.com/oam-dev/kubevela/apis/types"
"github.com/oam-dev/kubevela/pkg/oam"
velaerr "github.com/oam-dev/kubevela/pkg/utils/errors"
)
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// An ResourceTracker represents a tracker for track cross namespace resources
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.spec.type`
// +kubebuilder:printcolumn:name="APP",type=string,JSONPath=`.metadata.labels['app\.oam\.dev\/name']`
// +kubebuilder:printcolumn:name="APP-NS",type=string,JSONPath=`.metadata.labels['app\.oam\.dev\/namespace']`
// +kubebuilder:printcolumn:name="APP-GEN",type=number,JSONPath=`.spec.applicationGeneration`
// +kubebuilder:resource:scope=Cluster,categories={oam},shortName=rt
type ResourceTracker struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ResourceTrackerSpec `json:"spec,omitempty"`
Status ResourceTrackerStatus `json:"status,omitempty"`
}
// ResourceTrackerType defines the type of resourceTracker
type ResourceTrackerType string
const (
// ResourceTrackerTypeRoot means resources in this resourceTracker will only be recycled when application is deleted
ResourceTrackerTypeRoot = ResourceTrackerType("root")
// ResourceTrackerTypeVersioned means resources in this resourceTracker will be recycled when this version is unused and this resource is not managed by latest RT
ResourceTrackerTypeVersioned = ResourceTrackerType("versioned")
// ResourceTrackerTypeComponentRevision stores all component revisions used
ResourceTrackerTypeComponentRevision = ResourceTrackerType("component-revision")
)
// ResourceTrackerSpec define the spec of resourceTracker
type ResourceTrackerSpec struct {
Type ResourceTrackerType `json:"type,omitempty"`
ApplicationGeneration int64 `json:"applicationGeneration"`
ManagedResources []ManagedResource `json:"managedResources,omitempty"`
Compression ResourceTrackerCompression `json:"compression,omitempty"`
}
// ResourceTrackerCompression represents the compressed components in ResourceTracker.
type ResourceTrackerCompression struct {
compression.CompressedText `json:",inline"`
}
// MarshalJSON will encode ResourceTrackerSpec according to the compression type. If type specified,
// it will encode data to compression data.
// Note: this is not the standard json Marshal process but re-use the framework function.
func (in *ResourceTrackerSpec) MarshalJSON() ([]byte, error) {
type Alias ResourceTrackerSpec
tmp := &struct{ *Alias }{}
if in.Compression.Type == compression.Uncompressed {
tmp.Alias = (*Alias)(in)
} else {
cpy := in.DeepCopy()
cpy.ManagedResources = nil
err := cpy.Compression.EncodeFrom(in.ManagedResources)
if err != nil {
return nil, err
}
tmp.Alias = (*Alias)(cpy)
}
return json.Marshal(tmp.Alias)
}
// UnmarshalJSON will decode ResourceTrackerSpec according to the compression type. If type specified,
// it will decode data from compression data.
// Note: this is not the standard json Unmarshal process but re-use the framework function.
func (in *ResourceTrackerSpec) UnmarshalJSON(src []byte) error {
type Alias ResourceTrackerSpec
tmp := &struct{ *Alias }{}
if err := json.Unmarshal(src, tmp); err != nil {
return err
}
if tmp.Compression.Type != compression.Uncompressed {
tmp.ManagedResources = []ManagedResource{}
err := tmp.Compression.DecodeTo(&tmp.ManagedResources)
if err != nil {
return err
}
tmp.Compression.Clean()
}
(*ResourceTrackerSpec)(tmp.Alias).DeepCopyInto(in)
return nil
}
// ManagedResource define the resource to be managed by ResourceTracker
type ManagedResource struct {
common.ClusterObjectReference `json:",inline"`
common.OAMObjectReference `json:",inline"`
// +kubebuilder:pruning:PreserveUnknownFields
Data *runtime.RawExtension `json:"raw,omitempty"`
// Deleted marks the resource to be deleted
Deleted bool `json:"deleted,omitempty"`
// SkipGC marks the resource to skip gc
SkipGC bool `json:"skipGC,omitempty"`
}
// Equal check if two managed resource equals
func (in ManagedResource) Equal(r ManagedResource) bool {
if !in.ClusterObjectReference.Equal(r.ClusterObjectReference) {
return false
}
if !in.OAMObjectReference.Equal(r.OAMObjectReference) {
return false
}
return reflect.DeepEqual(in.Data, r.Data)
}
// DisplayName readable name for locating resource
func (in ManagedResource) DisplayName() string {
s := in.Kind + " " + in.Name
if in.Namespace != "" || in.Cluster != "" {
s += " ("
if in.Cluster != "" {
s += "Cluster: " + in.Cluster
if in.Namespace != "" {
s += ", "
}
}
if in.Namespace != "" {
s += "Namespace: " + in.Namespace
}
s += ")"
}
return s
}
// NamespacedName namespacedName
func (in ManagedResource) NamespacedName() types.NamespacedName {
return types.NamespacedName{Namespace: in.Namespace, Name: in.Name}
}
// ResourceKey computes the key for managed resource, resources with the same key points to the same resource
func (in ManagedResource) ResourceKey() string {
group := in.GroupVersionKind().Group
kind := in.GroupVersionKind().Kind
cluster := in.Cluster
if cluster == "" {
cluster = velatypes.ClusterLocalName
}
return strings.Join([]string{group, kind, cluster, in.Namespace, in.Name}, "/")
}
// ComponentKey computes the key for the component which managed resource belongs to
func (in ManagedResource) ComponentKey() string {
return strings.Join([]string{in.Env, in.Component}, "/")
}
// UnmarshalTo unmarshal ManagedResource into target object
func (in ManagedResource) UnmarshalTo(obj interface{}) error {
if in.Data == nil || in.Data.Raw == nil {
return velaerr.ManagedResourceHasNoDataError{}
}
return json.Unmarshal(in.Data.Raw, obj)
}
// ToUnstructured converts managed resource into unstructured
func (in ManagedResource) ToUnstructured() *unstructured.Unstructured {
obj := &unstructured.Unstructured{}
obj.SetGroupVersionKind(in.GroupVersionKind())
obj.SetName(in.Name)
if in.Namespace != "" {
obj.SetNamespace(in.Namespace)
}
oam.SetCluster(obj, in.Cluster)
return obj
}
// ToUnstructuredWithData converts managed resource into unstructured and unmarshal data
func (in ManagedResource) ToUnstructuredWithData() (*unstructured.Unstructured, error) {
obj := in.ToUnstructured()
if err := in.UnmarshalTo(obj); err != nil {
if errors.Is(err, velaerr.ManagedResourceHasNoDataError{}) {
return nil, err
}
}
return obj, nil
}
// ResourceTrackerStatus define the status of resourceTracker
// For backward-compatibility
type ResourceTrackerStatus struct {
// Deprecated
TrackedResources []common.ClusterObjectReference `json:"trackedResources,omitempty"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ResourceTrackerList contains a list of ResourceTracker
type ResourceTrackerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ResourceTracker `json:"items"`
}
func (in *ResourceTracker) findMangedResourceIndex(mr ManagedResource) int {
for i, _mr := range in.Spec.ManagedResources {
if mr.ClusterObjectReference.Equal(_mr.ClusterObjectReference) {
return i
}
}
return -1
}
func newManagedResourceFromResource(rsc client.Object) ManagedResource {
gvk := rsc.GetObjectKind().GroupVersionKind()
return ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{
ObjectReference: corev1.ObjectReference{
APIVersion: gvk.GroupVersion().String(),
Kind: gvk.Kind,
Name: rsc.GetName(),
Namespace: rsc.GetNamespace(),
},
Cluster: oam.GetCluster(rsc),
},
OAMObjectReference: common.NewOAMObjectReferenceFromObject(rsc),
Deleted: false,
}
}
// ContainsManagedResource check if resource exists in ResourceTracker
func (in *ResourceTracker) ContainsManagedResource(rsc client.Object) bool {
mr := newManagedResourceFromResource(rsc)
return in.findMangedResourceIndex(mr) >= 0
}
// AddManagedResource add object to managed resources, if exists, update
func (in *ResourceTracker) AddManagedResource(rsc client.Object, metaOnly bool, skipGC bool, creator string) (updated bool) {
mr := newManagedResourceFromResource(rsc)
mr.SkipGC = skipGC
if !metaOnly {
mr.Data = &runtime.RawExtension{Object: rsc}
}
if creator != "" {
mr.ClusterObjectReference.Creator = creator
}
if idx := in.findMangedResourceIndex(mr); idx >= 0 {
if reflect.DeepEqual(in.Spec.ManagedResources[idx], mr) {
return false
}
in.Spec.ManagedResources[idx] = mr
} else {
in.Spec.ManagedResources = append(in.Spec.ManagedResources, mr)
}
return true
}
// DeleteManagedResource if remove flag is on, it will remove the object from recorded resources.
// otherwise, it will mark the object as deleted instead of removing it
// workflow stage: resources are marked as deleted (and execute the deletion action)
// state-keep stage: resources marked as deleted and successfully deleted will be removed from resourcetracker
func (in *ResourceTracker) DeleteManagedResource(rsc client.Object, remove bool) (updated bool) {
gvk := rsc.GetObjectKind().GroupVersionKind()
mr := ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{
ObjectReference: corev1.ObjectReference{
APIVersion: gvk.GroupVersion().String(),
Kind: gvk.Kind,
Name: rsc.GetName(),
Namespace: rsc.GetNamespace(),
},
Cluster: oam.GetCluster(rsc),
},
Deleted: true,
}
if idx := in.findMangedResourceIndex(mr); idx >= 0 {
if remove {
in.Spec.ManagedResources = append(in.Spec.ManagedResources[:idx], in.Spec.ManagedResources[idx+1:]...)
} else {
if reflect.DeepEqual(in.Spec.ManagedResources[idx], mr) {
return false
}
in.Spec.ManagedResources[idx] = mr
}
} else {
if !remove {
in.Spec.ManagedResources = append(in.Spec.ManagedResources, mr)
}
}
return true
}
// addClusterObjectReference
// Deprecated
func (in *ResourceTracker) addClusterObjectReference(ref common.ClusterObjectReference) bool {
for _, _rsc := range in.Status.TrackedResources {
if _rsc.Equal(ref) {
return true
}
}
in.Status.TrackedResources = append(in.Status.TrackedResources, ref)
return false
}
// AddTrackedResource add new object reference into tracked resources, return if already exists
// Deprecated
func (in *ResourceTracker) AddTrackedResource(rsc interfaces.TrackableResource) bool {
return in.addClusterObjectReference(common.ClusterObjectReference{
ObjectReference: corev1.ObjectReference{
APIVersion: rsc.GetAPIVersion(),
Kind: rsc.GetKind(),
Name: rsc.GetName(),
Namespace: rsc.GetNamespace(),
UID: rsc.GetUID(),
},
})
}

View File

@@ -0,0 +1,350 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
"encoding/json"
"fmt"
"os"
"strings"
"testing"
"time"
"github.com/kubevela/pkg/util/compression"
"github.com/stretchr/testify/require"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/utils/pointer"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/pkg/oam"
"github.com/oam-dev/kubevela/pkg/utils/errors"
)
func TestManagedResource_DeepCopyEqual(t *testing.T) {
r := require.New(t)
mr := ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{Cluster: "cluster"},
OAMObjectReference: common.OAMObjectReference{Component: "component"},
Data: &runtime.RawExtension{Raw: []byte("data")},
}
r.True(mr.Equal(*mr.DeepCopy()))
}
func TestManagedResource_Equal(t *testing.T) {
testCases := map[string]struct {
input1 ManagedResource
input2 ManagedResource
equal bool
}{
"equal": {
input1: ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{Cluster: "cluster"},
OAMObjectReference: common.OAMObjectReference{Component: "component"},
Data: &runtime.RawExtension{Raw: []byte("data")},
},
input2: ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{Cluster: "cluster"},
OAMObjectReference: common.OAMObjectReference{Component: "component"},
Data: &runtime.RawExtension{Raw: []byte("data")},
},
equal: true,
},
"ClusterObjectReference not equal": {
input1: ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{Cluster: "cluster"},
},
input2: ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{Cluster: "c"},
},
equal: false,
},
"OAMObjectReference not equal": {
input1: ManagedResource{
OAMObjectReference: common.OAMObjectReference{Component: "component"},
},
input2: ManagedResource{
OAMObjectReference: common.OAMObjectReference{Component: "c"},
},
equal: false,
},
"Data content not equal": {
input1: ManagedResource{
Data: &runtime.RawExtension{Raw: []byte("data")},
},
input2: ManagedResource{
Data: &runtime.RawExtension{Raw: []byte("d")},
},
equal: false,
},
"one data empty, one data not empty": {
input1: ManagedResource{Data: nil},
input2: ManagedResource{
Data: &runtime.RawExtension{Raw: []byte("d")},
},
equal: false,
},
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
r := require.New(t)
r.Equal(tc.equal, tc.input1.Equal(tc.input2))
r.Equal(tc.equal, tc.input2.Equal(tc.input1))
})
}
}
func TestManagedResourceKeys(t *testing.T) {
r := require.New(t)
input := ManagedResource{
ClusterObjectReference: common.ClusterObjectReference{
Cluster: "cluster",
ObjectReference: corev1.ObjectReference{
Namespace: "namespace",
Name: "name",
APIVersion: appsv1.SchemeGroupVersion.String(),
Kind: "Deployment",
},
},
OAMObjectReference: common.OAMObjectReference{
Env: "env",
Component: "component",
Trait: "trait",
},
}
r.Equal("namespace/name", input.NamespacedName().String())
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 appsv1.Deployment
deploy1.Spec.Replicas = pointer.Int32(5)
bs, err := json.Marshal(deploy1)
r.NoError(err)
r.ErrorIs(input.UnmarshalTo(&deploy2), errors.ManagedResourceHasNoDataError{})
_, err = input.ToUnstructuredWithData()
r.ErrorIs(err, errors.ManagedResourceHasNoDataError{})
input.Data = &runtime.RawExtension{Raw: bs}
r.NoError(input.UnmarshalTo(&deploy2))
r.Equal(deploy1, deploy2)
obj := input.ToUnstructured()
r.Equal("Deployment", obj.GetKind())
r.Equal("apps/v1", obj.GetAPIVersion())
r.Equal("name", obj.GetName())
r.Equal("namespace", obj.GetNamespace())
r.Equal("cluster", oam.GetCluster(obj))
obj, err = input.ToUnstructuredWithData()
r.NoError(err)
val, correct, err := unstructured.NestedInt64(obj.Object, "spec", "replicas")
r.NoError(err)
r.True(correct)
r.Equal(int64(5), val)
}
func TestResourceTracker_ManagedResource(t *testing.T) {
r := require.New(t)
input := &ResourceTracker{}
deploy1 := appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{Name: "deploy1"}}
input.AddManagedResource(&deploy1, true, false, "")
r.Equal(1, len(input.Spec.ManagedResources))
cm2 := corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: "cm2"}}
input.AddManagedResource(&cm2, false, false, "")
r.Equal(2, len(input.Spec.ManagedResources))
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, false, "")
r.Equal(3, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&cm2, false)
r.Equal(3, len(input.Spec.ManagedResources))
r.True(input.Spec.ManagedResources[1].Deleted)
input.DeleteManagedResource(&cm2, true)
r.Equal(2, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&deploy1, true)
r.Equal(1, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&pod3, true)
r.Equal(0, len(input.Spec.ManagedResources))
secret4 := corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "secret4"}}
input.DeleteManagedResource(&secret4, true)
r.Equal(0, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&secret4, false)
r.Equal(1, len(input.Spec.ManagedResources))
}
func TestResourceTrackerCompression(t *testing.T) {
count := 20
r := require.New(t)
// Load some real CRDs, and other test data to simulate real use-cases.
// The user must have some large resourcetrackers if they use compression,
// so we load some large CRDs.
var data []string
paths := []string{
"../../../charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_applications.yaml",
"../../../charts/vela-core/crds/core.oam.dev_definitionrevisions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_healthscopes.yaml",
"../../../charts/vela-core/crds/core.oam.dev_traitdefinitions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_componentdefinitions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_workloaddefinitions.yaml",
"../../../charts/vela-core/crds/standard.oam.dev_rollouts.yaml",
"../../../charts/vela-core/templates/kubevela-controller.yaml",
"../../../charts/vela-core/README.md",
"../../../pkg/velaql/providers/query/testdata/machinelearning.seldon.io_seldondeployments.yaml",
"../../../legacy/charts/vela-core-legacy/crds/standard.oam.dev_podspecworkloads.yaml",
}
for _, p := range paths {
b, err := os.ReadFile(p)
r.NoError(err)
data = append(data, string(b))
}
size := len(data)
// Gzip
var (
gzipCompressTime int64
gzipSize int
gzipBs []byte
)
for c := 0; c < count; c++ {
var err error
rtGzip := &ResourceTracker{}
for i := 0; i < size; i++ {
rtGzip.AddManagedResource(&corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("cm%d", i)}, Data: map[string]string{"1": data[i]}}, false, false, "")
rtGzip.AddManagedResource(&corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("secret%d", i)}}, true, false, "")
}
rtGzip.Spec.Compression.Type = compression.Gzip
// Compress
t0 := time.Now()
gzipBs, err = json.Marshal(rtGzip)
elapsed := time.Since(t0).Nanoseconds()
if gzipCompressTime == 0 {
gzipCompressTime = elapsed
} else {
gzipCompressTime = (elapsed + gzipCompressTime) / 2
}
if gzipSize == 0 {
gzipSize = len(gzipBs)
} else {
gzipSize = (len(gzipBs) + gzipSize) / 2
}
r.NoError(err)
r.Contains(string(gzipBs), `"type":"gzip","data":`)
}
// Zstd
var (
zstdCompressTime int64
zstdSize int
zstdBs []byte
)
for c := 0; c < count; c++ {
var err error
rtZstd := &ResourceTracker{}
for i := 0; i < size; i++ {
rtZstd.AddManagedResource(&corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("cm%d", i)}, Data: map[string]string{"1": data[i]}}, false, false, "")
rtZstd.AddManagedResource(&corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("secret%d", i)}}, true, false, "")
}
rtZstd.Spec.Compression.Type = compression.Zstd
t0 := time.Now()
zstdBs, err = json.Marshal(rtZstd)
elapsed := time.Since(t0).Nanoseconds()
if zstdCompressTime == 0 {
zstdCompressTime = elapsed
} else {
zstdCompressTime = (elapsed + zstdCompressTime) / 2
}
if zstdSize == 0 {
zstdSize = len(zstdBs)
} else {
zstdSize = (len(zstdBs) + zstdSize) / 2
}
r.NoError(err)
r.Contains(string(zstdBs), `"type":"zstd","data":`)
}
rtUncmp := &ResourceTracker{}
r.NoError(json.Unmarshal(gzipBs, rtUncmp))
r.Equal(size*2, len(rtUncmp.Spec.ManagedResources))
for i, rsc := range rtUncmp.Spec.ManagedResources {
r.Equal(i%2 == 1, rsc.Data == nil)
}
r.NoError(json.Unmarshal(zstdBs, rtUncmp))
r.Equal(size*2, len(rtUncmp.Spec.ManagedResources))
for i, rsc := range rtUncmp.Spec.ManagedResources {
r.Equal(i%2 == 1, rsc.Data == nil)
}
// No compression
var (
uncmpTime int64
uncmpSize int
)
rtUncmp.Spec.Compression.Type = compression.Uncompressed
for c := 0; c < count; c++ {
t0 := time.Now()
_bs, err := json.Marshal(rtUncmp)
if uncmpTime == 0 {
uncmpTime = time.Since(t0).Nanoseconds()
} else {
uncmpTime = (time.Since(t0).Nanoseconds() + uncmpTime) / 2
}
if uncmpSize == 0 {
uncmpSize = len(_bs)
} else {
uncmpSize = (len(_bs) + uncmpSize) / 2
}
r.NoError(err)
before, after := len(_bs), len(zstdBs)
r.Less(after, before)
before, after = len(_bs), len(gzipBs)
r.Less(after, before)
}
fmt.Printf(`Compressed Size:
uncompressed: %d bytes 100.00%%
gzip: %d bytes %.2f%%
zstd: %d bytes %.2f%%
`,
uncmpSize,
gzipSize, float64(gzipSize)*100.0/float64(uncmpSize),
zstdSize, float64(zstdSize)*100.0/float64(uncmpSize))
fmt.Printf(`Marshal Time:
no compression: %d ns 1.00x
gzip: %d ns %.2fx
zstd: %d ns %.2fx
`,
uncmpTime,
gzipCompressTime, float64(gzipCompressTime)/float64(uncmpTime),
zstdCompressTime, float64(zstdCompressTime)/float64(uncmpTime),
)
}
func TestResourceTrackerInvalidMarshal(t *testing.T) {
r := require.New(t)
rt := &ResourceTracker{}
rt.Spec.Compression.Type = "invalid"
_, err := json.Marshal(rt)
r.ErrorIs(err, compression.NewUnsupportedCompressionTypeError("invalid"))
r.True(strings.Contains(err.Error(), "invalid"))
r.ErrorIs(json.Unmarshal([]byte(`{"spec":{"compression":{"type":"invalid"}}}`), rt), compression.NewUnsupportedCompressionTypeError("invalid"))
r.NotNil(json.Unmarshal([]byte(`{"spec":{"compression":{"type":"gzip","data":"xxx"}}}`), rt))
r.NotNil(json.Unmarshal([]byte(`{"spec":["invalid"]}`), rt))
}

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"`
}
@@ -38,7 +39,8 @@ type WorkflowStepDefinitionSpec struct {
type WorkflowStepDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
condition.ConditionedStatus `json:",inline"`
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
ConfigMapRef string `json:"configMapRef,omitempty"`
// LatestRevision of the component definition
// +optional
LatestRevision *common.Revision `json:"latestRevision,omitempty"`

View File

@@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
@@ -21,127 +22,22 @@ limitations under the License.
package v1beta1
import (
corev1 "k8s.io/api/core/v1"
"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/standard.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.
func (in *AppDeployment) DeepCopyInto(out *AppDeployment) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppDeployment.
func (in *AppDeployment) DeepCopy() *AppDeployment {
if in == nil {
return nil
}
out := new(AppDeployment)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AppDeployment) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppDeploymentList) DeepCopyInto(out *AppDeploymentList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]AppDeployment, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppDeploymentList.
func (in *AppDeploymentList) DeepCopy() *AppDeploymentList {
if in == nil {
return nil
}
out := new(AppDeploymentList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AppDeploymentList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppDeploymentSpec) DeepCopyInto(out *AppDeploymentSpec) {
*out = *in
if in.Traffic != nil {
in, out := &in.Traffic, &out.Traffic
*out = new(Traffic)
(*in).DeepCopyInto(*out)
}
if in.AppRevisions != nil {
in, out := &in.AppRevisions, &out.AppRevisions
*out = make([]AppRevision, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppDeploymentSpec.
func (in *AppDeploymentSpec) DeepCopy() *AppDeploymentSpec {
if in == nil {
return nil
}
out := new(AppDeploymentSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppDeploymentStatus) DeepCopyInto(out *AppDeploymentStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
if in.Placement != nil {
in, out := &in.Placement, &out.Placement
*out = make([]PlacementStatus, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppDeploymentStatus.
func (in *AppDeploymentStatus) DeepCopy() *AppDeploymentStatus {
if in == nil {
return nil
}
out := new(AppDeploymentStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppPolicy) DeepCopyInto(out *AppPolicy) {
*out = *in
in.Properties.DeepCopyInto(&out.Properties)
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppPolicy.
@@ -154,108 +50,6 @@ func (in *AppPolicy) DeepCopy() *AppPolicy {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRevision) DeepCopyInto(out *AppRevision) {
*out = *in
if in.Placement != nil {
in, out := &in.Placement, &out.Placement
*out = make([]common.ClusterPlacement, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRevision.
func (in *AppRevision) DeepCopy() *AppRevision {
if in == nil {
return nil
}
out := new(AppRevision)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRollout) DeepCopyInto(out *AppRollout) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRollout.
func (in *AppRollout) DeepCopy() *AppRollout {
if in == nil {
return nil
}
out := new(AppRollout)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AppRollout) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRolloutList) DeepCopyInto(out *AppRolloutList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]AppRollout, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutList.
func (in *AppRolloutList) DeepCopy() *AppRolloutList {
if in == nil {
return nil
}
out := new(AppRolloutList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AppRolloutList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRolloutSpec) DeepCopyInto(out *AppRolloutSpec) {
*out = *in
if in.ComponentList != nil {
in, out := &in.ComponentList, &out.ComponentList
*out = make([]string, len(*in))
copy(*out, *in)
}
in.RolloutPlan.DeepCopyInto(&out.RolloutPlan)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutSpec.
func (in *AppRolloutSpec) DeepCopy() *AppRolloutSpec {
if in == nil {
return nil
}
out := new(AppRolloutSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Application) DeepCopyInto(out *Application) {
*out = *in
@@ -321,6 +115,7 @@ func (in *ApplicationRevision) DeepCopyInto(out *ApplicationRevision) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevision.
@@ -342,39 +137,7 @@ func (in *ApplicationRevision) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationRevisionList) DeepCopyInto(out *ApplicationRevisionList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ApplicationRevision, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevisionList.
func (in *ApplicationRevisionList) DeepCopy() *ApplicationRevisionList {
if in == nil {
return nil
}
out := new(ApplicationRevisionList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ApplicationRevisionList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationRevisionSpec) DeepCopyInto(out *ApplicationRevisionSpec) {
func (in *ApplicationRevisionCompressibleFields) DeepCopyInto(out *ApplicationRevisionCompressibleFields) {
*out = *in
in.Application.DeepCopyInto(&out.Application)
if in.ComponentDefinitions != nil {
@@ -426,15 +189,90 @@ func (in *ApplicationRevisionSpec) DeepCopyInto(out *ApplicationRevisionSpec) {
(*out)[key] = val
}
}
if in.Components != nil {
in, out := &in.Components, &out.Components
*out = make([]common.RawComponent, len(*in))
if in.Policies != nil {
in, out := &in.Policies, &out.Policies
*out = make(map[string]core_oam_devv1alpha1.Policy, len(*in))
for key, val := range *in {
(*out)[key] = *val.DeepCopy()
}
}
if in.Workflow != nil {
in, out := &in.Workflow, &out.Workflow
*out = new(v1alpha1.Workflow)
(*in).DeepCopyInto(*out)
}
if in.ReferredObjects != nil {
in, out := &in.ReferredObjects, &out.ReferredObjects
*out = make([]common.ReferredObject, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
in.ApplicationConfiguration.DeepCopyInto(&out.ApplicationConfiguration)
out.ResourcesConfigMap = in.ResourcesConfigMap
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevisionCompressibleFields.
func (in *ApplicationRevisionCompressibleFields) DeepCopy() *ApplicationRevisionCompressibleFields {
if in == nil {
return nil
}
out := new(ApplicationRevisionCompressibleFields)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationRevisionCompression) DeepCopyInto(out *ApplicationRevisionCompression) {
*out = *in
out.CompressedText = in.CompressedText
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevisionCompression.
func (in *ApplicationRevisionCompression) DeepCopy() *ApplicationRevisionCompression {
if in == nil {
return nil
}
out := new(ApplicationRevisionCompression)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationRevisionList) DeepCopyInto(out *ApplicationRevisionList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ApplicationRevision, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevisionList.
func (in *ApplicationRevisionList) DeepCopy() *ApplicationRevisionList {
if in == nil {
return nil
}
out := new(ApplicationRevisionList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ApplicationRevisionList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationRevisionSpec) DeepCopyInto(out *ApplicationRevisionSpec) {
*out = *in
in.ApplicationRevisionCompressibleFields.DeepCopyInto(&out.ApplicationRevisionCompressibleFields)
out.Compression = in.Compression
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevisionSpec.
@@ -447,6 +285,33 @@ func (in *ApplicationRevisionSpec) DeepCopy() *ApplicationRevisionSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationRevisionStatus) DeepCopyInto(out *ApplicationRevisionStatus) {
*out = *in
if in.Workflow != nil {
in, out := &in.Workflow, &out.Workflow
*out = new(common.WorkflowStatus)
(*in).DeepCopyInto(*out)
}
if in.WorkflowContext != nil {
in, out := &in.WorkflowContext, &out.WorkflowContext
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationRevisionStatus.
func (in *ApplicationRevisionStatus) DeepCopy() *ApplicationRevisionStatus {
if in == nil {
return nil
}
out := new(ApplicationRevisionStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationSpec) DeepCopyInto(out *ApplicationSpec) {
*out = *in
@@ -469,11 +334,6 @@ func (in *ApplicationSpec) DeepCopyInto(out *ApplicationSpec) {
*out = new(Workflow)
(*in).DeepCopyInto(*out)
}
if in.RolloutPlan != nil {
in, out := &in.RolloutPlan, &out.RolloutPlan
*out = new(v1alpha1.RolloutPlan)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationSpec.
@@ -486,111 +346,6 @@ func (in *ApplicationSpec) DeepCopy() *ApplicationSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Cluster) DeepCopyInto(out *Cluster) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
out.Status = in.Status
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster.
func (in *Cluster) DeepCopy() *Cluster {
if in == nil {
return nil
}
out := new(Cluster)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Cluster) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterList) DeepCopyInto(out *ClusterList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Cluster, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList.
func (in *ClusterList) DeepCopy() *ClusterList {
if in == nil {
return nil
}
out := new(ClusterList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterPlacementStatus) DeepCopyInto(out *ClusterPlacementStatus) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPlacementStatus.
func (in *ClusterPlacementStatus) DeepCopy() *ClusterPlacementStatus {
if in == nil {
return nil
}
out := new(ClusterPlacementStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
*out = *in
out.KubeconfigSecretRef = in.KubeconfigSecretRef
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec.
func (in *ClusterSpec) DeepCopy() *ClusterSpec {
if in == nil {
return nil
}
out := new(ClusterSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus.
func (in *ClusterStatus) DeepCopy() *ClusterStatus {
if in == nil {
return nil
}
out := new(ClusterStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ComponentDefinition) DeepCopyInto(out *ComponentDefinition) {
*out = *in
@@ -787,199 +542,23 @@ func (in *DefinitionRevisionSpec) DeepCopy() *DefinitionRevisionSpec {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DependsOn) DeepCopyInto(out *DependsOn) {
func (in *ManagedResource) DeepCopyInto(out *ManagedResource) {
*out = *in
out.Ref = in.Ref
out.ClusterObjectReference = in.ClusterObjectReference
out.OAMObjectReference = in.OAMObjectReference
if in.Data != nil {
in, out := &in.Data, &out.Data
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DependsOn.
func (in *DependsOn) DeepCopy() *DependsOn {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedResource.
func (in *ManagedResource) DeepCopy() *ManagedResource {
if in == nil {
return nil
}
out := new(DependsOn)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HTTPMatchRequest) DeepCopyInto(out *HTTPMatchRequest) {
*out = *in
if in.URI != nil {
in, out := &in.URI, &out.URI
*out = new(URIMatch)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPMatchRequest.
func (in *HTTPMatchRequest) DeepCopy() *HTTPMatchRequest {
if in == nil {
return nil
}
out := new(HTTPMatchRequest)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HTTPRule) DeepCopyInto(out *HTTPRule) {
*out = *in
if in.Match != nil {
in, out := &in.Match, &out.Match
*out = make([]*HTTPMatchRequest, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(HTTPMatchRequest)
(*in).DeepCopyInto(*out)
}
}
}
if in.WeightedTargets != nil {
in, out := &in.WeightedTargets, &out.WeightedTargets
*out = make([]WeightedTarget, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRule.
func (in *HTTPRule) DeepCopy() *HTTPRule {
if in == nil {
return nil
}
out := new(HTTPRule)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Initializer) DeepCopyInto(out *Initializer) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Initializer.
func (in *Initializer) DeepCopy() *Initializer {
if in == nil {
return nil
}
out := new(Initializer)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Initializer) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *InitializerList) DeepCopyInto(out *InitializerList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Initializer, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InitializerList.
func (in *InitializerList) DeepCopy() *InitializerList {
if in == nil {
return nil
}
out := new(InitializerList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *InitializerList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *InitializerSpec) DeepCopyInto(out *InitializerSpec) {
*out = *in
in.AppTemplate.DeepCopyInto(&out.AppTemplate)
if in.DependsOn != nil {
in, out := &in.DependsOn, &out.DependsOn
*out = make([]DependsOn, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InitializerSpec.
func (in *InitializerSpec) DeepCopy() *InitializerSpec {
if in == nil {
return nil
}
out := new(InitializerSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *InitializerStatus) DeepCopyInto(out *InitializerStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InitializerStatus.
func (in *InitializerStatus) DeepCopy() *InitializerStatus {
if in == nil {
return nil
}
out := new(InitializerStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LocalSecretReference) DeepCopyInto(out *LocalSecretReference) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalSecretReference.
func (in *LocalSecretReference) DeepCopy() *LocalSecretReference {
if in == nil {
return nil
}
out := new(LocalSecretReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PlacementStatus) DeepCopyInto(out *PlacementStatus) {
*out = *in
if in.Clusters != nil {
in, out := &in.Clusters, &out.Clusters
*out = make([]ClusterPlacementStatus, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementStatus.
func (in *PlacementStatus) DeepCopy() *PlacementStatus {
if in == nil {
return nil
}
out := new(PlacementStatus)
out := new(ManagedResource)
in.DeepCopyInto(out)
return out
}
@@ -1090,6 +669,7 @@ func (in *ResourceTracker) DeepCopyInto(out *ResourceTracker) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
@@ -1111,6 +691,22 @@ func (in *ResourceTracker) DeepCopyObject() runtime.Object {
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceTrackerCompression) DeepCopyInto(out *ResourceTrackerCompression) {
*out = *in
out.CompressedText = in.CompressedText
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceTrackerCompression.
func (in *ResourceTrackerCompression) DeepCopy() *ResourceTrackerCompression {
if in == nil {
return nil
}
out := new(ResourceTrackerCompression)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceTrackerList) DeepCopyInto(out *ResourceTrackerList) {
*out = *in
@@ -1143,12 +739,35 @@ func (in *ResourceTrackerList) DeepCopyObject() runtime.Object {
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceTrackerSpec) DeepCopyInto(out *ResourceTrackerSpec) {
*out = *in
if in.ManagedResources != nil {
in, out := &in.ManagedResources, &out.ManagedResources
*out = make([]ManagedResource, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
out.Compression = in.Compression
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceTrackerSpec.
func (in *ResourceTrackerSpec) DeepCopy() *ResourceTrackerSpec {
if in == nil {
return nil
}
out := new(ResourceTrackerSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceTrackerStatus) DeepCopyInto(out *ResourceTrackerStatus) {
*out = *in
if in.TrackedResources != nil {
in, out := &in.TrackedResources, &out.TrackedResources
*out = make([]corev1.ObjectReference, len(*in))
*out = make([]common.ClusterObjectReference, len(*in))
copy(*out, *in)
}
}
@@ -1242,38 +861,6 @@ func (in *ScopeDefinitionSpec) DeepCopy() *ScopeDefinitionSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Traffic) DeepCopyInto(out *Traffic) {
*out = *in
if in.Hosts != nil {
in, out := &in.Hosts, &out.Hosts
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Gateways != nil {
in, out := &in.Gateways, &out.Gateways
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.HTTP != nil {
in, out := &in.HTTP, &out.HTTP
*out = make([]HTTPRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Traffic.
func (in *Traffic) DeepCopy() *Traffic {
if in == nil {
return nil
}
out := new(Traffic)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TraitDefinition) DeepCopyInto(out *TraitDefinition) {
*out = *in
@@ -1395,42 +982,17 @@ func (in *TraitDefinitionStatus) DeepCopy() *TraitDefinitionStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *URIMatch) DeepCopyInto(out *URIMatch) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new URIMatch.
func (in *URIMatch) DeepCopy() *URIMatch {
if in == nil {
return nil
}
out := new(URIMatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WeightedTarget) DeepCopyInto(out *WeightedTarget) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WeightedTarget.
func (in *WeightedTarget) DeepCopy() *WeightedTarget {
if in == nil {
return nil
}
out := new(WeightedTarget)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Workflow) DeepCopyInto(out *Workflow) {
*out = *in
if in.Mode != nil {
in, out := &in.Mode, &out.Mode
*out = new(v1alpha1.WorkflowExecuteMode)
**out = **in
}
if in.Steps != nil {
in, out := &in.Steps, &out.Steps
*out = make([]WorkflowStep, len(*in))
*out = make([]v1alpha1.WorkflowStep, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@@ -1447,37 +1009,6 @@ func (in *Workflow) DeepCopy() *Workflow {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkflowStep) DeepCopyInto(out *WorkflowStep) {
*out = *in
in.Properties.DeepCopyInto(&out.Properties)
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

@@ -1,3 +1,4 @@
//go:build generate
// +build generate
/*

View File

@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,25 +14,22 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package controllers_test
package interfaces
import (
"context"
"time"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)
var verifyComponentCreated = func(testcase, namespace, compName string) {
Eventually(
func() error {
comp := v1alpha2.Component{}
return k8sClient.Get(context.TODO(), client.ObjectKey{Namespace: namespace, Name: compName}, &comp)
},
time.Second*3, 30*time.Millisecond).Should(BeNil(), "check component created fail for test "+testcase)
// ObjectOwner is the interface for get and set ownerReference
type ObjectOwner interface {
GetOwnerReferences() []metav1.OwnerReference
SetOwnerReferences([]metav1.OwnerReference)
}
// TrackableResource is the interface for resources to be tracked by resourcetracker
type TrackableResource interface {
client.Object
metav1.Type
ObjectOwner
}

View File

@@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*

View File

@@ -19,12 +19,11 @@ package types
import (
"encoding/json"
"cuelang.org/go/cue"
"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"cuelang.org/go/cue"
"github.com/spf13/pflag"
)
// Source record the source of Capability
@@ -79,6 +78,10 @@ const CapabilityConfigMapNamePrefix = "schema-"
const (
// OpenapiV3JSONSchema is the key to store OpenAPI v3 JSON schema in ConfigMap
OpenapiV3JSONSchema string = "openapi-v3-json-schema"
// UISchema is the key to store ui custom schema
UISchema string = "ui-schema"
// VelaQLConfigmapKey is the key to store velaql view
VelaQLConfigmapKey string = "template"
)
// CapabilityCategory defines the category of a capability
@@ -162,6 +165,7 @@ type Capability struct {
Center string `json:"center,omitempty"`
Status string `json:"status,omitempty"`
Description string `json:"description,omitempty"`
Example string `json:"example,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Category CapabilityCategory `json:"category,omitempty"`
@@ -178,6 +182,8 @@ type Capability struct {
// Terraform
TerraformConfiguration string `json:"terraformConfiguration,omitempty"`
ConfigurationType string `json:"configurationType,omitempty"`
Path string `json:"path,omitempty"`
// KubeTemplate
KubeTemplate runtime.RawExtension `json:"kubetemplate,omitempty"`

View File

@@ -28,9 +28,11 @@ type ComponentManifest struct {
RevisionName string
RevisionHash string
ExternalRevision string
// StandardWorkload contains K8s resource generated from "output" block of ComponentDefinition
StandardWorkload *unstructured.Unstructured
Traits []*unstructured.Unstructured
Scopes []*corev1.ObjectReference
// Traits contains both resources generated from "outputs" block of ComponentDefinition and resources generated from TraitDefinition
Traits []*unstructured.Unstructured
Scopes []*corev1.ObjectReference
// PackagedWorkloadResources contain all the workload related resources. It could be a Helm
// Release, Git Repo or anything that can package and run a workload.

View File

@@ -18,13 +18,14 @@ package types
// reason for Application
const (
ReasonParsed = "Parsed"
ReasonRendered = "Rendered"
ReasonRevisoned = "Revisioned"
ReasonApplied = "Applied"
ReasonHealthCheck = "HealthChecked"
ReasonDeployed = "Deployed"
ReasonRollout = "Rollout"
ReasonParsed = "Parsed"
ReasonRendered = "Rendered"
ReasonPolicyGenerated = "PolicyGenerated"
ReasonRevisoned = "Revisioned"
ReasonApplied = "Applied"
ReasonHealthCheck = "HealthChecked"
ReasonDeployed = "Deployed"
ReasonRollout = "Rollout"
ReasonFailedParse = "FailedParse"
ReasonFailedRender = "FailedRender"
@@ -32,6 +33,7 @@ const (
ReasonFailedWorkflow = "FailedWorkflow"
ReasonFailedApply = "FailedApply"
ReasonFailedHealthCheck = "FailedHealthCheck"
ReasonFailedStateKeep = "FailedStateKeep"
ReasonFailedGC = "FailedGC"
ReasonFailedRollout = "FailedRollout"
)
@@ -40,6 +42,7 @@ const (
const (
MessageParsed = "Parsed successfully"
MessageRendered = "Rendered successfully"
MessagePolicyGenerated = "Policy generated successfully"
MessageRevisioned = "Revisioned successfully"
MessageApplied = "Applied successfully"
MessageWorkflowFinished = "Workflow finished"

View File

@@ -0,0 +1,56 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package types
import (
"github.com/oam-dev/cluster-gateway/pkg/apis/cluster/v1alpha1"
"github.com/oam-dev/cluster-gateway/pkg/config"
)
const (
// ClusterLocalName the name for the hub cluster
ClusterLocalName = "local"
// CredentialTypeInternal identifies the virtual cluster from internal kubevela system
CredentialTypeInternal v1alpha1.CredentialType = "Internal"
// CredentialTypeOCMManagedCluster identifies the virtual cluster from ocm
CredentialTypeOCMManagedCluster v1alpha1.CredentialType = "ManagedCluster"
// ClusterBlankEndpoint identifies the endpoint of a cluster as blank (not available)
ClusterBlankEndpoint = "-"
// ClustersArg indicates the argument for specific clusters to install addon
ClustersArg = "clusters"
)
var (
// AnnotationClusterAlias the annotation key for cluster alias
AnnotationClusterAlias = config.MetaApiGroupName + "/cluster-alias"
// 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

@@ -19,8 +19,13 @@ package types
import "github.com/oam-dev/kubevela/pkg/oam"
const (
// DefaultKubeVelaNS defines the default KubeVela namespace in Kubernetes
DefaultKubeVelaNS = "vela-system"
// KubeVelaName name of kubevela
KubeVelaName = "kubevela"
// VelaCoreName name of vela-core
VelaCoreName = "vela-core"
)
const (
// DefaultKubeVelaReleaseName defines the default name of KubeVela Release
DefaultKubeVelaReleaseName = "kubevela"
// DefaultKubeVelaChartName defines the default chart name of KubeVela, this variable MUST align to the chart name of this repo
@@ -33,11 +38,68 @@ const (
DefaultAppNamespace = "default"
// AutoDetectWorkloadDefinition defines the default workload type for ComponentDefinition which doesn't specify a workload
AutoDetectWorkloadDefinition = "autodetects.core.oam.dev"
// KubeVelaControllerDeployment defines the KubeVela controller's deployment name
KubeVelaControllerDeployment = "kubevela-vela-core"
)
// DefaultKubeVelaNS defines the default KubeVela namespace in Kubernetes
var DefaultKubeVelaNS = "vela-system"
const (
// AnnDescription is the annotation which describe what is the capability used for in a WorkloadDefinition/TraitDefinition Object
AnnDescription = "definition.oam.dev/description"
// AnnoDefinitionDescription is the annotation which describe what is the capability used for in a WorkloadDefinition/TraitDefinition Object
AnnoDefinitionDescription = "definition.oam.dev/description"
// AnnoDefinitionExampleURL is the annotation which describe url of usage examples of the capability, it will be loaded in documentation generate.
AnnoDefinitionExampleURL = "definition.oam.dev/example-url"
// AnnoDefinitionAlias is the annotation for definition alias
AnnoDefinitionAlias = "definition.oam.dev/alias"
// AnnoDefinitionIcon is the annotation which describe the icon url
AnnoDefinitionIcon = "definition.oam.dev/icon"
// AnnoDefinitionAppliedWorkloads is the annotation which describe what is the workloads used for in a TraitDefinition Object
AnnoDefinitionAppliedWorkloads = "definition.oam.dev/appliedWorkloads"
// LabelDefinition is the label for definition
LabelDefinition = "definition.oam.dev"
// LabelDefinitionName is the label for definition name
LabelDefinitionName = "definition.oam.dev/name"
// LabelDefinitionDeprecated is the label which describe whether the capability is deprecated
LabelDefinitionDeprecated = "custom.definition.oam.dev/deprecated"
// LabelDefinitionHidden is the label which describe whether the capability is hidden by UI
LabelDefinitionHidden = "custom.definition.oam.dev/ui-hidden"
// LabelDefinitionScope is the label which describe whether the capability's scope
LabelDefinitionScope = "custom.definition.oam.dev/scope"
// LabelNodeRoleGateway gateway role of node
LabelNodeRoleGateway = "node-role.kubernetes.io/gateway"
// LabelNodeRoleWorker worker role of node
LabelNodeRoleWorker = "node-role.kubernetes.io/worker"
// AnnoIngressControllerHTTPSPort define ingress controller listen port for https
AnnoIngressControllerHTTPSPort = "ingress.controller/https-port"
// AnnoIngressControllerHTTPPort define ingress controller listen port for http
AnnoIngressControllerHTTPPort = "ingress.controller/http-port"
// AnnoIngressControllerHost define ingress controller externally host
AnnoIngressControllerHost = "ingress.controller/host"
// LabelConfigType is the label marked as the template that generated the config.
LabelConfigType = "config.oam.dev/type"
// 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"
// LabelConfigProject is the label for config project
LabelConfigProject = "config.oam.dev/project"
// LabelConfigSyncToMultiCluster is the label to decide whether a config will be synchronized to multi-cluster
LabelConfigSyncToMultiCluster = "config.oam.dev/multi-cluster"
// LabelConfigIdentifier is the label for config identifier
LabelConfigIdentifier = "config.oam.dev/identifier"
// 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 (
@@ -47,29 +109,39 @@ const (
StatusStaging = "Staging"
)
// EnvMeta stores the info for app environment
// Config contains key/value pairs
type Config map[string]string
// EnvMeta stores the namespace for app environment
type EnvMeta struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Email string `json:"email,omitempty"`
Domain string `json:"domain,omitempty"`
Current string `json:"current,omitempty"`
Labels string `json:"labels"`
Current string `json:"current"`
}
const (
// TagCommandType used for tag cli category
TagCommandType = "commandType"
// TagCommandOrder defines the order
TagCommandOrder = "commandOrder"
// TypeStart defines one category
TypeStart = "Getting Started"
// TypeApp defines one category
TypeApp = "Managing Applications"
// TypeCap defines one category
TypeCap = "Managing Capabilities"
// TypeCD defines workflow Management operations
TypeCD = "Continuous Delivery"
// TypeExtension defines one category
TypeExtension = "Managing Extension"
// TypeSystem defines one category
TypeSystem = "System"
// TypeDefinition defines one category
TypeDefinition = "Managing Definitions"
TypeSystem = "Others"
// TypePlugin defines one category used in Kubectl Plugin
TypePlugin = "Plugin Command"
)
@@ -84,4 +156,33 @@ var DefaultFilterAnnots = []string{
oam.AnnotationInplaceUpgrade,
oam.AnnotationFilterLabelKeys,
oam.AnnotationFilterAnnotationKeys,
oam.AnnotationLastAppliedConfiguration,
}
// ConfigType is the type of config
type ConfigType string
const (
// TerraformProvider is the config type for terraform provider
TerraformProvider = "terraform-provider"
// DexConnector is the config type for dex connector
DexConnector = "dex-connector"
// ImageRegistry is the config type for image registry
ImageRegistry = "image-registry"
// HelmRepository is the config type for Helm chart repository
HelmRepository = "helm-repository"
// CatalogConfigDistribution is the catalog type
CatalogConfigDistribution = "config-distribution"
)
const (
// TerraformComponentPrefix is the prefix of component type of terraform-xxx
TerraformComponentPrefix = "terraform-"
// ProviderAppPrefix is the prefix of the application to create a Terraform Provider
ProviderAppPrefix = "config-terraform-provider"
// ProviderNamespace is the namespace of Terraform Cloud Provider
ProviderNamespace = "default"
// VelaCoreConfig is to mark application, config and its secret or Terraform provider lelong to a KubeVela config
VelaCoreConfig = "velacore-config"
)

View File

@@ -1,21 +0,0 @@
apiVersion: v2
name: oam-runtime
description: A Helm chart for oam-runtime aligns with OAM spec v0.2
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 0.1.0

View File

@@ -1,178 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: components.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: Component
listKind: ComponentList
plural: components
singular: component
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.workload.kind
name: WORKLOAD-KIND
type: string
- jsonPath: .metadata.creationTimestamp
name: age
type: date
name: v1alpha2
schema:
openAPIV3Schema:
description: A Component describes how an OAM workload kind may be instantiated.
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 ComponentSpec defines the desired state of a Component.
properties:
helm:
description: HelmRelease records a Helm release used by a Helm module
workload.
properties:
release:
description: Release records a Helm release used by a Helm module
workload.
type: object
x-kubernetes-preserve-unknown-fields: true
repository:
description: HelmRelease records a Helm repository used by a Helm
module workload.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- release
- repository
type: object
parameters:
description: Parameters exposed by this component. ApplicationConfigurations
that reference this component may specify values for these parameters,
which will in turn be injected into the embedded workload.
items:
description: A ComponentParameter defines a configurable parameter
of a component.
properties:
description:
description: Description of this parameter.
type: string
fieldPaths:
description: FieldPaths specifies an array of fields within
this Component's workload that will be overwritten by the
value of this parameter. The type of the parameter (e.g. int,
string) is inferred from the type of these fields; All fields
must be of the same type. Fields are specified as JSON field
paths without a leading dot, for example 'spec.replicas'.
items:
type: string
type: array
name:
description: Name of this parameter. OAM ApplicationConfigurations
will specify parameter values using this name.
type: string
required:
default: false
description: Required specifies whether or not a value for this
parameter must be supplied when authoring an ApplicationConfiguration.
type: boolean
required:
- fieldPaths
- name
type: object
type: array
workload:
description: A Workload that will be created for each ApplicationConfiguration
that includes this Component. Workload is an instance of a workloadDefinition.
We either use the GVK info or a special "type" field in the workload
to associate the content of the workload with its workloadDefinition
type: object
x-kubernetes-embedded-resource: true
x-kubernetes-preserve-unknown-fields: true
required:
- workload
type: object
status:
description: A ComponentStatus represents the observed state of a Component.
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
latestRevision:
description: LatestRevision of component
properties:
name:
type: string
revision:
format: int64
type: integer
revisionHash:
description: RevisionHash record the hash value of the spec of
ApplicationRevision object.
type: string
required:
- name
- revision
type: object
observedGeneration:
description: The generation observed by the component controller.
format: int64
type: integer
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -1,593 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: containerizedworkloads.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: ContainerizedWorkload
listKind: ContainerizedWorkloadList
plural: containerizedworkloads
singular: containerizedworkload
scope: Namespaced
versions:
- name: v1alpha2
schema:
openAPIV3Schema:
description: A ContainerizedWorkload is a workload that runs OCI containers.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: A ContainerizedWorkloadSpec defines the desired state of
a ContainerizedWorkload.
properties:
arch:
description: CPUArchitecture required by this workload.
enum:
- i386
- amd64
- arm
- arm64
type: string
containers:
description: Containers of which this workload consists.
items:
description: A Container represents an Open Containers Initiative
(OCI) container.
properties:
args:
description: Arguments to be passed to the command run by this
container.
items:
type: string
type: array
command:
description: Command to be run by this container.
items:
type: string
type: array
config:
description: ConfigFiles that should be written within this
container.
items:
description: A ContainerConfigFile specifies a configuration
file that should be written within a container.
properties:
fromSecret:
description: FromSecret is a secret key reference which
can be used to assign a value to be written to the configuration
file at the given path in the container.
properties:
key:
description: The key to select.
type: string
name:
description: The name of the secret.
type: string
required:
- key
- name
type: object
path:
description: Path within the container at which the configuration
file should be written.
type: string
value:
description: Value that should be written to the configuration
file.
type: string
required:
- path
type: object
type: array
env:
description: Environment variables that should be set within
this container.
items:
description: A ContainerEnvVar specifies an environment variable
that should be set within a container.
properties:
fromSecret:
description: FromSecret is a secret key reference which
can be used to assign a value to the environment variable.
properties:
key:
description: The key to select.
type: string
name:
description: The name of the secret.
type: string
required:
- key
- name
type: object
name:
description: Name of the environment variable. Must be
composed of valid Unicode letter and number characters,
as well as _ and -.
pattern: ^[-_a-zA-Z0-9]+$
type: string
value:
description: Value of the environment variable.
type: string
required:
- name
type: object
type: array
image:
description: Image this container should run. Must be a path-like
or URI-like representation of an OCI image. May be prefixed
with a registry address and should be suffixed with a tag.
type: string
imagePullSecret:
description: ImagePullSecret specifies the name of a Secret
from which the credentials required to pull this container's
image can be loaded.
type: string
livenessProbe:
description: A LivenessProbe assesses whether this container
is alive. Containers that fail liveness probes will be restarted.
properties:
exec:
description: Exec probes a container's health by executing
a command.
properties:
command:
description: Command to be run by this probe.
items:
type: string
type: array
required:
- command
type: object
failureThreshold:
description: FailureThreshold specifies how many consecutive
probes must fail in order for the container to be considered
healthy.
format: int32
type: integer
httpGet:
description: HTTPGet probes a container's health by sending
an HTTP GET request.
properties:
httpHeaders:
description: HTTPHeaders to send with the GET request.
items:
description: A HTTPHeader to be passed when probing
a container.
properties:
name:
description: Name of this HTTP header. Must be
unique per probe.
type: string
value:
description: Value of this HTTP header.
type: string
required:
- name
- value
type: object
type: array
path:
description: Path to probe, e.g. '/healthz'.
type: string
port:
description: Port to probe.
format: int32
type: integer
required:
- path
- port
type: object
initialDelaySeconds:
description: InitialDelaySeconds after a container starts
before the first probe.
format: int32
type: integer
periodSeconds:
description: PeriodSeconds between probes.
format: int32
type: integer
successThreshold:
description: SuccessThreshold specifies how many consecutive
probes must success in order for the container to be considered
healthy.
format: int32
type: integer
tcpSocket:
description: TCPSocketProbe probes a container's health
by connecting to a TCP socket.
properties:
port:
description: Port this probe should connect to.
format: int32
type: integer
required:
- port
type: object
timeoutSeconds:
description: TimeoutSeconds after which the probe times
out.
format: int32
type: integer
type: object
name:
description: Name of this container. Must be unique within its
workload.
type: string
ports:
description: Ports exposed by this container.
items:
description: A ContainerPort specifies a port that is exposed
by a container.
properties:
containerPort:
description: Port number. Must be unique within its container.
format: int32
type: integer
name:
description: Name of this port. Must be unique within
its container. Must be lowercase alphabetical characters.
pattern: ^[a-z]+$
type: string
protocol:
description: Protocol used by the server listening on
this port.
enum:
- TCP
- UDP
type: string
required:
- containerPort
- name
type: object
type: array
readinessProbe:
description: A ReadinessProbe assesses whether this container
is ready to serve requests. Containers that fail readiness
probes will be withdrawn from service.
properties:
exec:
description: Exec probes a container's health by executing
a command.
properties:
command:
description: Command to be run by this probe.
items:
type: string
type: array
required:
- command
type: object
failureThreshold:
description: FailureThreshold specifies how many consecutive
probes must fail in order for the container to be considered
healthy.
format: int32
type: integer
httpGet:
description: HTTPGet probes a container's health by sending
an HTTP GET request.
properties:
httpHeaders:
description: HTTPHeaders to send with the GET request.
items:
description: A HTTPHeader to be passed when probing
a container.
properties:
name:
description: Name of this HTTP header. Must be
unique per probe.
type: string
value:
description: Value of this HTTP header.
type: string
required:
- name
- value
type: object
type: array
path:
description: Path to probe, e.g. '/healthz'.
type: string
port:
description: Port to probe.
format: int32
type: integer
required:
- path
- port
type: object
initialDelaySeconds:
description: InitialDelaySeconds after a container starts
before the first probe.
format: int32
type: integer
periodSeconds:
description: PeriodSeconds between probes.
format: int32
type: integer
successThreshold:
description: SuccessThreshold specifies how many consecutive
probes must success in order for the container to be considered
healthy.
format: int32
type: integer
tcpSocket:
description: TCPSocketProbe probes a container's health
by connecting to a TCP socket.
properties:
port:
description: Port this probe should connect to.
format: int32
type: integer
required:
- port
type: object
timeoutSeconds:
description: TimeoutSeconds after which the probe times
out.
format: int32
type: integer
type: object
resources:
description: Resources required by this container
properties:
cpu:
description: CPU required by this container.
properties:
required:
anyOf:
- type: integer
- type: string
description: Required CPU count. 1.0 represents one
CPU core.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- required
type: object
extended:
description: Extended resources required by this container.
items:
description: ExtendedResource required by a container.
properties:
name:
description: Name of the external resource. Resource
names are specified in kind.group/version format,
e.g. motionsensor.ext.example.com/v1.
type: string
required:
anyOf:
- type: integer
- type: string
description: Required extended resource(s), e.g. 8
or "very-cool-widget"
x-kubernetes-int-or-string: true
required:
- name
- required
type: object
type: array
gpu:
description: GPU required by this container.
properties:
required:
anyOf:
- type: integer
- type: string
description: Required GPU count.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- required
type: object
memory:
description: Memory required by this container.
properties:
required:
anyOf:
- type: integer
- type: string
description: Required memory.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- required
type: object
volumes:
description: Volumes required by this container.
items:
description: VolumeResource required by a container.
properties:
accessMode:
description: AccessMode of this volume; RO (read only)
or RW (read and write).
enum:
- RO
- RW
type: string
disk:
description: Disk requirements of this volume.
properties:
ephemeral:
description: Ephemeral specifies whether an external
disk needs to be mounted.
type: boolean
required:
anyOf:
- type: integer
- type: string
description: Required disk space.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- required
type: object
mountPath:
description: MountPath at which this volume will be
mounted within its container.
type: string
name:
description: Name of this volume. Must be unique within
its container.
type: string
sharingPolicy:
description: SharingPolicy of this volume; Exclusive
or Shared.
enum:
- Exclusive
- Shared
type: string
required:
- mountPath
- name
type: object
type: array
required:
- cpu
- memory
type: object
required:
- image
- name
type: object
type: array
osType:
description: OperatingSystem required by this workload.
enum:
- linux
- windows
type: string
required:
- containers
type: object
status:
description: A ContainerizedWorkloadStatus represents the observed state
of a ContainerizedWorkload.
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
type: string
required:
- lastTransitionTime
- reason
- status
- type
type: object
type: array
resources:
description: Resources managed by this containerised workload.
items:
description: 'ObjectReference contains enough information to let
you inspect or modify the referred object. --- New uses of this
type are discouraged because of difficulty describing its usage
when embedded in APIs. 1. Ignored fields. It includes many fields
which are not generally honored. For instance, ResourceVersion
and FieldPath are both very rarely valid in actual usage. 2.
Invalid usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are particular restrictions
like, "must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be well described
when embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage, which
makes it hard for users to predict what will happen. 4. The fields
are both imprecise and overly precise. Kind is not a precise
mapping to a URL. This can produce ambiguity during interpretation
and require a REST mapping. In most cases, the dependency is
on the group,resource tuple and the version of the actual
struct is irrelevant. 5. We cannot easily change it. Because
this type is embedded in many locations, updates to this type will
affect numerous schemas. Don''t make new APIs embed an underspecified
API type they do not control. Instead of using this type, create
a locally provided and used type that is well-focused on your
reference. For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of
an entire object, this string should contain a valid JSON/Go
field access statement, such as desiredState.manifest.containers[2].
For example, if the object reference is to a container within
a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container that triggered
the event) or if no container name is specified "spec.containers[2]"
(container with index 2 in this pod). This syntax is chosen
only to have some well-defined way of referencing a part of
an object. TODO: this design is not final and this field is
subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this reference
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@@ -1,590 +0,0 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
name: healthscopes.core.oam.dev
spec:
group: core.oam.dev
names:
categories:
- oam
kind: HealthScope
listKind: HealthScopeList
plural: healthscopes
singular: healthscope
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.health
name: HEALTH
type: string
name: v1alpha2
schema:
openAPIV3Schema:
description: A HealthScope determines an aggregate health status based of
the health of components.
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 HealthScopeSpec defines the desired state of a HealthScope.
properties:
appReferences:
description: AppRefs records references of applications' components
items:
description: AppReference records references of an application's
components
properties:
appName:
type: string
compReferences:
items:
description: CompReference records references of a component's
resources
properties:
compName:
type: string
traits:
items:
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object.
--- New uses of this type are discouraged because
of difficulty describing its usage when embedded in
APIs. 1. Ignored fields. It includes many fields
which are not generally honored. For instance, ResourceVersion
and FieldPath are both very rarely valid in actual
usage. 2. Invalid usage help. It is impossible to
add specific help for individual usage. In most embedded
usages, there are particular restrictions like,
"must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be
well described when embedded. 3. Inconsistent validation. Because
the usages are different, the validation rules are
different by usage, which makes it hard for users
to predict what will happen. 4. The fields are both
imprecise and overly precise. Kind is not a precise
mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most
cases, the dependency is on the group,resource tuple and
the version of the actual struct is irrelevant. 5.
We cannot easily change it. Because this type is
embedded in many locations, updates to this type will
affect numerous schemas. Don''t make new APIs embed
an underspecified API type they do not control. Instead
of using this type, create a locally provided and
used type that is well-focused on your reference.
For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object
instead of an entire object, this string should
contain a valid JSON/Go field access statement,
such as desiredState.manifest.containers[2]. For
example, if the object reference is to a container
within a pod, this would take on a value like:
"spec.containers{name}" (where "name" refers to
the name of the container that triggered the event)
or if no container name is specified "spec.containers[2]"
(container with index 2 in this pod). This syntax
is chosen only to have some well-defined way of
referencing a part of an object. TODO: this design
is not final and this field is subject to change
in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which
this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
type: array
workload:
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object. ---
New uses of this type are discouraged because of difficulty
describing its usage when embedded in APIs. 1. Ignored
fields. It includes many fields which are not generally
honored. For instance, ResourceVersion and FieldPath
are both very rarely valid in actual usage. 2. Invalid
usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are
particular restrictions like, "must refer only to
types A and B" or "UID not honored" or "name must be
restricted". Those cannot be well described when
embedded. 3. Inconsistent validation. Because the
usages are different, the validation rules are different
by usage, which makes it hard for users to predict what
will happen. 4. The fields are both imprecise and overly
precise. Kind is not a precise mapping to a URL. This
can produce ambiguity during interpretation and
require a REST mapping. In most cases, the dependency
is on the group,resource tuple and the version of
the actual struct is irrelevant. 5. We cannot easily
change it. Because this type is embedded in many locations,
updates to this type will affect numerous schemas. Don''t
make new APIs embed an underspecified API type they
do not control. Instead of using this type, create a
locally provided and used type that is well-focused
on your reference. For example, ServiceReferences for
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object
instead of an entire object, this string should
contain a valid JSON/Go field access statement,
such as desiredState.manifest.containers[2]. For
example, if the object reference is to a container
within a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container
that triggered the event) or if no container name
is specified "spec.containers[2]" (container with
index 2 in this pod). This syntax is chosen only
to have some well-defined way of referencing a part
of an object. TODO: this design is not final and
this field is subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this
reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
type: object
type: array
type: object
type: array
probe-interval:
description: ProbeInterval is the amount of time in seconds between
probing tries.
format: int32
type: integer
probe-timeout:
description: ProbeTimeout is the amount of time in seconds to wait
when receiving a response before marked failure.
format: int32
type: integer
workloadRefs:
description: WorkloadReferences to the workloads that are in this
scope.
items:
description: 'ObjectReference contains enough information to let
you inspect or modify the referred object. --- New uses of this
type are discouraged because of difficulty describing its usage
when embedded in APIs. 1. Ignored fields. It includes many fields
which are not generally honored. For instance, ResourceVersion
and FieldPath are both very rarely valid in actual usage. 2.
Invalid usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are particular restrictions
like, "must refer only to types A and B" or "UID not honored"
or "name must be restricted". Those cannot be well described
when embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage, which
makes it hard for users to predict what will happen. 4. The fields
are both imprecise and overly precise. Kind is not a precise
mapping to a URL. This can produce ambiguity during interpretation
and require a REST mapping. In most cases, the dependency is
on the group,resource tuple and the version of the actual
struct is irrelevant. 5. We cannot easily change it. Because
this type is embedded in many locations, updates to this type will
affect numerous schemas. Don''t make new APIs embed an underspecified
API type they do not control. Instead of using this type, create
a locally provided and used type that is well-focused on your
reference. For example, ServiceReferences for admission registration:
https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object instead of
an entire object, this string should contain a valid JSON/Go
field access statement, such as desiredState.manifest.containers[2].
For example, if the object reference is to a container within
a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container that triggered
the event) or if no container name is specified "spec.containers[2]"
(container with index 2 in this pod). This syntax is chosen
only to have some well-defined way of referencing a part of
an object. TODO: this design is not final and this field is
subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this reference
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
type: array
required:
- workloadRefs
type: object
status:
description: A HealthScopeStatus represents the observed state of a HealthScope.
properties:
appHealthConditions:
description: AppHealthConditions represents health condition of applications
in the scope
items:
description: AppHealthCondition represents health condition of an
application
properties:
appName:
type: string
components:
items:
description: WorkloadHealthCondition represents informative
health condition of a workload.
properties:
componentName:
description: ComponentName represents the component name
if target is a workload
type: string
customStatusMsg:
type: string
diagnosis:
type: string
healthStatus:
description: HealthStatus represents health status strings.
type: string
targetWorkload:
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object. ---
New uses of this type are discouraged because of difficulty
describing its usage when embedded in APIs. 1. Ignored
fields. It includes many fields which are not generally
honored. For instance, ResourceVersion and FieldPath
are both very rarely valid in actual usage. 2. Invalid
usage help. It is impossible to add specific help for
individual usage. In most embedded usages, there are
particular restrictions like, "must refer only to
types A and B" or "UID not honored" or "name must be
restricted". Those cannot be well described when
embedded. 3. Inconsistent validation. Because the
usages are different, the validation rules are different
by usage, which makes it hard for users to predict what
will happen. 4. The fields are both imprecise and overly
precise. Kind is not a precise mapping to a URL. This
can produce ambiguity during interpretation and
require a REST mapping. In most cases, the dependency
is on the group,resource tuple and the version of
the actual struct is irrelevant. 5. We cannot easily
change it. Because this type is embedded in many locations,
updates to this type will affect numerous schemas. Don''t
make new APIs embed an underspecified API type they
do not control. Instead of using this type, create a
locally provided and used type that is well-focused
on your reference. For example, ServiceReferences for
admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object
instead of an entire object, this string should
contain a valid JSON/Go field access statement,
such as desiredState.manifest.containers[2]. For
example, if the object reference is to a container
within a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container
that triggered the event) or if no container name
is specified "spec.containers[2]" (container with
index 2 in this pod). This syntax is chosen only
to have some well-defined way of referencing a part
of an object. TODO: this design is not final and
this field is subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this
reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
traits:
items:
description: TraitHealthCondition represents informative
health condition of a trait.
properties:
customStatusMsg:
type: string
diagnosis:
type: string
healthStatus:
description: HealthStatus represents health status
strings.
type: string
resource:
type: string
type:
type: string
required:
- healthStatus
- resource
- type
type: object
type: array
workloadStatus:
description: WorkloadStatus represents status of workloads
whose HealthStatus is UNKNOWN.
type: string
required:
- healthStatus
type: object
type: array
envName:
type: string
required:
- appName
type: object
type: array
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
healthConditions:
description: WorkloadHealthConditions represents health condition
of workloads in the scope Use AppHealthConditions to provide app
level status
items:
description: WorkloadHealthCondition represents informative health
condition of a workload.
properties:
componentName:
description: ComponentName represents the component name if
target is a workload
type: string
customStatusMsg:
type: string
diagnosis:
type: string
healthStatus:
description: HealthStatus represents health status strings.
type: string
targetWorkload:
description: 'ObjectReference contains enough information to
let you inspect or modify the referred object. --- New uses
of this type are discouraged because of difficulty describing
its usage when embedded in APIs. 1. Ignored fields. It includes
many fields which are not generally honored. For instance,
ResourceVersion and FieldPath are both very rarely valid in
actual usage. 2. Invalid usage help. It is impossible to
add specific help for individual usage. In most embedded
usages, there are particular restrictions like, "must
refer only to types A and B" or "UID not honored" or "name
must be restricted". Those cannot be well described when
embedded. 3. Inconsistent validation. Because the usages
are different, the validation rules are different by usage,
which makes it hard for users to predict what will happen. 4.
The fields are both imprecise and overly precise. Kind is
not a precise mapping to a URL. This can produce ambiguity during
interpretation and require a REST mapping. In most cases,
the dependency is on the group,resource tuple and the
version of the actual struct is irrelevant. 5. We cannot
easily change it. Because this type is embedded in many locations,
updates to this type will affect numerous schemas. Don''t
make new APIs embed an underspecified API type they do not
control. Instead of using this type, create a locally provided
and used type that is well-focused on your reference. For
example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
.'
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object instead
of an entire object, this string should contain a valid
JSON/Go field access statement, such as desiredState.manifest.containers[2].
For example, if the object reference is to a container
within a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container that
triggered the event) or if no container name is specified
"spec.containers[2]" (container with index 2 in this pod).
This syntax is chosen only to have some well-defined way
of referencing a part of an object. TODO: this design
is not final and this field is subject to change in the
future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this reference
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
traits:
items:
description: TraitHealthCondition represents informative health
condition of a trait.
properties:
customStatusMsg:
type: string
diagnosis:
type: string
healthStatus:
description: HealthStatus represents health status strings.
type: string
resource:
type: string
type:
type: string
required:
- healthStatus
- resource
- type
type: object
type: array
workloadStatus:
description: WorkloadStatus represents status of workloads whose
HealthStatus is UNKNOWN.
type: string
required:
- healthStatus
type: object
type: array
scopeHealthCondition:
description: ScopeHealthCondition represents health condition summary
of the scope
properties:
healthStatus:
description: HealthStatus represents health status strings.
type: string
healthyWorkloads:
format: int64
type: integer
total:
format: int64
type: integer
unhealthyWorkloads:
format: int64
type: integer
unknownWorkloads:
format: int64
type: integer
required:
- healthStatus
type: object
required:
- scopeHealthCondition
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

Some files were not shown because too many files have changed in this diff Show More