mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 10:00:06 +00:00
Feat: apply-component supports namespace (#6248)
This commit is contained in:
@@ -19,5 +19,7 @@ spec:
|
||||
component: string
|
||||
// +usage=Specify the cluster
|
||||
cluster: *"" | string
|
||||
// +usage=Specify the namespace
|
||||
namespace: *"" | string
|
||||
}
|
||||
|
||||
|
||||
@@ -254,6 +254,7 @@ func convertStepProperties(step *workflowv1alpha1.WorkflowStep, app *v1beta1.App
|
||||
o := struct {
|
||||
Component string `json:"component"`
|
||||
Cluster string `json:"cluster"`
|
||||
Namespace string `json:"namespace"`
|
||||
}{}
|
||||
js, err := common.RawExtensionPointer{RawExtension: step.Properties}.MarshalJSON()
|
||||
if err != nil {
|
||||
@@ -293,6 +294,9 @@ func convertStepProperties(step *workflowv1alpha1.WorkflowStep, app *v1beta1.App
|
||||
"value": c,
|
||||
"cluster": o.Cluster,
|
||||
}
|
||||
if o.Namespace != "" {
|
||||
stepProperties["namespace"] = o.Namespace
|
||||
}
|
||||
step.Properties = util.Object2RawExtension(stepProperties)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@ import (
|
||||
oam: op.oam
|
||||
// apply component and traits
|
||||
apply: oam.#ApplyComponent & {
|
||||
value: parameter.value
|
||||
cluster: parameter.cluster
|
||||
value: parameter.value
|
||||
cluster: parameter.cluster
|
||||
namespace: parameter.namespace
|
||||
}
|
||||
|
||||
if apply.output != _|_ {
|
||||
@@ -18,5 +19,6 @@ if apply.outputs != _|_ {
|
||||
}
|
||||
parameter: {
|
||||
value: {...}
|
||||
cluster: *"" | string
|
||||
cluster: *"" | string
|
||||
namespace: *"" | string
|
||||
}
|
||||
|
||||
@@ -24,4 +24,5 @@ spec:
|
||||
properties:
|
||||
component: express-server
|
||||
# cluster: <your cluster name>
|
||||
```
|
||||
# namespace: <your namespace name>
|
||||
```
|
||||
|
||||
@@ -14,5 +14,7 @@ template: {
|
||||
component: string
|
||||
// +usage=Specify the cluster
|
||||
cluster: *"" | string
|
||||
// +usage=Specify the namespace
|
||||
namespace: *"" | string
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user