|
|
|
@ -34,6 +34,7 @@ import (
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
|
|
|
ci "helm.sh/helm/v4/pkg/chart"
|
|
|
|
appsv1 "k8s.io/api/apps/v1"
|
|
|
|
appsv1 "k8s.io/api/apps/v1"
|
|
|
|
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
|
|
|
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
|
|
|
"k8s.io/apimachinery/pkg/api/meta"
|
|
|
|
"k8s.io/apimachinery/pkg/api/meta"
|
|
|
|
@ -49,8 +50,8 @@ import (
|
|
|
|
chart "helm.sh/helm/v4/pkg/chart/v2"
|
|
|
|
chart "helm.sh/helm/v4/pkg/chart/v2"
|
|
|
|
"helm.sh/helm/v4/pkg/kube"
|
|
|
|
"helm.sh/helm/v4/pkg/kube"
|
|
|
|
kubefake "helm.sh/helm/v4/pkg/kube/fake"
|
|
|
|
kubefake "helm.sh/helm/v4/pkg/kube/fake"
|
|
|
|
rcommon "helm.sh/helm/v4/pkg/release/common"
|
|
|
|
|
|
|
|
"helm.sh/helm/v4/pkg/registry"
|
|
|
|
"helm.sh/helm/v4/pkg/registry"
|
|
|
|
|
|
|
|
rcommon "helm.sh/helm/v4/pkg/release/common"
|
|
|
|
release "helm.sh/helm/v4/pkg/release/v1"
|
|
|
|
release "helm.sh/helm/v4/pkg/release/v1"
|
|
|
|
"helm.sh/helm/v4/pkg/storage/driver"
|
|
|
|
"helm.sh/helm/v4/pkg/storage/driver"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -275,17 +276,6 @@ func TestInstallReleaseWithValues(t *testing.T) {
|
|
|
|
is.Equal(expectedUserValues, rel.Config)
|
|
|
|
is.Equal(expectedUserValues, rel.Config)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestInstallReleaseClientOnly(t *testing.T) {
|
|
|
|
|
|
|
|
is := assert.New(t)
|
|
|
|
|
|
|
|
instAction := installAction(t)
|
|
|
|
|
|
|
|
instAction.ClientOnly = true
|
|
|
|
|
|
|
|
_, err := instAction.Run(buildChart(), nil)
|
|
|
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
is.Equal(instAction.cfg.Capabilities, common.DefaultCapabilities)
|
|
|
|
|
|
|
|
is.Equal(instAction.cfg.KubeClient, &kubefake.PrintingKubeClient{Out: io.Discard})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func TestInstallRelease_NoName(t *testing.T) {
|
|
|
|
func TestInstallRelease_NoName(t *testing.T) {
|
|
|
|
instAction := installAction(t)
|
|
|
|
instAction := installAction(t)
|
|
|
|
instAction.ReleaseName = ""
|
|
|
|
instAction.ReleaseName = ""
|
|
|
|
@ -1186,12 +1176,12 @@ func TestCheckDependencies(t *testing.T) {
|
|
|
|
dependency := chart.Dependency{Name: "hello"}
|
|
|
|
dependency := chart.Dependency{Name: "hello"}
|
|
|
|
mockChart := buildChart(withDependency())
|
|
|
|
mockChart := buildChart(withDependency())
|
|
|
|
|
|
|
|
|
|
|
|
assert.Nil(t, CheckDependencies(mockChart, []*chart.Dependency{&dependency}))
|
|
|
|
assert.Nil(t, CheckDependencies(mockChart, []ci.Dependency{&dependency}))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestCheckDependencies_MissingDependency(t *testing.T) {
|
|
|
|
func TestCheckDependencies_MissingDependency(t *testing.T) {
|
|
|
|
dependency := chart.Dependency{Name: "missing"}
|
|
|
|
dependency := chart.Dependency{Name: "missing"}
|
|
|
|
mockChart := buildChart(withDependency())
|
|
|
|
mockChart := buildChart(withDependency())
|
|
|
|
|
|
|
|
|
|
|
|
assert.ErrorContains(t, CheckDependencies(mockChart, []*chart.Dependency{&dependency}), "missing in charts")
|
|
|
|
assert.ErrorContains(t, CheckDependencies(mockChart, []ci.Dependency{&dependency}), "missing in charts")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|