mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 18:10:21 +00:00
Fix: add deploy as built-in step to avoid parse in offline mode (#6201)
This commit is contained in:
@@ -174,7 +174,7 @@ func (g *DeployWorkflowStepGenerator) Generate(app *v1beta1.Application, existin
|
||||
steps = append(steps, workflowv1alpha1.WorkflowStep{
|
||||
WorkflowStepBase: workflowv1alpha1.WorkflowStepBase{
|
||||
Name: "deploy",
|
||||
Type: "deploy",
|
||||
Type: DeployWorkflowStep,
|
||||
Properties: util.Object2RawExtension(map[string]interface{}{"policies": append([]string{}, overrides...)}),
|
||||
},
|
||||
})
|
||||
@@ -190,6 +190,7 @@ func IsBuiltinWorkflowStepType(wfType string) bool {
|
||||
wftypes.WorkflowStepTypeApplyComponent,
|
||||
wftypes.WorkflowStepTypeBuiltinApplyComponent,
|
||||
wftypes.WorkflowStepTypeStepGroup,
|
||||
DeployWorkflowStep,
|
||||
} {
|
||||
if _type == wfType {
|
||||
return true
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -290,3 +291,11 @@ func TestWorkflowStepGenerator(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsBuiltinWorkflowStepType(t *testing.T) {
|
||||
assert.True(t, IsBuiltinWorkflowStepType("deploy"))
|
||||
assert.True(t, IsBuiltinWorkflowStepType("suspend"))
|
||||
assert.True(t, IsBuiltinWorkflowStepType("apply-component"))
|
||||
assert.True(t, IsBuiltinWorkflowStepType("step-group"))
|
||||
assert.True(t, IsBuiltinWorkflowStepType("builtin-apply-component"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user