-
Notifications
You must be signed in to change notification settings - Fork 879
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport release-1.8] Fix: install dependency is invalid for runtime…
… addon when it's cluster arg is nil (#5935) * Fix: install dependency is invalid for runtime addon when it's clusters arg is nil Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com> (cherry picked from commit 142242a) * Fix: add unit test for getDependencyArgs and checkDependencyNeedInstall Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com> (cherry picked from commit c38f6e4) * Fix: Simplified the checkDependencyNeedInstall func logic Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com> (cherry picked from commit f038023) * Fix: add comments for checkDependencyNeedInstall Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com> (cherry picked from commit 1009de2) --------- Co-authored-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
- Loading branch information
1 parent
c3b736f
commit e528902
Showing
11 changed files
with
385 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# mock-dependence-rely2 | ||
|
||
This is an addon template. Check how to build your own addon: https://kubevela.net/docs/platform-engineers/addon/intro |
10 changes: 10 additions & 0 deletions
10
e2e/addon/mock/testdata/mock-dependence-rely2/metadata.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
description: An addon for testing addon dependency with specified clusters. | ||
icon: "" | ||
invisible: false | ||
name: mock-dependence-rely2 | ||
tags: | ||
- my-tag | ||
version: 1.0.0 | ||
dependencies: | ||
# install controller by helm. | ||
- name: mock-dependence2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
parameter: { | ||
// +usage=Custom parameter description | ||
myparam: *"mynsrely" | string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package main | ||
output: { | ||
apiVersion: "core.oam.dev/v1beta1" | ||
kind: "Application" | ||
spec: { | ||
components: [] | ||
policies: [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# mock-dependence2 | ||
|
||
This is an addon template. Check how to build your own addon: https://kubevela.net/docs/platform-engineers/addon/intro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
description: An addon for testing addon dependency with specified clusters. | ||
icon: "" | ||
invisible: false | ||
name: mock-dependence2 | ||
tags: | ||
- my-tag | ||
version: 1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
parameter: { | ||
// +usage=Custom parameter description | ||
myparam: *"myns" | string | ||
//+usage=Deploy to specified clusters. Leave empty to deploy to all clusters. | ||
clusters?: [...string] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package main | ||
_targetNamespace: parameter.myparam | ||
output: { | ||
apiVersion: "core.oam.dev/v1beta1" | ||
kind: "Application" | ||
spec: { | ||
components: [], | ||
policies: [ | ||
{ | ||
type: "topology" | ||
name: "deploy-mock-dependency-ns" | ||
properties: { | ||
namespace: _targetNamespace | ||
if parameter.clusters != _|_ { | ||
clusters: parameter.clusters | ||
} | ||
if parameter.clusters == _|_ { | ||
clusterLabelSelector: {} | ||
} | ||
} | ||
}, | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.