1
0
mirror of https://github.com/regclient/regclient.git synced 2025-09-18 07:43:15 +03:00

14 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
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
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
e6bc1fb637 Add regctl blob delete and ocidir blob delete API
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-02-22 18:54:19 -05:00
Brandon Mitchell
3bc242a860 Add tests for ocidir throttle race
The lock on the throttle was also moved to avoid future foot-guns.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
2023-11-15 20:22:09 -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
44dd971327 Separate manifest interfaces and add set methods
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-06-27 19:50:30 -04:00
Brandon Mitchell
8b77bd1e08 Fix ocidir index.json dangling entries
This fixes cases when both a tag and digest match two separate
descriptors. The first entry is replaced and later entries are deleted.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-03-12 10:55:52 -05:00
Brandon Mitchell
99ee6bdc35 Updating blob methods to use descriptors
Descriptors will be useful when Data field is added.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-03-06 14:48:07 -05:00
Brandon Mitchell
5c3f85f253 Refactor blob like manifests, add SetConfig
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-02-22 21:15:03 -05:00
Brandon Mitchell
10e56c92a8 Refactoring manifest interface, adding SetOrig
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-02-22 21:00:36 -05:00
Brandon Mitchell
7ad7b83d76 Adding garbage collection support to ocidir
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-02-04 15:23:01 -05:00
Brandon Mitchell
76bf62f9b3 Adding ocidir scheme support
Signed-off-by: Brandon Mitchell <git@bmitch.net>
2022-01-16 19:23:59 -05:00