Commit a7d755c4 authored by Adam Reese's avatar Adam Reese

Merge pull request #420 from adamreese/fix/repo-client

fix(repository): remove hard coded host
parents 513a1854 807fb4f6
...@@ -19,7 +19,6 @@ package main ...@@ -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() { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment