diff --git a/cmd/helm/get.go b/cmd/helm/get.go index 5edba1c15..954b76407 100644 --- a/cmd/helm/get.go +++ b/cmd/helm/get.go @@ -66,7 +66,7 @@ func newGetCmd(client helm.Interface, out io.Writer) *cobra.Command { } get.release = args[0] if get.client == nil { - get.client = helm.NewClient(helm.HelmHost(helm.Config.ServAddr)) + get.client = helm.NewClient(helm.Host(helm.Config.ServAddr)) } return get.run() }, @@ -130,5 +130,5 @@ func ensureHelmClient(h helm.Interface) helm.Interface { if h != nil { return h } - return helm.NewClient(helm.HelmHost(helm.Config.ServAddr)) + return helm.NewClient(helm.Host(helm.Config.ServAddr)) } diff --git a/cmd/helm/get_manifest.go b/cmd/helm/get_manifest.go index 20f61443e..f3b9679bd 100644 --- a/cmd/helm/get_manifest.go +++ b/cmd/helm/get_manifest.go @@ -54,7 +54,7 @@ func newGetManifestCmd(client helm.Interface, out io.Writer) *cobra.Command { } get.release = args[0] if get.client == nil { - get.client = helm.NewClient(helm.HelmHost(helm.Config.ServAddr)) + get.client = helm.NewClient(helm.Host(helm.Config.ServAddr)) } return get.run() }, diff --git a/cmd/helm/list.go b/cmd/helm/list.go index 0897f6b56..7314a4a22 100644 --- a/cmd/helm/list.go +++ b/cmd/helm/list.go @@ -80,7 +80,7 @@ func newListCmd(client helm.Interface, out io.Writer) *cobra.Command { list.filter = strings.Join(args, " ") } if list.client == nil { - list.client = helm.NewClient(helm.HelmHost(helm.Config.ServAddr)) + list.client = helm.NewClient(helm.Host(helm.Config.ServAddr)) } return list.run() }, diff --git a/pkg/helm/client.go b/pkg/helm/client.go index a815cf5f6..b1efcac2d 100644 --- a/pkg/helm/client.go +++ b/pkg/helm/client.go @@ -57,8 +57,8 @@ func (h *Client) Option(opts ...Option) *Client { // Init initializes the helm client with default options func (h *Client) Init() *Client { - return h.Option(HelmHost(DefaultHelmHost)). - Option(HelmHome(os.ExpandEnv(DefaultHelmHome))) + return h.Option(Host(DefaultHelmHost)). + Option(Home(os.ExpandEnv(DefaultHelmHome))) } // ListReleases lists the current releases. diff --git a/pkg/helm/compat.go b/pkg/helm/compat.go index 5e3088107..d398f83ae 100644 --- a/pkg/helm/compat.go +++ b/pkg/helm/compat.go @@ -39,32 +39,32 @@ func ListReleases(limit int, offset string, sort rls.ListSort_SortBy, order rls. ReleaseListSort(int32(sort)), ReleaseListOrder(int32(order)), } - return NewClient(HelmHost(Config.ServAddr)).ListReleases(opts...) + return NewClient(Host(Config.ServAddr)).ListReleases(opts...) } // GetReleaseStatus gets a release status. DEPRECATED // // Soon to be deprecated helm GetReleaseStatus API. func GetReleaseStatus(rlsName string) (*rls.GetReleaseStatusResponse, error) { - return NewClient(HelmHost(Config.ServAddr)).ReleaseStatus(rlsName) + return NewClient(Host(Config.ServAddr)).ReleaseStatus(rlsName) } // GetReleaseContent gets the content of a release. // Soon to be deprecated helm GetReleaseContent API. func GetReleaseContent(rlsName string) (*rls.GetReleaseContentResponse, error) { - return NewClient(HelmHost(Config.ServAddr)).ReleaseContent(rlsName) + return NewClient(Host(Config.ServAddr)).ReleaseContent(rlsName) } // UpdateRelease updates a release. // Soon to be deprecated helm UpdateRelease API. func UpdateRelease(rlsName string) (*rls.UpdateReleaseResponse, error) { - return NewClient(HelmHost(Config.ServAddr)).UpdateRelease(rlsName) + return NewClient(Host(Config.ServAddr)).UpdateRelease(rlsName) } // InstallRelease runs an install for a release. // Soon to be deprecated helm InstallRelease API. func InstallRelease(vals []byte, rlsName, chStr string, dryRun bool) (*rls.InstallReleaseResponse, error) { - client := NewClient(HelmHost(Config.ServAddr)) + client := NewClient(Host(Config.ServAddr)) if dryRun { client.Option(DryRun()) } @@ -74,7 +74,7 @@ func InstallRelease(vals []byte, rlsName, chStr string, dryRun bool) (*rls.Insta // UninstallRelease destroys an existing release. // Soon to be deprecated helm UninstallRelease API. func UninstallRelease(rlsName string, dryRun bool) (*rls.UninstallReleaseResponse, error) { - client := NewClient(HelmHost(Config.ServAddr)) + client := NewClient(Host(Config.ServAddr)) if dryRun { client.Option(DryRun()) } diff --git a/pkg/helm/option.go b/pkg/helm/option.go index cfc43769a..efc3f35c1 100644 --- a/pkg/helm/option.go +++ b/pkg/helm/option.go @@ -51,15 +51,15 @@ func DryRun() Option { } } -// HelmHome specifies the location of helm home, (default = "$HOME/.helm"). -func HelmHome(home string) Option { +// Home specifies the location of helm home, (default = "$HOME/.helm"). +func Home(home string) Option { return func(opts *options) { opts.home = home } } -// HelmHost specifies the host address of the Tiller release server, (default = ":44134"). -func HelmHost(host string) Option { +// Host specifies the host address of the Tiller release server, (default = ":44134"). +func Host(host string) Option { return func(opts *options) { opts.host = host }