1
0
mirror of https://github.com/regclient/regclient.git synced 2025-04-18 22:44:00 +03:00

25 Commits

Author SHA1 Message Date
Brandon Mitchell
95c9152941
Chore: Modernize Go to the 1.22 specs
- Use "any" instead of an empty interface.
- Use range over an integer for for loops.
- Remove shadow variables in loops now that Go no longer reuses the variable.
- Use "slices.Contains", "slices.Delete", "slices.Equal", "slices.Index", "slices.SortFunc".
- Use "cmp.Or", "min", and "max".
- Use "fmt.Appendf" instead of "Sprintf" for generating a byte slice.
- Use "errors.Join" or "fmt.Errorf" with multiple "%w" for multiple errors.

Additionally, use modern regclient features:

- Use "ref.SetTag", "ref.SetDigest", and "ref.AddDigest".
- Call "regclient.ManifestGet" using "WithManifestDesc" instead of setting the digest on the reference.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
2025-02-18 14:32:06 -05:00
Brandon Mitchell
ead52eb575
Feat: Copy image with external referrers
This supports both external source and target repositories for referrers.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-12-04 17:01:12 -05:00
Brandon Mitchell
1eb1ea4b34
Feat: Refactor logging to use log/slog
This updates the regclient Go library.
Existing users of logrus will continue to work using a logrus handler to slog.
Updates to the various commands will be made in a future commit.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-11-10 17:14:57 -05:00
Brandon Mitchell
4bd605f9ef
Chore: Remove ReqPerSec in tests
This is no longer needed to speed up tests since request per second does not have a default setting.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-08-20 16:08:19 -04:00
Brandon Mitchell
16a9d83434
Remove rwfs internal package
This was used for test implementations that were better handled with t.TempDir or olareg backed by memory.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-06-26 17:21:24 -04:00
Brandon Mitchell
5417b713d0
Feat: Adding zstd support
Breaking: pkg/archive.Compress no longer decompresses the input.
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-05-06 16:41:35 -04:00
Brandon Mitchell
415eaf4808
Add regclient.ImageConfig method
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-03-29 15:27:37 -04:00
Brandon Mitchell
eea06e2a5c
Refactoring the type package
I feel like I need to explain, this is all to move the descriptor package.
The platform package could not use the predefined errors in types because of a circular dependency from descriptor.
The most appropriate way to reorg this is to move descriptor out of the type package since it was more complex than a self contained type.
When doing that, type aliases were needed to avoid breaking changes to existing users.
Those aliases themselves caused circular dependency loops because of the media types and errors, so those were also pulled out to separate packages.
All of the old values were aliased and deprecated, and to fix the linter, those deprecations were fixed by updating the imports... everywhere.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-03-04 15:43:18 -05:00
Brandon Mitchell
cc0ae63f8f
Replace t.Error and return with t.Fatal
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-02-27 15:33:52 -05:00
Brandon Mitchell
23c2697f29
Improve error handling of a failed copy
This prefers errors other than the context.Canceled that is generated by stopping goroutines.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-02-21 11:05:45 -05:00
Brandon Mitchell
b45796dfb2
Upgrade olareg and close resources when done
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-01-25 10:06:31 -05:00
Brandon Mitchell
f769330d4f
Add tests for regclient.TagList and Delete
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-01-05 19:01:26 -05:00
Brandon Mitchell
23bcaf2e1e
Update olareg to leverage mem backed by dir
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-01-02 11:13:16 -05:00
Brandon Mitchell
872fcd7ac4
Add tests with embedded registry
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-12-26 14:49:16 -05:00
Brandon Mitchell
0ad815ee02
Update tests to use t.Parallel where possible
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-10-02 20:09:11 -04:00
Brandon Mitchell
4b89bdc912
Support compression on import and export
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-08-25 20:10:13 -04:00
Brandon Mitchell
d860d33c88
Track tags when deduping manifests in copy
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-06-26 16:54:05 -04:00
Brandon Mitchell
f6f87eba74
Prevent deadlock on looping referrers
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-06-10 19:05:20 -04:00
Brandon Mitchell
c8983c2aa8
Add a fast check option for image copy
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-05-22 20:33:22 -04:00
Brandon Mitchell
09ce57120c
Add a test for ImageCopy
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-05-08 19:32:25 -04:00
Brandon Mitchell
d2ca5fa5eb
Add concurrency to image copy
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-05-06 09:01:35 -04:00
Brandon Mitchell
4ee0d719b0
Normalize filenames on tar import
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-02-04 20:58:25 -05:00
Brandon Mitchell
a227c9230d
Add image mod to convert docker to oci referrers
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-01-22 09:50:40 -05:00
Brandon Mitchell
4155d3e87e Update check-base tests
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-08-31 17:13:48 -04:00
Brandon Mitchell
f0ceda1677 Add image check-base
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-08-30 09:37:56 -04:00