-
Notifications
You must be signed in to change notification settings - Fork 15
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 an ability to configure digest evaluation method #79
Conversation
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.
LGTM. I wonder if we can just use podman inspect
in all cases (i.e. make register_catalogsource
just do what register_catalogsource_for_cpaas
does here)
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 minor comments but I'll approve ahead of time for when they're fixed
Makefile
Outdated
IMAGE=$$(podman inspect $(INDEX_IMG) | jq ".[].RepoDigests[0]" -r) | ||
|
||
# replace references of catalogsource img with your image | ||
sed -i.bak -e "s|quay.io/wto/web-terminal-operator-index:next|$${IMAGE}|g" ./catalog-source.yaml |
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 think we can technically extract lines 89-97 to a script and call them from here and from line 75 (since both of those parts are doing essentially the same thing) but it's up to you
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'd vote against, but mostly because I also touch these lines in #80 and don't want to fix conflicts 😄
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.
As for me it makes sense to keep the previous command with skopeo inspect
. Because it does not require pulling of images and potentially it can save space on a file system and avoid to get a long list of images, if a user does not want to pull images.
But if we know that this operation can take a long time - we have alternatives. Actually I used both commands register_catalogsource
(with scopeo) and register_catalogsource_for_cpaas
(with podman). It just depended on an image which I used. Mostly, if it was not IIB - I used register_catalogsource . Because it worked quickly and did not pull images on the filesystem.
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.
@musienko-maxim
well, I don't think it should be a dedicated rule for cpass, but I'm OK with leaving a choice.
Maybe it should be one rule but with an ability to configure impl for digest evaluation, like
GET_DIGEST_WITH='skopeo'
make register_catalogsource
@amisevsk I believe Maxim won't be against if you in your PR just onboard the idea to have an ability evaluate digest with podman
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.
Add the GET_DIGEST_WITH env for managing ways of obtaining Didgest (skopeo, podman, docker), remove register_catalogsource_for_cpaas
target.
|
||
# replace references of catalogsource img with your image | ||
sed -i.bak -e "s|quay.io/wto/web-terminal-operator-index:next|$${INDEX_IMG_DIGEST}|g" ./catalog-source.yaml | ||
echo ">>>>>>>catalogsource content:>>>>>>>" |
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.
Do you want to have such output all the time, or it's just what you used for testing?
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 want to save catlog source content, because i need it for the investigating problem with mirroring the IIB images on brew. The problem still actual and resolved partially. After solving all problems we can remove it.
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.
Maybe we could configure that behavior with VERBOSE env var, but that's not a requirement at all. It's small enough to display it by default.
|
||
# replace references of catalogsource img with your image | ||
sed -i.bak -e "s|quay.io/wto/web-terminal-operator-index:next|$${INDEX_IMG_DIGEST}|g" ./catalog-source.yaml | ||
echo ">>>>>>>catalogsource content:>>>>>>>" |
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.
Maybe we could configure that behavior with VERBOSE env var, but that's not a requirement at all. It's small enough to display it by default.
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.
LGTM
What does this PR do?
In some specific cases the command can perform too long. For example: when we try to get Index Didgest from a IIB image. For instance: invokation command like
skopeo inspect docker://registry-proxy.engineering.redhat.com/rh-osbs/iib:77245 --debug
can take about 20-30 minutes.Screencast:
As alternative solution we can pull the image locally and get the Didgest with jg. It can decrease a gettin the image didgest. This PR add new target to the Makefile
Is it tested? How?
Has been checked on local crc instance