Compare commits

...

61 Commits

Author SHA1 Message Date
github-actions[bot]
3df1776b37 Fix: the create time of the synced policies is zero (#4610)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 29436e6d23)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-12 14:44:23 +08:00
github-actions[bot]
a6434c3efa Feat: align resource selector across policies (#4609)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 989f599fab)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-08-12 11:01:14 +08:00
github-actions[bot]
766594d625 Fix: remove the ui-hidden label and the grafana traits (#4608)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit d098e34a17)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-11 17:36:24 +08:00
github-actions[bot]
f7bd17edd7 [Backport release-1.5] Fix: try to fix addon flaky test (#4598)
* 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>
(cherry picked from commit ba973b722c)

* fix comments

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-08-10 21:08:17 +08:00
github-actions[bot]
5213e54466 Fix: fix writing logs to file (#4589)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
(cherry picked from commit d4b3bbf049)

Co-authored-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-08-10 10:00:59 +08:00
github-actions[bot]
939556a698 Fix: addon dependency 1.1 legacy support (#4591)
Signed-off-by: Zhiyu Wang <cloudsky.newbis@gmail.com>
(cherry picked from commit 512a0563fa)

Co-authored-by: Zhiyu Wang <cloudsky.newbis@gmail.com>
2022-08-10 09:59:42 +08:00
github-actions[bot]
c8d89a1856 Fix: gc resources without resourceversion (#4586)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit bccae77a8c)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-08-09 19:21:49 +08:00
github-actions[bot]
891429c5f5 Fix: add status code for cue struct (#4584)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 6ae03228ac)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-08-09 17:25:09 +08:00
github-actions[bot]
8b6dbd781f Feat: definition support controller requirement (#4579)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>
(cherry picked from commit 714f218f90)

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-08-08 16:07:58 +08:00
github-actions[bot]
7916e874c5 Docs: add description for shared-resource (#4575)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit cec1f3e9c2)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-08-08 12:05:09 +08:00
github-actions[bot]
8f78189a79 [Backport release-1.5] Fix: fix addon bond component annotaion (#4574)
* fix miss spell annotation

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

* add comments

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

* fix golint

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-08-08 11:58:11 +08:00
github-actions[bot]
6d979cfcab [Backport release-1.5] Fix: reject applications with empty policy properties (#4566)
* Fix: reject applications with empty policies

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

* Style: change err msg

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

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

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

* Test: fix tests

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

Co-authored-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-08-05 15:05:00 +08:00
github-actions[bot]
491127daec [Backport release-1.5] Fix: vela CLI provider compatibility (#4564)
* Fix: vela CLI provider compatibility

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

* fix

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

* List interface won't return NotFoundError

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

* format imports

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

Co-authored-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-08-05 14:41:22 +08:00
github-actions[bot]
1829cf4e40 Fix: compare resource without version (#4562)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit cea2e6034d)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-08-04 17:32:49 +08:00
github-actions[bot]
b0facbeaab Feat: ignore control check for resource without resource version (#4557)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 71554adbf1)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-08-04 15:30:11 +08:00
github-actions[bot]
e29b1af202 Chore: fix cli description to remove html tag format (#4552)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit d4d3b1c9dd)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-08-03 20:15:32 +08:00
github-actions[bot]
a3ee8eb01d [Backport release-1.5] Fix: remove the cloudshell dockerfile (#4549)
* Fix: remove the cloudshell dockerfile

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

* Fix: change the configmap name

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

* Fix: change the way to get the namespace

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-03 16:20:34 +08:00
github-actions[bot]
84b4d0f685 [Backport release-1.5] Feat: report the manifest name when addon enabling failed (#4547)
* Feat: Report the manifest name when Addon enabling failed

Signed-off-by: ghostloda <78798447@qq.com>
(cherry picked from commit d143c341af)

* Apply suggestions from code review

Co-authored-by: Jianbo Sun <wonderflow@icloud.com>
Signed-off-by: ghostloda <78798447@qq.com>
(cherry picked from commit a5ba4658a9)

* Apply suggestions from code review

Co-authored-by: Charlie Chiang <charlie_c_0129@outlook.com>
Signed-off-by: ghostloda <78798447@qq.com>
(cherry picked from commit 67f34ac4a6)

Co-authored-by: ghostloda <78798447@qq.com>
2022-08-03 13:52:25 +08:00
github-actions[bot]
4e370b940c Fix: sidecar trait (#4543)
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
(cherry picked from commit 3eaf2dd02a)

Co-authored-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-08-02 23:10:12 +08:00
github-actions[bot]
110156aff0 Fix: upgrade the cloudshell image (#4540)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 922b9b10ef)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-02 22:21:57 +08:00
github-actions[bot]
62df98818e [Backport release-1.5] Feat: Check def binding to a component (#4539)
* finish logic

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

* 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>
(cherry picked from commit 0418ad5207)

* fix comments

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

fix ci

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

* fix test

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

* fix tests

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-08-02 21:37:53 +08:00
github-actions[bot]
992e636211 Feat: support change resource gc policy from onAppUpdate to Never (#4537)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 55c9f6049f)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-08-02 20:21:42 +08:00
github-actions[bot]
3a7a8ac59f Fix: publish chart version (#4536)
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
(cherry picked from commit 53ebebba78)

Co-authored-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-08-02 20:20:56 +08:00
github-actions[bot]
75fd38f1de [Backport release-1.5] Chore: update chart-publishing, only push index and new charts (#4534)
* Chore: update chart-publishing, only push index and new charts

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

* fix

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

Co-authored-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-08-02 19:29:40 +08:00
github-actions[bot]
8abd78e5f1 [Backport release-1.5] Fix: storage patch env (#4533)
* Fix: empty health policy do not check object existence

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

* Fix: fix health check error

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

* Fix: app use storage and env trait

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

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-08-02 19:19:23 +08:00
github-actions[bot]
2d82e74c5b [Backport release-1.5] Feat: add the daemonset resource rule for building the tree (#4532)
* Feat: add the daemonset resource policy for building the tree

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

* Fix: the import package

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

* Fix: the unit test case

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

* Fix: change some function and variable names

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-02 19:15:53 +08:00
github-actions[bot]
66dfcec0ad [Backport release-1.5] Feat: add http status and code from http cmd run (#4528)
* Feat: add http status and code from http cmd run

Signed-off-by: suxiang <704427617@qq.com>
(cherry picked from commit 0b96b2e60a)

* Feat: fix unit test error

Signed-off-by: suxiang <704427617@qq.com>
(cherry picked from commit 25f2291503)

* Feat: status is not necessary

Signed-off-by: suxiang <704427617@qq.com>
(cherry picked from commit ef3b8ac82b)

* Feat: make reviewable

Signed-off-by: suxiang <704427617@qq.com>
(cherry picked from commit 684f5e9ae2)

* Feat: add unit test

Signed-off-by: suxiang <704427617@qq.com>
(cherry picked from commit 6c39f602ea)

* Feat: make reviewable

Signed-off-by: suxiang <704427617@qq.com>
(cherry picked from commit 20ae7f2e15)

Co-authored-by: suxiang <704427617@qq.com>
2022-08-02 16:18:47 +08:00
github-actions[bot]
37dd176dd3 [Backport release-1.5] Fix: fix e2e flaky tests (#4524)
* 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

(cherry picked from commit ba5cc24d54)

* only for tests

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-08-02 15:18:34 +08:00
Zhiyu Wang
da9bd8ca63 Fix: missing return when token is null (#4520)
Signed-off-by: Zhiyu Wang <cloudsky.newbis@gmail.com>
(cherry picked from commit d810d9d042)
2022-08-02 11:02:02 +08:00
github-actions[bot]
bc1d24e034 [Backport release-1.5] Fix: empty health policy do not check object existence (#4522)
* Fix: empty health policy do not check object existence

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

* Fix: fix health check error

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

* Fix: add test

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

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2022-08-02 11:00:57 +08:00
github-actions[bot]
bcce87c073 Fix: can not find the resource when the resource namespace is diffrent with application (#4518)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 56b440677d)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-01 22:43:28 +08:00
github-actions[bot]
3a9e5ccd5d [Backport release-1.5] Feat: refactor CLI commands related to resources (#4514)
* Feat: refactor CLI commands related to resources

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

* Fix: remove the old test case.

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

* Fix: e2e test

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

* Fix: optimize test cases

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

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

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

* Feat: optimize the e2e test case

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

* Fix: sort the objects

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

* Fix: optimize the e2e test case

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

* Fix: list the pod by the labels

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

* Fix: order the tree resource

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

* Fix: set multicluster config

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-01 19:46:20 +08:00
github-actions[bot]
1b21db979f Fix: there is no color in the diff report (#4513)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 7ab3d58d8a)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-01 18:27:56 +08:00
github-actions[bot]
618596b98e [Backport release-1.5] Feat: support set labels for env (#4506)
* Feat: support set labels for env

Signed-off-by: codinghuang <codinghuang@qq.com>
(cherry picked from commit 25558c1f18)

* Refactor: Remove util.ParseLabelString

use k8s.io/apimachinery/pkg/labels

Signed-off-by: codinghuang <codinghuang@qq.com>
(cherry picked from commit abf756fb14)

Co-authored-by: codinghuang <codinghuang@qq.com>
2022-07-29 19:18:32 +08:00
github-actions[bot]
db21d74a52 [Backport release-1.5] Fix: failed to assign the default role for the users who log in from dex (#4504)
* Fix: failed to assign the default role for the users who log in from dex

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

* Fix: cluster e2e test case

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

* Fix: the ensure namespace error is ignored

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-29 17:19:21 +08:00
github-actions[bot]
fafa18e8db [Backport release-1.5] Fix: check definition of addon whether is conflict (#4502)
* 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>
(cherry picked from commit 226b4d390f)

* 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>
(cherry picked from commit 910d411e99)

* fix comments

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

* small fix

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-07-29 16:47:43 +08:00
github-actions[bot]
acf923dd10 [Backport release-1.5] Fix: CloudShell read-only authorization is not automatically revoked (#4503)
* Fix: CloudShell read-only authorization is not automatically revoked

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

* Fix: code style

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

* Fix: rename the prefix

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-29 16:47:17 +08:00
github-actions[bot]
8fc94f057f [Backport release-1.5] Feat: System Info & Diagnose (#4499)
* Feat: System Info & Diagnose

Signed-off-by: foursevenlove <foursevenlove@gmail.com>
(cherry picked from commit 96e303f2e6)

* Fix:1.misspelling 2.license

Signed-off-by: foursevenlove <foursevenlove@gmail.com>
(cherry picked from commit 3f9d8dfa8f)

* Fix: pattern of imported package

Signed-off-by: foursevenlove <foursevenlove@gmail.com>
(cherry picked from commit 6584564a89)

* Fix: pattern of imported package

Signed-off-by: foursevenlove <foursevenlove@gmail.com>
(cherry picked from commit b500f41cc6)

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

(cherry picked from commit 548a3accef)

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

(cherry picked from commit 9ba993d71a)

* Fix: Making syntax simple

(cherry picked from commit 558812d64d)

Co-authored-by: foursevenlove <foursevenlove@gmail.com>
2022-07-29 14:28:01 +08:00
github-actions[bot]
6a6dfba79b [Backport release-1.5] Chore: organize appliesToWorkloads field of trait defs, add doc example (#4497)
* Chore: organize appliesToWorkloads field of trait defs, add doc example

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

* fix gen

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

* add deprecate label

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

* fix

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

* fix script to read all definition in directory

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

* add comment

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

* go.mod

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

* update some usage, better trait doc gen

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

* minor fix

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

* minor fix

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

* postpone markdown escape pipe char

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

Co-authored-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2022-07-29 11:23:35 +08:00
github-actions[bot]
3b7a997b3e Fix: repeat query configuration type (#4494)
Signed-off-by: ghostloda <78798447@qq.com>
(cherry picked from commit 5c048b3ee3)

Co-authored-by: ghostloda <78798447@qq.com>
2022-07-28 14:27:36 +08:00
github-actions[bot]
e13a259bca Feat: delete multi apps from vela delete cli command (#4486)
Signed-off-by: suxiang <704427617@qq.com>
(cherry picked from commit 957da65449)

Co-authored-by: suxiang <704427617@qq.com>
2022-07-27 18:59:10 +08:00
Somefive
58af7103e7 Fix: address vela-core crash due to empty policy properties (#4473) (#4479)
* Fix: fix topology core crash

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

* Test: add tests

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

* Fix: same problem in other places

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

* Style: remove empty line

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

* Feat: raise error when empty topology is used

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

* Feat: raise error when empty override policy is used

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

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

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-07-27 01:12:40 +08:00
github-actions[bot]
6f8cc0f5b4 [Backport release-1.5] Feat: show warnings about internal addon rendering logic (#4478)
* Feat: show warnings about addon rendering logic

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

* Feat: update vela init to not show warnings

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

* Refactor: use setter

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

* fix check-diff

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

Co-authored-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-07-26 23:37:56 +08:00
github-actions[bot]
8c9d0ae314 Chore: refactor addon enable with package (#4468)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 702fa36621)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-26 15:23:33 +08:00
Somefive
b6c024c205 Feat: add featuregates to disallow url in ref-objects (#4466)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-07-26 13:37:11 +08:00
github-actions[bot]
3ab0b503c5 Fix: docker file fail to build for vela cli (#4465)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 62fcb152e2)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-25 22:45:13 +08:00
github-actions[bot]
85e168fea7 Fix: The apply failure error is ignored when the workflow is executed (#4462)
Signed-off-by: yangsoon <songyang.song@alibaba-inc.com>
(cherry picked from commit b1d8e6c88b)

Co-authored-by: yangsoon <songyang.song@alibaba-inc.com>
2022-07-25 22:18:53 +08:00
github-actions[bot]
189d74e87b Feat: delete svc flag from vela delete cli cmd (#4463)
Signed-off-by: suxiang <704427617@qq.com>
(cherry picked from commit 8d1a87083d)

Co-authored-by: suxiang <704427617@qq.com>
2022-07-25 22:18:29 +08:00
github-actions[bot]
8ec0209026 Feat: support vela addon enable with package (#4458)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 863d6161b1)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-25 22:16:50 +08:00
github-actions[bot]
c3a7209fa7 [Backport release-1.5] Feat: make addon init use the latest CUE addon template (#4456)
* Feat: make addon init use the latest CUE addon template

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

* Refactor: simplify init cmd

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

* Feat: ignore metadata

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

* Feat: remove status

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

* do not marshal to application

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

* Feat: only look for output field

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

* Feat: use global constant

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

* Test: update tests according to changes

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

Co-authored-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-07-25 21:34:22 +08:00
github-actions[bot]
564cba9aac [Backport release-1.5] Feat: support outputs for addon (#4457)
* support outputs for addon

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

* fix comments

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

fix comments

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

Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2022-07-25 21:34:04 +08:00
github-actions[bot]
f7c21df915 [Backport release-1.5] Feat: support to query the alias of the project member (#4454)
* Feat: support to query the alias of the project member

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

* Fix: optimize the e2e test case

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-25 21:30:46 +08:00
github-actions[bot]
0b9c7f66c0 Feat: adapt vela port-forward with the velaql (#4453)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
(cherry picked from commit 50f902e483)

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-25 21:29:00 +08:00
github-actions[bot]
54867c50d8 Fix: the history applications are repeatedly synchronized (#4452)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit de80fbcf40)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-25 21:26:59 +08:00
github-actions[bot]
16d7a4b4f4 Revert "Chore: upgrade kind in tests, fix flaky test (#4105)" (#4451)
This reverts commit 8aaf526877.

(cherry picked from commit 3f9529dd34)

Co-authored-by: Jianbo Sun <wonderflow@icloud.com>
2022-07-25 19:09:12 +08:00
github-actions[bot]
35ae4e5ef5 [Backport release-1.5] Fix: address failure when rendering addon API schemas (#4445)
* Fix: address failure when rendering addon API schemas

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

* Fix: address failure when rendering addon API schemas

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

* Test: add tests

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

* Test: fix tests

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

* Test: fix tests

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

Co-authored-by: Charlie Chiang <charlie_c_0129@outlook.com>
2022-07-25 17:02:32 +08:00
github-actions[bot]
853f44cf61 [Backport release-1.5] Fix: support to test authentication with dex (#4440)
* Fix: support to test login with dex

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

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

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

* Fix: systemInfoService is nil

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-25 15:53:22 +08:00
github-actions[bot]
ca2a90a097 [Backport release-1.5] Feat: support to init the roles of the user who login by dex (#4436)
* Feat: support to init the roles of the user which login by dex

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

* Fix: add the comment

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

* Fix: make the sub string to lower

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

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-07-25 11:14:06 +08:00
github-actions[bot]
d110e97d68 [Backport release-1.5] Chore: update description of policy/workflowstep definition (#4435)
* Chore: update description of policy definition

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

* Fix: support workflow step generation for doc

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

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

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

* Chore: add examples of def docs for workflow step

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

* Feat: refine workflow description

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

* Chore: refine the workflow step definition

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

* Chore: update workflow step definition

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

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-25 10:48:00 +08:00
github-actions[bot]
741559c8e0 Feat: support vela def apply for directory (#4432)
Co-authored-by: ivyilike <pww123@cmbchina.com>

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

Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2022-07-24 16:37:04 +08:00
456 changed files with 6890 additions and 2649 deletions

View File

@@ -19,9 +19,9 @@ env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.14.0'
KIND_IMAGE_VERSION: '[\"v1.20.15\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.15\",\"v1.22.9\"]'
KIND_VERSION: 'v0.7.0'
KIND_IMAGE_VERSION: '[\"v1.20.7\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.7\",\"v1.22.7\"]'
jobs:

View File

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

View File

@@ -17,9 +17,9 @@ env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.14.0'
KIND_IMAGE_VERSION: '[\"v1.20.15\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.15\",\"v1.22.9\"]'
KIND_VERSION: 'v0.7.0'
KIND_IMAGE_VERSION: '[\"v1.20.7\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.7\",\"v1.22.7\"]'
jobs:

View File

@@ -17,9 +17,9 @@ env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.14.0'
KIND_IMAGE_VERSION: '[\"v1.20.15\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.15\",\"v1.22.9\"]'
KIND_VERSION: 'v0.7.0'
KIND_IMAGE_VERSION: '[\"v1.20.7\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.7\",\"v1.22.7\"]'
jobs:

View File

@@ -17,9 +17,9 @@ env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.14.0'
KIND_IMAGE_VERSION: '[\"v1.20.15\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.15\",\"v1.22.9\"]'
KIND_VERSION: 'v0.7.0'
KIND_IMAGE_VERSION: '[\"v1.20.7\"]'
KIND_IMAGE_VERSIONS: '[\"v1.18.20\",\"v1.20.7\",\"v1.22.7\"]'
jobs:

View File

@@ -15,7 +15,7 @@ env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.14.0'
KIND_VERSION: 'v0.7.0'
jobs:

View File

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

View File

@@ -15,7 +15,7 @@ env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.38'
KIND_VERSION: 'v0.14.0'
KIND_VERSION: 'v0.7.0'
jobs:

2
.gitignore vendored
View File

@@ -1,4 +1,4 @@
# Binaries for programs and plugins
# Binaries for programs and docgen
*.exe
*.exe~
*.dll

View File

@@ -39,5 +39,5 @@ RUN apk add --no-cache ca-certificates bash expat
WORKDIR /
ARG TARGETARCH
COPY --from=builder /workspace/vela-${TARGETARCH} /vela
ENTRYPOINT ["/vela"]
COPY --from=builder /workspace/vela-${TARGETARCH} /bin/vela
ENTRYPOINT ["/bin/vela"]

View File

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

View File

@@ -53,15 +53,7 @@ func (in ApplyOncePolicySpec) FindStrategy(manifest *unstructured.Unstructured)
return nil
}
for _, rule := range in.Rules {
match := func(src []string, val string) (found bool) {
for _, _val := range src {
found = found || _val == val
}
return val != "" && found
}
if (match(rule.Selector.CompNames, manifest.GetName()) && match(rule.Selector.ResourceTypes, manifest.GetKind())) ||
(rule.Selector.CompNames == nil && match(rule.Selector.ResourceTypes, manifest.GetKind()) ||
(rule.Selector.ResourceTypes == nil && match(rule.Selector.CompNames, manifest.GetName()))) {
if rule.Selector.Match(manifest) {
return rule.Strategy
}
}

View File

@@ -18,6 +18,7 @@ package v1alpha1
import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/utils/pointer"
"k8s.io/utils/strings/slices"
"github.com/oam-dev/kubevela/pkg/oam"
@@ -57,20 +58,19 @@ type GarbageCollectPolicyRule struct {
}
// ResourcePolicyRuleSelector select the targets of the rule
// 1) for GarbageCollectPolicyRule
// if both traitTypes, oamTypes and componentTypes are specified, combination logic is OR
// if one resource is specified with conflict strategies, strategy as component go first.
// 2) for ApplyOncePolicyRule only CompNames and ResourceTypes are used
// if multiple conditions are specified, combination logic is AND
type ResourcePolicyRuleSelector struct {
CompNames []string `json:"componentNames"`
CompTypes []string `json:"componentTypes"`
OAMResourceTypes []string `json:"oamTypes"`
TraitTypes []string `json:"traitTypes"`
ResourceTypes []string `json:"resourceTypes"`
ResourceNames []string `json:"resourceNames"`
CompNames []string `json:"componentNames,omitempty"`
CompTypes []string `json:"componentTypes,omitempty"`
OAMResourceTypes []string `json:"oamTypes,omitempty"`
TraitTypes []string `json:"traitTypes,omitempty"`
ResourceTypes []string `json:"resourceTypes,omitempty"`
ResourceNames []string `json:"resourceNames,omitempty"`
}
// Match check if current rule selector match the target resource
// If at least one condition is matched and no other condition failed (could be empty), return true
// Otherwise, return false
func (in *ResourcePolicyRuleSelector) Match(manifest *unstructured.Unstructured) bool {
var compName, compType, oamType, traitType, resourceType, resourceName string
if labels := manifest.GetLabels(); labels != nil {
@@ -81,15 +81,33 @@ func (in *ResourcePolicyRuleSelector) Match(manifest *unstructured.Unstructured)
}
resourceType = manifest.GetKind()
resourceName = manifest.GetName()
match := func(src []string, val string) (found bool) {
return val != "" && slices.Contains(src, val)
match := func(src []string, val string) (found *bool) {
if len(src) == 0 {
return nil
}
return pointer.Bool(val != "" && slices.Contains(src, val))
}
return match(in.CompNames, compName) ||
match(in.CompTypes, compType) ||
match(in.OAMResourceTypes, oamType) ||
match(in.TraitTypes, traitType) ||
match(in.ResourceTypes, resourceType) ||
match(in.ResourceNames, resourceName)
conditions := []*bool{
match(in.CompNames, compName),
match(in.CompTypes, compType),
match(in.OAMResourceTypes, oamType),
match(in.TraitTypes, traitType),
match(in.ResourceTypes, resourceType),
match(in.ResourceNames, resourceName),
}
hasMatched := false
for _, cond := range conditions {
// if any non-empty condition failed, return false
if cond != nil && !*cond {
return false
}
// if condition succeed, record it
if cond != nil && *cond {
hasMatched = true
}
}
// if at least one condition is met, return true
return hasMatched
}
// GarbageCollectStrategy the strategy for target resource to recycle

View File

@@ -120,7 +120,7 @@ type TraitDefinitionSpec struct {
PodDisruptive bool `json:"podDisruptive,omitempty"`
// AppliesToWorkloads specifies the list of workload kinds this trait
// applies to. Workload kinds are specified in kind.group/version format,
// applies to. Workload kinds are specified in resource.group/version format,
// e.g. server.core.oam.dev/v1alpha2. Traits that omit this field apply to
// all workload kinds.
// +optional

View File

@@ -82,6 +82,8 @@ type ManagedResource struct {
Data *runtime.RawExtension `json:"raw,omitempty"`
// Deleted marks the resource to be deleted
Deleted bool `json:"deleted,omitempty"`
// SkipGC marks the resource to skip gc
SkipGC bool `json:"skipGC,omitempty"`
}
// Equal check if two managed resource equals
@@ -121,12 +123,13 @@ func (in ManagedResource) NamespacedName() types.NamespacedName {
// ResourceKey computes the key for managed resource, resources with the same key points to the same resource
func (in ManagedResource) ResourceKey() string {
gv, kind := in.GroupVersionKind().ToAPIVersionAndKind()
group := in.GroupVersionKind().Group
kind := in.GroupVersionKind().Kind
cluster := in.Cluster
if cluster == "" {
cluster = velatypes.ClusterLocalName
}
return strings.Join([]string{gv, kind, cluster, in.Namespace, in.Name}, "/")
return strings.Join([]string{group, kind, cluster, in.Namespace, in.Name}, "/")
}
// ComponentKey computes the key for the component which managed resource belongs to
@@ -215,8 +218,9 @@ func (in *ResourceTracker) ContainsManagedResource(rsc client.Object) bool {
}
// AddManagedResource add object to managed resources, if exists, update
func (in *ResourceTracker) AddManagedResource(rsc client.Object, metaOnly bool, creator common.ResourceCreatorRole) (updated bool) {
func (in *ResourceTracker) AddManagedResource(rsc client.Object, metaOnly bool, skipGC bool, creator common.ResourceCreatorRole) (updated bool) {
mr := newManagedResourceFromResource(rsc)
mr.SkipGC = skipGC
if !metaOnly {
mr.Data = &runtime.RawExtension{Object: rsc}
}

View File

@@ -125,7 +125,7 @@ func TestManagedResourceKeys(t *testing.T) {
},
}
r.Equal("namespace/name", input.NamespacedName().String())
r.Equal("apps/v1/Deployment/cluster/namespace/name", input.ResourceKey())
r.Equal("apps/Deployment/cluster/namespace/name", input.ResourceKey())
r.Equal("env/component", input.ComponentKey())
r.Equal("Deployment name (Cluster: cluster, Namespace: namespace)", input.DisplayName())
var deploy1, deploy2 v12.Deployment
@@ -156,16 +156,16 @@ func TestResourceTracker_ManagedResource(t *testing.T) {
r := require.New(t)
input := &ResourceTracker{}
deploy1 := v12.Deployment{ObjectMeta: v13.ObjectMeta{Name: "deploy1"}}
input.AddManagedResource(&deploy1, true, "")
input.AddManagedResource(&deploy1, true, false, "")
r.Equal(1, len(input.Spec.ManagedResources))
cm2 := v1.ConfigMap{ObjectMeta: v13.ObjectMeta{Name: "cm2"}}
input.AddManagedResource(&cm2, false, "")
input.AddManagedResource(&cm2, false, false, "")
r.Equal(2, len(input.Spec.ManagedResources))
pod3 := v1.Pod{ObjectMeta: v13.ObjectMeta{Name: "pod3"}}
input.AddManagedResource(&pod3, false, "")
input.AddManagedResource(&pod3, false, false, "")
r.Equal(3, len(input.Spec.ManagedResources))
deploy1.Spec.Replicas = pointer.Int32(5)
input.AddManagedResource(&deploy1, false, "")
input.AddManagedResource(&deploy1, false, false, "")
r.Equal(3, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&cm2, false)
r.Equal(3, len(input.Spec.ManagedResources))

View File

@@ -106,6 +106,7 @@ type Config map[string]string
type EnvMeta struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Labels string `json:"labels"`
Current string `json:"current"`
}

View File

@@ -3650,7 +3650,7 @@ spec:
appliesToWorkloads:
description: AppliesToWorkloads specifies the list of workload
kinds this trait applies to. Workload kinds are specified
in kind.group/version format, e.g. server.core.oam.dev/v1alpha2.
in resource.group/version format, e.g. server.core.oam.dev/v1alpha2.
Traits that omit this field apply to all workload kinds.
items:
type: string

View File

@@ -708,7 +708,7 @@ spec:
appliesToWorkloads:
description: AppliesToWorkloads specifies the list of workload
kinds this trait applies to. Workload kinds are specified
in kind.group/version format, e.g. server.core.oam.dev/v1alpha2.
in resource.group/version format, e.g. server.core.oam.dev/v1alpha2.
Traits that omit this field apply to all workload kinds.
items:
type: string

View File

@@ -105,6 +105,9 @@ spec:
description: 'Specific resourceVersion to which this reference
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
skipGC:
description: SkipGC marks the resource to skip gc
type: boolean
trait:
type: string
uid:

View File

@@ -356,7 +356,7 @@ spec:
properties:
appliesToWorkloads:
description: AppliesToWorkloads specifies the list of workload kinds
this trait applies to. Workload kinds are specified in kind.group/version
this trait applies to. Workload kinds are specified in resource.group/version
format, e.g. server.core.oam.dev/v1alpha2. Traits that omit this
field apply to all workload kinds.
items:

View File

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

View File

@@ -4,9 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add annotations on K8s pod for your workload which follows the pod spec in path 'spec.template'.
labels:
custom.definition.oam.dev/ui-hidden: "true"
definition.oam.dev/description: Add annotations on your workload. if it generates pod, add same annotations for generated pods.
name: annotations
namespace: {{ include "systemDefinitionNamespace" . }}
spec:

View File

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

View File

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

View File

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

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: PolicyDefinition
metadata:
annotations:
definition.oam.dev/description: Configure the behaviour of preventing configuration drift.
definition.oam.dev/description: Allow configuration drift for applied resources, delivery the resource without continuously reconciliation.
name: apply-once
namespace: {{ include "systemDefinitionNamespace" . }}
spec:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -6,6 +6,7 @@ metadata:
annotations:
definition.oam.dev/description: Deploy application to runtime clusters
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/ui-hidden: "true"
name: deploy2runtime
namespace: {{ include "systemDefinitionNamespace" . }}

View File

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

View File

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

View File

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

View File

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

View File

@@ -5,11 +5,12 @@ kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Expose port to enable web traffic for your component.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: expose
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
podDisruptive: false
schematic:
cue:

View File

@@ -9,7 +9,8 @@ metadata:
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- '*'
- deployments.apps
- statefulsets.apps
podDisruptive: false
schematic:
cue:
@@ -85,7 +86,7 @@ spec:
// +usage=Set ingress class in '.spec.ingressClassName' instead of 'kubernetes.io/ingress.class' annotation.
classInSpec: *false | bool
// +usage=Specify the secret name you want to quote.
// +usage=Specify the secret name you want to quote to use tls.
secretName?: string
// +usage=Specify the host of the ingress gateway, which is used to generate the endpoints when the host is empty.

View File

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

View File

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

View File

@@ -5,13 +5,14 @@ kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: add an init container and use shared volume with pod
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: init-container
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- daemonsets.apps
- jobs.batch
podDisruptive: true
schematic:
cue:

View File

@@ -4,9 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add labels on K8s pod for your workload which follows the pod spec in path 'spec.template'.
labels:
custom.definition.oam.dev/ui-hidden: "true"
definition.oam.dev/description: Add labels on your workload. if it generates pod, add same label for generated pods.
name: labels
namespace: {{ include "systemDefinitionNamespace" . }}
spec:

View File

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

View File

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

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Send message to webhook
definition.oam.dev/description: Send notifications to Email, DingTalk, Slack, Lark or webhook in your workflow.
name: notification
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
@@ -17,9 +17,11 @@ spec:
)
parameter: {
// +usage=Please fulfill its url and message if you want to send Lark messages
lark?: {
// +usage=Specify the the lark url, you can either sepcify it in value or use secretRef
url: {
// +usage=the url address content in string
value: string
} | {
secretRef: {
@@ -29,7 +31,7 @@ spec:
key: string
}
}
// +useage=Specify the message that you want to sent
// +usage=Specify the message that you want to sent, refer to [Lark messaging](https://open.feishu.cn/document/ukTMukTMukTM/ucTM5YjL3ETO24yNxkjN#8b0f2a1b).
message: {
// +usage=msg_type can be text, post, image, interactive, share_chat, share_user, audio, media, file, sticker
msg_type: string
@@ -37,10 +39,11 @@ spec:
content: string
}
}
// +usage=Please fulfill its url and message if you want to send DingTalk messages
dingding?: {
// +usage=Specify the the dingding url, you can either sepcify it in value or use secretRef
url: {
// +usage=the url address content in string
value: string
} | {
secretRef: {
@@ -50,8 +53,9 @@ spec:
key: string
}
}
// +useage=Specify the message that you want to sent
// +usage=Specify the message that you want to sent, refer to [dingtalk messaging](https://developers.dingtalk.com/document/robots/custom-robot-access/title-72m-8ag-pqw)
message: {
// +usage=Specify the message content of dingtalk notification
text?: *null | {
content: string
}
@@ -93,10 +97,11 @@ spec:
}
}
}
// +usage=Please fulfill its url and message if you want to send Slack messages
slack?: {
// +usage=Specify the the slack url, you can either sepcify it in value or use secretRef
url: {
// +usage=the url address content in string
value: string
} | {
secretRef: {
@@ -106,8 +111,9 @@ spec:
key: string
}
}
// +useage=Specify the message that you want to sent
// +usage=Specify the message that you want to sent, refer to [slack messaging](https://api.slack.com/reference/messaging/payload)
message: {
// +usage=Specify the message text for slack notification
text: string
blocks?: *null | [...block]
attachments?: *null | {
@@ -115,10 +121,11 @@ spec:
color?: string
}
thread_ts?: string
mrkdwn?: *true | bool
// +usage=Specify the message text format in markdown for slack notification
mrkdwn?: *true | bool
}
}
// +usage=Please fulfill its from, to and content if you want to send email
email?: {
// +usage=Specify the email info that you want to send from
from: {
@@ -128,6 +135,7 @@ spec:
alias?: string
// +usage=Specify the password of the email, you can either sepcify it in value or use secretRef
password: {
// +usage=the password content in string
value: string
} | {
secretRef: {

View File

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

View File

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

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Read objects for your workflow steps
definition.oam.dev/description: Read Kubernetes objects from cluster for your workflow steps
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: read-object
@@ -50,15 +50,15 @@ spec:
}
}
parameter: {
// +usage=Specify the apiVersion of the object, defaults to core.oam.dev/v1beta1
// +usage=Specify the apiVersion of the object, defaults to 'core.oam.dev/v1beta1'
apiVersion?: string
// +usage=Specify the kind of the object, defaults to Application
kind?: string
// +usage=Specify the name of the object
name: string
// +usage=Specify the namespace of the object
namespace?: string
// +usage=Specify the cluster of the object
// +usage=The namespace of the resource you want to read
namespace?: *"default" | string
// +usage=The cluster you want to apply the resource to, default is the current control plane cluster
cluster: *"" | string
}

View File

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

View File

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

View File

@@ -9,7 +9,8 @@ metadata:
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- '*'
- deployments.apps
- statefulsets.apps
podDisruptive: false
schematic:
cue:

View File

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

View File

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

View File

@@ -0,0 +1,38 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/shared-resource.cue
apiVersion: core.oam.dev/v1beta1
kind: PolicyDefinition
metadata:
annotations:
definition.oam.dev/description: Configure the resources to be sharable across applications.
name: shared-resource
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
#SharedResourcePolicyRule: {
// +usage=Specify how to select the targets of the rule
selector: [...#ResourcePolicyRuleSelector]
}
#ResourcePolicyRuleSelector: {
// +usage=Select resources by component names
componentNames?: [...string]
// +usage=Select resources by component types
componentTypes?: [...string]
// +usage=Select resources by oamTypes (COMPONENT or TRAIT)
oamTypes?: [...string]
// +usage=Select resources by trait types
traitTypes?: [...string]
// +usage=Select resources by resource types (like Deployment)
resourceTypes?: [...string]
// +usage=Select resources by their names
resourceNames?: [...string]
}
parameter: {
// +usage=Specify the list of rules to control shared-resource strategy at resource level.
// The selected resource will be sharable across applications. (That means multiple applications
// can all read it without conflict, but only the first one can write it)
rules?: [...#SharedResourcePolicyRule]
}

View File

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

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: step group
definition.oam.dev/description: A special step that you can declare 'subSteps' in it, 'subSteps' is an array containing any step type whose valid parameters do not include the `step-group` step type itself. The sub steps were executed in parallel.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: step-group
@@ -13,6 +13,6 @@ spec:
schematic:
cue:
template: |
// no parameters
parameter: {}
// no parameters, the nop only to make the template not empty or it's invalid
nop: {}

View File

@@ -10,6 +10,9 @@ metadata:
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- daemonsets.apps
- jobs.batch
podDisruptive: true
schematic:
cue:

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Suspend your workflow
definition.oam.dev/description: Suspend the current workflow, it can be resumed by 'vela workflow resume' command.
name: suspend
namespace: {{ include "systemDefinitionNamespace" . }}
spec:

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: PolicyDefinition
metadata:
annotations:
definition.oam.dev/description: Determining the destination where components should be deployed to.
definition.oam.dev/description: Describe the destination where components should be deployed to.
name: topology
namespace: {{ include "systemDefinitionNamespace" . }}
spec:

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Send webhook request to the url
definition.oam.dev/description: Send a request to the specified Webhook URL. If no request body is specified, the current Application body will be sent by default.
name: webhook
namespace: {{ include "systemDefinitionNamespace" . }}
spec:

View File

@@ -13,6 +13,12 @@ spec:
properties:
image: {{ .Values.imageRegistry }}{{ .Values.test.app.repository }}:{{ .Values.test.app.tag }}
port: 8000
traits:
- type: ingress
properties:
domain: testsvc.example.com
http:
"/": 8000
---
apiVersion: v1
kind: Pod
@@ -46,6 +52,12 @@ spec:
kubectl -n {{ include "systemDefinitionNamespace" . }} wait --for=condition=available deployments helm-test-express-server --timeout 3m
echo "deployment being available"
# wait for ingress being created
while ! [ `kubectl -n {{ include "systemDefinitionNamespace" . }} get ing helm-test-express-server | grep -v NAME | wc -l` = 1 ]; do
echo "waiting for ingress being created"
sleep 1
done
echo "Application and its components are created"

View File

@@ -0,0 +1,77 @@
{{- if not (lookup "v1" "ConfigMap" (include "systemDefinitionNamespace" .) "component-pod-view") }}
apiVersion: v1
data:
template: |
import (
"vela/ql"
)
parameter: {
appName: string
appNs: string
name?: string
cluster?: string
clusterNs?: string
}
result: ql.#CollectPods & {
app: {
name: parameter.appName
namespace: parameter.appNs
filter: {
if parameter.cluster != _|_ {
cluster: parameter.cluster
}
if parameter.clusterNs != _|_ {
clusterNamespace: parameter.clusterNs
}
if parameter.name != _|_ {
components: [parameter.name]
}
}
}
}
if result.err == _|_ {
status: {
podList: [ for pod in result.list if pod.object != _|_ {
cluster: pod.cluster
workload: pod.workload
component: pod.component
metadata: {
name: pod.object.metadata.name
namespace: pod.object.metadata.namespace
creationTime: pod.object.metadata.creationTimestamp
labels: pod.object.metadata.labels
version: {
if pod.publishVersion != _|_ {
publishVersion: pod.publishVersion
}
if pod.deployVersion != _|_ {
deployVersion: pod.deployVersion
}
}
}
status: {
phase: pod.object.status.phase
// refer to https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
if phase != "Pending" && phase != "Unknown" {
podIP: pod.object.status.podIP
hostIP: pod.object.status.hostIP
nodeName: pod.object.spec.nodeName
}
}
}]
}
}
if result.err != _|_ {
status: {
error: result.err
}
}
kind: ConfigMap
metadata:
name: component-pod-view
namespace: {{ include "systemDefinitionNamespace" . }}
{{- end }}

View File

@@ -0,0 +1,50 @@
{{- if not (lookup "v1" "ConfigMap" (include "systemDefinitionNamespace" .) "component-service-view") }}
apiVersion: v1
data:
template: |
import (
"vela/ql"
)
parameter: {
appName: string
appNs: string
name?: string
cluster?: string
clusterNs?: string
}
result: ql.#CollectServices & {
app: {
name: parameter.appName
namespace: parameter.appNs
filter: {
if parameter.cluster != _|_ {
cluster: parameter.cluster
}
if parameter.clusterNs != _|_ {
clusterNamespace: parameter.clusterNs
}
if parameter.name != _|_ {
components: [parameter.name]
}
}
}
}
if result.err == _|_ {
status: {
services: result.list
}
}
if result.err != _|_ {
status: {
error: result.err
}
}
kind: ConfigMap
metadata:
name: component-service-view
namespace: {{ include "systemDefinitionNamespace" . }}
{{- end}}

View File

@@ -3650,7 +3650,7 @@ spec:
appliesToWorkloads:
description: AppliesToWorkloads specifies the list of workload
kinds this trait applies to. Workload kinds are specified
in kind.group/version format, e.g. server.core.oam.dev/v1alpha2.
in resource.group/version format, e.g. server.core.oam.dev/v1alpha2.
Traits that omit this field apply to all workload kinds.
items:
type: string

View File

@@ -708,7 +708,7 @@ spec:
appliesToWorkloads:
description: AppliesToWorkloads specifies the list of workload
kinds this trait applies to. Workload kinds are specified
in kind.group/version format, e.g. server.core.oam.dev/v1alpha2.
in resource.group/version format, e.g. server.core.oam.dev/v1alpha2.
Traits that omit this field apply to all workload kinds.
items:
type: string

View File

@@ -105,6 +105,9 @@ spec:
description: 'Specific resourceVersion to which this reference
is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
skipGC:
description: SkipGC marks the resource to skip gc
type: boolean
trait:
type: string
uid:

View File

@@ -356,7 +356,7 @@ spec:
properties:
appliesToWorkloads:
description: AppliesToWorkloads specifies the list of workload kinds
this trait applies to. Workload kinds are specified in kind.group/version
this trait applies to. Workload kinds are specified in resource.group/version
format, e.g. server.core.oam.dev/v1alpha2. Traits that omit this
field apply to all workload kinds.
items:

View File

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

View File

@@ -4,9 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add annotations on K8s pod for your workload which follows the pod spec in path 'spec.template'.
labels:
custom.definition.oam.dev/ui-hidden: "true"
definition.oam.dev/description: Add annotations on your workload. if it generates pod, add same annotations for generated pods.
name: annotations
namespace: {{ include "systemDefinitionNamespace" . }}
spec:

View File

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

View File

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

View File

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

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: PolicyDefinition
metadata:
annotations:
definition.oam.dev/description: Configure the behaviour of preventing configuration drift.
definition.oam.dev/description: Allow configuration drift for applied resources, delivery the resource without continuously reconciliation.
name: apply-once
namespace: {{ include "systemDefinitionNamespace" . }}
spec:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -6,6 +6,7 @@ metadata:
annotations:
definition.oam.dev/description: Deploy application to runtime clusters
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/ui-hidden: "true"
name: deploy2runtime
namespace: {{ include "systemDefinitionNamespace" . }}

View File

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

View File

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

View File

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

View File

@@ -5,11 +5,12 @@ kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Expose port to enable web traffic for your component.
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: expose
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
podDisruptive: false
schematic:
cue:

View File

@@ -9,7 +9,8 @@ metadata:
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- '*'
- deployments.apps
- statefulsets.apps
podDisruptive: false
schematic:
cue:
@@ -85,7 +86,7 @@ spec:
// +usage=Set ingress class in '.spec.ingressClassName' instead of 'kubernetes.io/ingress.class' annotation.
classInSpec: *false | bool
// +usage=Specify the secret name you want to quote.
// +usage=Specify the secret name you want to quote to use tls.
secretName?: string
// +usage=Specify the host of the ingress gateway, which is used to generate the endpoints when the host is empty.

View File

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

View File

@@ -5,13 +5,14 @@ kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: add an init container and use shared volume with pod
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: init-container
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- daemonsets.apps
- jobs.batch
podDisruptive: true
schematic:
cue:

View File

@@ -4,9 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add labels on K8s pod for your workload which follows the pod spec in path 'spec.template'.
labels:
custom.definition.oam.dev/ui-hidden: "true"
definition.oam.dev/description: Add labels on your workload. if it generates pod, add same label for generated pods.
name: labels
namespace: {{ include "systemDefinitionNamespace" . }}
spec:

View File

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

View File

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

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Send message to webhook
definition.oam.dev/description: Send notifications to Email, DingTalk, Slack, Lark or webhook in your workflow.
name: notification
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
@@ -17,9 +17,11 @@ spec:
)
parameter: {
// +usage=Please fulfill its url and message if you want to send Lark messages
lark?: {
// +usage=Specify the the lark url, you can either sepcify it in value or use secretRef
url: {
// +usage=the url address content in string
value: string
} | {
secretRef: {
@@ -29,7 +31,7 @@ spec:
key: string
}
}
// +useage=Specify the message that you want to sent
// +usage=Specify the message that you want to sent, refer to [Lark messaging](https://open.feishu.cn/document/ukTMukTMukTM/ucTM5YjL3ETO24yNxkjN#8b0f2a1b).
message: {
// +usage=msg_type can be text, post, image, interactive, share_chat, share_user, audio, media, file, sticker
msg_type: string
@@ -37,10 +39,11 @@ spec:
content: string
}
}
// +usage=Please fulfill its url and message if you want to send DingTalk messages
dingding?: {
// +usage=Specify the the dingding url, you can either sepcify it in value or use secretRef
url: {
// +usage=the url address content in string
value: string
} | {
secretRef: {
@@ -50,8 +53,9 @@ spec:
key: string
}
}
// +useage=Specify the message that you want to sent
// +usage=Specify the message that you want to sent, refer to [dingtalk messaging](https://developers.dingtalk.com/document/robots/custom-robot-access/title-72m-8ag-pqw)
message: {
// +usage=Specify the message content of dingtalk notification
text?: *null | {
content: string
}
@@ -93,10 +97,11 @@ spec:
}
}
}
// +usage=Please fulfill its url and message if you want to send Slack messages
slack?: {
// +usage=Specify the the slack url, you can either sepcify it in value or use secretRef
url: {
// +usage=the url address content in string
value: string
} | {
secretRef: {
@@ -106,8 +111,9 @@ spec:
key: string
}
}
// +useage=Specify the message that you want to sent
// +usage=Specify the message that you want to sent, refer to [slack messaging](https://api.slack.com/reference/messaging/payload)
message: {
// +usage=Specify the message text for slack notification
text: string
blocks?: *null | [...block]
attachments?: *null | {
@@ -115,10 +121,11 @@ spec:
color?: string
}
thread_ts?: string
mrkdwn?: *true | bool
// +usage=Specify the message text format in markdown for slack notification
mrkdwn?: *true | bool
}
}
// +usage=Please fulfill its from, to and content if you want to send email
email?: {
// +usage=Specify the email info that you want to send from
from: {
@@ -128,6 +135,7 @@ spec:
alias?: string
// +usage=Specify the password of the email, you can either sepcify it in value or use secretRef
password: {
// +usage=the password content in string
value: string
} | {
secretRef: {

View File

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

View File

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

View File

@@ -4,7 +4,7 @@ apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Read objects for your workflow steps
definition.oam.dev/description: Read Kubernetes objects from cluster for your workflow steps
labels:
custom.definition.oam.dev/ui-hidden: "true"
name: read-object
@@ -50,15 +50,15 @@ spec:
}
}
parameter: {
// +usage=Specify the apiVersion of the object, defaults to core.oam.dev/v1beta1
// +usage=Specify the apiVersion of the object, defaults to 'core.oam.dev/v1beta1'
apiVersion?: string
// +usage=Specify the kind of the object, defaults to Application
kind?: string
// +usage=Specify the name of the object
name: string
// +usage=Specify the namespace of the object
namespace?: string
// +usage=Specify the cluster of the object
// +usage=The namespace of the resource you want to read
namespace?: *"default" | string
// +usage=The cluster you want to apply the resource to, default is the current control plane cluster
cluster: *"" | string
}

View File

@@ -6,6 +6,7 @@ metadata:
annotations:
definition.oam.dev/description: Add a datasource to Grafana
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/ui-hidden: "true"
name: register-grafana-datasource
namespace: {{ include "systemDefinitionNamespace" . }}

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