mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 10:00:06 +00:00
Refactor: update workflow-related types to use v1alpha1 API (#6975)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 17m1s
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 17m1s
* refactor: update workflow-related types to use v1alpha1 API - Changed the workflow mode in ApplicationBuilder from v1beta1 to v1alpha1. - Updated WorkflowStep and WorkflowSubStep constructors to use the new v1alpha1 types. - Modified the TypedApplication interface to reflect the new workflow mode. - Adjusted WorkflowStepBase and WorkflowSubStepBase to utilize v1alpha1 inputs and outputs. - Commented out unused WorkflowSubStep registration for future consideration. Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Signed-off-by: semmet95 <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> * fix: update Inputs and Outputs types to use v1alpha1 API in GoDefModifier Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Signed-off-by: semmet95 <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> * fix: remove commented-out code for AddInput and AddOutput in genBaseSetterFunc Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com> Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com> Signed-off-by: semmet95 <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> * fix: update ApplicationBuilder to use apis package for components, steps, and policies Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com> Signed-off-by: semmet95 <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> * fix: remove unused WorkflowSubStep related code and update WorkflowStep reference to use v1alpha1 API Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com> Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Signed-off-by: semmet95 <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> * feat: add support for WorkflowSubStep registration and handling in GoDefModifier Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com> Signed-off-by: semmet95 <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> * fix: update import path for WorkflowStepBase in GoDefModifier Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com> Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Signed-off-by: semmet95 <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> * fix: update import path for WorkflowStep in DefinitionKindToStatement Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com> Signed-off-by: semmet95 <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> * fix: update WorkflowSubStep references to use WorkflowStepBase from v1alpha1 API Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com> Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Signed-off-by: semmet95 <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> * fix: simplify subSteps generation in GoDefModifier by directly appending WorkflowStepBase Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com> Signed-off-by: semmet95 <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> * fix: nest properties under WorkflowStepBase in GoDefModifier for WorkflowStep definitions Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com> Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Signed-off-by: semmet95 <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> * fix: remove toolchain version from go.mod Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com> Signed-off-by: semmet95 <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> * Run: make reviewable Signed-off-by: Amit Singh <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> * fix: enhance application auto-update test to wait for application revisions Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> --------- Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Signed-off-by: semmet95 <singhamitch@outlook.com> Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com> Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com> Signed-off-by: Amit Singh <singhamitch@outlook.com> Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
This commit is contained in:
committed by
GitHub
parent
0a599ad177
commit
90ed704cff
@@ -138,6 +138,12 @@ var _ = Describe("Application Auto update", Ordered, func() {
|
||||
_, err = e2e.Exec(fmt.Sprintf("%s up -f data/app.yaml", velaCommandPrefix))
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
By("Wait for application revision v1 to be created")
|
||||
Eventually(func() error {
|
||||
appRev := &v1beta1.ApplicationRevision{}
|
||||
return k8sClient.Get(ctx, client.ObjectKey{Name: "app-with-auto-update-v1", Namespace: namespace}, appRev)
|
||||
}, 30*time.Second, time.Second).Should(BeNil())
|
||||
|
||||
By("Create configmap-component with 1.4.0 version")
|
||||
updatedComponent := new(v1beta1.ComponentDefinition)
|
||||
updatedComponentVersion := "1.4.0"
|
||||
@@ -151,9 +157,11 @@ var _ = Describe("Application Auto update", Ordered, func() {
|
||||
return k8sClient.Update(ctx, updatedComponent)
|
||||
}, 15*time.Second, time.Second).Should(BeNil())
|
||||
|
||||
By("Create application using configmap-component@v1 component")
|
||||
_, err = e2e.Exec(fmt.Sprintf("%s up -f data/app.yaml", velaCommandPrefix))
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
By("Wait for application to auto-update and create revision v2")
|
||||
Eventually(func() error {
|
||||
appRev := &v1beta1.ApplicationRevision{}
|
||||
return k8sClient.Get(ctx, client.ObjectKey{Name: "app-with-auto-update-v2", Namespace: namespace}, appRev)
|
||||
}, 60*time.Second, 2*time.Second).Should(BeNil())
|
||||
|
||||
By("Execute a live-diff command for previous two application versions")
|
||||
output, err := e2e.Exec(fmt.Sprintf("%s live-diff --revision app-with-auto-update-v2,app-with-auto-update-v1", velaCommandPrefix))
|
||||
|
||||
@@ -1,119 +1,128 @@
|
||||
module github.com/kubevela/vela-go-sdk
|
||||
|
||||
go 1.19
|
||||
go 1.23.8
|
||||
|
||||
require (
|
||||
github.com/oam-dev/kubevela-core-api v1.5.8
|
||||
github.com/oam-dev/kubevela-core-api v1.7.8-0.20250930174210-fb3adce5e9f6
|
||||
|
||||
// for main module
|
||||
github.com/pkg/errors v0.9.1
|
||||
k8s.io/apimachinery v0.23.6
|
||||
k8s.io/client-go v0.23.6
|
||||
sigs.k8s.io/controller-runtime v0.11.2
|
||||
sigs.k8s.io/yaml v1.3.0
|
||||
k8s.io/apimachinery v0.31.10
|
||||
k8s.io/client-go v0.31.10
|
||||
sigs.k8s.io/controller-runtime v0.19.7
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
// for sub-module
|
||||
// require github.com/kubevela/vela-go-sdk v0.0.0-20230309022604-cd431bb25a9a
|
||||
|
||||
require github.com/kubevela/workflow v0.6.3-0.20250717221743-56b80cee4121
|
||||
|
||||
require (
|
||||
cuelang.org/go v0.5.0-alpha.1 // indirect
|
||||
cuelang.org/go v0.9.2 // indirect
|
||||
dario.cat/mergo v1.0.0 // indirect
|
||||
github.com/NYTimes/gziphandler v1.1.1 // indirect
|
||||
github.com/PuerkitoBio/purell v1.1.1 // indirect
|
||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
|
||||
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/blang/semver v3.5.1+incompatible // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/blang/semver/v4 v4.0.0 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
|
||||
github.com/coreos/go-semver v0.3.0 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
|
||||
github.com/crossplane/crossplane-runtime v0.14.1-0.20210722005935-0b469fcc77cd // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
|
||||
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
|
||||
github.com/felixge/httpsnoop v1.0.1 // indirect
|
||||
github.com/fsnotify/fsnotify v1.5.1 // indirect
|
||||
github.com/go-logr/logr v1.2.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.5 // indirect
|
||||
github.com/go-openapi/jsonreference v0.19.5 // indirect
|
||||
github.com/go-openapi/swag v0.19.14 // indirect
|
||||
github.com/coreos/go-semver v0.3.1 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
|
||||
github.com/crossplane/crossplane-runtime v1.16.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
|
||||
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/google/go-cmp v0.5.8 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/google/cel-go v0.20.1 // indirect
|
||||
github.com/google/gnostic-models v0.6.9 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/googleapis/gnostic v0.5.5 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
|
||||
github.com/imdario/mergo v0.3.12 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.0.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
|
||||
github.com/imdario/mergo v0.3.16 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/mailru/easyjson v0.7.6 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
|
||||
github.com/klauspost/compress v1.17.10 // indirect
|
||||
github.com/kubevela/pkg v1.9.3-0.20250625225831-a2894a62a307 // indirect
|
||||
github.com/kylelemons/godebug v1.1.0 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/mpvl/unique v0.0.0-20150818121801-cbe035fff7de // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
|
||||
github.com/oam-dev/cluster-gateway v1.4.0 // indirect
|
||||
github.com/oam-dev/terraform-controller v0.7.0 // indirect
|
||||
github.com/onsi/gomega v1.20.2 // indirect
|
||||
github.com/openshift/library-go v0.0.0-20220112153822-ac82336bd076 // indirect
|
||||
github.com/prometheus/client_golang v1.12.2 // indirect
|
||||
github.com/prometheus/client_model v0.2.0 // indirect
|
||||
github.com/prometheus/common v0.32.1 // indirect
|
||||
github.com/prometheus/procfs v0.7.3 // indirect
|
||||
github.com/spf13/cobra v1.4.0 // indirect
|
||||
github.com/oam-dev/cluster-gateway v1.9.2-0.20250629203450-2b04dd452b7a // indirect
|
||||
github.com/oam-dev/terraform-controller v0.8.0 // indirect
|
||||
github.com/openshift/library-go v0.0.0-20230327085348-8477ec72b725 // indirect
|
||||
github.com/prometheus/client_golang v1.20.5 // indirect
|
||||
github.com/prometheus/client_model v0.6.1 // indirect
|
||||
github.com/prometheus/common v0.55.0 // indirect
|
||||
github.com/prometheus/procfs v0.15.1 // indirect
|
||||
github.com/spf13/cobra v1.8.1 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/stretchr/testify v1.7.1 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.5.0 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.0 // indirect
|
||||
go.etcd.io/etcd/client/v3 v3.5.0 // indirect
|
||||
go.opentelemetry.io/contrib v0.20.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk/export/metric v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk/metric v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v0.20.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v0.7.0 // indirect
|
||||
go.uber.org/atomic v1.9.0 // indirect
|
||||
go.uber.org/multierr v1.7.0 // indirect
|
||||
go.uber.org/zap v1.21.0 // indirect
|
||||
golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect
|
||||
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
|
||||
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
|
||||
golang.org/x/text v0.3.8 // indirect
|
||||
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03 // indirect
|
||||
google.golang.org/grpc v1.48.0 // indirect
|
||||
google.golang.org/protobuf v1.28.0 // indirect
|
||||
github.com/stoewer/go-strcase v1.2.0 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.5.16 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect
|
||||
go.etcd.io/etcd/client/v3 v3.5.16 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
|
||||
go.opentelemetry.io/otel v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.28.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
|
||||
go.uber.org/automaxprocs v1.5.3 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.26.0 // indirect
|
||||
golang.org/x/crypto v0.37.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
|
||||
golang.org/x/net v0.39.0 // indirect
|
||||
golang.org/x/oauth2 v0.29.0 // indirect
|
||||
golang.org/x/sync v0.13.0 // indirect
|
||||
golang.org/x/sys v0.32.0 // indirect
|
||||
golang.org/x/term v0.31.0 // indirect
|
||||
golang.org/x/text v0.24.0 // indirect
|
||||
golang.org/x/time v0.10.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
|
||||
google.golang.org/grpc v1.67.1 // indirect
|
||||
google.golang.org/protobuf v1.36.5 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/api v0.23.6 // indirect
|
||||
k8s.io/apiextensions-apiserver v0.23.6 // indirect
|
||||
k8s.io/apiserver v0.23.6 // indirect
|
||||
k8s.io/component-base v0.23.6 // indirect
|
||||
k8s.io/api v0.31.10 // indirect
|
||||
k8s.io/apiserver v0.31.10 // indirect
|
||||
k8s.io/component-base v0.31.10 // indirect
|
||||
k8s.io/klog v1.0.0 // indirect
|
||||
k8s.io/klog/v2 v2.60.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
|
||||
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
|
||||
open-cluster-management.io/api v0.7.0 // indirect
|
||||
sigs.k8s.io/apiserver-network-proxy v0.0.30 // indirect
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30 // indirect
|
||||
sigs.k8s.io/apiserver-runtime v1.1.1 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20250610211856-8b98d1ed966a // indirect
|
||||
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
|
||||
open-cluster-management.io/api v0.11.0 // indirect
|
||||
sigs.k8s.io/apiserver-network-proxy v0.31.4 // indirect
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.3 // indirect
|
||||
sigs.k8s.io/apiserver-runtime v1.1.2-0.20250117204231-9282f514a674 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
|
||||
)
|
||||
|
||||
replace (
|
||||
@@ -121,5 +130,5 @@ replace (
|
||||
github.com/docker/cli => github.com/docker/cli v20.10.9+incompatible
|
||||
github.com/docker/docker => github.com/moby/moby v17.12.0-ce-rc1.0.20200618181300-9dc6525e6118+incompatible
|
||||
github.com/wercker/stern => github.com/oam-dev/stern v1.13.2
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client => sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.24
|
||||
// sigs.k8s.io/apiserver-network-proxy/konnectivity-client => sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.24
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,10 +22,12 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
. "github.com/kubevela/vela-go-sdk/pkg/apis"
|
||||
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
|
||||
|
||||
"github.com/oam-dev/kubevela-core-api/apis/core.oam.dev/common"
|
||||
"github.com/oam-dev/kubevela-core-api/apis/core.oam.dev/v1beta1"
|
||||
|
||||
"github.com/kubevela/vela-go-sdk/pkg/apis"
|
||||
)
|
||||
|
||||
type ApplicationBuilder struct {
|
||||
@@ -35,14 +37,14 @@ type ApplicationBuilder struct {
|
||||
annotations map[string]string
|
||||
resourceVersion string
|
||||
|
||||
components []Component
|
||||
steps []WorkflowStep
|
||||
policies []Policy
|
||||
workflowMode v1beta1.WorkflowExecuteMode
|
||||
components []apis.Component
|
||||
steps []apis.WorkflowStep
|
||||
policies []apis.Policy
|
||||
workflowMode workflowv1alpha1.WorkflowExecuteMode
|
||||
}
|
||||
|
||||
// SetComponents set components to application, use component name to match, if component name not found, append it
|
||||
func (a *ApplicationBuilder) SetComponents(components ...Component) TypedApplication {
|
||||
func (a *ApplicationBuilder) SetComponents(components ...apis.Component) apis.TypedApplication {
|
||||
for _, addComp := range components {
|
||||
found := false
|
||||
for i, c := range a.components {
|
||||
@@ -60,7 +62,7 @@ func (a *ApplicationBuilder) SetComponents(components ...Component) TypedApplica
|
||||
}
|
||||
|
||||
// SetWorkflowSteps set workflow steps to application, use step name to match, if step name not found, append it
|
||||
func (a *ApplicationBuilder) SetWorkflowSteps(steps ...WorkflowStep) TypedApplication {
|
||||
func (a *ApplicationBuilder) SetWorkflowSteps(steps ...apis.WorkflowStep) apis.TypedApplication {
|
||||
for _, addStep := range steps {
|
||||
found := false
|
||||
for i, s := range a.steps {
|
||||
@@ -78,7 +80,7 @@ func (a *ApplicationBuilder) SetWorkflowSteps(steps ...WorkflowStep) TypedApplic
|
||||
}
|
||||
|
||||
// SetPolicies set policies to application, use policy name to match, if policy name not found, append it
|
||||
func (a *ApplicationBuilder) SetPolicies(policies ...Policy) TypedApplication {
|
||||
func (a *ApplicationBuilder) SetPolicies(policies ...apis.Policy) apis.TypedApplication {
|
||||
for _, addPolicy := range policies {
|
||||
found := false
|
||||
for i, p := range a.policies {
|
||||
@@ -95,7 +97,7 @@ func (a *ApplicationBuilder) SetPolicies(policies ...Policy) TypedApplication {
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *ApplicationBuilder) GetComponentByName(name string) Component {
|
||||
func (a *ApplicationBuilder) GetComponentByName(name string) apis.Component {
|
||||
for _, c := range a.components {
|
||||
if c.ComponentName() == name {
|
||||
return c
|
||||
@@ -104,8 +106,8 @@ func (a *ApplicationBuilder) GetComponentByName(name string) Component {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *ApplicationBuilder) GetComponentsByType(typ string) []Component {
|
||||
var result []Component
|
||||
func (a *ApplicationBuilder) GetComponentsByType(typ string) []apis.Component {
|
||||
var result []apis.Component
|
||||
for _, c := range a.components {
|
||||
if c.DefType() == typ {
|
||||
result = append(result, c)
|
||||
@@ -114,7 +116,7 @@ func (a *ApplicationBuilder) GetComponentsByType(typ string) []Component {
|
||||
return result
|
||||
}
|
||||
|
||||
func (a *ApplicationBuilder) GetWorkflowStepByName(name string) WorkflowStep {
|
||||
func (a *ApplicationBuilder) GetWorkflowStepByName(name string) apis.WorkflowStep {
|
||||
for _, s := range a.steps {
|
||||
if s.WorkflowStepName() == name {
|
||||
return s
|
||||
@@ -123,8 +125,8 @@ func (a *ApplicationBuilder) GetWorkflowStepByName(name string) WorkflowStep {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *ApplicationBuilder) GetWorkflowStepsByType(typ string) []WorkflowStep {
|
||||
var result []WorkflowStep
|
||||
func (a *ApplicationBuilder) GetWorkflowStepsByType(typ string) []apis.WorkflowStep {
|
||||
var result []apis.WorkflowStep
|
||||
for _, s := range a.steps {
|
||||
if s.DefType() == typ {
|
||||
result = append(result, s)
|
||||
@@ -133,7 +135,7 @@ func (a *ApplicationBuilder) GetWorkflowStepsByType(typ string) []WorkflowStep {
|
||||
return result
|
||||
}
|
||||
|
||||
func (a *ApplicationBuilder) GetPolicyByName(name string) Policy {
|
||||
func (a *ApplicationBuilder) GetPolicyByName(name string) apis.Policy {
|
||||
for _, p := range a.policies {
|
||||
if p.PolicyName() == name {
|
||||
return p
|
||||
@@ -142,8 +144,8 @@ func (a *ApplicationBuilder) GetPolicyByName(name string) Policy {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *ApplicationBuilder) GetPoliciesByType(typ string) []Policy {
|
||||
var result []Policy
|
||||
func (a *ApplicationBuilder) GetPoliciesByType(typ string) []apis.Policy {
|
||||
var result []apis.Policy
|
||||
for _, p := range a.policies {
|
||||
if p.DefType() == typ {
|
||||
result = append(result, p)
|
||||
@@ -153,28 +155,28 @@ func (a *ApplicationBuilder) GetPoliciesByType(typ string) []Policy {
|
||||
}
|
||||
|
||||
// SetWorkflowMode set the workflow mode of application
|
||||
func (a *ApplicationBuilder) SetWorkflowMode(steps, subSteps common.WorkflowMode) TypedApplication {
|
||||
func (a *ApplicationBuilder) SetWorkflowMode(steps, subSteps workflowv1alpha1.WorkflowMode) apis.TypedApplication {
|
||||
a.workflowMode.Steps = steps
|
||||
a.workflowMode.SubSteps = subSteps
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *ApplicationBuilder) Name(name string) TypedApplication {
|
||||
func (a *ApplicationBuilder) Name(name string) apis.TypedApplication {
|
||||
a.name = name
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *ApplicationBuilder) Namespace(namespace string) TypedApplication {
|
||||
func (a *ApplicationBuilder) Namespace(namespace string) apis.TypedApplication {
|
||||
a.namespace = namespace
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *ApplicationBuilder) Labels(labels map[string]string) TypedApplication {
|
||||
func (a *ApplicationBuilder) Labels(labels map[string]string) apis.TypedApplication {
|
||||
a.labels = labels
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *ApplicationBuilder) Annotations(annotations map[string]string) TypedApplication {
|
||||
func (a *ApplicationBuilder) Annotations(annotations map[string]string) apis.TypedApplication {
|
||||
a.annotations = annotations
|
||||
return a
|
||||
}
|
||||
@@ -196,11 +198,11 @@ func (a *ApplicationBuilder) GetAnnotations() map[string]string {
|
||||
}
|
||||
|
||||
// New creates a new application with the given components.
|
||||
func New() TypedApplication {
|
||||
func New() apis.TypedApplication {
|
||||
app := &ApplicationBuilder{
|
||||
components: make([]Component, 0),
|
||||
steps: make([]WorkflowStep, 0),
|
||||
policies: make([]Policy, 0),
|
||||
components: make([]apis.Component, 0),
|
||||
steps: make([]apis.WorkflowStep, 0),
|
||||
policies: make([]apis.Policy, 0),
|
||||
}
|
||||
return app
|
||||
}
|
||||
@@ -210,7 +212,7 @@ func (a *ApplicationBuilder) Build() v1beta1.Application {
|
||||
for _, component := range a.components {
|
||||
components = append(components, component.Build())
|
||||
}
|
||||
steps := make([]v1beta1.WorkflowStep, 0, len(a.steps))
|
||||
steps := make([]workflowv1alpha1.WorkflowStep, 0, len(a.steps))
|
||||
for _, step := range a.steps {
|
||||
steps = append(steps, step.Build())
|
||||
}
|
||||
@@ -287,7 +289,7 @@ func (a *ApplicationBuilder) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func FromK8sObject(app v1beta1.Application) (TypedApplication, error) {
|
||||
func FromK8sObject(app v1beta1.Application) (apis.TypedApplication, error) {
|
||||
a := &ApplicationBuilder{}
|
||||
a.Name(app.Name)
|
||||
a.Namespace(app.Namespace)
|
||||
@@ -319,7 +321,7 @@ func FromK8sObject(app v1beta1.Application) (TypedApplication, error) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
func FromComponent(component common.ApplicationComponent) (Component, error) {
|
||||
func FromComponent(component common.ApplicationComponent) (apis.Component, error) {
|
||||
build, ok := ComponentsBuilders[component.Type]
|
||||
if !ok {
|
||||
return nil, errors.Errorf("no component type %s registered", component.Type)
|
||||
@@ -327,7 +329,7 @@ func FromComponent(component common.ApplicationComponent) (Component, error) {
|
||||
return build(component)
|
||||
}
|
||||
|
||||
func FromWorkflowStep(step v1beta1.WorkflowStep) (WorkflowStep, error) {
|
||||
func FromWorkflowStep(step workflowv1alpha1.WorkflowStep) (apis.WorkflowStep, error) {
|
||||
build, ok := WorkflowStepsBuilders[step.Type]
|
||||
if !ok {
|
||||
return nil, errors.Errorf("no workflow step type %s registered", step.Type)
|
||||
@@ -335,7 +337,7 @@ func FromWorkflowStep(step v1beta1.WorkflowStep) (WorkflowStep, error) {
|
||||
return build(step)
|
||||
}
|
||||
|
||||
func FromPolicy(policy v1beta1.AppPolicy) (Policy, error) {
|
||||
func FromPolicy(policy v1beta1.AppPolicy) (apis.Policy, error) {
|
||||
build, ok := PoliciesBuilders[policy.Type]
|
||||
if !ok {
|
||||
return nil, errors.Errorf("no policy type %s registered", policy.Type)
|
||||
@@ -343,7 +345,7 @@ func FromPolicy(policy v1beta1.AppPolicy) (Policy, error) {
|
||||
return build(policy)
|
||||
}
|
||||
|
||||
func FromTrait(trait common.ApplicationTrait) (Trait, error) {
|
||||
func FromTrait(trait common.ApplicationTrait) (apis.Trait, error) {
|
||||
build, ok := TraitBuilders[trait.Type]
|
||||
if !ok {
|
||||
return nil, errors.Errorf("no trait type %s registered", trait.Type)
|
||||
|
||||
@@ -19,6 +19,8 @@ package common
|
||||
import (
|
||||
"github.com/kubevela/vela-go-sdk/pkg/apis"
|
||||
|
||||
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
|
||||
|
||||
"github.com/oam-dev/kubevela-core-api/apis/core.oam.dev/common"
|
||||
"github.com/oam-dev/kubevela-core-api/apis/core.oam.dev/v1beta1"
|
||||
)
|
||||
@@ -26,8 +28,8 @@ import (
|
||||
type (
|
||||
ComponentConstructor func(comp common.ApplicationComponent) (apis.Component, error)
|
||||
TraitConstructor func(trait common.ApplicationTrait) (apis.Trait, error)
|
||||
WorkflowStepConstructor func(step v1beta1.WorkflowStep) (apis.WorkflowStep, error)
|
||||
WorkflowSubStepConstructor func(step common.WorkflowSubStep) (apis.WorkflowStep, error)
|
||||
WorkflowStepConstructor func(step workflowv1alpha1.WorkflowStep) (apis.WorkflowStep, error)
|
||||
WorkflowSubStepConstructor func(step workflowv1alpha1.WorkflowStepBase) (apis.WorkflowStep, error)
|
||||
PolicyConstructor func(policy v1beta1.AppPolicy) (apis.Policy, error)
|
||||
)
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@ limitations under the License.
|
||||
package apis
|
||||
|
||||
import (
|
||||
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
|
||||
|
||||
"github.com/oam-dev/kubevela-core-api/apis/core.oam.dev/common"
|
||||
"github.com/oam-dev/kubevela-core-api/apis/core.oam.dev/v1beta1"
|
||||
)
|
||||
@@ -27,7 +29,7 @@ type TypedApplication interface {
|
||||
Labels(labels map[string]string) TypedApplication
|
||||
Annotations(annotations map[string]string) TypedApplication
|
||||
|
||||
SetWorkflowMode(steps, subSteps common.WorkflowMode) TypedApplication
|
||||
SetWorkflowMode(steps, subSteps workflowv1alpha1.WorkflowMode) TypedApplication
|
||||
SetComponents(components ...Component) TypedApplication
|
||||
SetWorkflowSteps(steps ...WorkflowStep) TypedApplication
|
||||
SetPolicies(policies ...Policy) TypedApplication
|
||||
@@ -65,7 +67,7 @@ type Trait interface {
|
||||
type WorkflowStep interface {
|
||||
WorkflowStepName() string
|
||||
DefType() string
|
||||
Build() v1beta1.WorkflowStep
|
||||
Build() workflowv1alpha1.WorkflowStep
|
||||
Validate() error
|
||||
}
|
||||
|
||||
@@ -80,8 +82,8 @@ type ComponentBase struct {
|
||||
Name string
|
||||
Type string
|
||||
DependsOn []string
|
||||
Inputs common.StepInputs
|
||||
Outputs common.StepOutputs
|
||||
Inputs workflowv1alpha1.StepInputs
|
||||
Outputs workflowv1alpha1.StepOutputs
|
||||
Traits []Trait
|
||||
}
|
||||
|
||||
@@ -92,24 +94,24 @@ type TraitBase struct {
|
||||
type WorkflowSubStepBase struct {
|
||||
Name string
|
||||
Type string
|
||||
Meta *common.WorkflowStepMeta
|
||||
Meta *workflowv1alpha1.WorkflowStepMeta
|
||||
If string
|
||||
Timeout string
|
||||
DependsOn []string
|
||||
Inputs common.StepInputs
|
||||
Outputs common.StepOutputs
|
||||
Inputs workflowv1alpha1.StepInputs
|
||||
Outputs workflowv1alpha1.StepOutputs
|
||||
}
|
||||
|
||||
type WorkflowStepBase struct {
|
||||
Name string
|
||||
Type string
|
||||
Meta *common.WorkflowStepMeta
|
||||
Meta *workflowv1alpha1.WorkflowStepMeta
|
||||
SubSteps []WorkflowStep
|
||||
If string
|
||||
Timeout string
|
||||
DependsOn []string
|
||||
Inputs common.StepInputs
|
||||
Outputs common.StepOutputs
|
||||
Inputs workflowv1alpha1.StepInputs
|
||||
Outputs workflowv1alpha1.StepOutputs
|
||||
}
|
||||
|
||||
type PolicyBase struct {
|
||||
|
||||
@@ -85,7 +85,7 @@ var (
|
||||
DefinitionKindToStatement = map[string]*j.Statement{
|
||||
v1beta1.ComponentDefinitionKind: j.Qual("common", "ApplicationComponent"),
|
||||
v1beta1.TraitDefinitionKind: j.Qual("common", "ApplicationTrait"),
|
||||
v1beta1.WorkflowStepDefinitionKind: j.Qual("v1beta1", "WorkflowStep"),
|
||||
v1beta1.WorkflowStepDefinitionKind: j.Qual("github.com/kubevela/workflow/api/v1alpha1", "WorkflowStep"),
|
||||
v1beta1.PolicyDefinitionKind: j.Qual("v1beta1", "AppPolicy"),
|
||||
}
|
||||
)
|
||||
@@ -432,24 +432,37 @@ func (m *GoDefModifier) genCommonFunc() []*j.Statement {
|
||||
)
|
||||
traitType := DefinitionKindToStatement[v1beta1.TraitDefinitionKind]
|
||||
stepType := DefinitionKindToStatement[v1beta1.WorkflowStepDefinitionKind]
|
||||
builderDict := j.Dict{
|
||||
// all definition have type and properties
|
||||
j.Id("Type"): j.Add(typeName),
|
||||
j.Id("Properties"): j.Qual("util", "Object2RawExtension").Params(j.Id(m.defFuncReceiver).Dot("Properties")),
|
||||
}
|
||||
builderDictValues := map[string][]string{
|
||||
v1beta1.PolicyDefinitionKind: {"Name"},
|
||||
v1beta1.ComponentDefinitionKind: {"Name", "DependsOn", "Inputs", "Outputs"},
|
||||
v1beta1.WorkflowStepDefinitionKind: {"Name", "DependsOn", "Inputs", "Outputs", "If", "Timeout", "Meta"},
|
||||
}
|
||||
for _, v := range builderDictValues[kind] {
|
||||
builderDict[j.Id(v)] = j.Id(m.defFuncReceiver).Dot("Base").Dot(v)
|
||||
}
|
||||
switch kind {
|
||||
case v1beta1.ComponentDefinitionKind:
|
||||
builderDict[j.Id("Traits")] = j.Id("traits")
|
||||
case v1beta1.WorkflowStepDefinitionKind:
|
||||
builderDict := j.Dict{}
|
||||
|
||||
// For WorkflowStep, we need to nest properties under WorkflowStepBase
|
||||
if kind == v1beta1.WorkflowStepDefinitionKind {
|
||||
workflowStepBaseDict := j.Dict{
|
||||
j.Id("Type"): j.Add(typeName),
|
||||
j.Id("Properties"): j.Qual("util", "Object2RawExtension").Params(j.Id(m.defFuncReceiver).Dot("Properties")),
|
||||
j.Id("Name"): j.Id(m.defFuncReceiver).Dot("Base").Dot("Name"),
|
||||
j.Id("DependsOn"): j.Id(m.defFuncReceiver).Dot("Base").Dot("DependsOn"),
|
||||
j.Id("Inputs"): j.Id(m.defFuncReceiver).Dot("Base").Dot("Inputs"),
|
||||
j.Id("Outputs"): j.Id(m.defFuncReceiver).Dot("Base").Dot("Outputs"),
|
||||
j.Id("If"): j.Id(m.defFuncReceiver).Dot("Base").Dot("If"),
|
||||
j.Id("Timeout"): j.Id(m.defFuncReceiver).Dot("Base").Dot("Timeout"),
|
||||
j.Id("Meta"): j.Id(m.defFuncReceiver).Dot("Base").Dot("Meta"),
|
||||
}
|
||||
builderDict[j.Id("WorkflowStepBase")] = j.Qual("github.com/kubevela/workflow/api/v1alpha1", "WorkflowStepBase").Values(workflowStepBaseDict)
|
||||
builderDict[j.Id("SubSteps")] = j.Id("subSteps")
|
||||
} else {
|
||||
builderDict[j.Id("Type")] = j.Add(typeName)
|
||||
builderDict[j.Id("Properties")] = j.Qual("util", "Object2RawExtension").Params(j.Id(m.defFuncReceiver).Dot("Properties"))
|
||||
|
||||
builderDictValues := map[string][]string{
|
||||
v1beta1.PolicyDefinitionKind: {"Name"},
|
||||
v1beta1.ComponentDefinitionKind: {"Name", "DependsOn", "Inputs", "Outputs"},
|
||||
}
|
||||
for _, v := range builderDictValues[kind] {
|
||||
builderDict[j.Id(v)] = j.Id(m.defFuncReceiver).Dot("Base").Dot(v)
|
||||
}
|
||||
if kind == v1beta1.ComponentDefinitionKind {
|
||||
builderDict[j.Id("Traits")] = j.Id("traits")
|
||||
}
|
||||
}
|
||||
buildFunc := j.Func().
|
||||
Params(j.Id(m.defFuncReceiver).Add(m.defStructPointer)).
|
||||
@@ -466,16 +479,10 @@ func (m *GoDefModifier) genCommonFunc() []*j.Statement {
|
||||
g.Add(j.For(j.List(j.Id("_"), j.Id("subStep")).Op(":=").Range().Id(m.defFuncReceiver).Dot("Base").Dot("SubSteps")).Block(
|
||||
j.Id("_subSteps").Op("=").Append(j.Id("_subSteps"), j.Id("subStep").Dot("Build").Call()),
|
||||
))
|
||||
g.Add(j.Id("subSteps").Op(":=").Make(j.Index().Qual("common", "WorkflowSubStep"), j.Lit(0)))
|
||||
g.Add(j.Id("subSteps").Op(":=").Make(j.Index().Qual("github.com/kubevela/workflow/api/v1alpha1", "WorkflowStepBase"), j.Lit(0)))
|
||||
g.Add(j.For(j.List(j.Id("_"), j.Id("_s").Op(":=").Range().Id("_subSteps"))).Block(
|
||||
j.Id("subSteps").Op("=").Append(j.Id("subSteps"), j.Qual("common", "WorkflowSubStep").ValuesFunc(
|
||||
func(_g *j.Group) {
|
||||
for _, v := range []string{"Name", "DependsOn", "Inputs", "Outputs", "If", "Timeout", "Meta", "Properties", "Type"} {
|
||||
_g.Add(j.Id(v).Op(":").Id("_s").Dot(v))
|
||||
}
|
||||
}),
|
||||
)),
|
||||
)
|
||||
j.Id("subSteps").Op("=").Append(j.Id("subSteps"), j.Id("_s").Dot("WorkflowStepBase")),
|
||||
))
|
||||
}
|
||||
g.Add(j.Id("res").Op(":=").Add(DefinitionKindToStatement[kind]).Values(builderDict))
|
||||
g.Add(j.Return(j.Id("res")))
|
||||
@@ -526,7 +533,7 @@ func (m *GoDefModifier) genFromFunc() []*j.Statement {
|
||||
params := DefinitionKindToStatement[kind]
|
||||
if sub {
|
||||
funcName = "FromWorkflowSubStep"
|
||||
params = j.Qual("common", "WorkflowSubStep")
|
||||
params = j.Qual("github.com/kubevela/workflow/api/v1alpha1", "WorkflowStepBase")
|
||||
}
|
||||
return j.Func().
|
||||
Params(j.Id(m.defFuncReceiver).Add(m.defStructPointer)).
|
||||
@@ -574,7 +581,7 @@ func (m *GoDefModifier) genFromFunc() []*j.Statement {
|
||||
j.Return(j.Id(m.defFuncReceiver).Dot("From"+DefinitionKindToPascal[kind]).Call(j.Id("from"))),
|
||||
)
|
||||
fromSubFunc := j.Func().Id("FromWorkflowSubStep").
|
||||
Params(j.Id("from").Qual("common", "WorkflowSubStep")).Params(j.Qual("apis", DefinitionKindToPascal[kind]), j.Error()).
|
||||
Params(j.Id("from").Qual("github.com/kubevela/workflow/api/v1alpha1", "WorkflowStepBase")).Params(j.Qual("apis", DefinitionKindToPascal[kind]), j.Error()).
|
||||
Block(
|
||||
j.Id(m.defFuncReceiver).Op(":=").Op("&").Id(m.defStructName).Values(j.Dict{}),
|
||||
j.Return(j.Id(m.defFuncReceiver).Dot("FromWorkflowSubStep").Call(j.Id("from"))),
|
||||
@@ -670,22 +677,17 @@ func (m *GoDefModifier) genBaseSetterFunc() []*j.Statement {
|
||||
}{
|
||||
v1beta1.ComponentDefinitionKind: {
|
||||
{funcName: "DependsOn", argName: "dependsOn", argType: j.Index().String()},
|
||||
{funcName: "Inputs", argName: "input", argType: j.Qual("common", "StepInputs")},
|
||||
{funcName: "Outputs", argName: "output", argType: j.Qual("common", "StepOutputs")},
|
||||
{funcName: "Inputs", argName: "input", argType: j.Qual("github.com/kubevela/workflow/api/v1alpha1", "StepInputs")},
|
||||
{funcName: "Outputs", argName: "output", argType: j.Qual("github.com/kubevela/workflow/api/v1alpha1", "StepOutputs")},
|
||||
{funcName: "AddDependsOn", argName: "dependsOn", argType: j.String(), isAppend: true, dst: j.Dot("DependsOn")},
|
||||
// TODO: uncomment this after https://github.com/kubevela/workflow/pull/125 is released.
|
||||
// {funcName: "AddInput", argName: "input", argType: Qual("common", "StepInputs"), isAppend: true, dst: "Inputs"},
|
||||
// {funcName: "AddOutput", argName: "output", argType: Qual("common", "StepOutputs"), isAppend: true, dst: "Outputs"},
|
||||
},
|
||||
v1beta1.WorkflowStepDefinitionKind: {
|
||||
{funcName: "If", argName: "_if", argType: j.String()},
|
||||
{funcName: "Alias", argName: "alias", argType: j.String(), dst: j.Dot("Meta").Dot("Alias")},
|
||||
{funcName: "Timeout", argName: "timeout", argType: j.String()},
|
||||
{funcName: "DependsOn", argName: "dependsOn", argType: j.Index().String()},
|
||||
{funcName: "Inputs", argName: "input", argType: j.Qual("common", "StepInputs")},
|
||||
{funcName: "Outputs", argName: "output", argType: j.Qual("common", "StepOutputs")},
|
||||
// {funcName: "AddInput", argName: "input", argType: Qual("common", "StepInputs"), isAppend: true, dst: "Inputs"},
|
||||
// {funcName: "AddOutput", argName: "output", argType: Qual("common", "StepOutputs"), isAppend: true, dst: "Outputs"},
|
||||
{funcName: "Inputs", argName: "input", argType: j.Qual("github.com/kubevela/workflow/api/v1alpha1", "StepInputs")},
|
||||
{funcName: "Outputs", argName: "output", argType: j.Qual("github.com/kubevela/workflow/api/v1alpha1", "StepOutputs")},
|
||||
},
|
||||
}
|
||||
baseFuncs := make([]*j.Statement, 0)
|
||||
|
||||
Reference in New Issue
Block a user