Skip to content

Commit

Permalink
Merge pull request #9 from mittwald/feature/use-interface
Browse files Browse the repository at this point in the history
use the interface as return value instead of HelmClient type
  • Loading branch information
Dominik Korittki authored May 20, 2020
2 parents 3402fb9 + b0e3cef commit 6d7a797
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (
)

// New returns a new Helm client with the provided options
func New(options *Options) (*HelmClient, error) {
func New(options *Options) (Client, error) {
settings := cli.New()

err := setEnvSettings(options, settings)
Expand All @@ -44,7 +44,7 @@ func New(options *Options) (*HelmClient, error) {
}

// NewClientFromKubeConf returns a new Helm client constructed with the provided kubeconfig options
func NewClientFromKubeConf(options *KubeConfClientOptions) (*HelmClient, error) {
func NewClientFromKubeConf(options *KubeConfClientOptions) (Client, error) {
settings := cli.New()
if options.KubeConfig == nil {
return nil, fmt.Errorf("kubeconfig missing")
Expand All @@ -64,7 +64,7 @@ func NewClientFromKubeConf(options *KubeConfClientOptions) (*HelmClient, error)
}

// NewClientFromRestConf returns a new Helm client constructed with the provided REST config options
func NewClientFromRestConf(options *RestConfClientOptions) (*HelmClient, error) {
func NewClientFromRestConf(options *RestConfClientOptions) (Client, error) {
settings := cli.New()

clientGetter := NewRESTClientGetter(options.Namespace, nil, options.RestConfig)
Expand All @@ -78,7 +78,7 @@ func NewClientFromRestConf(options *RestConfClientOptions) (*HelmClient, error)
}

// newClient returns a new Helm client via the provided options and REST config
func newClient(options *Options, clientGetter genericclioptions.RESTClientGetter, settings *cli.EnvSettings) (*HelmClient, error) {
func newClient(options *Options, clientGetter genericclioptions.RESTClientGetter, settings *cli.EnvSettings) (Client, error) {
err := setEnvSettings(options, settings)
if err != nil {
return nil, err
Expand Down

0 comments on commit 6d7a797

Please sign in to comment.