Move pkg/chart to pkg/chart/v2 to prepare for v3 charts

This change moves the code, updates the import locations, and
adds a doc.go file to document what the v2 package is for.

This is part of HIP 20 for v3 charts

Signed-off-by: Matt Farina <matt.farina@suse.com>
pull/30586/head
Matt Farina 6 months ago
parent 841f4b1256
commit 61d3eca55c
No known key found for this signature in database
GPG Key ID: 92C44A3D421FF7F9

@ -65,8 +65,8 @@ K8S_MODULES_MINOR_VER=$(word 2,$(K8S_MODULES_VER))
LDFLAGS += -X helm.sh/helm/v4/pkg/lint/rules.k8sVersionMajor=$(K8S_MODULES_MAJOR_VER)
LDFLAGS += -X helm.sh/helm/v4/pkg/lint/rules.k8sVersionMinor=$(K8S_MODULES_MINOR_VER)
LDFLAGS += -X helm.sh/helm/v4/pkg/chart/util.k8sVersionMajor=$(K8S_MODULES_MAJOR_VER)
LDFLAGS += -X helm.sh/helm/v4/pkg/chart/util.k8sVersionMinor=$(K8S_MODULES_MINOR_VER)
LDFLAGS += -X helm.sh/helm/v4/pkg/chart/v2/util.k8sVersionMajor=$(K8S_MODULES_MAJOR_VER)
LDFLAGS += -X helm.sh/helm/v4/pkg/chart/v2/util.k8sVersionMinor=$(K8S_MODULES_MINOR_VER)
.PHONY: all
all: build

@ -21,7 +21,7 @@ import (
"strings"
"testing"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/release"
)

@ -24,8 +24,8 @@ import (
"github.com/spf13/cobra"
"helm.sh/helm/v4/cmd/helm/require"
"helm.sh/helm/v4/pkg/chart"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chart "helm.sh/helm/v4/pkg/chart/v2"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/helmpath"
)

@ -23,9 +23,9 @@ import (
"testing"
"helm.sh/helm/v4/internal/test/ensure"
"helm.sh/helm/v4/pkg/chart"
"helm.sh/helm/v4/pkg/chart/loader"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/chart/v2/loader"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/helmpath"
)

@ -22,7 +22,7 @@ import (
"strings"
"testing"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/provenance"
"helm.sh/helm/v4/pkg/repo"
"helm.sh/helm/v4/pkg/repo/repotest"

@ -23,8 +23,8 @@ import (
"testing"
"helm.sh/helm/v4/internal/test/ensure"
"helm.sh/helm/v4/pkg/chart"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chart "helm.sh/helm/v4/pkg/chart/v2"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/helmpath"
"helm.sh/helm/v4/pkg/provenance"
"helm.sh/helm/v4/pkg/repo"

@ -20,7 +20,7 @@ import (
"fmt"
"testing"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/release"
helmtime "helm.sh/helm/v4/pkg/time"
)

@ -30,7 +30,7 @@ import (
"helm.sh/helm/v4/internal/test"
"helm.sh/helm/v4/pkg/action"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/cli"
kubefake "helm.sh/helm/v4/pkg/kube/fake"
"helm.sh/helm/v4/pkg/release"

@ -27,7 +27,7 @@ import (
"helm.sh/helm/v4/cmd/helm/require"
"helm.sh/helm/v4/pkg/action"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/cli/output"
"helm.sh/helm/v4/pkg/release"
releaseutil "helm.sh/helm/v4/pkg/release/util"

@ -32,8 +32,8 @@ import (
"helm.sh/helm/v4/cmd/helm/require"
"helm.sh/helm/v4/pkg/action"
"helm.sh/helm/v4/pkg/chart"
"helm.sh/helm/v4/pkg/chart/loader"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/chart/v2/loader"
"helm.sh/helm/v4/pkg/cli/output"
"helm.sh/helm/v4/pkg/cli/values"
"helm.sh/helm/v4/pkg/downloader"

@ -27,7 +27,7 @@ import (
"github.com/spf13/cobra"
"helm.sh/helm/v4/pkg/action"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/cli/values"
"helm.sh/helm/v4/pkg/getter"
"helm.sh/helm/v4/pkg/lint/support"

@ -19,7 +19,7 @@ package main
import (
"testing"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/release"
"helm.sh/helm/v4/pkg/time"
)

@ -23,8 +23,8 @@ import (
"strings"
"testing"
"helm.sh/helm/v4/pkg/chart"
"helm.sh/helm/v4/pkg/chart/loader"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/chart/v2/loader"
)
func TestPackage(t *testing.T) {

@ -21,7 +21,7 @@ import (
"reflect"
"testing"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/release"
)

@ -20,7 +20,7 @@ import (
"strings"
"testing"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/repo"
)

@ -30,7 +30,7 @@ import (
"helm.sh/helm/v4/cmd/helm/require"
"helm.sh/helm/v4/pkg/action"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/cli/output"
"helm.sh/helm/v4/pkg/release"
)

@ -20,7 +20,7 @@ import (
"testing"
"time"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/release"
helmtime "helm.sh/helm/v4/pkg/time"
)

@ -34,7 +34,7 @@ import (
"helm.sh/helm/v4/cmd/helm/require"
"helm.sh/helm/v4/pkg/action"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/cli/values"
releaseutil "helm.sh/helm/v4/pkg/release/util"
)

@ -31,7 +31,7 @@ import (
"helm.sh/helm/v4/cmd/helm/require"
"helm.sh/helm/v4/pkg/action"
"helm.sh/helm/v4/pkg/chart/loader"
"helm.sh/helm/v4/pkg/chart/v2/loader"
"helm.sh/helm/v4/pkg/cli/output"
"helm.sh/helm/v4/pkg/cli/values"
"helm.sh/helm/v4/pkg/downloader"

@ -24,9 +24,9 @@ import (
"strings"
"testing"
"helm.sh/helm/v4/pkg/chart"
"helm.sh/helm/v4/pkg/chart/loader"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/chart/v2/loader"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/release"
)

@ -25,7 +25,7 @@ import (
"time"
"helm.sh/helm/v4/internal/version"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
)
// SearchPath is the url path to the search API in monocular.

@ -27,8 +27,8 @@ import (
"github.com/Masterminds/semver/v3"
"github.com/pkg/errors"
"helm.sh/helm/v4/pkg/chart"
"helm.sh/helm/v4/pkg/chart/loader"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/chart/v2/loader"
"helm.sh/helm/v4/pkg/helmpath"
"helm.sh/helm/v4/pkg/provenance"
"helm.sh/helm/v4/pkg/registry"

@ -19,7 +19,7 @@ import (
"runtime"
"testing"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/registry"
)

@ -33,8 +33,8 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"helm.sh/helm/v4/pkg/chart"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chart "helm.sh/helm/v4/pkg/chart/v2"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/engine"
"helm.sh/helm/v4/pkg/kube"
"helm.sh/helm/v4/pkg/postrender"

@ -24,8 +24,8 @@ import (
"github.com/stretchr/testify/assert"
fakeclientset "k8s.io/client-go/kubernetes/fake"
"helm.sh/helm/v4/pkg/chart"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chart "helm.sh/helm/v4/pkg/chart/v2"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
kubefake "helm.sh/helm/v4/pkg/kube/fake"
"helm.sh/helm/v4/pkg/registry"
"helm.sh/helm/v4/pkg/release"

@ -26,8 +26,8 @@ import (
"github.com/Masterminds/semver/v3"
"github.com/gosuri/uitable"
"helm.sh/helm/v4/pkg/chart"
"helm.sh/helm/v4/pkg/chart/loader"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/chart/v2/loader"
)
// Dependency is the action for building a given chart's dependency tree.

@ -25,8 +25,8 @@ import (
"github.com/stretchr/testify/assert"
"helm.sh/helm/v4/internal/test"
"helm.sh/helm/v4/pkg/chart"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chart "helm.sh/helm/v4/pkg/chart/v2"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
)
func TestList(t *testing.T) {

@ -21,7 +21,7 @@ import (
"strings"
"time"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
)
// GetMetadata is the action for checking a given release's metadata.

@ -17,7 +17,7 @@ limitations under the License.
package action
import (
chartutil "helm.sh/helm/v4/pkg/chart/util"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
)
// GetValues is the action for checking a given release's values.

@ -19,7 +19,7 @@ package action
import (
"github.com/pkg/errors"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/release"
)

@ -24,7 +24,7 @@ import (
"github.com/stretchr/testify/assert"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
kubefake "helm.sh/helm/v4/pkg/kube/fake"
"helm.sh/helm/v4/pkg/release"
)

@ -39,8 +39,8 @@ import (
"k8s.io/cli-runtime/pkg/resource"
"sigs.k8s.io/yaml"
"helm.sh/helm/v4/pkg/chart"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chart "helm.sh/helm/v4/pkg/chart/v2"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/cli"
"helm.sh/helm/v4/pkg/downloader"
"helm.sh/helm/v4/pkg/getter"

@ -33,8 +33,8 @@ import (
"github.com/stretchr/testify/require"
"helm.sh/helm/v4/internal/test"
"helm.sh/helm/v4/pkg/chart"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chart "helm.sh/helm/v4/pkg/chart/v2"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
kubefake "helm.sh/helm/v4/pkg/kube/fake"
"helm.sh/helm/v4/pkg/release"
"helm.sh/helm/v4/pkg/storage/driver"

@ -23,7 +23,7 @@ import (
"github.com/pkg/errors"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/lint"
"helm.sh/helm/v4/pkg/lint/support"
)

@ -26,8 +26,8 @@ import (
"github.com/pkg/errors"
"golang.org/x/term"
"helm.sh/helm/v4/pkg/chart/loader"
chartutil "helm.sh/helm/v4/pkg/chart/util"
"helm.sh/helm/v4/pkg/chart/v2/loader"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/provenance"
)

@ -24,7 +24,7 @@ import (
"github.com/pkg/errors"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/cli"
"helm.sh/helm/v4/pkg/downloader"
"helm.sh/helm/v4/pkg/getter"

@ -27,7 +27,7 @@ import (
"github.com/pkg/errors"
v1 "k8s.io/api/core/v1"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/release"
)

@ -24,7 +24,7 @@ import (
"github.com/pkg/errors"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/release"
helmtime "helm.sh/helm/v4/pkg/time"
)

@ -25,9 +25,9 @@ import (
"k8s.io/cli-runtime/pkg/printers"
"sigs.k8s.io/yaml"
"helm.sh/helm/v4/pkg/chart"
"helm.sh/helm/v4/pkg/chart/loader"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/chart/v2/loader"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/registry"
)

@ -19,7 +19,7 @@ package action
import (
"testing"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
)
func TestShow(t *testing.T) {

@ -24,7 +24,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/kube"
"helm.sh/helm/v4/pkg/release"
releaseutil "helm.sh/helm/v4/pkg/release/util"

@ -28,8 +28,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/cli-runtime/pkg/resource"
"helm.sh/helm/v4/pkg/chart"
chartutil "helm.sh/helm/v4/pkg/chart/util"
chart "helm.sh/helm/v4/pkg/chart/v2"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/kube"
"helm.sh/helm/v4/pkg/postrender"
"helm.sh/helm/v4/pkg/registry"

@ -23,7 +23,7 @@ import (
"testing"
"time"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/storage/driver"
"github.com/stretchr/testify/assert"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package chart
package v2
import (
"path/filepath"

@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package chart
package v2
import (
"encoding/json"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package chart
package v2
import "time"

@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package chart
package v2
import (
"testing"

@ -0,0 +1,23 @@
/*
Copyright The Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
Package v2 provides chart handling for apiVersion v1 and v2 charts
This package and its sub-packages provide handling for apiVersion v1 and v2 charts.
The changes from v1 to v2 charts are minor and were able to be handled with minor
switches based on characteristics.
*/
package v2

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package chart
package v2
import "fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package chart
package v2
// File represents a file as a name/value pair.
//

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package chart
package v2
import (
"testing"

@ -30,7 +30,7 @@ import (
"github.com/pkg/errors"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
)
var drivePathPattern = regexp.MustCompile(`^[a-zA-Z]:/`)

@ -26,7 +26,7 @@ import (
"github.com/pkg/errors"
"helm.sh/helm/v4/internal/sympath"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
"helm.sh/helm/v4/pkg/ignore"
)

@ -30,7 +30,7 @@ import (
utilyaml "k8s.io/apimachinery/pkg/util/yaml"
"sigs.k8s.io/yaml"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
)
// ChartLoader loads a chart.

@ -30,7 +30,7 @@ import (
"testing"
"time"
"helm.sh/helm/v4/pkg/chart"
chart "helm.sh/helm/v4/pkg/chart/v2"
)
func TestLoadDir(t *testing.T) {

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 374 B

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 374 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save