Eliminate unnecessary function.
@@ -97,11 +97,6 @@ func NewForConfig(opts *config.SkaffoldOptions, cfg *latest.SkaffoldPipeline) (*
return nil, errors.Wrap(err, "parsing deploy config")
}
- syncer, err := getSyncer(namespaces)
- if err != nil {
- return nil, errors.Wrap(err, "creating syncer")
- }
-
labellers := []deploy.Labeller{opts, builder, deployer, tagger}
builder, tester, deployer = WithTimings(builder, tester, deployer)
@@ -119,7 +114,7 @@ func NewForConfig(opts *config.SkaffoldOptions, cfg *latest.SkaffoldPipeline) (*
Tester: tester,
Deployer: deployer,
Tagger: tagger,
- Syncer: syncer,
+ Syncer: kubectl.NewSyncer(namespaces),
Watcher: watch.NewWatcher(trigger),
opts: opts,
labellers: labellers,
@@ -161,10 +156,6 @@ func getTester(cfg *latest.TestConfig, opts *config.SkaffoldOptions) (test.Teste
}
}
-func getSyncer(namespaces []string) (sync.Syncer, error) {
- return kubectl.NewSyncer(namespaces), nil
-}
-
func getDeployer(cfg *latest.DeployConfig, kubeContext string, namespace string, defaultRepo string) (deploy.Deployer, error) {
// TODO(dgageot): this should be the folder containing skaffold.yaml. Should also be moved elsewhere.
cwd, err := os.Getwd()
