mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Merge pull request #51399 from thaJeztah/swarm_enums
api/types/swarm: create types for enum-consts
This commit is contained in:
@@ -276,7 +276,14 @@ func (sr *swarmRouter) updateService(ctx context.Context, w http.ResponseWriter,
|
||||
|
||||
// Get returns "" if the header does not exist
|
||||
flags.EncodedRegistryAuth = r.Header.Get(registry.AuthHeader)
|
||||
flags.RegistryAuthFrom = r.URL.Query().Get("registryAuthFrom")
|
||||
if v := r.URL.Query().Get("registryAuthFrom"); v != "" {
|
||||
switch val := types.RegistryAuthSource(v); val {
|
||||
case types.RegistryAuthFromSpec, types.RegistryAuthFromPreviousSpec:
|
||||
flags.RegistryAuthFrom = val
|
||||
default:
|
||||
return errdefs.InvalidParameter(fmt.Errorf("invalid registryAuthFrom '%s'", v))
|
||||
}
|
||||
}
|
||||
flags.Rollback = r.URL.Query().Get("rollback")
|
||||
queryRegistry := false
|
||||
if v := httputils.VersionFromContext(ctx); v != "" {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package swarmbackend
|
||||
|
||||
import "github.com/moby/moby/v2/daemon/internal/filters"
|
||||
import (
|
||||
"github.com/moby/moby/api/types/swarm"
|
||||
"github.com/moby/moby/v2/daemon/internal/filters"
|
||||
)
|
||||
|
||||
type ConfigListOptions struct {
|
||||
Filters filters.Args
|
||||
@@ -34,7 +37,7 @@ type ServiceUpdateOptions struct {
|
||||
// RegistryAuthFrom specifies where to find the registry authorization
|
||||
// credentials if they are not given in EncodedRegistryAuth. Valid
|
||||
// values are "spec" and "previous-spec".
|
||||
RegistryAuthFrom string
|
||||
RegistryAuthFrom swarm.RegistryAuthSource
|
||||
|
||||
// Rollback indicates whether a server-side rollback should be
|
||||
// performed. When this is set, the provided spec will be ignored.
|
||||
|
||||
Reference in New Issue
Block a user