From 7a1a8a60e261df02b49f0f555bf38146a2cb35ed Mon Sep 17 00:00:00 2001 From: gsquared94 Date: Mon, 26 Jul 2021 21:30:54 +0530 Subject: [PATCH] skip manifest validation for default `kubectl deployer` --- pkg/skaffold/schema/validation/validation.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/skaffold/schema/validation/validation.go b/pkg/skaffold/schema/validation/validation.go index 63dba9e410b..c942b43be15 100644 --- a/pkg/skaffold/schema/validation/validation.go +++ b/pkg/skaffold/schema/validation/validation.go @@ -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" @@ -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) { @@ -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,