✨ New features
To bring PrivateLoadZone mode closer to how other modes of testing in GCk6 work, we've expanded the API and what is configured through it. (issue)
.spec.args in TestRun CRD
To fully accommodate the above change, a new field .spec.args was added to a TestRun CRD (PR): it takes an array of strings as arguments to k6, which allows setting arbitrary values as tags and env vars of the k6 process. This is, in effect, a way to bypass the complex tricks around string escaping and the inability to set certain values in .spec.arguments (issue), which was a fundamental limitation of that configuration type. The new way to set k6 arguments in TestRun CRD looks like this:
apiVersion: k6.io/v1alpha1
kind: TestRun
metadata:
name: k6-sample-with-args
spec:
parallelism: 2
script:
configMap:
name: k6-test
file: test.js
args:
- --tag
- note=arbitrary values are possible "here" # passed to k6 as is
- -e
- PRICE_LABEL=$$100 # passed to k6 as is
- -e
- BASE_URL=$(BASE_URL) # Kubernetes env var will be expanded
runner:
env:
- name: BASE_URL
value: https://test.k6.ioWhen .spec.args is present, it overrides .spec.arguments. But if .spec.args is empty, the .spec.arguments work as before, so this change is backwards compatible.
The PLZ tests were switched to using the .spec.args under the hood.
Warning
Please make sure to update CRD definitions properly during upgrade, to avoid any issues.
🐛 Bug fixes
We finally have a fix for trying to create start / stop jobs more than once (issue). It has been spamming logs with false positive messages. Thanks, @Guflly!
📦 Helm
The bug with invalid lengthy names during Helm chart installation was solved by deliberately trimming all resource names to 63 characters. Thanks, @moko-poi!
Warning
If you have been using a lengthy release name with service.enabled: false, you might encounter the rename of Deployment as part of this upgrade. On a healthy cluster, it shouldn't be an issue. But it makes sense to keep an eye on observability setup, if any: watch out if it picks up the change in name correctly in this case.
🛠️ Maintenance
kube-api-linter was added as a custom plugin to our golangci-lint workflow, with some basic rules enabled already. Thanks, @moko-poi!
There was a cleanup of potential bugs with shared state around the GCk6 client in the TestRun controller. That should make k6-operator more reliable at scale.
A small refactor to improve readability of the default values in the code (issue). Thanks, @moko-poi!
Key dependencies update:
- Golang bumped to 1.26 (we're almost at the 1.27 release now)
- Kubernetes group bumped to 1.36
- controller-runtime bumped to 0.24.1
- go.k6.io/k6/v2 bumped to v2.2.0
Full changelog: v1.5.0...v1.6.0