From e37f8c5e5335bc17076526e8741bf8950f3ed5f9 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Wed, 20 Oct 2021 14:37:31 -0700 Subject: [PATCH] pipeline: analysis: ignore CUE errors Signed-off-by: Andrea Luzzardi --- environment/environment.go | 3 +-- environment/pipeline.go | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/environment/environment.go b/environment/environment.go index 3bac4433..01aa6413 100644 --- a/environment/environment.go +++ b/environment/environment.go @@ -119,8 +119,7 @@ func (e *Environment) LocalDirs() (map[string]string, error) { newTaskFunc(noOpRunner), ) for _, t := range flow.Tasks() { - v := compiler.Wrap(t.Value()) - if err := localdirs(v.Lookup("#up")); err != nil { + if err := localdirs(compiler.Wrap(t.Value())); err != nil { return nil, err } } diff --git a/environment/pipeline.go b/environment/pipeline.go index 3737e43c..0fcdf0c9 100644 --- a/environment/pipeline.go +++ b/environment/pipeline.go @@ -121,7 +121,9 @@ func ops(code *compiler.Value) ([]*compiler.Value, error) { func Analyze(fn func(*compiler.Value) error, code *compiler.Value) error { ops, err := ops(code) if err != nil { - return err + // Ignore CUE errors when analyzing. This might be because the value is + // not concrete since static analysis runs before pipelines are executed. + return nil } for _, op := range ops { if err := analyzeOp(fn, op); err != nil {