mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 17:52:12 +00:00
Make resource, resmap public.
This commit is contained in:
@@ -11,12 +11,12 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/ifc"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/loader"
|
||||
"sigs.k8s.io/kustomize/v3/api/ifc"
|
||||
"sigs.k8s.io/kustomize/v3/api/loader"
|
||||
"sigs.k8s.io/kustomize/v3/api/resmap"
|
||||
"sigs.k8s.io/kustomize/v3/api/resource"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/pgmconfig"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/plugins"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/resmap"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/resource"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/target"
|
||||
"sigs.k8s.io/kustomize/v3/plugin/builtin"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
@@ -15,12 +15,12 @@ import (
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit"
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/version"
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/api/resmap"
|
||||
"sigs.k8s.io/kustomize/v3/api/resource"
|
||||
"sigs.k8s.io/kustomize/v3/k8sdeps/kunstruct"
|
||||
"sigs.k8s.io/kustomize/v3/k8sdeps/transformer"
|
||||
"sigs.k8s.io/kustomize/v3/k8sdeps/validator"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/pgmconfig"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/resmap"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/resource"
|
||||
)
|
||||
|
||||
// NewDefaultCommand returns the default (aka root) command for kustomize command.
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util"
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/ifc"
|
||||
"sigs.k8s.io/kustomize/v3/api/ifc"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/pgmconfig"
|
||||
)
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ func TestAddBaseHappyPath(t *testing.T) {
|
||||
for _, base := range bases {
|
||||
fSys.Mkdir(base)
|
||||
}
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
|
||||
cmd := newCmdAddBase(fSys)
|
||||
args := []string{baseDirectoryPaths}
|
||||
@@ -30,7 +30,7 @@ func TestAddBaseHappyPath(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("unexpected cmd error: %v", err)
|
||||
}
|
||||
content, err := testutils.ReadTestKustomization(fSys)
|
||||
content, err := testutils_test.ReadTestKustomization(fSys)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected read error: %v", err)
|
||||
}
|
||||
@@ -49,7 +49,7 @@ func TestAddBaseAlreadyThere(t *testing.T) {
|
||||
for _, base := range bases {
|
||||
fSys.Mkdir(base)
|
||||
}
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
|
||||
cmd := newCmdAddBase(fSys)
|
||||
args := []string{baseDirectoryPaths}
|
||||
|
||||
@@ -9,13 +9,13 @@ import (
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/api/testutils/valtest"
|
||||
"sigs.k8s.io/kustomize/v3/api/types"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/validators"
|
||||
)
|
||||
|
||||
func makeKustomization(t *testing.T) *types.Kustomization {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
kf, err := kustfile.NewKustomizationFile(fSys)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected new error %v", err)
|
||||
@@ -51,7 +51,7 @@ func TestRunAddAnnotation(t *testing.T) {
|
||||
|
||||
func TestAddAnnotationNoArgs(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddAnnotation(fSys, v.Validator)
|
||||
err := cmd.Execute()
|
||||
v.VerifyNoCall()
|
||||
@@ -65,7 +65,7 @@ func TestAddAnnotationNoArgs(t *testing.T) {
|
||||
|
||||
func TestAddAnnotationInvalidFormat(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
v := validators.MakeSadMapValidator(t)
|
||||
v := valtest_test.MakeSadMapValidator(t)
|
||||
cmd := newCmdAddAnnotation(fSys, v.Validator)
|
||||
args := []string{"whatever:whatever"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -80,8 +80,8 @@ func TestAddAnnotationInvalidFormat(t *testing.T) {
|
||||
|
||||
func TestAddAnnotationManyArgs(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddAnnotation(fSys, v.Validator)
|
||||
args := []string{"k1:v1,k2:v2,k3:v3,k4:v5"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -93,8 +93,8 @@ func TestAddAnnotationManyArgs(t *testing.T) {
|
||||
|
||||
func TestAddAnnotationValueQuoted(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddAnnotation(fSys, v.Validator)
|
||||
args := []string{"k1:\"v1\""}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -106,8 +106,8 @@ func TestAddAnnotationValueQuoted(t *testing.T) {
|
||||
|
||||
func TestAddAnnotationValueWithColon(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddAnnotation(fSys, v.Validator)
|
||||
args := []string{"k1:\"v1:v2\""}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -119,7 +119,7 @@ func TestAddAnnotationValueWithColon(t *testing.T) {
|
||||
|
||||
func TestAddAnnotationNoKey(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddAnnotation(fSys, v.Validator)
|
||||
args := []string{":nokey"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -134,8 +134,8 @@ func TestAddAnnotationNoKey(t *testing.T) {
|
||||
|
||||
func TestAddAnnotationTooManyColons(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddAnnotation(fSys, v.Validator)
|
||||
args := []string{"key:v1:v2"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -147,8 +147,8 @@ func TestAddAnnotationTooManyColons(t *testing.T) {
|
||||
|
||||
func TestAddAnnotationNoValue(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddAnnotation(fSys, v.Validator)
|
||||
args := []string{"no:,value"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -160,8 +160,8 @@ func TestAddAnnotationNoValue(t *testing.T) {
|
||||
|
||||
func TestAddAnnotationMultipleArgs(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddAnnotation(fSys, v.Validator)
|
||||
args := []string{"this:annotation", "has:spaces"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -176,8 +176,8 @@ func TestAddAnnotationMultipleArgs(t *testing.T) {
|
||||
|
||||
func TestAddAnnotationForce(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddAnnotation(fSys, v.Validator)
|
||||
args := []string{"key:foo"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -187,7 +187,7 @@ func TestAddAnnotationForce(t *testing.T) {
|
||||
}
|
||||
// trying to add the same annotation again should not work
|
||||
args = []string{"key:bar"}
|
||||
v = validators.MakeHappyMapValidator(t)
|
||||
v = valtest_test.MakeHappyMapValidator(t)
|
||||
cmd = newCmdAddAnnotation(fSys, v.Validator)
|
||||
err = cmd.RunE(cmd, args)
|
||||
v.VerifyCall()
|
||||
@@ -198,7 +198,7 @@ func TestAddAnnotationForce(t *testing.T) {
|
||||
t.Errorf("expected an error")
|
||||
}
|
||||
// but trying to add it with --force should
|
||||
v = validators.MakeHappyMapValidator(t)
|
||||
v = valtest_test.MakeHappyMapValidator(t)
|
||||
cmd = newCmdAddAnnotation(fSys, v.Validator)
|
||||
cmd.Flag("force").Value.Set("true")
|
||||
err = cmd.RunE(cmd, args)
|
||||
@@ -232,7 +232,7 @@ func TestRunAddLabel(t *testing.T) {
|
||||
|
||||
func TestAddLabelNoArgs(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddLabel(fSys, v.Validator)
|
||||
err := cmd.Execute()
|
||||
v.VerifyNoCall()
|
||||
@@ -246,7 +246,7 @@ func TestAddLabelNoArgs(t *testing.T) {
|
||||
|
||||
func TestAddLabelInvalidFormat(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
v := validators.MakeSadMapValidator(t)
|
||||
v := valtest_test.MakeSadMapValidator(t)
|
||||
cmd := newCmdAddLabel(fSys, v.Validator)
|
||||
args := []string{"exclamation!:point"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -261,7 +261,7 @@ func TestAddLabelInvalidFormat(t *testing.T) {
|
||||
|
||||
func TestAddLabelNoKey(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddLabel(fSys, v.Validator)
|
||||
args := []string{":nokey"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -276,8 +276,8 @@ func TestAddLabelNoKey(t *testing.T) {
|
||||
|
||||
func TestAddLabelTooManyColons(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddLabel(fSys, v.Validator)
|
||||
args := []string{"key:v1:v2"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -289,8 +289,8 @@ func TestAddLabelTooManyColons(t *testing.T) {
|
||||
|
||||
func TestAddLabelNoValue(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddLabel(fSys, v.Validator)
|
||||
args := []string{"no,value:"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -302,8 +302,8 @@ func TestAddLabelNoValue(t *testing.T) {
|
||||
|
||||
func TestAddLabelMultipleArgs(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddLabel(fSys, v.Validator)
|
||||
args := []string{"this:input", "has:spaces"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -318,8 +318,8 @@ func TestAddLabelMultipleArgs(t *testing.T) {
|
||||
|
||||
func TestAddLabelForce(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdAddLabel(fSys, v.Validator)
|
||||
args := []string{"key:foo"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -329,7 +329,7 @@ func TestAddLabelForce(t *testing.T) {
|
||||
}
|
||||
// trying to add the same label again should not work
|
||||
args = []string{"key:bar"}
|
||||
v = validators.MakeHappyMapValidator(t)
|
||||
v = valtest_test.MakeHappyMapValidator(t)
|
||||
cmd = newCmdAddLabel(fSys, v.Validator)
|
||||
err = cmd.RunE(cmd, args)
|
||||
v.VerifyCall()
|
||||
@@ -340,7 +340,7 @@ func TestAddLabelForce(t *testing.T) {
|
||||
t.Errorf("expected an error")
|
||||
}
|
||||
// but trying to add it with --force should
|
||||
v = validators.MakeHappyMapValidator(t)
|
||||
v = valtest_test.MakeHappyMapValidator(t)
|
||||
cmd = newCmdAddLabel(fSys, v.Validator)
|
||||
cmd.Flag("force").Value.Set("true")
|
||||
err = cmd.RunE(cmd, args)
|
||||
|
||||
@@ -23,7 +23,7 @@ func TestAddPatchHappyPath(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
fSys.WriteFile(patchFileName, []byte(patchFileContent))
|
||||
fSys.WriteFile(patchFileName+"another", []byte(patchFileContent))
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
|
||||
cmd := newCmdAddPatch(fSys)
|
||||
args := []string{patchFileName + "*"}
|
||||
@@ -31,7 +31,7 @@ func TestAddPatchHappyPath(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("unexpected cmd error: %v", err)
|
||||
}
|
||||
content, err := testutils.ReadTestKustomization(fSys)
|
||||
content, err := testutils_test.ReadTestKustomization(fSys)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected read error: %v", err)
|
||||
}
|
||||
@@ -46,7 +46,7 @@ func TestAddPatchHappyPath(t *testing.T) {
|
||||
func TestAddPatchAlreadyThere(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
fSys.WriteFile(patchFileName, []byte(patchFileContent))
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
|
||||
cmd := newCmdAddPatch(fSys)
|
||||
args := []string{patchFileName}
|
||||
|
||||
@@ -23,7 +23,7 @@ func TestAddResourceHappyPath(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
fSys.WriteFile(resourceFileName, []byte(resourceFileContent))
|
||||
fSys.WriteFile(resourceFileName+"another", []byte(resourceFileContent))
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
|
||||
cmd := newCmdAddResource(fSys)
|
||||
args := []string{resourceFileName + "*"}
|
||||
@@ -31,7 +31,7 @@ func TestAddResourceHappyPath(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("unexpected cmd error: %v", err)
|
||||
}
|
||||
content, err := testutils.ReadTestKustomization(fSys)
|
||||
content, err := testutils_test.ReadTestKustomization(fSys)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected read error: %v", err)
|
||||
}
|
||||
@@ -46,7 +46,7 @@ func TestAddResourceHappyPath(t *testing.T) {
|
||||
func TestAddResourceAlreadyThere(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
fSys.WriteFile(resourceFileName, []byte(resourceFileContent))
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
|
||||
cmd := newCmdAddResource(fSys)
|
||||
args := []string{resourceFileName}
|
||||
|
||||
@@ -6,7 +6,7 @@ package add
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/ifc"
|
||||
"sigs.k8s.io/kustomize/v3/api/ifc"
|
||||
)
|
||||
|
||||
// NewCmdAdd returns an instance of 'add' subcommand.
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/api/ifc"
|
||||
"sigs.k8s.io/kustomize/v3/api/types"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/ifc"
|
||||
)
|
||||
|
||||
// newCmdAddConfigMap returns a new command.
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/api/kv"
|
||||
"sigs.k8s.io/kustomize/v3/api/loader"
|
||||
"sigs.k8s.io/kustomize/v3/api/testutils/valtest"
|
||||
"sigs.k8s.io/kustomize/v3/api/types"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/loader"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/validators"
|
||||
)
|
||||
|
||||
func TestNewAddConfigMapIsNotNil(t *testing.T) {
|
||||
@@ -19,7 +19,7 @@ func TestNewAddConfigMapIsNotNil(t *testing.T) {
|
||||
fSys,
|
||||
kv.NewLoader(
|
||||
loader.NewFileLoaderAtCwd(fSys),
|
||||
validators.MakeFakeValidator()),
|
||||
valtest_test.MakeFakeValidator()),
|
||||
nil) == nil {
|
||||
t.Fatal("newCmdAddConfigMap shouldn't be nil")
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/api/ifc"
|
||||
"sigs.k8s.io/kustomize/v3/api/types"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/ifc"
|
||||
)
|
||||
|
||||
// newCmdAddSecret returns a new command.
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"sigs.k8s.io/kustomize/v3/api/kv"
|
||||
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/api/loader"
|
||||
"sigs.k8s.io/kustomize/v3/api/testutils/valtest"
|
||||
"sigs.k8s.io/kustomize/v3/api/types"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/loader"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/validators"
|
||||
)
|
||||
|
||||
func TestNewCmdAddSecretIsNotNil(t *testing.T) {
|
||||
@@ -20,7 +20,7 @@ func TestNewCmdAddSecretIsNotNil(t *testing.T) {
|
||||
fSys,
|
||||
kv.NewLoader(
|
||||
loader.NewFileLoaderAtCwd(fSys),
|
||||
validators.MakeFakeValidator()),
|
||||
valtest_test.MakeFakeValidator()),
|
||||
nil) == nil {
|
||||
t.Fatal("newCmdAddSecret shouldn't be nil")
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/remove"
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/set"
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/api/ifc"
|
||||
"sigs.k8s.io/kustomize/v3/api/kv"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/ifc"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/loader"
|
||||
"sigs.k8s.io/kustomize/v3/api/loader"
|
||||
)
|
||||
|
||||
// NewCmdEdit returns an instance of 'edit' subcommand.
|
||||
|
||||
@@ -13,14 +13,14 @@ import (
|
||||
|
||||
func TestFix(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomizationWith(fSys, []byte(`nameprefix: some-prefix-`))
|
||||
testutils_test.WriteTestKustomizationWith(fSys, []byte(`nameprefix: some-prefix-`))
|
||||
|
||||
cmd := NewCmdFix(fSys)
|
||||
err := cmd.RunE(cmd, nil)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected cmd error: %v", err)
|
||||
}
|
||||
content, err := testutils.ReadTestKustomization(fSys)
|
||||
content, err := testutils_test.ReadTestKustomization(fSys)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected read error: %v", err)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ package remove
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/ifc"
|
||||
"sigs.k8s.io/kustomize/v3/api/ifc"
|
||||
)
|
||||
|
||||
// NewCmdRemove returns an instance of 'remove' subcommand.
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/api/testutils/valtest"
|
||||
"sigs.k8s.io/kustomize/v3/api/types"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/validators"
|
||||
)
|
||||
|
||||
func makeKustomizationFS() filesys.FileSystem {
|
||||
@@ -20,7 +20,7 @@ func makeKustomizationFS() filesys.FileSystem {
|
||||
commonLabels := []string{"label1: val1", "label2: val2"}
|
||||
commonAnnotations := []string{"annotation1: val1", "annotation2: val2"}
|
||||
|
||||
testutils.WriteTestKustomizationWith(fSys, []byte(
|
||||
testutils_test.WriteTestKustomizationWith(fSys, []byte(
|
||||
fmt.Sprintf("commonLabels:\n %s\ncommonAnnotations:\n %s",
|
||||
strings.Join(commonLabels, "\n "), strings.Join(commonAnnotations, "\n "))))
|
||||
return fSys
|
||||
@@ -73,7 +73,7 @@ func TestRemoveAnnotation(t *testing.T) {
|
||||
func TestRemoveAnnotationIgnore(t *testing.T) {
|
||||
fSys := makeKustomizationFS()
|
||||
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdRemoveAnnotation(fSys, v.ValidatorArray)
|
||||
cmd.Flag("ignore-non-existence").Value.Set("true")
|
||||
args := []string{"annotation3"}
|
||||
@@ -87,9 +87,9 @@ func TestRemoveAnnotationIgnore(t *testing.T) {
|
||||
|
||||
func TestRemoveAnnotationNoDefinition(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomizationWith(fSys, []byte(""))
|
||||
testutils_test.WriteTestKustomizationWith(fSys, []byte(""))
|
||||
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdRemoveAnnotation(fSys, v.ValidatorArray)
|
||||
args := []string{"annotation1,annotation2"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -105,9 +105,9 @@ func TestRemoveAnnotationNoDefinition(t *testing.T) {
|
||||
|
||||
func TestRemoveAnnotationNoDefinitionIgnore(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomizationWith(fSys, []byte(""))
|
||||
testutils_test.WriteTestKustomizationWith(fSys, []byte(""))
|
||||
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdRemoveLabel(fSys, v.ValidatorArray)
|
||||
cmd.Flag("ignore-non-existence").Value.Set("true")
|
||||
args := []string{"annotation1,annotation2"}
|
||||
@@ -122,7 +122,7 @@ func TestRemoveAnnotationNoDefinitionIgnore(t *testing.T) {
|
||||
func TestRemoveAnnotationNoArgs(t *testing.T) {
|
||||
fSys := makeKustomizationFS()
|
||||
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdRemoveAnnotation(fSys, v.ValidatorArray)
|
||||
err := cmd.Execute()
|
||||
v.VerifyNoCall()
|
||||
@@ -138,7 +138,7 @@ func TestRemoveAnnotationNoArgs(t *testing.T) {
|
||||
func TestRemoveAnnotationInvalidFormat(t *testing.T) {
|
||||
fSys := makeKustomizationFS()
|
||||
|
||||
v := validators.MakeSadMapValidator(t)
|
||||
v := valtest_test.MakeSadMapValidator(t)
|
||||
cmd := newCmdRemoveAnnotation(fSys, v.ValidatorArray)
|
||||
args := []string{"nospecialchars%^=@"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -155,7 +155,7 @@ func TestRemoveAnnotationInvalidFormat(t *testing.T) {
|
||||
func TestRemoveAnnotationMultipleArgs(t *testing.T) {
|
||||
fSys := makeKustomizationFS()
|
||||
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdRemoveAnnotation(fSys, v.ValidatorArray)
|
||||
args := []string{"annotation1,annotation2"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -177,7 +177,7 @@ func TestRemoveAnnotationMultipleArgs(t *testing.T) {
|
||||
func TestRemoveAnnotationMultipleArgsInvalidFormat(t *testing.T) {
|
||||
fSys := makeKustomizationFS()
|
||||
|
||||
v := validators.MakeSadMapValidator(t)
|
||||
v := valtest_test.MakeSadMapValidator(t)
|
||||
cmd := newCmdRemoveAnnotation(fSys, v.ValidatorArray)
|
||||
args := []string{"annotation1", "annotation2"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -221,7 +221,7 @@ func TestRemoveLabel(t *testing.T) {
|
||||
func TestRemoveLabelIgnore(t *testing.T) {
|
||||
fSys := makeKustomizationFS()
|
||||
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdRemoveLabel(fSys, v.ValidatorArray)
|
||||
cmd.Flag("ignore-non-existence").Value.Set("true")
|
||||
args := []string{"label3"}
|
||||
@@ -235,9 +235,9 @@ func TestRemoveLabelIgnore(t *testing.T) {
|
||||
|
||||
func TestRemoveLabelNoDefinition(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomizationWith(fSys, []byte(""))
|
||||
testutils_test.WriteTestKustomizationWith(fSys, []byte(""))
|
||||
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdRemoveLabel(fSys, v.ValidatorArray)
|
||||
args := []string{"label1,label2"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -253,9 +253,9 @@ func TestRemoveLabelNoDefinition(t *testing.T) {
|
||||
|
||||
func TestRemoveLabelNoDefinitionIgnore(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomizationWith(fSys, []byte(""))
|
||||
testutils_test.WriteTestKustomizationWith(fSys, []byte(""))
|
||||
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdRemoveLabel(fSys, v.ValidatorArray)
|
||||
cmd.Flag("ignore-non-existence").Value.Set("true")
|
||||
args := []string{"label1,label2"}
|
||||
@@ -270,7 +270,7 @@ func TestRemoveLabelNoDefinitionIgnore(t *testing.T) {
|
||||
func TestRemoveLabelNoArgs(t *testing.T) {
|
||||
fSys := makeKustomizationFS()
|
||||
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdRemoveLabel(fSys, v.ValidatorArray)
|
||||
err := cmd.Execute()
|
||||
v.VerifyNoCall()
|
||||
@@ -286,7 +286,7 @@ func TestRemoveLabelNoArgs(t *testing.T) {
|
||||
func TestRemoveLabelInvalidFormat(t *testing.T) {
|
||||
fSys := makeKustomizationFS()
|
||||
|
||||
v := validators.MakeSadMapValidator(t)
|
||||
v := valtest_test.MakeSadMapValidator(t)
|
||||
cmd := newCmdRemoveLabel(fSys, v.ValidatorArray)
|
||||
args := []string{"exclamation!"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -303,7 +303,7 @@ func TestRemoveLabelInvalidFormat(t *testing.T) {
|
||||
func TestRemoveLabelMultipleArgs(t *testing.T) {
|
||||
fSys := makeKustomizationFS()
|
||||
|
||||
v := validators.MakeHappyMapValidator(t)
|
||||
v := valtest_test.MakeHappyMapValidator(t)
|
||||
cmd := newCmdRemoveLabel(fSys, v.ValidatorArray)
|
||||
args := []string{"label1,label2"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
@@ -325,7 +325,7 @@ func TestRemoveLabelMultipleArgs(t *testing.T) {
|
||||
func TestRemoveLabelMultipleArgsInvalidFormat(t *testing.T) {
|
||||
fSys := makeKustomizationFS()
|
||||
|
||||
v := validators.MakeSadMapValidator(t)
|
||||
v := valtest_test.MakeSadMapValidator(t)
|
||||
cmd := newCmdRemoveLabel(fSys, v.ValidatorArray)
|
||||
args := []string{"label1", "label2"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
|
||||
@@ -24,7 +24,7 @@ func makeKustomizationPatchFS() filesys.FileSystem {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
patches := []string{"patch1.yaml", "patch2.yaml"}
|
||||
|
||||
testutils.WriteTestKustomizationWith(fSys, []byte(
|
||||
testutils_test.WriteTestKustomizationWith(fSys, []byte(
|
||||
fmt.Sprintf("patchesStrategicMerge:\n - %s",
|
||||
strings.Join(patches, "\n - "))))
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ func TestRemoveResources(t *testing.T) {
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.description, func(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomizationWith(
|
||||
testutils_test.WriteTestKustomizationWith(
|
||||
fSys,
|
||||
[]byte(fmt.Sprintf(
|
||||
"resources:\n - %s", strings.Join(tc.given.resources, "\n - "))))
|
||||
@@ -141,7 +141,7 @@ func TestRemoveResources(t *testing.T) {
|
||||
}
|
||||
return
|
||||
}
|
||||
content, err := testutils.ReadTestKustomization(fSys)
|
||||
content, err := testutils_test.ReadTestKustomization(fSys)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected read error: %v", err)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ package set
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/ifc"
|
||||
"sigs.k8s.io/kustomize/v3/api/ifc"
|
||||
)
|
||||
|
||||
// NewCmdSet returns an instance of 'set' subcommand.
|
||||
|
||||
@@ -17,7 +17,7 @@ const (
|
||||
|
||||
func TestSetNamePrefixHappyPath(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
|
||||
cmd := newCmdSetNamePrefix(fSys)
|
||||
args := []string{goodPrefixValue}
|
||||
@@ -25,7 +25,7 @@ func TestSetNamePrefixHappyPath(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("unexpected cmd error: %v", err)
|
||||
}
|
||||
content, err := testutils.ReadTestKustomization(fSys)
|
||||
content, err := testutils_test.ReadTestKustomization(fSys)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected read error: %v", err)
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ const (
|
||||
|
||||
func TestSetNameSuffixHappyPath(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
|
||||
cmd := newCmdSetNameSuffix(fSys)
|
||||
args := []string{goodSuffixValue}
|
||||
@@ -25,7 +25,7 @@ func TestSetNameSuffixHappyPath(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("unexpected cmd error: %v", err)
|
||||
}
|
||||
content, err := testutils.ReadTestKustomization(fSys)
|
||||
content, err := testutils_test.ReadTestKustomization(fSys)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected read error: %v", err)
|
||||
}
|
||||
|
||||
@@ -195,11 +195,11 @@ func TestSetImage(t *testing.T) {
|
||||
|
||||
if len(tc.given.infileImages) > 0 {
|
||||
// write file with infileImages
|
||||
testutils.WriteTestKustomizationWith(
|
||||
testutils_test.WriteTestKustomizationWith(
|
||||
fSys,
|
||||
[]byte(strings.Join(tc.given.infileImages, "\n")))
|
||||
} else {
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
}
|
||||
|
||||
// act
|
||||
@@ -211,7 +211,7 @@ func TestSetImage(t *testing.T) {
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
content, err := testutils.ReadTestKustomization(fSys)
|
||||
content, err := testutils_test.ReadTestKustomization(fSys)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected read error: %v", err)
|
||||
t.FailNow()
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile"
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/ifc"
|
||||
"sigs.k8s.io/kustomize/v3/api/ifc"
|
||||
)
|
||||
|
||||
type setNamespaceOptions struct {
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils"
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/validators"
|
||||
"sigs.k8s.io/kustomize/v3/api/testutils/valtest"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -19,15 +19,15 @@ const (
|
||||
|
||||
func TestSetNamespaceHappyPath(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
|
||||
cmd := newCmdSetNamespace(fSys, validators.MakeFakeValidator())
|
||||
cmd := newCmdSetNamespace(fSys, valtest_test.MakeFakeValidator())
|
||||
args := []string{goodNamespaceValue}
|
||||
err := cmd.RunE(cmd, args)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected cmd error: %v", err)
|
||||
}
|
||||
content, err := testutils.ReadTestKustomization(fSys)
|
||||
content, err := testutils_test.ReadTestKustomization(fSys)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected read error: %v", err)
|
||||
}
|
||||
@@ -39,9 +39,9 @@ func TestSetNamespaceHappyPath(t *testing.T) {
|
||||
|
||||
func TestSetNamespaceOverride(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
|
||||
cmd := newCmdSetNamespace(fSys, validators.MakeFakeValidator())
|
||||
cmd := newCmdSetNamespace(fSys, valtest_test.MakeFakeValidator())
|
||||
args := []string{goodNamespaceValue}
|
||||
err := cmd.RunE(cmd, args)
|
||||
if err != nil {
|
||||
@@ -52,7 +52,7 @@ func TestSetNamespaceOverride(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("unexpected cmd error: %v", err)
|
||||
}
|
||||
content, err := testutils.ReadTestKustomization(fSys)
|
||||
content, err := testutils_test.ReadTestKustomization(fSys)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected read error: %v", err)
|
||||
}
|
||||
@@ -65,7 +65,7 @@ func TestSetNamespaceOverride(t *testing.T) {
|
||||
func TestSetNamespaceNoArgs(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
|
||||
cmd := newCmdSetNamespace(fSys, validators.MakeFakeValidator())
|
||||
cmd := newCmdSetNamespace(fSys, valtest_test.MakeFakeValidator())
|
||||
err := cmd.Execute()
|
||||
if err == nil {
|
||||
t.Errorf("expected error: %v", err)
|
||||
@@ -78,7 +78,7 @@ func TestSetNamespaceNoArgs(t *testing.T) {
|
||||
func TestSetNamespaceInvalid(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
|
||||
cmd := newCmdSetNamespace(fSys, validators.MakeFakeValidator())
|
||||
cmd := newCmdSetNamespace(fSys, valtest_test.MakeFakeValidator())
|
||||
args := []string{"/badnamespace/"}
|
||||
err := cmd.RunE(cmd, args)
|
||||
if err == nil {
|
||||
|
||||
@@ -115,11 +115,11 @@ func TestSetReplicas(t *testing.T) {
|
||||
|
||||
if len(tc.given.infileReplicas) > 0 {
|
||||
// write file with infileReplicas
|
||||
testutils.WriteTestKustomizationWith(
|
||||
testutils_test.WriteTestKustomizationWith(
|
||||
fSys,
|
||||
[]byte(strings.Join(tc.given.infileReplicas, "\n")))
|
||||
} else {
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
}
|
||||
|
||||
// act
|
||||
@@ -131,7 +131,7 @@ func TestSetReplicas(t *testing.T) {
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
content, err := testutils.ReadTestKustomization(fSys)
|
||||
content, err := testutils_test.ReadTestKustomization(fSys)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected read error: %v", err)
|
||||
t.FailNow()
|
||||
|
||||
@@ -58,7 +58,7 @@ func TestWriteAndRead(t *testing.T) {
|
||||
}
|
||||
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomization(fSys)
|
||||
testutils_test.WriteTestKustomization(fSys)
|
||||
mf, err := NewKustomizationFile(fSys)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected Error: %v", err)
|
||||
@@ -144,7 +144,7 @@ patchesStrategicMerge:
|
||||
- pod.yaml
|
||||
`)
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomizationWith(fSys, kustomizationContentWithComments)
|
||||
testutils_test.WriteTestKustomizationWith(fSys, kustomizationContentWithComments)
|
||||
mf, err := NewKustomizationFile(fSys)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected Error: %v", err)
|
||||
@@ -236,7 +236,7 @@ generatorOptions:
|
||||
disableNameSuffixHash: true
|
||||
`)
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomizationWith(
|
||||
testutils_test.WriteTestKustomizationWith(
|
||||
fSys, kustomizationContentWithComments)
|
||||
mf, err := NewKustomizationFile(fSys)
|
||||
if err != nil {
|
||||
@@ -274,7 +274,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
`)
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomizationWith(
|
||||
testutils_test.WriteTestKustomizationWith(
|
||||
fSys, kustomizationContentWithComments)
|
||||
mf, err := NewKustomizationFile(fSys)
|
||||
if err != nil {
|
||||
@@ -320,7 +320,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
`)
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
testutils.WriteTestKustomizationWith(fSys, kustomizationContentWithComments)
|
||||
testutils_test.WriteTestKustomizationWith(fSys, kustomizationContentWithComments)
|
||||
mf, err := NewKustomizationFile(fSys)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected Error: %v", err)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package testutils
|
||||
package testutils_test
|
||||
|
||||
import (
|
||||
"sigs.k8s.io/kustomize/v3/api/filesys"
|
||||
|
||||
Reference in New Issue
Block a user