Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gitlab-runner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Seipel
gitlab-runner
Commits
23affe41
Unverified
Commit
23affe41
authored
8 years ago
by
Kirill Shirinkin
Committed by
Tomasz Maczukin
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Enable docker creds store
parent
9a62dbfc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
helpers/docker/auth_config.go
+31
-1
31 additions, 1 deletion
helpers/docker/auth_config.go
with
31 additions
and
1 deletion
helpers/docker/auth_config.go
+
31
−
1
View file @
23affe41
...
...
@@ -13,6 +13,7 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/cliconfig/configfile"
"github.com/docker/docker/cliconfig/credentials"
"github.com/docker/docker/pkg/homedir"
)
...
...
@@ -95,7 +96,36 @@ func ReadAuthConfigsFromReader(r io.Reader) (map[string]types.AuthConfig, error)
return
nil
,
err
}
return
config
.
AuthConfigs
,
nil
auths
:=
make
(
map
[
string
]
types
.
AuthConfig
)
addAll
(
auths
,
config
.
AuthConfigs
)
if
config
.
CredentialsStore
!=
""
{
authsFromCredentialsStore
,
err
:=
readAuthConfigsFromCredentialsStore
(
config
)
if
err
!=
nil
{
return
nil
,
err
}
addAll
(
auths
,
authsFromCredentialsStore
)
}
return
auths
,
nil
}
func
readAuthConfigsFromCredentialsStore
(
config
*
configfile
.
ConfigFile
)
(
map
[
string
]
types
.
AuthConfig
,
error
)
{
store
:=
credentials
.
NewNativeStore
(
config
,
config
.
CredentialsStore
)
newAuths
,
err
:=
store
.
GetAll
()
if
err
!=
nil
{
return
nil
,
err
}
return
newAuths
,
nil
}
func
addAll
(
to
,
from
map
[
string
]
types
.
AuthConfig
)
{
for
reg
,
ac
:=
range
from
{
to
[
reg
]
=
ac
}
}
// ResolveDockerAuthConfig taken from: https://github.com/docker/docker/blob/master/registry/auth.go
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment