(ctx context.Context)
| 103 | } |
| 104 | |
| 105 | func (c *client) getOfficialServer(ctx context.Context) string { |
| 106 | // The daemon `/info` endpoint informs us of the default registry being |
| 107 | // used. This is essential in cross-platforms environment, where for |
| 108 | // example a Linux client might be interacting with a Windows daemon, hence |
| 109 | // the default registry URL might be Windows specific. |
| 110 | serverAddress := registry.IndexServer |
| 111 | if info, err := c.Info(ctx); err != nil { |
| 112 | // Only report the warning if we're in debug mode to prevent nagging during engine initialization workflows |
| 113 | // log.Warnf("Warning: failed to get default registry endpoint from daemon (%v). Using system default: %s", err, serverAddress) |
| 114 | } else if info.IndexServerAddress == "" { |
| 115 | // log.Warnf("Warning: Empty registry endpoint from daemon. Using system default: %s", serverAddress) |
| 116 | } else { |
| 117 | serverAddress = info.IndexServerAddress |
| 118 | } |
| 119 | |
| 120 | return serverAddress |
| 121 | } |
| 122 | |
| 123 | func getDefaultAuthConfig(checkCredStore bool, serverAddress string, isDefaultRegistry bool) (*dockerregistry.AuthConfig, error) { |
| 124 | var authconfig dockerregistry.AuthConfig |
no test coverage detected