package gcrane
import "github.com/google/go-containerregistry/pkg/gcrane"
Package gcrane holds libraries used to implement the gcrane CLI.
Index ¶
- Variables
- func Copy(src, dst string, opts ...Option) error
- func CopyRepository(ctx context.Context, src, dst string, opts ...Option) error
- func GCRBackoff() retry.Backoff
- type Option
Variables ¶
var Keychain = authn.NewMultiKeychain(google.Keychain, authn.DefaultKeychain)
Keychain tries to use google-specific credential sources, falling back to the DefaultKeychain (config-file based).
Functions ¶
func Copy ¶
Copy copies a remote image or index from src to dst.
func CopyRepository ¶
CopyRepository copies everything from the src GCR repository to the dst GCR repository.
func GCRBackoff ¶
GCRBackoff returns a retry.Backoff that is suitable for use with gcr.io.
These numbers are based on GCR's posted quotas: https://cloud.google.com/container-registry/quotas - 50k requests per 10 minutes. - 1M requests per 24 hours.
On error, we will wait for: - 6 seconds (in case of very short term 429s from GCS), then - 1 minute (in case of temporary network issues), then - 10 minutes (to get around GCR 10 minute quotas), then fail.
TODO: In theory, we could keep retrying until the next day to get around the 1M limit.
Types ¶
type Option ¶
type Option func(*options)
Option is a functional option for gcrane operations.
func WithAuth ¶
func WithAuth(auth authn.Authenticator) Option
WithAuth is a functional option for overriding the default authenticator for remote operations.
By default, gcrane will use gcrane.Keychain.
func WithContext ¶
WithContext is a functional option for setting the context.
func WithJobs ¶
WithJobs sets the number of concurrent jobs to run.
The default number of jobs is GOMAXPROCS.
func WithKeychain ¶
WithKeychain is a functional option for overriding the default authenticator for remote operations, using an authn.Keychain to find credentials.
By default, gcrane will use gcrane.Keychain.
func WithTransport ¶
func WithTransport(t http.RoundTripper) Option
WithTransport is a functional option for overriding the default transport for remote operations.
func WithUserAgent ¶
WithUserAgent adds the given string to the User-Agent header for any HTTP requests.
Source Files ¶
- Version
- v0.20.3 (latest)
- Published
- Jan 15, 2025
- Platform
- linux/amd64
- Imports
- 16 packages
- Last checked
- 19 hours ago –
Tools for package owners.