Skip to content

Commit

Permalink
Fixing false warnings for the KudoOperatorTask (#1718)
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Aleksey Dukhovniy <alex.dukhovniy@googlemail.com>
  • Loading branch information
Aleksey Dukhovniy committed Oct 16, 2020
1 parent bcfaef8 commit 113db86
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pkg/kudoctl/packages/verifier/task/verify_build.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
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"
Expand All @@ -22,8 +24,15 @@ func tasksWellDefined(pf *packages.Files) verifier.Result {
for _, tt := range pf.Operator.Tasks {
tt := tt

if _, err := task.Build(&tt); err != nil {
result.AddErrors(err.Error())
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
Expand Down

0 comments on commit 113db86

Please sign in to comment.