diff --git a/cmd/helm/push.go b/cmd/helm/push.go index 4b81b554e..24bd8af6b 100644 --- a/cmd/helm/push.go +++ b/cmd/helm/push.go @@ -23,6 +23,7 @@ import ( "github.com/spf13/cobra" "helm.sh/helm/v3/cmd/helm/require" + experimental "helm.sh/helm/v3/internal/experimental/action" "helm.sh/helm/v3/pkg/action" ) @@ -34,7 +35,7 @@ provenance file, which will also be uploaded. ` func newPushCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { - client := action.NewPushWithOpts(action.WithPushConfig(cfg)) + client := experimental.NewPushWithOpts(experimental.WithPushConfig(cfg)) cmd := &cobra.Command{ Use: "push [chart] [remote]", diff --git a/cmd/helm/registry_login.go b/cmd/helm/registry_login.go index 43228f90a..546dcb2ac 100644 --- a/cmd/helm/registry_login.go +++ b/cmd/helm/registry_login.go @@ -29,6 +29,7 @@ import ( "github.com/spf13/cobra" "helm.sh/helm/v3/cmd/helm/require" + experimental "helm.sh/helm/v3/internal/experimental/action" "helm.sh/helm/v3/pkg/action" ) @@ -54,7 +55,7 @@ func newRegistryLoginCmd(cfg *action.Configuration, out io.Writer) *cobra.Comman return err } - return action.NewRegistryLogin(cfg).Run(out, hostname, username, password, insecureOpt) + return experimental.NewRegistryLogin(cfg).Run(out, hostname, username, password, insecureOpt) }, } @@ -67,7 +68,7 @@ func newRegistryLoginCmd(cfg *action.Configuration, out io.Writer) *cobra.Comman return cmd } -// Adapted from https://github.com/deislabs/oras +// Adapted from the ORAS project func getUsernamePassword(usernameOpt string, passwordOpt string, passwordFromStdinOpt bool) (string, string, error) { var err error username := usernameOpt @@ -110,7 +111,7 @@ func getUsernamePassword(usernameOpt string, passwordOpt string, passwordFromStd return username, password, nil } -// Copied/adapted from https://github.com/deislabs/oras +// Copied/adapted from the ORAS project func readLine(prompt string, silent bool) (string, error) { fmt.Print(prompt) if silent { diff --git a/cmd/helm/registry_logout.go b/cmd/helm/registry_logout.go index e7e1a24fe..abeb90461 100644 --- a/cmd/helm/registry_logout.go +++ b/cmd/helm/registry_logout.go @@ -22,6 +22,7 @@ import ( "github.com/spf13/cobra" "helm.sh/helm/v3/cmd/helm/require" + experimental "helm.sh/helm/v3/internal/experimental/action" "helm.sh/helm/v3/pkg/action" ) @@ -38,7 +39,7 @@ func newRegistryLogoutCmd(cfg *action.Configuration, out io.Writer) *cobra.Comma Hidden: !FeatureGateOCI.IsEnabled(), RunE: func(cmd *cobra.Command, args []string) error { hostname := args[0] - return action.NewRegistryLogout(cfg).Run(out, hostname) + return experimental.NewRegistryLogout(cfg).Run(out, hostname) }, } } diff --git a/pkg/action/push.go b/internal/experimental/action/push.go similarity index 93% rename from pkg/action/push.go rename to internal/experimental/action/push.go index 255c6bade..3e1fd142f 100644 --- a/pkg/action/push.go +++ b/internal/experimental/action/push.go @@ -21,6 +21,7 @@ import ( "helm.sh/helm/v3/internal/experimental/pusher" "helm.sh/helm/v3/internal/experimental/uploader" + "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/cli" ) @@ -30,14 +31,14 @@ import ( type Push struct { Settings *cli.EnvSettings WithProv bool - cfg *Configuration + cfg *action.Configuration } // PushOpt is a type of function that sets options for a push action. type PushOpt func(*Push) // WithPushConfig sets the cfg field on the push configuration object. -func WithPushConfig(cfg *Configuration) PushOpt { +func WithPushConfig(cfg *action.Configuration) PushOpt { return func(p *Push) { p.cfg = cfg } diff --git a/pkg/action/registry_login.go b/internal/experimental/action/registry_login.go similarity index 90% rename from pkg/action/registry_login.go rename to internal/experimental/action/registry_login.go index e09347787..5e9f97db7 100644 --- a/pkg/action/registry_login.go +++ b/internal/experimental/action/registry_login.go @@ -20,15 +20,16 @@ import ( "io" "helm.sh/helm/v3/internal/experimental/registry" + "helm.sh/helm/v3/pkg/action" ) // RegistryLogin performs a registry login operation. type RegistryLogin struct { - cfg *Configuration + cfg *action.Configuration } // NewRegistryLogin creates a new RegistryLogin object with the given configuration. -func NewRegistryLogin(cfg *Configuration) *RegistryLogin { +func NewRegistryLogin(cfg *action.Configuration) *RegistryLogin { return &RegistryLogin{ cfg: cfg, } diff --git a/pkg/action/registry_logout.go b/internal/experimental/action/registry_logout.go similarity index 88% rename from pkg/action/registry_logout.go rename to internal/experimental/action/registry_logout.go index 6fad56e45..092e4adb8 100644 --- a/pkg/action/registry_logout.go +++ b/internal/experimental/action/registry_logout.go @@ -18,15 +18,17 @@ package action import ( "io" + + "helm.sh/helm/v3/pkg/action" ) // RegistryLogout performs a registry login operation. type RegistryLogout struct { - cfg *Configuration + cfg *action.Configuration } // NewRegistryLogout creates a new RegistryLogout object with the given configuration. -func NewRegistryLogout(cfg *Configuration) *RegistryLogout { +func NewRegistryLogout(cfg *action.Configuration) *RegistryLogout { return &RegistryLogout{ cfg: cfg, }