feat(repo): update addChartRepo reponse

pull/448/head
Michelle Noorali 9 years ago
parent 45c4eb9655
commit 0ccb8d755f

@ -68,9 +68,10 @@ func addRepo(c *cli.Context) error {
payload, _ := json.Marshal(repo.Repo{URL: repoURL})
msg := ""
if _, err := NewClient(c).Post(chartRepoPath, payload, &msg); err != nil {
//TODO: Return more specific errors to the user
return err
}
format.Msg(repoURL + " has been added to your list of chart repositories")
format.Info(repoURL + " has been added to your chart repositories!")
return nil
}

@ -6,6 +6,7 @@ import (
"github.com/kubernetes/helm/pkg/repo"
"github.com/kubernetes/helm/pkg/util"
"encoding/json"
"net/http"
"net/url"
"regexp"
@ -46,7 +47,8 @@ func addChartRepoHandlerFunc(w http.ResponseWriter, r *http.Request, c *router.C
return nil
}
util.LogHandlerExitWithText(handler, w, "added", http.StatusOK)
msg, _ := json.Marshal(cr.URL + " has been added to the list of chart repositories.")
util.LogHandlerExitWithJSON(handler, w, msg, http.StatusCreated)
return nil
}

Loading…
Cancel
Save