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