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

15 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
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
89be757fd0
Feat: Consolidate warnings
When a registry returns a warning header on every request, clients should try to consolidate these.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-08-22 16:52:40 -04:00
Brandon Mitchell
5e05f50a3c
Refactor pulling a platform specific manifest
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-06-23 10:23:53 -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
4c1e999343
Validate the ref in various APIs
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-11-11 19:23:58 -05:00
Brandon Mitchell
8aeece90f8
Cleanup godoc comments on regclient package
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-09-26 11:48:51 -04:00
Brandon Mitchell
68acd0e9fc
Fallback from head to get when digest is missing
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-02-16 20:47:37 -05:00
Brandon Mitchell
f989bbc0d6 Rename refers to subject
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-09-17 17:07:32 -04:00
Brandon Mitchell
db025b75d0 Refactoring referrers support
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-08-21 20:04:26 -04:00
Brandon Mitchell
29a0d79421 Parse the descriptor data field when available
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-03-07 08:51:54 -05:00
Brandon Mitchell
5fa181ff08 regclient linting, scheme API rename
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-02-04 15:25:14 -05:00
Brandon Mitchell
7af29dae3f Supporting ocidir GC in regclient
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-02-04 15:23:01 -05:00
Brandon Mitchell
f539a23f76 Image copy on some schemes pushes manifest first
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-01-16 19:25:55 -05:00
Brandon Mitchell
1d93bf7bb6 Moving regclient package to top level
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2021-12-29 14:51:11 -05:00