MCPcopy Index your code
hub / github.com/cortexlabs/cortex / EncodeAuthConfig

Function EncodeAuthConfig

pkg/lib/docker/docker.go:308–315  ·  view source on GitHub ↗
(authConfig dockertypes.AuthConfig)

Source from the content-addressed store, hash-verified

306}
307
308func EncodeAuthConfig(authConfig dockertypes.AuthConfig) (string, error) {
309 encoded, err := json.Marshal(authConfig)
310 if err != nil {
311 return "", errors.Wrap(err, "failed to encode docker login credentials")
312 }
313 registryAuth := base64.URLEncoding.EncodeToString(encoded)
314 return registryAuth, nil
315}
316
317func CheckImageAccessible(dockerClient *Client, dockerImage, authConfig string) error {
318 if _, err := dockerClient.DistributionInspect(context.Background(), dockerImage, authConfig); err != nil {

Callers 3

getDockerAuthStrFromK8sFunction · 0.92
initFunction · 0.85
AWSAuthConfigFunction · 0.85

Calls 1

WrapFunction · 0.92

Tested by

no test coverage detected