fix: fix addon check (#6687)
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m21s
Definition-Lint / definition-doc (push) Failing after 7m18s
E2E MultiCluster Test / detect-noop (push) Successful in 26s
E2E Test / detect-noop (push) Successful in 19s
Go / detect-noop (push) Successful in 19s
license / Check for unapproved licenses (push) Failing after 2m57s
Registry / publish-core-images (push) Failing after 45s
Unit-Test / detect-noop (push) Successful in 21s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 1m39s
E2E Test / e2e-tests (v1.29) (push) Failing after 1m21s
Go / staticcheck (push) Successful in 17m18s
Go / lint (push) Failing after 19m39s
Go / check-diff (push) Failing after 14m58s
Go / check-core-image-build (push) Failing after 3m51s
Go / check-cli-image-build (push) Failing after 3m4s
Unit-Test / unit-tests (push) Failing after 12m46s
Go / check-windows (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Failing after 56s

Signed-off-by: FogDong <fog@bentoml.com>
This commit is contained in:
Tianxin Dong
2025-02-12 13:18:39 +08:00
committed by GitHub
parent bc15e5b359
commit 711c9f0053

View File

@@ -35,7 +35,6 @@ import (
"github.com/kubevela/pkg/cue/cuex"
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
"github.com/kubevela/workflow/pkg/cue/model/sets"
"github.com/kubevela/workflow/pkg/cue/model/value"
providertypes "github.com/kubevela/workflow/pkg/providers/types"
@@ -128,20 +127,9 @@ func ValidateView(ctx context.Context, viewStr string) error {
// Make sure `status` or `export` field exists
vStatus := val.LookupPath(cue.ParsePath(DefaultExportValue))
errStatus := vStatus.Err()
vExport := val.LookupPath(cue.ParsePath(KeyWordExport))
errExport := vExport.Err()
if errStatus != nil && errExport != nil {
return errors.Errorf("no `status` or `export` field found in view: %v, %v", errStatus, errExport)
}
if errStatus == nil {
_, errStatus = sets.ToString(vStatus)
}
if errExport == nil {
_, errExport = sets.ToString(vExport)
}
if errStatus != nil && errExport != nil {
return errors.Errorf("connot get string from` status` or `export`: %v, %v", errStatus, errExport)
if !vStatus.Exists() && !vExport.Exists() {
return errors.Errorf("no `status` or `export` field found in view")
}
return nil