Handle private docker registry auth

This adds support for private docker registries, by adding
an optional `registryAuth` field in the CreateFunctionRequest.
Auth must be passed as base64-encoded basic auth, similar to
how done in Docker file store credentials (~/.docker/config.json).
Credentials are then passed to swarm at service creation.
This commit is contained in:
Sebastien Guilloux
2017-05-30 15:32:05 +02:00
committed by Alex Ellis
parent 6f68b72c21
commit 9e711b3b5d
5 changed files with 222 additions and 0 deletions

View File

@ -18,6 +18,11 @@ type CreateFunctionRequest struct {
// EnvVars provides overrides for functions.
EnvVars map[string]string `json:"envVars"`
// RegistryAuth is the registry authentication (optional)
// in the same encoded format as Docker native credentials
// (see ~/.docker/config.json)
RegistryAuth string `json:"registryAuth,omitempty"`
}
type DeleteFunctionRequest struct {