Merge pull request #3592 from fluxcd/fix-golden-files
tests: only provide template values when used
This commit is contained in:
@@ -54,7 +54,7 @@ data:
|
|||||||
tmpFile, err := saveReaderToFile(strings.NewReader(tt.string))
|
tmpFile, err := saveReaderToFile(strings.NewReader(tt.string))
|
||||||
g.Expect(err).To(BeNil())
|
g.Expect(err).To(BeNil())
|
||||||
|
|
||||||
defer os.Remove(tmpFile)
|
t.Cleanup(func() { _ = os.Remove(tmpFile) })
|
||||||
|
|
||||||
b, err := os.ReadFile(tmpFile)
|
b, err := os.ReadFile(tmpFile)
|
||||||
if tt.expectErr {
|
if tt.expectErr {
|
||||||
|
|||||||
@@ -171,8 +171,7 @@ spec:
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
t.Cleanup(func() { _ = os.Remove("./testdata/build-kustomization/podinfo.yaml") })
|
||||||
defer os.Remove("./testdata/build-kustomization/podinfo.yaml")
|
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|||||||
@@ -109,7 +109,9 @@ func TestDiffKustomization(t *testing.T) {
|
|||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
if tt.objectFile != "" {
|
if tt.objectFile != "" {
|
||||||
resourceManager.ApplyAll(context.Background(), createObjectFromFile(tt.objectFile, tmpl, t), ssa.DefaultApplyOptions())
|
if _, err := resourceManager.ApplyAll(context.Background(), createObjectFromFile(tt.objectFile, tmpl, t), ssa.DefaultApplyOptions()); err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cmd := cmdTestCase{
|
cmd := cmdTestCase{
|
||||||
args: tt.args + " -n " + tmpl["fluxns"],
|
args: tt.args + " -n " + tmpl["fluxns"],
|
||||||
|
|||||||
@@ -8,78 +8,92 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestExport(t *testing.T) {
|
func TestExport(t *testing.T) {
|
||||||
|
namespace := allocateNamespace("flux-system")
|
||||||
|
|
||||||
|
objectFile := "testdata/export/objects.yaml"
|
||||||
|
tmpl := map[string]string{
|
||||||
|
"fluxns": namespace,
|
||||||
|
}
|
||||||
|
testEnv.CreateObjectFile(objectFile, tmpl, t)
|
||||||
|
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
name string
|
name string
|
||||||
arg string
|
arg string
|
||||||
goldenFile string
|
goldenFile string
|
||||||
|
tmpl map[string]string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"alert-provider",
|
"alert-provider",
|
||||||
"export alert-provider slack",
|
"export alert-provider slack",
|
||||||
"testdata/export/provider.yaml",
|
"testdata/export/provider.yaml",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alert",
|
"alert",
|
||||||
"export alert flux-system",
|
"export alert flux-system",
|
||||||
"testdata/export/alert.yaml",
|
"testdata/export/alert.yaml",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"image policy",
|
"image policy",
|
||||||
"export image policy flux-system",
|
"export image policy flux-system",
|
||||||
"testdata/export/image-policy.yaml",
|
"testdata/export/image-policy.yaml",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"image repository",
|
"image repository",
|
||||||
"export image repository flux-system",
|
"export image repository flux-system",
|
||||||
"testdata/export/image-repo.yaml",
|
"testdata/export/image-repo.yaml",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"image update",
|
"image update",
|
||||||
"export image update flux-system",
|
"export image update flux-system",
|
||||||
"testdata/export/image-update.yaml",
|
"testdata/export/image-update.yaml",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source git",
|
"source git",
|
||||||
"export source git flux-system",
|
"export source git flux-system",
|
||||||
"testdata/export/git-repo.yaml",
|
"testdata/export/git-repo.yaml",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source helm",
|
"source helm",
|
||||||
"export source helm flux-system",
|
"export source helm flux-system",
|
||||||
"testdata/export/helm-repo.yaml",
|
"testdata/export/helm-repo.yaml",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"receiver",
|
"receiver",
|
||||||
"export receiver flux-system",
|
"export receiver flux-system",
|
||||||
"testdata/export/receiver.yaml",
|
"testdata/export/receiver.yaml",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kustomization",
|
"kustomization",
|
||||||
"export kustomization flux-system",
|
"export kustomization flux-system",
|
||||||
"testdata/export/ks.yaml",
|
"testdata/export/ks.yaml",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"helmrelease",
|
"helmrelease",
|
||||||
"export helmrelease flux-system",
|
"export helmrelease flux-system",
|
||||||
"testdata/export/helm-release.yaml",
|
"testdata/export/helm-release.yaml",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"bucket",
|
"bucket",
|
||||||
"export source bucket flux-system",
|
"export source bucket flux-system",
|
||||||
"testdata/export/bucket.yaml",
|
"testdata/export/bucket.yaml",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
objectFile := "testdata/export/objects.yaml"
|
|
||||||
tmpl := map[string]string{
|
|
||||||
"fluxns": allocateNamespace("flux-system"),
|
|
||||||
}
|
|
||||||
testEnv.CreateObjectFile(objectFile, tmpl, t)
|
|
||||||
|
|
||||||
for _, tt := range cases {
|
for _, tt := range cases {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
cmd := cmdTestCase{
|
cmd := cmdTestCase{
|
||||||
args: tt.arg + " -n=" + tmpl["fluxns"],
|
args: tt.arg + " -n=" + namespace,
|
||||||
assert: assertGoldenTemplateFile(tt.goldenFile, tmpl),
|
assert: assertGoldenTemplateFile(tt.goldenFile, tmpl),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,51 +22,61 @@ package main
|
|||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
func TestHelmReleaseFromGit(t *testing.T) {
|
func TestHelmReleaseFromGit(t *testing.T) {
|
||||||
|
namespace := allocateNamespace("thrfg")
|
||||||
|
del, err := execSetupTestNamespace(namespace)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
t.Cleanup(del)
|
||||||
|
|
||||||
|
tmpl := map[string]string{"ns": namespace}
|
||||||
|
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
args string
|
args string
|
||||||
goldenFile string
|
goldenFile string
|
||||||
|
tmpl map[string]string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"create source git thrfg --url=https://github.com/stefanprodan/podinfo --branch=main --tag=6.0.0",
|
"create source git thrfg --url=https://github.com/stefanprodan/podinfo --branch=main --tag=6.0.0",
|
||||||
"testdata/helmrelease/create_source_git.golden",
|
"testdata/helmrelease/create_source_git.golden",
|
||||||
|
nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"create helmrelease thrfg --source=GitRepository/thrfg --chart=./charts/podinfo",
|
"create helmrelease thrfg --source=GitRepository/thrfg --chart=./charts/podinfo",
|
||||||
"testdata/helmrelease/create_helmrelease_from_git.golden",
|
"testdata/helmrelease/create_helmrelease_from_git.golden",
|
||||||
|
nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"get helmrelease thrfg",
|
"get helmrelease thrfg",
|
||||||
"testdata/helmrelease/get_helmrelease_from_git.golden",
|
"testdata/helmrelease/get_helmrelease_from_git.golden",
|
||||||
|
nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"reconcile helmrelease thrfg --with-source",
|
"reconcile helmrelease thrfg --with-source",
|
||||||
"testdata/helmrelease/reconcile_helmrelease_from_git.golden",
|
"testdata/helmrelease/reconcile_helmrelease_from_git.golden",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"suspend helmrelease thrfg",
|
"suspend helmrelease thrfg",
|
||||||
"testdata/helmrelease/suspend_helmrelease_from_git.golden",
|
"testdata/helmrelease/suspend_helmrelease_from_git.golden",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resume helmrelease thrfg",
|
"resume helmrelease thrfg",
|
||||||
"testdata/helmrelease/resume_helmrelease_from_git.golden",
|
"testdata/helmrelease/resume_helmrelease_from_git.golden",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"delete helmrelease thrfg --silent",
|
"delete helmrelease thrfg --silent",
|
||||||
"testdata/helmrelease/delete_helmrelease_from_git.golden",
|
"testdata/helmrelease/delete_helmrelease_from_git.golden",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace := allocateNamespace("thrfg")
|
|
||||||
del, err := setupTestNamespace(namespace)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
defer del()
|
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
cmd := cmdTestCase{
|
cmd := cmdTestCase{
|
||||||
args: tc.args + " -n=" + namespace,
|
args: tc.args + " -n=" + namespace,
|
||||||
assert: assertGoldenTemplateFile(tc.goldenFile, map[string]string{"ns": namespace}),
|
assert: assertGoldenTemplateFile(tc.goldenFile, tc.tmpl),
|
||||||
}
|
}
|
||||||
cmd.runTestCmd(t)
|
cmd.runTestCmd(t)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,13 @@ package main
|
|||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
func TestImageScanning(t *testing.T) {
|
func TestImageScanning(t *testing.T) {
|
||||||
|
namespace := allocateNamespace("tis")
|
||||||
|
del, err := execSetupTestNamespace(namespace)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
t.Cleanup(del)
|
||||||
|
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
args string
|
args string
|
||||||
goldenFile string
|
goldenFile string
|
||||||
@@ -48,13 +55,6 @@ func TestImageScanning(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace := allocateNamespace("tis")
|
|
||||||
del, err := setupTestNamespace(namespace)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
defer del()
|
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
cmd := cmdTestCase{
|
cmd := cmdTestCase{
|
||||||
args: tc.args + " -n=" + namespace,
|
args: tc.args + " -n=" + namespace,
|
||||||
|
|||||||
@@ -25,9 +25,7 @@ func TestInstall(t *testing.T) {
|
|||||||
// Given that this test uses an invalid namespace, it ensures
|
// Given that this test uses an invalid namespace, it ensures
|
||||||
// to restore whatever value it had previously.
|
// to restore whatever value it had previously.
|
||||||
currentNamespace := *kubeconfigArgs.Namespace
|
currentNamespace := *kubeconfigArgs.Namespace
|
||||||
defer func() {
|
t.Cleanup(func() { *kubeconfigArgs.Namespace = currentNamespace })
|
||||||
*kubeconfigArgs.Namespace = currentNamespace
|
|
||||||
}()
|
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
|
|||||||
@@ -22,51 +22,61 @@ package main
|
|||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
func TestKustomizationFromGit(t *testing.T) {
|
func TestKustomizationFromGit(t *testing.T) {
|
||||||
|
namespace := allocateNamespace("tkfg")
|
||||||
|
del, err := execSetupTestNamespace(namespace)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
t.Cleanup(del)
|
||||||
|
|
||||||
|
tmpl := map[string]string{"ns": namespace}
|
||||||
|
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
args string
|
args string
|
||||||
goldenFile string
|
goldenFile string
|
||||||
|
tmpl map[string]string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"create source git tkfg --url=https://github.com/stefanprodan/podinfo --branch=main --tag=6.0.0",
|
"create source git tkfg --url=https://github.com/stefanprodan/podinfo --branch=main --tag=6.0.0",
|
||||||
"testdata/kustomization/create_source_git.golden",
|
"testdata/kustomization/create_source_git.golden",
|
||||||
|
nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"create kustomization tkfg --source=tkfg --path=./deploy/overlays/dev --prune=true --interval=5m --health-check=Deployment/frontend.dev --health-check=Deployment/backend.dev --health-check-timeout=3m",
|
"create kustomization tkfg --source=tkfg --path=./deploy/overlays/dev --prune=true --interval=5m --health-check=Deployment/frontend.dev --health-check=Deployment/backend.dev --health-check-timeout=3m",
|
||||||
"testdata/kustomization/create_kustomization_from_git.golden",
|
"testdata/kustomization/create_kustomization_from_git.golden",
|
||||||
|
nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"get kustomization tkfg",
|
"get kustomization tkfg",
|
||||||
"testdata/kustomization/get_kustomization_from_git.golden",
|
"testdata/kustomization/get_kustomization_from_git.golden",
|
||||||
|
nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"reconcile kustomization tkfg --with-source",
|
"reconcile kustomization tkfg --with-source",
|
||||||
"testdata/kustomization/reconcile_kustomization_from_git.golden",
|
"testdata/kustomization/reconcile_kustomization_from_git.golden",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"suspend kustomization tkfg",
|
"suspend kustomization tkfg",
|
||||||
"testdata/kustomization/suspend_kustomization_from_git.golden",
|
"testdata/kustomization/suspend_kustomization_from_git.golden",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resume kustomization tkfg",
|
"resume kustomization tkfg",
|
||||||
"testdata/kustomization/resume_kustomization_from_git.golden",
|
"testdata/kustomization/resume_kustomization_from_git.golden",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"delete kustomization tkfg --silent",
|
"delete kustomization tkfg --silent",
|
||||||
"testdata/kustomization/delete_kustomization_from_git.golden",
|
"testdata/kustomization/delete_kustomization_from_git.golden",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace := allocateNamespace("tkfg")
|
|
||||||
del, err := setupTestNamespace(namespace)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
defer del()
|
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
cmd := cmdTestCase{
|
cmd := cmdTestCase{
|
||||||
args: tc.args + " -n=" + namespace,
|
args: tc.args + " -n=" + namespace,
|
||||||
assert: assertGoldenTemplateFile(tc.goldenFile, map[string]string{"ns": namespace}),
|
assert: assertGoldenTemplateFile(tc.goldenFile, tc.tmpl),
|
||||||
}
|
}
|
||||||
cmd.runTestCmd(t)
|
cmd.runTestCmd(t)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ func TestMain(m *testing.M) {
|
|||||||
os.Exit(code)
|
os.Exit(code)
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupTestNamespace(namespace string) (func(), error) {
|
func execSetupTestNamespace(namespace string) (func(), error) {
|
||||||
kubectlArgs := []string{"create", "namespace", namespace}
|
kubectlArgs := []string{"create", "namespace", namespace}
|
||||||
_, err := utils.ExecKubectlCommand(context.TODO(), utils.ModeStderrOS, *kubeconfigArgs.KubeConfig, *kubeconfigArgs.Context, kubectlArgs...)
|
_, err := utils.ExecKubectlCommand(context.TODO(), utils.ModeStderrOS, *kubeconfigArgs.KubeConfig, *kubeconfigArgs.Context, kubectlArgs...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -24,47 +24,56 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestSourceOCI(t *testing.T) {
|
func TestSourceOCI(t *testing.T) {
|
||||||
|
namespace := allocateNamespace("oci-test")
|
||||||
|
del, err := execSetupTestNamespace(namespace)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
t.Cleanup(del)
|
||||||
|
|
||||||
|
tmpl := map[string]string{"ns": namespace}
|
||||||
|
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
args string
|
args string
|
||||||
goldenFile string
|
goldenFile string
|
||||||
|
tmpl map[string]string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"create source oci thrfg --url=oci://ghcr.io/stefanprodan/manifests/podinfo --tag=6.1.6 --interval 10m",
|
"create source oci thrfg --url=oci://ghcr.io/stefanprodan/manifests/podinfo --tag=6.1.6 --interval 10m",
|
||||||
"testdata/oci/create_source_oci.golden",
|
"testdata/oci/create_source_oci.golden",
|
||||||
|
nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"get source oci thrfg",
|
"get source oci thrfg",
|
||||||
"testdata/oci/get_oci.golden",
|
"testdata/oci/get_oci.golden",
|
||||||
|
nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"reconcile source oci thrfg",
|
"reconcile source oci thrfg",
|
||||||
"testdata/oci/reconcile_oci.golden",
|
"testdata/oci/reconcile_oci.golden",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"suspend source oci thrfg",
|
"suspend source oci thrfg",
|
||||||
"testdata/oci/suspend_oci.golden",
|
"testdata/oci/suspend_oci.golden",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resume source oci thrfg",
|
"resume source oci thrfg",
|
||||||
"testdata/oci/resume_oci.golden",
|
"testdata/oci/resume_oci.golden",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"delete source oci thrfg --silent",
|
"delete source oci thrfg --silent",
|
||||||
"testdata/oci/delete_oci.golden",
|
"testdata/oci/delete_oci.golden",
|
||||||
|
tmpl,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace := allocateNamespace("oci-test")
|
|
||||||
del, err := setupTestNamespace(namespace)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
defer del()
|
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
cmd := cmdTestCase{
|
cmd := cmdTestCase{
|
||||||
args: tc.args + " -n=" + namespace,
|
args: tc.args + " -n=" + namespace,
|
||||||
assert: assertGoldenTemplateFile(tc.goldenFile, map[string]string{"ns": namespace}),
|
assert: assertGoldenTemplateFile(tc.goldenFile, tc.tmpl),
|
||||||
}
|
}
|
||||||
cmd.runTestCmd(t)
|
cmd.runTestCmd(t)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ limitations under the License.
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
@@ -135,16 +134,9 @@ func TestExtractCRDs(t *testing.T) {
|
|||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
// Create temporary directory to write the result in.
|
outManifestPath := filepath.Join(t.TempDir(), "crds.yaml")
|
||||||
dir, err := os.MkdirTemp("", "flux-TestExtractCRDs")
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("failed to create temporary directory: %v", err)
|
|
||||||
}
|
|
||||||
defer os.RemoveAll(dir)
|
|
||||||
|
|
||||||
outManifestPath := filepath.Join(dir, "crds.yaml")
|
|
||||||
inManifestPath := filepath.Join("testdata", tt.inManifestFile)
|
inManifestPath := filepath.Join("testdata", tt.inManifestFile)
|
||||||
if err = ExtractCRDs(inManifestPath, outManifestPath); (err != nil) != tt.expectErr {
|
if err := ExtractCRDs(inManifestPath, outManifestPath); (err != nil) != tt.expectErr {
|
||||||
t.Errorf("ExtractCRDs() error = %v, expectErr %v", err, tt.expectErr)
|
t.Errorf("ExtractCRDs() error = %v, expectErr %v", err, tt.expectErr)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user