|
|
|
@ -28,6 +28,9 @@ func init() {
|
|
|
|
|
addCommands(repoCommands())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var dmURL string = "http://localhost:8080"
|
|
|
|
|
var chartRepoPath string = "chart_repositories"
|
|
|
|
|
|
|
|
|
|
func repoCommands() cli.Command {
|
|
|
|
|
return cli.Command{
|
|
|
|
|
Name: "repository",
|
|
|
|
@ -89,11 +92,9 @@ func addRepo(c *cli.Context) error {
|
|
|
|
|
return errors.New("'helm repo add' requires a repository as an argument")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dmURL := "http://localhost:8080"
|
|
|
|
|
path := "chart_repositories"
|
|
|
|
|
client := client.NewClient(dmURL)
|
|
|
|
|
var dest string = ""
|
|
|
|
|
err := client.CallService(path, "POST", "add a chart repository", &dest, nil)
|
|
|
|
|
err := client.CallService(chartRepoPath, "POST", "add a chart repository", &dest, nil)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
@ -102,11 +103,9 @@ func addRepo(c *cli.Context) error {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func listRepos(c *cli.Context) error {
|
|
|
|
|
dmURL := "http://localhost:8080"
|
|
|
|
|
path := "chart_repositories"
|
|
|
|
|
client := client.NewClient(dmURL)
|
|
|
|
|
var dest string = ""
|
|
|
|
|
err := client.CallService(path, "GET", "list chart repos", &dest, nil)
|
|
|
|
|
err := client.CallService(chartRepoPath, "GET", "list chart repos", &dest, nil)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
@ -119,5 +118,12 @@ 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)
|
|
|
|
|
var dest string = ""
|
|
|
|
|
err := client.CallService(chartRepoPath, "DELETE", "delete a chart repository from list", &dest, nil)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
format.Msg(dest)
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|