Skip to content

Add a cloud section to TestRun CRD #668

@yorugac

Description

@yorugac

Feature Description

So far, we have been inserting bits specific for Grafana Cloud k6 into TestRun definition rather arbitrarily. For example, we have 2 fields at a top-level of .spec which are reserved for PLZ and not meant to be used by anything else.

Additionally, k6 OSS considers --out cloud format deprecated, so cloud output in the TestRun should try to support that direction and new format. Problem: currently, cloud output in k6-operator depends on passing --out cloud as part of .spec.arguments, so it's relying on a deprecated format of the command.

Finally, in the future, there can be other GCk6 specific parameters we might need to pass to the TestRun CRD.

Suggested Solution (optional)

To improve structure of the TestRun CRD and facilitate migration to the k6 cloud run --local-execution, implement the following changes:

apiVersion: k6.io/v1alpha1
kind: TestRun
metadata:
  name: test
spec:
  cloud: # GCk6 reserved fields
    stream: true # a new way to indicate a cloud output mode in k6-operator
    token: .. # for PLZ (for now)
    testRunId: ... # for PLZ

As a second iteration, it might make sense to consider .spec.cloud.token as token for cloud output tests as well.

Note This must be a backwards-compatible change. So basically, k6-operator will need to support 2 possible ways to indicate a cloud output test, as well as support both formats of PLZ tests (with cloud section and without it). Revisit maintaining both spec closer to k6-operator v2.0.0.

Already existing or connected issues / PRs (optional)

Not yet set in stone, but this might be a prerequisite for upgrading TestRun CRD version #623

Metadata

Metadata

Assignees

No one assigned

    Labels

    GCk6pertaining to cloud test runs and communication between k6-operator and GCk6enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions