Skip to content

Commit

Permalink
Rename variable to avoid name clash with package name
Browse files Browse the repository at this point in the history
Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
  • Loading branch information
corneliusweig committed Aug 15, 2019
1 parent b2a2579 commit b22e3c5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cmd/skaffold/app/cmd/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,41 +66,41 @@ func createNewRunner(opts config.SkaffoldOptions) (runner.Runner, *latest.Skaffo
return nil, nil, errors.Wrap(err, "parsing skaffold config")
}

config := parsed.(*latest.SkaffoldConfig)
cfg := parsed.(*latest.SkaffoldConfig)

if kubeContext, err := pkgconfig.GetKubeContext(opts.GlobalConfig, config.Metadata.Name, opts.KubeContext); err != nil {
if kubeContext, err := config.GetKubeContext(opts.GlobalConfig, cfg.Metadata.Name, opts.KubeContext); err != nil {
return nil, nil, errors.Wrap(err, "resolving kubeContext from config")
} else {
// Do this before profile application, in order to
// process profiles with the correct kube-context.
kubectx.UseKubeContext(kubeContext)
}

if err = schema.ApplyProfiles(config, opts); err != nil {
if err = schema.ApplyProfiles(cfg, opts); err != nil {
return nil, nil, errors.Wrap(err, "applying profiles")
}

if err := defaults.Set(config); err != nil {
if err := defaults.Set(cfg); err != nil {
return nil, nil, errors.Wrap(err, "setting default values")
}

if err := validation.Process(config); err != nil {
if err := validation.Process(cfg); err != nil {
return nil, nil, errors.Wrap(err, "invalid skaffold config")
}

runCtx, err := runcontext.GetRunContext(opts, config.Pipeline)
runCtx, err := runcontext.GetRunContext(opts, cfg.Pipeline)
if err != nil {
return nil, nil, errors.Wrap(err, "getting run context")
}

applyDefaultRepoSubstitution(config, runCtx.DefaultRepo)
applyDefaultRepoSubstitution(cfg, runCtx.DefaultRepo)

runner, err := runner.NewForConfig(runCtx)
if err != nil {
return nil, nil, errors.Wrap(err, "creating runner")
}

return runner, config, nil
return runner, cfg, nil
}

func warnIfUpdateIsAvailable() {
Expand Down

0 comments on commit b22e3c5

Please sign in to comment.