From 807fb4f615f0e19fbdb639554c84fd021eae3d19 Mon Sep 17 00:00:00 2001 From: Adam Reese <adam@reese.io> Date: Mon, 21 Mar 2016 11:24:04 -0700 Subject: [PATCH] fix(repository): remove hard coded host /cc @michelleN --- cmd/helm/repository.go | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/cmd/helm/repository.go b/cmd/helm/repository.go index f0dbb3cc6..8b110a6b7 100644 --- a/cmd/helm/repository.go +++ b/cmd/helm/repository.go @@ -19,7 +19,6 @@ package main import ( "errors" "github.com/codegangsta/cli" - "github.com/kubernetes/helm/pkg/client" "github.com/kubernetes/helm/pkg/format" "os" ) @@ -28,8 +27,7 @@ func init() { addCommands(repoCommands()) } -var dmURL = "http://localhost:8080" -var chartRepoPath = "chart_repositories" +const chartRepoPath = "chart_repositories" func repoCommands() cli.Command { return cli.Command{ @@ -91,11 +89,8 @@ func addRepo(c *cli.Context) error { if len(args) < 1 { return errors.New("'helm repo add' requires a repository as an argument") } - - client := client.NewClient(dmURL) dest := "" - _, err := client.Post(chartRepoPath, nil, &dest) - if err != nil { + if _, err := NewClient(c).Post(chartRepoPath, nil, &dest); err != nil { return err } format.Msg(dest) @@ -103,10 +98,8 @@ func addRepo(c *cli.Context) error { } func listRepos(c *cli.Context) error { - client := client.NewClient(dmURL) dest := "" - _, err := client.Get(chartRepoPath, &dest) - if err != nil { + if _, err := NewClient(c).Get(chartRepoPath, &dest); err != nil { return err } format.Msg(dest) @@ -118,10 +111,8 @@ func removeRepo(c *cli.Context) error { if len(args) < 1 { return errors.New("'helm repo remove' requires a repository as an argument") } - client := client.NewClient(dmURL) dest := "" - _, err := client.Delete(chartRepoPath, &dest) - if err != nil { + if _, err := NewClient(c).Delete(chartRepoPath, &dest); err != nil { return err } format.Msg(dest) -- GitLab