mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-12-24 11:51:13 +08:00
1.7 KiB
1.7 KiB
Migration Guide
In version v2, ORAS Go library has been completely refreshed with:
- More unified interfaces
- Notably fewer dependencies
- Higher test coverage
- Better documentation
Besides, ORAS Go v2 is now a registry client.
Major Changes in v2
- Moves
content.FileStoreto file.Store - Moves
content.OCIStoreto oci.Store - Moves
content.MemoryStoreto memory.Store - Provides SDK to interact with OCI-compliant and Docker-compliant registries
- Supports Copy with more flexible options
- Supports Extended Copy with options (experimental)
- No longer supports
docker.Loginanddocker.Logout(removes the dependency ondocker); instead, provides authentication through auth.Client
Documentation and examples are available at pkg.go.dev.
Migrating from v1 to v2
-
Get the
v2packagego get oras.land/oras-go/v2 -
Import and use the
v2packageimport "oras.land/oras-go/v2" -
Run
go mod tidy
Since breaking changes are introduced in v2, code refactoring is required for migrating from v1 to v2.
The migration can be done in an iterative fashion, as v1 and v2 can be imported and used at the same time.