Skip to content
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

feat(image): Set User-Agent header for Trivy container registry requests #6868

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

nabokihms
Copy link
Contributor

@nabokihms nabokihms commented Jun 6, 2024

Description

  • Added functionality to set the User-Agent header in Trivy when making requests to container registries.
  • Updated tests to cover the new functionality and ensure that the User-Agent header is properly set.

This enhancement is important for distinguishing requests to container registries, especially when operating Kubernetes clusters at scale in enterprise environments. It aids in tracking and managing Trivy requests more effectively.

Before the User-Agent header was just a plain go-conainerregistry/version. After the change, it becomes trivy/version go-conainerregistry/version.

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

- Added functionality to set the User-Agent header in Trivy when making requests to container registries.
- Updated tests to cover the new functionality and ensure that the User-Agent header is properly set.

This enhancement is important for distinguishing requests to container registries, especially when operating Kubernetes clusters at scale in enterprise environments. It aids in tracking and managing Trivy requests more effectively.

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
@CLAassistant
Copy link

CLAassistant commented Jun 6, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@nabokihms nabokihms changed the title feat (container): Set User-Agent header for Trivy container registry requests feat(container): Set User-Agent header for Trivy container registry requests Jun 6, 2024
@nabokihms nabokihms changed the title feat(container): Set User-Agent header for Trivy container registry requests feat(image): Set User-Agent header for Trivy container registry requests Jun 6, 2024
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason for moving the function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid circle dependencies

@nabokihms nabokihms requested a review from knqyf263 June 7, 2024 11:44
@knqyf263 knqyf263 enabled auto-merge June 10, 2024 06:40
@knqyf263 knqyf263 added this pull request to the merge queue Jun 10, 2024
Merged via the queue into aquasecurity:main with commit 9b31697 Jun 10, 2024
12 checks passed
@nabokihms nabokihms deleted the user-agent-trivy branch June 10, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants