DockerCredentialStore¶
- class controller.storage.docker.DockerCredentialStore(credentials)¶
Bases:
object
Read and write the
.dockerconfigjson
syntax used by Kubernetes.- Parameters:
credentials (
dict
[str
,DockerCredentials
])
Methods Summary
from_path
(path)Load credentials for Docker API hosts from a file.
get
(host)Get credentials for a given host.
save
(path)Save the credentials store in
.dockerconfigjson
format.set
(host, credentials)Set credentials for a given host.
Methods Documentation
- classmethod from_path(path)¶
Load credentials for Docker API hosts from a file.
- Parameters:
path (
Path
) – Path to file containing credentials.- Returns:
The resulting credential store.
- Return type:
- get(host)¶
Get credentials for a given host.
These may be domain credentials, so if there is no exact match, return the credentials for any parent domain found.
- Parameters:
host (
str
) – Host to which to authenticate.- Returns:
The corresponding credentials or
None
if there are no credentials in the store for that host.- Return type:
DockerCredentials or None
- save(path)¶
Save the credentials store in
.dockerconfigjson
format.- Parameters:
path (
Path
) – Path at which to save the credential store.- Return type:
- set(host, credentials)¶
Set credentials for a given host.
- Parameters:
host (
str
) – The Docker API host.credentials (
DockerCredentials
) – The credentials to use for that host.
- Return type: