Skip to content

Commit

Permalink
skip manifest validation for default kubectl deployer (GoogleContai…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsquared94 authored and halvards committed Jul 28, 2021
1 parent 17a03dc commit f8ce09a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/skaffold/schema/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ import (

"github.com/docker/docker/api/types"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

"github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/misc"
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/config"
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/constants"
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/docker"
sErrors "github.com/GoogleContainerTools/skaffold/pkg/skaffold/errors"
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/parser"
Expand Down Expand Up @@ -612,6 +614,11 @@ func validateKubectlManifests(configs parser.SkaffoldConfigSet) (errs []error) {
if c.Deploy.KubectlDeploy == nil {
continue
}
if len(c.Deploy.KubectlDeploy.Manifests) == 1 && c.Deploy.KubectlDeploy.Manifests[0] == constants.DefaultKubectlManifests[0] {
logrus.Debugln("skipping validating `kubectl` deployer manifests since only the default manifest list is defined")
continue
}

// validate that manifest files referenced in config exist
for _, pattern := range c.Deploy.KubectlDeploy.Manifests {
if util.IsURL(pattern) {
Expand All @@ -623,7 +630,7 @@ func validateKubectlManifests(configs parser.SkaffoldConfigSet) (errs []error) {
errs = append(errs, err)
}
if len(expanded) == 0 {
msg := fmt.Sprintf("skaffold config named %q referenced file %q that could not be found", c.SourceFile, pattern)
msg := fmt.Sprintf("skaffold config file %q referenced file %q that could not be found", c.SourceFile, pattern)
errs = append(errs, sErrors.NewError(fmt.Errorf(msg),
proto.ActionableErr{
Message: msg,
Expand Down

0 comments on commit f8ce09a

Please sign in to comment.