diff --git a/cmd/helm/dependency_build_test.go b/cmd/helm/dependency_build_test.go index 4ffacbdf2..37e3242c4 100644 --- a/cmd/helm/dependency_build_test.go +++ b/cmd/helm/dependency_build_test.go @@ -50,11 +50,6 @@ func TestDependencyBuildCmd(t *testing.T) { } ociSrv.Run(t, repotest.WithDependingChart(c)) - err = os.Setenv("HELM_EXPERIMENTAL_OCI", "1") - if err != nil { - t.Fatal("failed to set environment variable enabling OCI support") - } - dir := func(p ...string) string { return filepath.Join(append([]string{srv.Root()}, p...)...) } diff --git a/cmd/helm/dependency_update_test.go b/cmd/helm/dependency_update_test.go index 3f708dd42..491f6a856 100644 --- a/cmd/helm/dependency_update_test.go +++ b/cmd/helm/dependency_update_test.go @@ -51,11 +51,6 @@ func TestDependencyUpdateCmd(t *testing.T) { } ociSrv.Run(t, repotest.WithDependingChart(c)) - err = os.Setenv("HELM_EXPERIMENTAL_OCI", "1") - if err != nil { - t.Fatal("failed to set environment variable enabling OCI support") - } - if err := srv.LinkIndices(); err != nil { t.Fatal(err) } diff --git a/cmd/helm/helm.go b/cmd/helm/helm.go index 1766f8646..15b0d5c76 100644 --- a/cmd/helm/helm.go +++ b/cmd/helm/helm.go @@ -31,16 +31,12 @@ import ( "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/cli" - "helm.sh/helm/v3/pkg/gates" "helm.sh/helm/v3/pkg/kube" kubefake "helm.sh/helm/v3/pkg/kube/fake" "helm.sh/helm/v3/pkg/release" "helm.sh/helm/v3/pkg/storage/driver" ) -// FeatureGateOCI is the feature gate for checking if `helm chart` and `helm registry` commands should work -const FeatureGateOCI = gates.Gate("HELM_EXPERIMENTAL_OCI") - var settings = cli.New() func init() { @@ -95,15 +91,6 @@ func main() { } } -func checkOCIFeatureGate() func(_ *cobra.Command, _ []string) error { - return func(_ *cobra.Command, _ []string) error { - if !FeatureGateOCI.IsEnabled() { - return FeatureGateOCI.Error() - } - return nil - } -} - // This function loads releases into the memory storage if the // environment variable is properly set. func loadReleasesInMemory(actionConfig *action.Configuration) { diff --git a/cmd/helm/install.go b/cmd/helm/install.go index c664828a6..0e63ab3a5 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -187,10 +187,6 @@ func runInstall(args []string, client *action.Install, valueOpts *values.Options } client.ReleaseName = name - if err := checkOCI(chart); err != nil { - return nil, err - } - cp, err := client.ChartPathOptions.LocateChart(chart, settings) if err != nil { return nil, err diff --git a/cmd/helm/pull.go b/cmd/helm/pull.go index c910007db..b1c04fe0a 100644 --- a/cmd/helm/pull.go +++ b/cmd/helm/pull.go @@ -64,10 +64,6 @@ func newPullCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { client.Version = ">0.0.0-0" } - if err := checkOCI(args[0]); err != nil { - return err - } - for i := 0; i < len(args); i++ { output, err := client.Run(args[i]) if err != nil { diff --git a/cmd/helm/pull_test.go b/cmd/helm/pull_test.go index 901557bd2..41ac237f4 100644 --- a/cmd/helm/pull_test.go +++ b/cmd/helm/pull_test.go @@ -34,7 +34,6 @@ func TestPullCmd(t *testing.T) { } defer srv.Stop() - os.Setenv("HELM_EXPERIMENTAL_OCI", "1") ociSrv, err := repotest.NewOCIServer(t, srv.Root()) if err != nil { t.Fatal(err) diff --git a/cmd/helm/push.go b/cmd/helm/push.go index 7daa66563..ed5d1699a 100644 --- a/cmd/helm/push.go +++ b/cmd/helm/push.go @@ -23,7 +23,6 @@ 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" ) @@ -35,15 +34,13 @@ it will also be uploaded. ` func newPushCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { - client := experimental.NewPushWithOpts(experimental.WithPushConfig(cfg)) + client := action.NewPushWithOpts(action.WithPushConfig(cfg)) cmd := &cobra.Command{ - Use: "push [chart] [remote]", - Short: "push a chart to remote", - Long: pushDesc, - Hidden: !FeatureGateOCI.IsEnabled(), - PersistentPreRunE: checkOCIFeatureGate(), - Args: require.MinimumNArgs(2), + Use: "push [chart] [remote]", + Short: "push a chart to remote", + Long: pushDesc, + Args: require.MinimumNArgs(2), RunE: func(cmd *cobra.Command, args []string) error { chartRef := args[0] remote := args[1] diff --git a/cmd/helm/registry.go b/cmd/helm/registry.go index d13c308b2..b2b24cd14 100644 --- a/cmd/helm/registry.go +++ b/cmd/helm/registry.go @@ -29,11 +29,9 @@ This command consists of multiple subcommands to interact with registries. func newRegistryCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { cmd := &cobra.Command{ - Use: "registry", - Short: "login to or logout from a registry", - Long: registryHelp, - Hidden: !FeatureGateOCI.IsEnabled(), - PersistentPreRunE: checkOCIFeatureGate(), + Use: "registry", + Short: "login to or logout from a registry", + Long: registryHelp, } cmd.AddCommand( newRegistryLoginCmd(cfg, out), diff --git a/cmd/helm/registry_login.go b/cmd/helm/registry_login.go index cd2977b47..84f9f27b5 100644 --- a/cmd/helm/registry_login.go +++ b/cmd/helm/registry_login.go @@ -29,7 +29,6 @@ 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" ) @@ -42,11 +41,10 @@ func newRegistryLoginCmd(cfg *action.Configuration, out io.Writer) *cobra.Comman var passwordFromStdinOpt, insecureOpt bool cmd := &cobra.Command{ - Use: "login [host]", - Short: "login to a registry", - Long: registryLoginDesc, - Args: require.MinimumNArgs(1), - Hidden: !FeatureGateOCI.IsEnabled(), + Use: "login [host]", + Short: "login to a registry", + Long: registryLoginDesc, + Args: require.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { hostname := args[0] @@ -55,7 +53,7 @@ func newRegistryLoginCmd(cfg *action.Configuration, out io.Writer) *cobra.Comman return err } - return experimental.NewRegistryLogin(cfg).Run(out, hostname, username, password, insecureOpt) + return action.NewRegistryLogin(cfg).Run(out, hostname, username, password, insecureOpt) }, } diff --git a/cmd/helm/registry_logout.go b/cmd/helm/registry_logout.go index abeb90461..8d6a54d97 100644 --- a/cmd/helm/registry_logout.go +++ b/cmd/helm/registry_logout.go @@ -22,7 +22,6 @@ 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" ) @@ -32,14 +31,13 @@ Remove credentials stored for a remote registry. func newRegistryLogoutCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { return &cobra.Command{ - Use: "logout [host]", - Short: "logout from a registry", - Long: registryLogoutDesc, - Args: require.MinimumNArgs(1), - Hidden: !FeatureGateOCI.IsEnabled(), + Use: "logout [host]", + Short: "logout from a registry", + Long: registryLogoutDesc, + Args: require.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { hostname := args[0] - return experimental.NewRegistryLogout(cfg).Run(out, hostname) + return action.NewRegistryLogout(cfg).Run(out, hostname) }, } } diff --git a/cmd/helm/root.go b/cmd/helm/root.go index 2888d14e2..05af89d13 100644 --- a/cmd/helm/root.go +++ b/cmd/helm/root.go @@ -29,8 +29,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/clientcmd" - "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/pkg/action" + "helm.sh/helm/v3/pkg/registry" "helm.sh/helm/v3/pkg/repo" ) @@ -193,7 +193,6 @@ func newRootCmd(actionConfig *action.Configuration, out io.Writer, args []string newDocsCmd(out), ) - // Add *experimental* subcommands cmd.AddCommand( newRegistryCmd(actionConfig, out), newPushCmd(actionConfig, out), @@ -258,12 +257,3 @@ func checkForExpiredRepos(repofile string) { } } - -// When dealing with OCI-based charts, ensure that the user has -// enabled the experimental feature gate prior to continuing -func checkOCI(ref string) error { - if registry.IsOCI(ref) && !FeatureGateOCI.IsEnabled() { - return FeatureGateOCI.Error() - } - return nil -} diff --git a/cmd/helm/show.go b/cmd/helm/show.go index a479ccda5..718d716a0 100644 --- a/cmd/helm/show.go +++ b/cmd/helm/show.go @@ -198,10 +198,6 @@ func runShow(args []string, client *action.Show) (string, error) { client.Version = ">0.0.0-0" } - if err := checkOCI(args[0]); err != nil { - return "", err - } - cp, err := client.ChartPathOptions.LocateChart(args[0], settings) if err != nil { return "", err diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index 7f4920ec9..7ada8e3b1 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -87,10 +87,6 @@ func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { return nil, cobra.ShellCompDirectiveNoFileComp }, RunE: func(cmd *cobra.Command, args []string) error { - if err := checkOCI(args[1]); err != nil { - return err - } - client.Namespace = settings.Namespace() // Fixes #7002 - Support reading values from STDIN for `upgrade` command diff --git a/internal/resolver/resolver.go b/internal/resolver/resolver.go index cf370e927..c9472dfb4 100644 --- a/internal/resolver/resolver.go +++ b/internal/resolver/resolver.go @@ -27,17 +27,14 @@ import ( "github.com/Masterminds/semver/v3" "github.com/pkg/errors" - "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chart/loader" - "helm.sh/helm/v3/pkg/gates" "helm.sh/helm/v3/pkg/helmpath" "helm.sh/helm/v3/pkg/provenance" + "helm.sh/helm/v3/pkg/registry" "helm.sh/helm/v3/pkg/repo" ) -const FeatureGateOCI = gates.Gate("HELM_EXPERIMENTAL_OCI") - // Resolver resolves dependencies from semantic version ranges to a particular version. type Resolver struct { chartpath string @@ -138,11 +135,6 @@ func (r *Resolver) Resolve(reqs []*chart.Dependency, repoNames map[string]string found = false } else { version = d.Version - if !FeatureGateOCI.IsEnabled() { - return nil, errors.Wrapf(FeatureGateOCI.Error(), - "repository %s is an OCI registry", d.Repository) - } - // Retrieve list of tags for repository ref := fmt.Sprintf("%s/%s", strings.TrimPrefix(d.Repository, fmt.Sprintf("%s://", registry.OCIScheme)), d.Name) tags, err := r.registryClient.Tags(ref) diff --git a/internal/resolver/resolver_test.go b/internal/resolver/resolver_test.go index 6fbc2e86a..a79852175 100644 --- a/internal/resolver/resolver_test.go +++ b/internal/resolver/resolver_test.go @@ -19,8 +19,8 @@ import ( "runtime" "testing" - "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/pkg/chart" + "helm.sh/helm/v3/pkg/registry" ) func TestResolve(t *testing.T) { diff --git a/pkg/action/action.go b/pkg/action/action.go index f093ed7f8..deb3f65df 100644 --- a/pkg/action/action.go +++ b/pkg/action/action.go @@ -32,12 +32,12 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" - "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chartutil" "helm.sh/helm/v3/pkg/engine" "helm.sh/helm/v3/pkg/kube" "helm.sh/helm/v3/pkg/postrender" + "helm.sh/helm/v3/pkg/registry" "helm.sh/helm/v3/pkg/release" "helm.sh/helm/v3/pkg/releaseutil" "helm.sh/helm/v3/pkg/storage" diff --git a/pkg/action/action_test.go b/pkg/action/action_test.go index f8bdff3b7..190d00cae 100644 --- a/pkg/action/action_test.go +++ b/pkg/action/action_test.go @@ -23,10 +23,10 @@ import ( fakeclientset "k8s.io/client-go/kubernetes/fake" - "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chartutil" kubefake "helm.sh/helm/v3/pkg/kube/fake" + "helm.sh/helm/v3/pkg/registry" "helm.sh/helm/v3/pkg/release" "helm.sh/helm/v3/pkg/storage" "helm.sh/helm/v3/pkg/storage/driver" diff --git a/pkg/action/install.go b/pkg/action/install.go index f0bbb5cb0..32be904b4 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -38,7 +38,6 @@ import ( "k8s.io/cli-runtime/pkg/resource" "sigs.k8s.io/yaml" - "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chartutil" "helm.sh/helm/v3/pkg/cli" @@ -47,6 +46,7 @@ import ( "helm.sh/helm/v3/pkg/kube" kubefake "helm.sh/helm/v3/pkg/kube/fake" "helm.sh/helm/v3/pkg/postrender" + "helm.sh/helm/v3/pkg/registry" "helm.sh/helm/v3/pkg/release" "helm.sh/helm/v3/pkg/releaseutil" "helm.sh/helm/v3/pkg/repo" diff --git a/pkg/action/pull.go b/pkg/action/pull.go index 55a127d4d..b4018869e 100644 --- a/pkg/action/pull.go +++ b/pkg/action/pull.go @@ -25,11 +25,11 @@ import ( "github.com/pkg/errors" - "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/pkg/chartutil" "helm.sh/helm/v3/pkg/cli" "helm.sh/helm/v3/pkg/downloader" "helm.sh/helm/v3/pkg/getter" + "helm.sh/helm/v3/pkg/registry" "helm.sh/helm/v3/pkg/repo" ) diff --git a/internal/experimental/action/push.go b/pkg/action/push.go similarity index 85% rename from internal/experimental/action/push.go rename to pkg/action/push.go index b125ae1f4..99d1beadc 100644 --- a/internal/experimental/action/push.go +++ b/pkg/action/push.go @@ -19,11 +19,10 @@ package action import ( "strings" - "helm.sh/helm/v3/internal/experimental/pusher" - "helm.sh/helm/v3/internal/experimental/registry" - "helm.sh/helm/v3/internal/experimental/uploader" - "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/cli" + "helm.sh/helm/v3/pkg/pusher" + "helm.sh/helm/v3/pkg/registry" + "helm.sh/helm/v3/pkg/uploader" ) // Push is the action for uploading a chart. @@ -31,14 +30,14 @@ import ( // It provides the implementation of 'helm push'. type Push struct { Settings *cli.EnvSettings - cfg *action.Configuration + cfg *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 *action.Configuration) PushOpt { +func WithPushConfig(cfg *Configuration) PushOpt { return func(p *Push) { p.cfg = cfg } diff --git a/internal/experimental/action/registry_login.go b/pkg/action/registry_login.go similarity index 86% rename from internal/experimental/action/registry_login.go rename to pkg/action/registry_login.go index 8312f3c57..68bcc7442 100644 --- a/internal/experimental/action/registry_login.go +++ b/pkg/action/registry_login.go @@ -19,17 +19,16 @@ package action import ( "io" - "helm.sh/helm/v3/internal/experimental/registry" - "helm.sh/helm/v3/pkg/action" + "helm.sh/helm/v3/pkg/registry" ) // RegistryLogin performs a registry login operation. type RegistryLogin struct { - cfg *action.Configuration + cfg *Configuration } // NewRegistryLogin creates a new RegistryLogin object with the given configuration. -func NewRegistryLogin(cfg *action.Configuration) *RegistryLogin { +func NewRegistryLogin(cfg *Configuration) *RegistryLogin { return &RegistryLogin{ cfg: cfg, } diff --git a/internal/experimental/action/registry_logout.go b/pkg/action/registry_logout.go similarity index 88% rename from internal/experimental/action/registry_logout.go rename to pkg/action/registry_logout.go index 039515c7e..69add4163 100644 --- a/internal/experimental/action/registry_logout.go +++ b/pkg/action/registry_logout.go @@ -18,17 +18,15 @@ package action import ( "io" - - "helm.sh/helm/v3/pkg/action" ) // RegistryLogout performs a registry login operation. type RegistryLogout struct { - cfg *action.Configuration + cfg *Configuration } // NewRegistryLogout creates a new RegistryLogout object with the given configuration. -func NewRegistryLogout(cfg *action.Configuration) *RegistryLogout { +func NewRegistryLogout(cfg *Configuration) *RegistryLogout { return &RegistryLogout{ cfg: cfg, } diff --git a/pkg/downloader/chart_downloader.go b/pkg/downloader/chart_downloader.go index 8ca5cacb6..ea228d9e6 100644 --- a/pkg/downloader/chart_downloader.go +++ b/pkg/downloader/chart_downloader.go @@ -25,12 +25,12 @@ import ( "github.com/pkg/errors" - "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/internal/fileutil" "helm.sh/helm/v3/internal/urlutil" "helm.sh/helm/v3/pkg/getter" "helm.sh/helm/v3/pkg/helmpath" "helm.sh/helm/v3/pkg/provenance" + "helm.sh/helm/v3/pkg/registry" "helm.sh/helm/v3/pkg/repo" ) diff --git a/pkg/downloader/manager.go b/pkg/downloader/manager.go index cc59ae864..535ef387d 100644 --- a/pkg/downloader/manager.go +++ b/pkg/downloader/manager.go @@ -34,7 +34,6 @@ import ( "github.com/pkg/errors" "sigs.k8s.io/yaml" - "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/internal/resolver" "helm.sh/helm/v3/internal/third_party/dep/fs" "helm.sh/helm/v3/internal/urlutil" @@ -43,6 +42,7 @@ import ( "helm.sh/helm/v3/pkg/chartutil" "helm.sh/helm/v3/pkg/getter" "helm.sh/helm/v3/pkg/helmpath" + "helm.sh/helm/v3/pkg/registry" "helm.sh/helm/v3/pkg/repo" ) @@ -344,11 +344,6 @@ func (m *Manager) downloadAll(deps []*chart.Dependency) error { version := "" if registry.IsOCI(churl) { - if !resolver.FeatureGateOCI.IsEnabled() { - return errors.Wrapf(resolver.FeatureGateOCI.Error(), - "the repository %s is an OCI registry", churl) - } - churl, version, err = parseOCIRef(churl) if err != nil { return errors.Wrapf(err, "could not parse OCI reference") diff --git a/pkg/getter/getter.go b/pkg/getter/getter.go index 3a0567a87..7f830bac7 100644 --- a/pkg/getter/getter.go +++ b/pkg/getter/getter.go @@ -22,8 +22,8 @@ import ( "github.com/pkg/errors" - "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/pkg/cli" + "helm.sh/helm/v3/pkg/registry" ) // options are generic parameters to be provided to the getter during instantiation. diff --git a/pkg/getter/ocigetter.go b/pkg/getter/ocigetter.go index dbf382102..76c2db628 100644 --- a/pkg/getter/ocigetter.go +++ b/pkg/getter/ocigetter.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "helm.sh/helm/v3/internal/experimental/registry" + "helm.sh/helm/v3/pkg/registry" ) // OCIGetter is the default HTTP(/S) backend handler diff --git a/internal/experimental/pusher/doc.go b/pkg/pusher/doc.go similarity index 100% rename from internal/experimental/pusher/doc.go rename to pkg/pusher/doc.go diff --git a/internal/experimental/pusher/ocipusher.go b/pkg/pusher/ocipusher.go similarity index 97% rename from internal/experimental/pusher/ocipusher.go rename to pkg/pusher/ocipusher.go index a1df0da85..24cfd8cad 100644 --- a/internal/experimental/pusher/ocipusher.go +++ b/pkg/pusher/ocipusher.go @@ -24,8 +24,8 @@ import ( "github.com/pkg/errors" - "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/pkg/chart/loader" + "helm.sh/helm/v3/pkg/registry" ) // OCIPusher is the default OCI backend handler diff --git a/internal/experimental/pusher/ocipusher_test.go b/pkg/pusher/ocipusher_test.go similarity index 100% rename from internal/experimental/pusher/ocipusher_test.go rename to pkg/pusher/ocipusher_test.go diff --git a/internal/experimental/pusher/pusher.go b/pkg/pusher/pusher.go similarity index 98% rename from internal/experimental/pusher/pusher.go rename to pkg/pusher/pusher.go index 32c1351e9..30c6af97c 100644 --- a/internal/experimental/pusher/pusher.go +++ b/pkg/pusher/pusher.go @@ -19,8 +19,8 @@ package pusher import ( "github.com/pkg/errors" - "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/pkg/cli" + "helm.sh/helm/v3/pkg/registry" ) // options are generic parameters to be provided to the pusher during instantiation. diff --git a/internal/experimental/pusher/pusher_test.go b/pkg/pusher/pusher_test.go similarity index 96% rename from internal/experimental/pusher/pusher_test.go rename to pkg/pusher/pusher_test.go index a99b1a5db..d43e6c9ec 100644 --- a/internal/experimental/pusher/pusher_test.go +++ b/pkg/pusher/pusher_test.go @@ -18,8 +18,8 @@ package pusher import ( "testing" - "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/pkg/cli" + "helm.sh/helm/v3/pkg/registry" ) func TestProvider(t *testing.T) { diff --git a/internal/experimental/registry/client.go b/pkg/registry/client.go similarity index 99% rename from internal/experimental/registry/client.go rename to pkg/registry/client.go index 1b686b8ba..213a9dc49 100644 --- a/internal/experimental/registry/client.go +++ b/pkg/registry/client.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package registry // import "helm.sh/helm/v3/internal/experimental/registry" +package registry // import "helm.sh/helm/v3/pkg/registry" import ( "context" diff --git a/internal/experimental/registry/client_test.go b/pkg/registry/client_test.go similarity index 94% rename from internal/experimental/registry/client_test.go rename to pkg/registry/client_test.go index baf9b4291..abec6975a 100644 --- a/internal/experimental/registry/client_test.go +++ b/pkg/registry/client_test.go @@ -138,7 +138,7 @@ func (suite *RegistryClientTestSuite) Test_1_Push() { suite.NotNil(err, "error pushing non-chart bytes") // Load a test chart - chartData, err := ioutil.ReadFile("../../../pkg/repo/repotest/testdata/examplechart-0.1.0.tgz") + chartData, err := ioutil.ReadFile("../repo/repotest/testdata/examplechart-0.1.0.tgz") suite.Nil(err, "no error loading test chart") meta, err := extractChartMeta(chartData) suite.Nil(err, "no error extracting chart meta") @@ -162,7 +162,7 @@ func (suite *RegistryClientTestSuite) Test_1_Push() { suite.Nil(err, "no error pushing non-strict ref (bad tag), with strict mode disabled") // basic push, good ref - chartData, err = ioutil.ReadFile("../../../pkg/downloader/testdata/local-subchart-0.1.0.tgz") + chartData, err = ioutil.ReadFile("../downloader/testdata/local-subchart-0.1.0.tgz") suite.Nil(err, "no error loading test chart") meta, err = extractChartMeta(chartData) suite.Nil(err, "no error extracting chart meta") @@ -174,13 +174,13 @@ func (suite *RegistryClientTestSuite) Test_1_Push() { suite.Nil(err, "no error pulling a simple chart") // Load another test chart - chartData, err = ioutil.ReadFile("../../../pkg/downloader/testdata/signtest-0.1.0.tgz") + chartData, err = ioutil.ReadFile("../downloader/testdata/signtest-0.1.0.tgz") suite.Nil(err, "no error loading test chart") meta, err = extractChartMeta(chartData) suite.Nil(err, "no error extracting chart meta") // Load prov file - provData, err := ioutil.ReadFile("../../../pkg/downloader/testdata/signtest-0.1.0.tgz.prov") + provData, err := ioutil.ReadFile("../downloader/testdata/signtest-0.1.0.tgz.prov") suite.Nil(err, "no error loading test prov") // push with prov @@ -222,7 +222,7 @@ func (suite *RegistryClientTestSuite) Test_2_Pull() { suite.NotNil(err, "error on bad/missing ref") // Load test chart (to build ref pushed in previous test) - chartData, err := ioutil.ReadFile("../../../pkg/downloader/testdata/local-subchart-0.1.0.tgz") + chartData, err := ioutil.ReadFile("../downloader/testdata/local-subchart-0.1.0.tgz") suite.Nil(err, "no error loading test chart") meta, err := extractChartMeta(chartData) suite.Nil(err, "no error extracting chart meta") @@ -244,14 +244,14 @@ func (suite *RegistryClientTestSuite) Test_2_Pull() { "no error pulling a chart with prov when no prov exists, ignoring missing") // Load test chart (to build ref pushed in previous test) - chartData, err = ioutil.ReadFile("../../../pkg/downloader/testdata/signtest-0.1.0.tgz") + chartData, err = ioutil.ReadFile("../downloader/testdata/signtest-0.1.0.tgz") suite.Nil(err, "no error loading test chart") meta, err = extractChartMeta(chartData) suite.Nil(err, "no error extracting chart meta") ref = fmt.Sprintf("%s/testrepo/%s:%s", suite.DockerRegistryHost, meta.Name, meta.Version) // Load prov file - provData, err := ioutil.ReadFile("../../../pkg/downloader/testdata/signtest-0.1.0.tgz.prov") + provData, err := ioutil.ReadFile("../downloader/testdata/signtest-0.1.0.tgz.prov") suite.Nil(err, "no error loading test prov") // no chart and no prov causes error @@ -297,7 +297,7 @@ func (suite *RegistryClientTestSuite) Test_2_Pull() { func (suite *RegistryClientTestSuite) Test_3_Tags() { // Load test chart (to build ref pushed in previous test) - chartData, err := ioutil.ReadFile("../../../pkg/downloader/testdata/local-subchart-0.1.0.tgz") + chartData, err := ioutil.ReadFile("../downloader/testdata/local-subchart-0.1.0.tgz") suite.Nil(err, "no error loading test chart") meta, err := extractChartMeta(chartData) suite.Nil(err, "no error extracting chart meta") diff --git a/internal/experimental/registry/constants.go b/pkg/registry/constants.go similarity index 94% rename from internal/experimental/registry/constants.go rename to pkg/registry/constants.go index 9babcdfce..570b6f0d3 100644 --- a/internal/experimental/registry/constants.go +++ b/pkg/registry/constants.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package registry // import "helm.sh/helm/v3/internal/experimental/registry" +package registry // import "helm.sh/helm/v3/pkg/registry" const ( // OCIScheme is the URL scheme for OCI-based requests diff --git a/internal/experimental/registry/util.go b/pkg/registry/util.go similarity index 98% rename from internal/experimental/registry/util.go rename to pkg/registry/util.go index 8c6eb1958..47eed267f 100644 --- a/internal/experimental/registry/util.go +++ b/pkg/registry/util.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package registry // import "helm.sh/helm/v3/internal/experimental/registry" +package registry // import "helm.sh/helm/v3/pkg/registry" import ( "bytes" diff --git a/pkg/repo/repotest/server.go b/pkg/repo/repotest/server.go index 0a5c3ae69..e1ddb1d9a 100644 --- a/pkg/repo/repotest/server.go +++ b/pkg/repo/repotest/server.go @@ -34,11 +34,11 @@ import ( "golang.org/x/crypto/bcrypt" "sigs.k8s.io/yaml" - ociRegistry "helm.sh/helm/v3/internal/experimental/registry" "helm.sh/helm/v3/internal/tlsutil" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chart/loader" "helm.sh/helm/v3/pkg/chartutil" + ociRegistry "helm.sh/helm/v3/pkg/registry" "helm.sh/helm/v3/pkg/repo" ) diff --git a/internal/experimental/uploader/chart_uploader.go b/pkg/uploader/chart_uploader.go similarity index 94% rename from internal/experimental/uploader/chart_uploader.go rename to pkg/uploader/chart_uploader.go index 87a9d5772..2aa04937a 100644 --- a/internal/experimental/uploader/chart_uploader.go +++ b/pkg/uploader/chart_uploader.go @@ -22,8 +22,8 @@ import ( "github.com/pkg/errors" - "helm.sh/helm/v3/internal/experimental/pusher" - "helm.sh/helm/v3/internal/experimental/registry" + "helm.sh/helm/v3/pkg/pusher" + "helm.sh/helm/v3/pkg/registry" ) // ChartUploader handles uploading a chart. diff --git a/internal/experimental/uploader/doc.go b/pkg/uploader/doc.go similarity index 100% rename from internal/experimental/uploader/doc.go rename to pkg/uploader/doc.go