Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/agent/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1323,11 +1323,19 @@ func Test_ValidateAndCombineConfig_NGTS(t *testing.T) {

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

// service_id is not required at config-validation time as long as the
Expand Down
Loading