-
Notifications
You must be signed in to change notification settings - Fork 139
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
prowjob,env: add script to extract env vars from job #3946
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
hack/export-job-env-vars.sh
Outdated
fi | ||
|
||
rg -l "$1" "${PROJECT_INFRA_ROOT}/github/ci/prow-deploy/files/jobs" | \ | ||
xargs yq -r '.periodics[] | select(.name=="periodic-kubevirt-e2e-k8s-1.31-sig-storage-root") | .spec.containers[0].env[] | "export "+.name+"="+.value+ " &&"' | \ |
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.
Will this include env variables that are included in presets? You might have to create the prowjob with hack/mkpj.sh to get all env variables.
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.
good point - this script originated from a quick hack I did for someone asking to replicate the settings of the k/kubevirt lanes.
This PR is just to not lose it though - I could add this as a follow up, WDYT?
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.
To answer your question - no, it obviously will not include the presets :)
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.
Just noticed that this will not work as expected anyways - sorry for the noise, reverted to draft
Signed-off-by: Daniel Hiller <[email protected]>
783ea93
to
3f4aba4
Compare
What this PR does / why we need it:
Adds a script that extract the environment variables from a job and converts them into a set of
export
commands.Example:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer: