From 662f0d8cae08b86a0f40d8017c3debb231046aa7 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Wed, 15 Feb 2023 13:56:55 +0100 Subject: [PATCH] tests: rename "kubectl" `setupTestNamespace` As the other version has a different signature, but exists for a different build tag. Resulting in my IDE becoming absolutely confused when I tried to enable both at the same time. Opted for "exec" because this one shells out. Signed-off-by: Hidde Beydals --- cmd/flux/helmrelease_test.go | 2 +- cmd/flux/image_test.go | 2 +- cmd/flux/kustomization_test.go | 2 +- cmd/flux/main_e2e_test.go | 2 +- cmd/flux/source_oci_test.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/flux/helmrelease_test.go b/cmd/flux/helmrelease_test.go index 2596ca48..0686592e 100644 --- a/cmd/flux/helmrelease_test.go +++ b/cmd/flux/helmrelease_test.go @@ -23,7 +23,7 @@ import "testing" func TestHelmReleaseFromGit(t *testing.T) { namespace := allocateNamespace("thrfg") - del, err := setupTestNamespace(namespace) + del, err := execSetupTestNamespace(namespace) if err != nil { t.Fatal(err) } diff --git a/cmd/flux/image_test.go b/cmd/flux/image_test.go index 7b705283..8fe76a1e 100644 --- a/cmd/flux/image_test.go +++ b/cmd/flux/image_test.go @@ -23,7 +23,7 @@ import "testing" func TestImageScanning(t *testing.T) { namespace := allocateNamespace("tis") - del, err := setupTestNamespace(namespace) + del, err := execSetupTestNamespace(namespace) if err != nil { t.Fatal(err) } diff --git a/cmd/flux/kustomization_test.go b/cmd/flux/kustomization_test.go index a08936f3..b76022f3 100644 --- a/cmd/flux/kustomization_test.go +++ b/cmd/flux/kustomization_test.go @@ -23,7 +23,7 @@ import "testing" func TestKustomizationFromGit(t *testing.T) { namespace := allocateNamespace("tkfg") - del, err := setupTestNamespace(namespace) + del, err := execSetupTestNamespace(namespace) if err != nil { t.Fatal(err) } diff --git a/cmd/flux/main_e2e_test.go b/cmd/flux/main_e2e_test.go index 20a51c5f..22e27fdf 100644 --- a/cmd/flux/main_e2e_test.go +++ b/cmd/flux/main_e2e_test.go @@ -65,7 +65,7 @@ func TestMain(m *testing.M) { os.Exit(code) } -func setupTestNamespace(namespace string) (func(), error) { +func execSetupTestNamespace(namespace string) (func(), error) { kubectlArgs := []string{"create", "namespace", namespace} _, err := utils.ExecKubectlCommand(context.TODO(), utils.ModeStderrOS, *kubeconfigArgs.KubeConfig, *kubeconfigArgs.Context, kubectlArgs...) if err != nil { diff --git a/cmd/flux/source_oci_test.go b/cmd/flux/source_oci_test.go index 12afa957..051af4f8 100644 --- a/cmd/flux/source_oci_test.go +++ b/cmd/flux/source_oci_test.go @@ -25,7 +25,7 @@ import ( func TestSourceOCI(t *testing.T) { namespace := allocateNamespace("oci-test") - del, err := setupTestNamespace(namespace) + del, err := execSetupTestNamespace(namespace) if err != nil { t.Fatal(err) }