get all supervisor unit tests to pass

Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
This commit is contained in:
Ashish Amarnath
2024-06-28 14:57:03 -07:00
committed by Ryan Richard
parent 3a969a83b7
commit 199562fd05
12 changed files with 355 additions and 178 deletions

View File

@@ -271,6 +271,7 @@ func TestTLSSpecKubeBuilderValidationSupervisor_Parallel(t *testing.T) {
yamlBytes := []byte(fmt.Sprintf(tc.customResourceYaml, env.APIGroupSuffix, resourceName))
require.NoError(t, os.WriteFile(yamlFilepath, yamlBytes, 0600))
//nolint:gosec // this is test code.
cmd := exec.CommandContext(context.Background(), "kubectl", []string{"apply", "-f", yamlFilepath}...)
var stdOut, stdErr bytes.Buffer
cmd.Stdout = &stdOut
@@ -278,6 +279,7 @@ func TestTLSSpecKubeBuilderValidationSupervisor_Parallel(t *testing.T) {
err := cmd.Run()
t.Cleanup(func() {
t.Helper()
//nolint:gosec // this is test code.
require.NoError(t, exec.Command("kubectl", []string{"delete", "--ignore-not-found", "-f", yamlFilepath}...).Run())
})
if tc.expectedError == "" {