-
Notifications
You must be signed in to change notification settings - Fork 138
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
Add script to check outdated image references #2199
base: master
Are you sure you want to change the base?
Add script to check outdated image references #2199
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rbaturov 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 |
/test all |
hack/verify-images-updated.sh
Outdated
@@ -0,0 +1,56 @@ | |||
#!/bin/bash | |||
|
|||
# Purpose: This script verifies that no files in a release branch contain references to images from the previous release version. |
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 curious why you are limiting this to the previous release version? Why not check for any release that doesn't match the current release. For example, if the current release is release-4.17 fail on anything matching "release-4.*" where * isn't "17".
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 was thinking of implementing it by using a regex pattern like 4.*
to match versions that are not equal to the current release. However, I’m concerned that this approach might lead to false positives since the 4.* pattern is too broad. There might be a smarter way to handle this—I’m still thinking it through, and this is just a draft. 😊
However, since I am aligning the master branch in all these references to the new release branch (4.19), there should theoretically be no scenario in the future where we skip two or more versions. This is ensured by the script, which would fail the CI and prevent such a situation.
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 what cases would the "release-4.*" pattern be too broad? I still think checking for any release that doesn't match the current one is a good idea.
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.
@bartwensley we are grep
-ing "4.* " and not "release-4.* ", as most of the image references (if not all) don't have the release
prefix. Look here for example.
"4.*" is a pattern which will potentially fail us on false positives.
a87f554
to
9320f96
Compare
/test all |
/retest |
|
||
x="${BASH_REMATCH[1]}" | ||
y="${BASH_REMATCH[2]}" | ||
previous_version="$x.$((y - 1))" # Example: 4.16 for branch release-4.17 |
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.
What if the branch was significantly outdated and contained references older than the previous release?
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.
This won't be possible, look at my comment to Bart. Since we aligned the master branch to reference 4.19 images and assuming having this script this would be impossible
- Detects release branch naming (e.g., `release-x.y`) and identifies the previous version. - Scans specified files for references to the previous version. - Ensures files are updated for the current release branch, aiding consistency. This script helps developers creating a new branch to remember updating image references. Signed-off-by: Ronny Baturov <[email protected]>
9320f96
to
9429de9
Compare
/retest |
@rbaturov: The following tests failed, say
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. |
This script ensures that developers update image references when creating a new branch.
How it works:
Note: I have prepared a POC to simulate this working in #2212.
This is the failure results
depends on:
#2168