Fixing false warnings for the `KudoOperatorTask`
Summary:
in many cases the task's `OperatorVersion` is being set by the dependency resolver during the package installation so that it is valid for the field to be empty during verification.
package task
import (
+ "fmt"
+
"github.com/kudobuilder/kudo/pkg/engine/task"
"github.com/kudobuilder/kudo/pkg/kudoctl/packages"
"github.com/kudobuilder/kudo/pkg/kudoctl/verifier"
@@ -22,9 +24,16 @@ func tasksWellDefined(pf *packages.Files) verifier.Result {
for _, tt := range pf.Operator.Tasks {
tt := tt
+ switch tt.Kind {
+ case task.KudoOperatorTaskKind:
+ if tt.Spec.KudoOperatorTaskSpec.Package == "" {
+ result.AddErrors(fmt.Sprintf("task validation error: kudo operator task '%s' has an empty package name", tt.Name))
+ }
+ default:
if _, err := task.Build(&tt); err != nil {
result.AddErrors(err.Error())
}
}
+ }
return result
}
