Hi @nocgod,
Welcome to the forum!
In case of k6-operator’s usage, test-wide tags can be passed as part of arguments field. Options struct in JS generally works with k6 too but has tricks described in this issue.
I’m not sure what you meant by “adding to k6 archive command” but your second attempt should have worked, so long as env var substitution happened correctly:
spec.arguments command --tag pod=$HOSTNAME didnt play out as well.
IIRC it wasn’t interpolated into the command string, I had the $HOSTNAME as value for the pod tag
I needed it to implement some logic (see metrics per pod) which was not available in 0.0.7, but I’ve since updated to 0.0.8-rc3 which has the tags I needed instance_id and job_name.
Got it, that makes sense. Glad to hear that you resolved it with built-in tags
Your question made me double-check what Kubernetes is supposed to support in such cases and it seems the “standard” way to pass env vars to Pod is with specific format:
And this format isn’t possible in k6-operator, due to escaped double quotes causing a k6 error This is not easy to fix at the moment and I’m inclined to treat this as a potential feature request - will open an issue. Thanks for your question and for helping to locate this!