fix(repository): remove hard coded host

/cc @michelleN
pull/420/head
Adam Reese 9 years ago
parent 513a18548a
commit 807fb4f615

@ -19,7 +19,6 @@ package main
import ( import (
"errors" "errors"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/kubernetes/helm/pkg/client"
"github.com/kubernetes/helm/pkg/format" "github.com/kubernetes/helm/pkg/format"
"os" "os"
) )
@ -28,8 +27,7 @@ func init() {
addCommands(repoCommands()) addCommands(repoCommands())
} }
var dmURL = "http://localhost:8080" const chartRepoPath = "chart_repositories"
var chartRepoPath = "chart_repositories"
func repoCommands() cli.Command { func repoCommands() cli.Command {
return cli.Command{ return cli.Command{
@ -91,11 +89,8 @@ func addRepo(c *cli.Context) error {
if len(args) < 1 { if len(args) < 1 {
return errors.New("'helm repo add' requires a repository as an argument") return errors.New("'helm repo add' requires a repository as an argument")
} }
client := client.NewClient(dmURL)
dest := "" dest := ""
_, err := client.Post(chartRepoPath, nil, &dest) if _, err := NewClient(c).Post(chartRepoPath, nil, &dest); err != nil {
if err != nil {
return err return err
} }
format.Msg(dest) format.Msg(dest)
@ -103,10 +98,8 @@ func addRepo(c *cli.Context) error {
} }
func listRepos(c *cli.Context) error { func listRepos(c *cli.Context) error {
client := client.NewClient(dmURL)
dest := "" dest := ""
_, err := client.Get(chartRepoPath, &dest) if _, err := NewClient(c).Get(chartRepoPath, &dest); err != nil {
if err != nil {
return err return err
} }
format.Msg(dest) format.Msg(dest)
@ -118,10 +111,8 @@ func removeRepo(c *cli.Context) error {
if len(args) < 1 { if len(args) < 1 {
return errors.New("'helm repo remove' requires a repository as an argument") return errors.New("'helm repo remove' requires a repository as an argument")
} }
client := client.NewClient(dmURL)
dest := "" dest := ""
_, err := client.Delete(chartRepoPath, &dest) if _, err := NewClient(c).Delete(chartRepoPath, &dest); err != nil {
if err != nil {
return err return err
} }
format.Msg(dest) format.Msg(dest)

Loading…
Cancel
Save