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: add support for registry mirrors #8244

Merged
merged 22 commits into from
Jan 22, 2025

Conversation

DmitriyLewen
Copy link
Contributor

@DmitriyLewen DmitriyLewen commented Jan 14, 2025

Description

  • added registry.mirrors flag (only for config file)
    e.g. :
    registry:
      mirrors:
        index.docker.io:
          - harbor.example.com/docker.io
          - mirror.gcr.io
    
  • add logic to check mirrors. If can't get image from mirrors - check host registry.

Related issues

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).

@DmitriyLewen DmitriyLewen self-assigned this Jan 14, 2025
@DmitriyLewen DmitriyLewen marked this pull request as ready for review January 15, 2025 11:17
Copy link
Collaborator

@knqyf263 knqyf263 left a comment

Choose a reason for hiding this comment

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

It looks great 👍 Left small comments.

docs/docs/configuration/others.md Outdated Show resolved Hide resolved
docs/docs/configuration/others.md Show resolved Hide resolved
docs/docs/references/configuration/config-file.md Outdated Show resolved Hide resolved
pkg/flag/options.go Show resolved Hide resolved
pkg/flag/registry_flags.go Show resolved Hide resolved
pkg/remote/remote.go Outdated Show resolved Hide resolved
pkg/remote/remote.go Outdated Show resolved Hide resolved
pkg/remote/remote.go Outdated Show resolved Hide resolved
pkg/remote/remote.go Outdated Show resolved Hide resolved
pkg/remote/remote.go Outdated Show resolved Hide resolved
pkg/remote/remote.go Outdated Show resolved Hide resolved
@knqyf263
Copy link
Collaborator

@DmitriyLewen I tried to reduce duplicates in 2981a6f, but please correct me if I'm missing something.

@DmitriyLewen
Copy link
Contributor Author

I always forget that i can use generics :(
great implementation 👍
LGTM

@knqyf263
Copy link
Collaborator

I always forget that i can use generics :(

I'm not a big fan of generics as it complicates things, but we can use it in simple cases.

@knqyf263 knqyf263 added this pull request to the merge queue Jan 22, 2025
Merged via the queue into aquasecurity:main with commit 4316bcb Jan 22, 2025
17 checks passed
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.

support registry mirrors for image scanning
3 participants