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
tests: Use a function to build path for utility images #11540
Conversation
ca9f522
to
0eb48d6
Compare
The only other place my grep found IMHO, PR is good as is so |
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.
Thank you!
tests/util/images.go
Outdated
"kubevirt.io/kubevirt/tests/flags" | ||
) | ||
|
||
func GetUtilityImageFromRegistry(imageName string) string { |
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 would prefer not to see additions under any generic util
package.
Can this be placed in a more focused package?
E.g. libimageregistry
or libregistry
.
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.
@EdDev, what do you think about adding the function to libinfra
instead? Does it look like a suitable place? I do not have a strong opinion on that, tbh, so I am also fine with creating a new package.
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.
If I only knew what this libinfra
represents.
Based on git history, it got helpers from a prev test file named infra_test.go
.
Do you think the image registry is related somehow? I just do not know.
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.
@dhiller , can you please suggest what this libinfra
represents exactly?
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.
My guess was that it stand for infrastructure
stuff. Currently, it includes smth related to certificates, http, node-labeler, etc. Just assumed that utility container images might fall into the infra category as well.
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.
Looks like I am not alone with that pain
kubevirt/tests/migration/eviction_strategy.go
Lines 257 to 261 in 9db1b13
// TODO: move this function in `libnode` package. First resolve cycle in dependency graph | |
// .-> //tests/testsuite:go_default_library | |
// | //tests/libnode:go_default_library | |
// | //tests/clientcmd:go_default_library | |
// `-- //tests/testsuite:go_default_library |
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.
Looks like I am not alone with that pain
kubevirt/tests/migration/eviction_strategy.go
Lines 257 to 261 in 9db1b13
// TODO: move this function in `libnode` package. First resolve cycle in dependency graph // .-> //tests/testsuite:go_default_library // | //tests/libnode:go_default_library // | //tests/clientcmd:go_default_library // `-- //tests/testsuite:go_default_library
Here I am 🙂 🙋♂️
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.
@vasiliy-ul , can you try and place it in the previously suggested new package?
libimageregistry
or libregistry
?
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.
Well, I tried to fix the cycle. But eventually faced a few more. There is a need to decouple a lot of stuff to fully address the problem, and the refactoring turns out pretty messy at the end. So yeah, probably for now if that is okay, I will go with a new libregistry
package.
I will take one more look and probably open a follow-up PR with some attempts to move things around in the hope to make things a bit better.
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.
@dhiller , can you please suggest what this
libinfra
represents exactly?
As you guessed right, the libinfra
was created to collect things that originated from the slicing of tests/infrastructure.go into several files.
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.
/approve
/hold
@EdDev please unhold if you agree.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: xpivarc 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 |
Required labels detected, running phase 2 presubmits: |
0eb48d6
to
06f260f
Compare
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.
Thank you!
Required labels detected, running phase 2 presubmits: |
/unhold |
06f260f
to
2d54a74
Compare
Required labels detected, running phase 2 presubmits: |
PR needs rebase. 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/test-infra repository. |
This is a common function to build full registry paths using the provided image name and respecting the utility repo prefix and tag. Signed-off-by: Vasiliy Ulyanov <vulyanov@suse.de>
Signed-off-by: Vasiliy Ulyanov <vulyanov@suse.de>
Signed-off-by: Vasiliy Ulyanov <vulyanov@suse.de>
2d54a74
to
f4cce54
Compare
Rebased the PR. No new changes. |
Required labels detected, running phase 2 presubmits: |
@vasiliy-ul: The following test failed, say
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/test-infra repository. I understand the commands that are listed here. |
/retest-required |
What this PR does
The PR introduces a common function to build full registry paths using the provided image name and respecting the utility repo prefix and tag.
Before this PR: image paths were hardcoded in some places without taking into account the
flags
(i.e. repo prefix and tag).After this PR: common function is used. No more hardcoding.
Fixes #
Why we need it and why it was done in this way
The following tradeoffs were made:
The following alternatives were considered:
Links to places where the discussion took place:
Special notes for your reviewer
Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
Release note