-
Notifications
You must be signed in to change notification settings - Fork 927
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 User-agent for repo-plugins api calls #2722
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.
Please add tests
- would be nice to use command.config but we couldn't see an easy way to thread it Co-authored-by: david alvarado <alvaradoda@vmware.com>
…o as we made changes
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
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
* Add user agent info for plugin api calls * Remove comment * Edit error message * Use same user agent as api/plugin/client.go - would be nice to use command.config but we couldn't see an easy way to thread it Co-authored-by: david alvarado <alvaradoda@vmware.com> * Add test - The reason it is checking NotTo(Equal(...)) is because the default user agent "Go-http-client/1.1" is being blocked by the webserver Co-authored-by: david alvarado <alvaradoda@vmware.com> * Clean up deprecation and some warnings and regenerate fake_plugin_repo as we made changes --------- Co-authored-by: M. Oleske <moleske@pivotal.io> Co-authored-by: david alvarado <alvaradoda@vmware.com> Co-authored-by: Al Berez <a-b@users.noreply.github.com>
* Add user agent info for plugin api calls * Remove comment * Edit error message * Use same user agent as api/plugin/client.go - would be nice to use command.config but we couldn't see an easy way to thread it Co-authored-by: david alvarado <alvaradoda@vmware.com> * Add test - The reason it is checking NotTo(Equal(...)) is because the default user agent "Go-http-client/1.1" is being blocked by the webserver Co-authored-by: david alvarado <alvaradoda@vmware.com> * Clean up deprecation and some warnings and regenerate fake_plugin_repo as we made changes --------- Co-authored-by: M. Oleske <moleske@pivotal.io> Co-authored-by: david alvarado <alvaradoda@vmware.com> Co-authored-by: Al Berez <a-b@users.noreply.github.com>
* Add user agent info for plugin api calls * Remove comment * Edit error message * Use same user agent as api/plugin/client.go - would be nice to use command.config but we couldn't see an easy way to thread it * Add test - The reason it is checking NotTo(Equal(...)) is because the default user agent "Go-http-client/1.1" is being blocked by the webserver * Clean up deprecation and some warnings and regenerate fake_plugin_repo as we made changes --------- Co-authored-by: Shwetha Gururaj <gururajsh@vmware.com> Co-authored-by: david alvarado <alvaradoda@vmware.com> Co-authored-by: Al Berez <a-b@users.noreply.github.com>
* Add user agent info for plugin api calls * Remove comment * Edit error message * Use same user agent as api/plugin/client.go - would be nice to use command.config but we couldn't see an easy way to thread it * Add test - The reason it is checking NotTo(Equal(...)) is because the default user agent "Go-http-client/1.1" is being blocked by the webserver * Clean up deprecation and some warnings and regenerate fake_plugin_repo as we made changes --------- Co-authored-by: Shwetha Gururaj <gururajsh@vmware.com> Co-authored-by: david alvarado <alvaradoda@vmware.com> Co-authored-by: Al Berez <a-b@users.noreply.github.com>
Where this PR should be backported?
Description of the Change
cf repo-plugins
command is erroring withLogged errors: Invalid json data from 'CF-Community' - invalid character '<' looking for beginning of value
. It seems https://plugins.cloudfoundry.org/list endpoint is expecting a user agent to be set. This PR adds that.Why Is This PR Valuable?
Fixes a bug.
Applicable Issues
List any applicable GitHub Issues here
How Urgent Is The Change?
Is the change urgent? If so, explain why it is time-sensitive.
Other Relevant Parties
Who else is affected by the change?