Merge pull request #13577 from gjenkins8/gjenkins/rm_pull_with_opts

refactor: Remove redundant `NewPullWithOpts`
pull/13622/head
George Jenkins 9 months ago committed by GitHub
commit 5d13b0cac3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -43,7 +43,7 @@ result in an error, and the chart will not be saved locally.
` `
func newPullCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func newPullCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewPullWithOpts(action.WithConfig(cfg)) client := action.NewPull(action.WithConfig(cfg))
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "pull [chart URL | repo/chartname] [...]", Use: "pull [chart URL | repo/chartname] [...]",

@ -56,13 +56,8 @@ func WithConfig(cfg *Configuration) PullOpt {
} }
} }
// NewPull creates a new Pull object. // NewPull creates a new Pull with configuration options.
func NewPull() *Pull { func NewPull(opts ...PullOpt) *Pull {
return NewPullWithOpts()
}
// NewPullWithOpts creates a new pull, with configuration options.
func NewPullWithOpts(opts ...PullOpt) *Pull {
p := &Pull{} p := &Pull{}
for _, fn := range opts { for _, fn := range opts {
fn(p) fn(p)

Loading…
Cancel
Save