-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
e2e-k8s.sh: support alpha features #3023
Conversation
Let's test the modified script first in kubernetes/test-infra#28248 before merging this PR here. |
/assign @BenTheElder |
Discussed more with aojea. I think we should support this. We won't make the go commands drop in replacements for this script and will migrate some core workflows to something else later while leaving this alone. |
@@ -24,7 +24,12 @@ set -o errexit -o nounset -o xtrace | |||
# FOCUS: ginkgo focus regex | |||
# GA_ONLY: true - limit to GA APIs/features as much as possible | |||
# false - (default) APIs and features left at defaults | |||
# | |||
# FEATURE_GATES: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe we should just require a valid yaml map string in the env and not try to do any bash parsing. Same for runtime_config
like FEATURE_GATES='{foo: true}'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, will change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep forgetting that YAML supports JSON and thus everything in a single string with no line breaks 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one small (and perfectly acceptable) loss of functionality when removing the parsing:
For the sake of simplicity, not attempt is made to merge the settings from
GA_ONLY with these new env variables. If GA_ONLY=true is set, the new env
variables are ignored.
Revised commit pushed.
/hold
I still need to test it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested:
- no vars set
- GA_ONLY=true
- FEATURE_GATES/RUNTIME_CONFIG as in sig-instrumentation: additional log output testing kubernetes/test-infra#28248
- all variables
That all works as expected now.
/hold cancel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script is also being used in https://testgrid.k8s.io/sig-instrumentation-tests#kind-json-logging-master through https://github.com/pohly/test-infra/blob/cc00ee53e0bee4a32e3171d86ddfc67438c81219/config/jobs/kubernetes/sig-instrumentation/sig-instrumentation-kind-periodics.yaml#L36-L43
That also works.
9bde011
to
f5ece48
Compare
+1 |
f5ece48
to
b585ec9
Compare
/retest |
# JSON or YAML map injected into featureGates config | ||
feature_gates="${FEATURE_GATES:-{\}}" | ||
# --runtime-config argument value passed to the API server, again as a map | ||
runtime_config="${RUNTIME_CONFIG:-{\}}" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should GA_ONLY and FEATURE_GATES/RUNTIME_CONFIG be mutually exclusive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A prior version of this PR allowed both to be set and used shell code to parse and merge all settings. This was deemed too complex and now the options are mutually exclusive: setting GA_ONLY
overrides FEATURE_GATES/RUNTIME_CONFIG
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I think that's sufficient: someone who has a need to set features individually can also add the "api/alpha":"false", "api/beta":"false"
there. The special case for "certificates.k8s.io/v1beta1":"true"
seems irrelevant now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the GA_ONLY=true case below, can we detect and error if $feature_gates or $runtime_config are anything other than {}
, rather than silently ignoring the envvar-set values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
@BenTheElder, @liggitt: have your questions regarding this PR been addressed? Please take another look. |
/retest |
b585ec9
to
8cfc170
Compare
I force-pushed without any changes to trigger a retest. |
one comment to explicitly make GA_ONLY=true and FEATURE_GATES/RUNTIME_CONFIG use mutually exclusive, then lgtm |
you'll need to rebase as well, the GA_ONLY=true path got cleaned up a couple months ago |
8cfc170
to
65e4dff
Compare
65e4dff
to
c4639bf
Compare
... and rebased. |
hack/ci/e2e-k8s.sh
Outdated
# FEATURE_GATES: | ||
# JSON or YAML encoding of a string/bool map: {"FeatureGateA": true, "FeatureGateB": false} | ||
# Enables or disables feature gates in the entire cluster. | ||
# Ignored when GA_ONLY=true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Ignored when GA_ONLY=true. | |
# Cannot be used when GA_ONLY=true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
hack/ci/e2e-k8s.sh
Outdated
# RUNTIME_CONFIG: | ||
# JSON or YAML encoding of a string/string (!) map: {"apia.example.com/v1alpha1": "true", "apib.example.com/v1beta1": "false"} | ||
# Enables API groups in the apiserver via --runtime-config. | ||
# Ignored when GA_ONLY=true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Ignored when GA_ONLY=true. | |
# Cannot be used when GA_ONLY=true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
FEATURE_GATES and RUNTIME_CONFIG can be set to populate the corresponding kind config and thus modify the cluster. For the sake of simplicity, not attempt is made to merge the settings from GA_ONLY with these new env variables. If GA_ONLY=true is set, the new env variables are ignored.
c4639bf
to
5551b32
Compare
/lgtm |
|
||
case "${GA_ONLY:-false}" in | ||
false) | ||
feature_gates="{}" | ||
runtime_config="{}" | ||
: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
puff, you make me learn things I wish I didn't know they existed 😄 https://stackoverflow.com/a/3224910
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh no, you incentivised me to click it, now I also wish to forget this.
/approve Jordan for final approval (unhold) |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aojea, pohly 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 |
oh, he already did Thanks patrick |
FEATURE_GATES and RUNTIME_CONFIG can be set to populate the corresponding kind config and thus modify the cluster.