MCPcopy Create free account
hub / github.com/conforma/cli / CreateRemoteOptions

Function CreateRemoteOptions

internal/utils/oci/client.go:41–74  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

39const clientContextKey contextKey = "ec.oci.client"
40
41func CreateRemoteOptions(ctx context.Context) []remote.Option {
42 backoff := remote.Backoff{
43 Duration: echttp.DefaultBackoff.Duration,
44 Factor: echttp.DefaultBackoff.Factor,
45 Jitter: echttp.DefaultBackoff.Jitter,
46 Steps: echttp.DefaultRetry.MaxRetry,
47 }
48
49 // Log retry/backoff configuration when tracing is enabled
50 if log.IsLevelEnabled(log.TraceLevel) {
51 log.Tracef("OCI client retry configuration: max_retry=%d, max_wait=%v, base_duration=%v, factor=%.2f, jitter=%.2f",
52 echttp.DefaultRetry.MaxRetry,
53 echttp.DefaultRetry.MaxWait,
54 echttp.DefaultBackoff.Duration,
55 echttp.DefaultBackoff.Factor,
56 echttp.DefaultBackoff.Jitter,
57 )
58 }
59
60 // Create a transport that handles transient errors with exponential backoff
61 var transport http.RoundTripper
62 if log.IsLevelEnabled(log.TraceLevel) {
63 transport = echttp.NewTracingRoundTripper(echttp.NewRetryTransport(remote.DefaultTransport))
64 } else {
65 transport = echttp.NewRetryTransport(remote.DefaultTransport)
66 }
67
68 return []remote.Option{
69 remote.WithTransport(transport),
70 remote.WithContext(ctx),
71 remote.WithAuthFromKeychain(authn.DefaultKeychain),
72 remote.WithRetryBackoff(backoff),
73 }
74}
75
76type Client interface {
77 VerifyImageSignatures(name.Reference, *cosign.CheckOpts) ([]oci.Signature, bool, error)

Callers 3

ociImageTagRefsFunction · 0.92
ociImageReferrersFunction · 0.92
NewClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected