MCPcopy Index your code
hub / github.com/devspace-sh/devspace / getOfficialServer

Method getOfficialServer

pkg/devspace/docker/auth.go:105–121  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

103}
104
105func (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
123func getDefaultAuthConfig(checkCredStore bool, serverAddress string, isDefaultRegistry bool) (*dockerregistry.AuthConfig, error) {
124 var authconfig dockerregistry.AuthConfig

Callers 1

GetRegistryEndpointMethod · 0.95

Calls 1

InfoMethod · 0.45

Tested by

no test coverage detected