Skip to content
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

Cl2: Make CL2_* envs available in templates #921

Merged
merged 1 commit into from
Dec 10, 2019

Conversation

mm4tt
Copy link
Contributor

@mm4tt mm4tt commented Dec 10, 2019

This will make all env variables starting with CL2_ prefix available in the CL2 template files.

It will allow us to leverage the presets mechanism in cl2 templates and (in some cases) use it instead of relying on cumbersome test override files.

The problem it solves is that sometimes we want to set something for almost all (but not all tests) tests.
Currently, the only way to do that is the create an override file and pass it to many test definitions.
This is arduous for many reasons, e.g. it requires at least 2 PRs (one to perf-test with the override file, second to test-infra) and it requires keeping many places in sync.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 10, 2019
@mm4tt
Copy link
Contributor Author

mm4tt commented Dec 10, 2019

This will be needed for #906

"regexp"
"strings"
"sync"
"text/template"

goErrors "github.com/go-errors/errors"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convention is to use small letters only for aliases

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

In the ideal world we'd have a lint check for such things.
@oxddr, you were looking at some golint alternatives, right? Would it be possible to configure them to detect such things?

Copy link
Contributor

@oxddr oxddr Dec 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enforcing naming convention could be done using the current linter. However we have many violations in our codebase, so I've put the change turning them on on hold.

I will have a look at it again in spare time.

This will make all env variables starting with CL2_ prefix available in the CL2 template files.

It will allow us to leverage the presets mechanism in cl2 templates and use it instead of relying on cumbersome test override files (in some cases).

The problem it solves is that sometimes we want to set something for almost all (but not all tests) tests.
Currently, the only way to do that is the create an override file and pass it to many test definitions.
This is cumbersome for many reasons, e.g. it requires at least 2 PRs (one to perf-test with the override file, second to test-infra).
@wojtek-t
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 10, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mm4tt, wojtek-t

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 972623a into kubernetes:master Dec 10, 2019
k8s-ci-robot added a commit that referenced this pull request Jul 17, 2020
Cl2 env template params - backport #1263, #1145, #998 & #921 (release-1.17)
k8s-ci-robot added a commit that referenced this pull request Jul 17, 2020
Cl2 env template params - backport #1263, #1145, #998 & #921 (release-1.16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants