-
Notifications
You must be signed in to change notification settings - Fork 49
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
tdnf does not set a user agent when doing http requests #451
Comments
Note: they changed the pkgs.k8s.io infrastructure to now allow empty user agents. However, I think this would be still a valuable feature to implement. |
Interesting. If just setting an empty But I don't see any issue with adding that header to tdnf. |
Yeah, it is a default settings to get blocked if you are hosting behind AWS WAF https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-baseline.html And I think at least having the option to configure it is good. |
The header can be anything, right? So I think if we add it, then with something useful - like mentioning the version of |
This has been fixed a while ago with #453 . I forgot to close this. |
Describe the bug
The kubernetes-sigs project
image-builder
tries to switch the used repositories to the new upstream repository atpkgs.k8s.io
(via this PR: kubernetes-sigs/image-builder#1280 ).However, the installation or to be more precise
tdnf makecache
fails when using that repository with a403
http error.It turns out that
tdnf
does not set any user agent in its requests.Note: I was also not able to find a possibility to configure the user agent for
tdnf
.Reproduction steps
Run photon in a container
docker run -ti --rm photon:latest
Create the repo entry:
Try to update the caches:
tdnf install kubelet-1.26.7 --nogpgcheck -y
Output:
Expected behavior
tdnf makecache
to succeed.Additional context
According to slack, this happens at the repository because they use AWS AWF, which blocks requests which have an empty/not set user agent.
After analysing the request using
mitmdump
I was able to see that tdnf does not set any request, when requesting:https://pkgs.k8s.io/core:/stable:/v1.26/rpm/repodata/repomd.xml
It is reproducible using curl:
xref: kubernetes-sigs/image-builder#1280 (comment)
Slack thread with the maintainers of the repository: https://kubernetes.slack.com/archives/C03U7N0VCGK/p1694194051373989
The text was updated successfully, but these errors were encountered: