Skip to content

Add support for multiple watched namespaces #585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chris-pinola-rf
Copy link

@chris-pinola-rf chris-pinola-rf commented May 30, 2025

Adds support for a new environment variable, WATCH_NAMESPACES, which allows users to specify a comma-separated list of multiple Kubernetes namespaces that the k6 Operator will watch for its CRDs. The existing WATCH_NAMESPACE environment variable only supports a single namespace.

I added a new e2e test modeled after the existing testrun-watch-namespace scenario to test the new environment variable.

I verified that the new (and existing) tests pass locally on my k3d cluster.

I also manually inspected the virtual cluster while the new test was running and confirmed that the TestRun CRD from the invisible namespace was not scheduled, but the other two were:

(⎈|testrun-watch-namespaces:N/A)
$ kubectl get testrun -A
NAMESPACE       NAME        STAGE      AGE   TESTRUNID
invisible       k6-sample              84s   
some-ns         k6-sample   finished   84s   
some-other-ns   k6-sample   finished   84s   

Fixes #267

@CLAassistant
Copy link

CLAassistant commented May 30, 2025

CLA assistant check
All committers have signed the CLA.

@chris-pinola-rf chris-pinola-rf marked this pull request as ready for review May 30, 2025 21:01
@chris-pinola-rf
Copy link
Author

Hi @yorugac - can you please permit the test workflows to run for this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WATCH_NAMESPACE multiple namespaces
2 participants