Skip to content

Rigid binding to KUBECONFIG env variable causes unit tests failures in some environments #273

@ardaguclu

Description

@ardaguclu

As seen in here https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_openshift-mcp-server/21/pull-ci-openshift-openshift-mcp-server-main-test/1957772596984418304 (PR: openshift#21), CI pipeline in OpenShift automatically sets its KUBECONFIG environment variable. Relying on KUBECONFIG in unit tests cause unexpected failures.

we need to pass fake kubeconfig via StaticConfig instead of modifying KUBECONFIG (i.e. os.Setenv("KUBECONFIG", kubeConfig)) to have a reliable unit tests that work on various environments.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions