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

Function getDefaultAuthConfig

pkg/devspace/docker/auth.go:123–151  ·  view source on GitHub ↗
(checkCredStore bool, serverAddress string, isDefaultRegistry bool)

Source from the content-addressed store, hash-verified

121}
122
123func getDefaultAuthConfig(checkCredStore bool, serverAddress string, isDefaultRegistry bool) (*dockerregistry.AuthConfig, error) {
124 var authconfig dockerregistry.AuthConfig
125 var err error
126
127 if !isDefaultRegistry {
128 serverAddress = registry.ConvertToHostname(serverAddress)
129 }
130
131 if checkCredStore {
132 configfile, err := LoadDockerConfig()
133 if configfile != nil && err == nil {
134 authconfigOrig, err := configfile.GetAuthConfig(serverAddress)
135 if err != nil {
136 authconfig.ServerAddress = serverAddress
137 return &authconfig, err
138 }
139
140 // convert
141 err = util.Convert(authconfigOrig, &authconfig)
142 if err != nil {
143 authconfig.ServerAddress = serverAddress
144 return &authconfig, err
145 }
146 }
147 }
148
149 authconfig.ServerAddress = serverAddress
150 return &authconfig, err
151}

Callers 2

GetAuthConfigMethod · 0.85
LoginMethod · 0.85

Calls 3

ConvertFunction · 0.92
LoadDockerConfigFunction · 0.85
GetAuthConfigMethod · 0.65

Tested by

no test coverage detected