From 7261ee028505236823a4d95b0369c8868218bf97 Mon Sep 17 00:00:00 2001 From: Nick Kubala Date: Tue, 2 Oct 2018 15:22:56 -0700 Subject: [PATCH] fix corner case where no config values are set --- pkg/skaffold/runner/runner.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/skaffold/runner/runner.go b/pkg/skaffold/runner/runner.go index b55cca76bba..87a0c955a03 100644 --- a/pkg/skaffold/runner/runner.go +++ b/pkg/skaffold/runner/runner.go @@ -72,6 +72,11 @@ func NewForConfig(opts *config.SkaffoldOptions, cfg *latest.SkaffoldConfig) (*Sk return nil, errors.Wrap(err, "retrieving global config") } + defaultRepo := "" + if globalConfig != nil { + defaultRepo = globalConfig.DefaultRepo + } + tagger, err := getTagger(cfg.Build.TagPolicy, opts.CustomTag) if err != nil { return nil, errors.Wrap(err, "parsing skaffold tag config") @@ -82,7 +87,7 @@ func NewForConfig(opts *config.SkaffoldOptions, cfg *latest.SkaffoldConfig) (*Sk return nil, errors.Wrap(err, "parsing skaffold build config") } - deployer, err := getDeployer(&cfg.Deploy, kubeContext, opts.Namespace, globalConfig.DefaultRepo) + deployer, err := getDeployer(&cfg.Deploy, kubeContext, opts.Namespace, defaultRepo) if err != nil { return nil, errors.Wrap(err, "parsing skaffold deploy config") }