-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Utilising is() function instead of [[. Avoiding wildcard for comparison #9916
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is a NOP: if you assign
iid_new=$output
in line 245, it is pretty certain that they will be identical in line 246 :-). What did you intend to check here?PS Glad to see you back! Thank you for this!
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! I was aiming to test that both old and new images' IDs are available in the output. I think, for the root bug #8931 just one is enough. I should have used lines to parse multiple sha outputs. This is currently a simple output check, which is done in previous is(). Or the second one can/may be avoided.
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.
Following correction might be better. Yet, line deletion, with sed, could be handled in a better and configurable way.
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 does not do what you think it does. I think you meant:
However, this still makes me uncomfortable because it relies on
localhost/test:1.0
sorting before$IMAGE
. This is true today, but might not be tomorrow ($IMAGE
might change, or podman's sorting behavior). I would prefer to see the manifest created aszzz.zzz/test:1.0
, withrun_podman images --sort repository
then comparing${lines[0]}
and[1]
sequentially. 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.
Following would work, I think. As long as $IMAGE is defined and test:1.0 is kept unique, it will work. Using
--format '{{.ID}}' --no-trunc IMAGE_NAME
will avoid multi-line output and the need for repository information.What it contributes differently is that iids are collected and checked at different times.
If we were to check pure
podman images
command (which would be an elegant way to test), I agree, what you have suggested would work. However, we started to move away from a regression test. Following might help:This cross checks for sha256 text. Yet, I could not find a way to remove localhost as the repository other than
tag
&rmi
.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.
Did you consider
podman images --sort=created
?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.
It would be useful. However, similarly, tests become susceptible to changes. Question remains, how much we want to diverge from original structure ? I'd definitely prefer that way via which a more concrete testing would be possible.
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.
@aliaslanturk at this point I'm too confused about what we're talking about... if you'd like to rebase and resubmit a new set of diffs, I will gladly take a look at that!
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 am just overthinking it. Sorry :)
Both
--sort=created
and--sort=repository
would work, I believe. Check with repository seems to be more robust. I could re-submit with any one of the two.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.
Your PR, your choice! :)