Skip to content

Commit 49e244a

Browse files
authored
Merge pull request #826 from jetstack/cp-21164/fix-cyberark-validation-test-ambient-secrets
CP-21164: run e2e-tests since they don't run on PRs from forks
2 parents 42ac4e5 + 3e753e2 commit 49e244a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎pkg/agent/config_test.go‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,11 +1323,19 @@ func Test_ValidateAndCombineConfig_NGTS(t *testing.T) {
13231323

13241324
func TestConfig_CyberArk_Validation(t *testing.T) {
13251325
// Common env setup: ARK_SUBDOMAIN is the only required env var for MachineHub mode.
1326+
// ARK_USERNAME/ARK_SECRET are cleared unconditionally rather than left
1327+
// ambient — CI sets both from real secrets at the job level (for the
1328+
// separate ARK_LIVE_TEST-gated live test), so leaving them untouched here
1329+
// would let real credentials leak into subtests that assert on an empty
1330+
// username/secret. Subtests needing non-empty values set them explicitly
1331+
// after calling setEnv.
13261332
setEnv := func(t *testing.T) {
13271333
t.Helper()
13281334
t.Setenv("POD_NAMESPACE", "venafi")
13291335
t.Setenv("KUBECONFIG", withFile(t, fakeKubeconfig))
13301336
t.Setenv("ARK_SUBDOMAIN", "tlspk")
1337+
t.Setenv("ARK_USERNAME", "")
1338+
t.Setenv("ARK_SECRET", "")
13311339
}
13321340

13331341
// service_id is not required at config-validation time as long as the

0 commit comments

Comments
 (0)