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

fix(ci): reorder gke tags and labels variable expansions #1522

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

BradLugo
Copy link
Contributor

Description

If you're really unlucky, you can get a . at the end of the tags variable, which will be substituted for - after we replace the last - with x. GKE doesn't allow for - at the end of the string, which is why we change the last -.

See openshift/release#47789 for a real-world example of this problem.

These changes reorders the shell expansion so we first replace all . with -, then delete the last -.

Cherry-picked from #1513

Testing Performed

Testing the variable expansions:

# Before
❯ JOB_NAME=rehearse-47789-pull-ci-stackrox-scanner-release-2.32-e2e-tests
❯ tags="stackrox-ci"
❯ tags="${tags},stackrox-ci-${JOB_NAME:0:50}"echo "${tags}"
stackrox-ci,stackrox-ci-rehearse-47789-pull-ci-stackrox-scanner-release-2.
❯ tags="${tags/%-/x}"echo "${tags}"
stackrox-ci,stackrox-ci-rehearse-47789-pull-ci-stackrox-scanner-release-2.
❯ tags="${tags//./-}"echo "${tags}"
stackrox-ci,stackrox-ci-rehearse-47789-pull-ci-stackrox-scanner-release-2-

# After
❯ JOB_NAME=rehearse-47789-pull-ci-stackrox-scanner-release-2.32-e2e-tests
❯ tags="stackrox-ci"
❯ tags="${tags},stackrox-ci-${JOB_NAME:0:50}"
❯ tags="${tags//./-}"
❯ tags="${tags/%-/}"echo "${tags}"
stackrox-ci,stackrox-ci-rehearse-47789-pull-ci-stackrox-scanner-release-2

@BradLugo BradLugo requested a review from a team May 21, 2024 17:26
Copy link

openshift-ci bot commented May 21, 2024

@BradLugo: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-tests 1df1326 link false /test e2e-tests
ci/prow/store-genesis-dump 1df1326 link false /test store-genesis-dump
ci/prow/store-db-dump 1df1326 link false /test store-db-dump
ci/prow/push-images 1df1326 link true /test push-images
ci/prow/slim-e2e-tests 1df1326 link false /test slim-e2e-tests
ci/prow/images 1df1326 link true /test images
ci/prow/style-checks 1df1326 link true /test style-checks

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@BradLugo BradLugo merged commit 12cef04 into release-2.33 Jun 13, 2024
24 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants