mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-21 18:11:22 +00:00
Remove dependency on docker daemon for core credential types
We are removing dependencies on docker types where possible in the core libraries. credentialprovider is generic to Docker and uses a public API (the config file format) that must remain stable. Create an equivalent type and use a type cast (which would error if we ever change the type) in the dockershim. We already perform a transformation like this for CRI and so we aren't changing much.
This commit is contained in:
@@ -22,7 +22,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
dockertypes "github.com/docker/docker/api/types"
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
|
||||
@@ -40,14 +39,12 @@ type DockerConfigProvider interface {
|
||||
LazyProvide() *DockerConfigEntry
|
||||
}
|
||||
|
||||
func LazyProvide(creds LazyAuthConfiguration) dockertypes.AuthConfig {
|
||||
func LazyProvide(creds LazyAuthConfiguration) AuthConfig {
|
||||
if creds.Provider != nil {
|
||||
entry := *creds.Provider.LazyProvide()
|
||||
return DockerConfigEntryToLazyAuthConfiguration(entry).AuthConfig
|
||||
} else {
|
||||
return creds.AuthConfig
|
||||
}
|
||||
|
||||
return creds.AuthConfig
|
||||
}
|
||||
|
||||
// A DockerConfigProvider that simply reads the .dockercfg file
|
||||
|
Reference in New Issue
Block a user