Skip to content

Commit 762b59f

Browse files
committed
fix: address remaining PR review comments
- Fix safety check logic: check INTEGRATION_TEST_UNSAFE env var before calling t.Fatalf, not after - Fix .gitignore: add coder-logstream-kube and build/ on separate lines
1 parent 5bc0fbf commit 762b59f

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
coder-logstream-kube
12
coder-logstream-kube-*
3+
build/

integration_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func getKubeClient(t *testing.T) kubernetes.Interface {
4242
// Safety check: ensure we're connecting to a KinD cluster.
4343
// KinD clusters run on localhost or have "kind" in the host.
4444
// This prevents accidentally running destructive tests against production clusters.
45-
if config.Host != "" {
45+
if config.Host != "" && os.Getenv("INTEGRATION_TEST_UNSAFE") != "1" {
4646
isKind := strings.Contains(config.Host, "127.0.0.1") ||
4747
strings.Contains(config.Host, "localhost") ||
4848
strings.Contains(strings.ToLower(config.Host), "kind")
@@ -53,11 +53,6 @@ func getKubeClient(t *testing.T) kubernetes.Interface {
5353
}
5454
}
5555

56-
// Allow bypassing the safety check for CI or special cases
57-
if os.Getenv("INTEGRATION_TEST_UNSAFE") == "1" {
58-
t.Log("WARNING: INTEGRATION_TEST_UNSAFE=1 is set, bypassing KinD cluster check")
59-
}
60-
6156
client, err := kubernetes.NewForConfig(config)
6257
require.NoError(t, err, "failed to create kubernetes client")
6358

0 commit comments

Comments
 (0)