mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client: remove "version" header for service create, update
The version header is no longer used since [moby@a9d2091] (v20.10.0-beta1)
which was not gated by API version, as handling of the header was broken
(using the client version, instead of the API version used for the request).
Given that any current version of the daemon, regardless of API version will
ignore the header, this code was only in place to allow connecting to a
daemon older than (v20.10.0-beta1), which would be long EOL now.
[moby@a9d2091]: a9d20916c3
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -62,12 +62,6 @@ func (cli *Client) ServiceCreate(ctx context.Context, service swarm.ServiceSpec,
|
||||
}
|
||||
|
||||
headers := http.Header{}
|
||||
if versions.LessThan(cli.version, "1.30") {
|
||||
// the custom "version" header was used by engine API before 20.10
|
||||
// (API 1.30) to switch between client- and server-side lookup of
|
||||
// image digests.
|
||||
headers["version"] = []string{cli.version}
|
||||
}
|
||||
if options.EncodedRegistryAuth != "" {
|
||||
headers[registry.AuthHeader] = []string{options.EncodedRegistryAuth}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
"github.com/moby/moby/api/types/registry"
|
||||
"github.com/moby/moby/api/types/swarm"
|
||||
"github.com/moby/moby/api/types/versions"
|
||||
)
|
||||
|
||||
// ServiceUpdate updates a Service. The version number is required to avoid
|
||||
@@ -65,12 +64,6 @@ func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version
|
||||
}
|
||||
|
||||
headers := http.Header{}
|
||||
if versions.LessThan(cli.version, "1.30") {
|
||||
// the custom "version" header was used by engine API before 20.10
|
||||
// (API 1.30) to switch between client- and server-side lookup of
|
||||
// image digests.
|
||||
headers["version"] = []string{cli.version}
|
||||
}
|
||||
if options.EncodedRegistryAuth != "" {
|
||||
headers.Set(registry.AuthHeader, options.EncodedRegistryAuth)
|
||||
}
|
||||
|
||||
6
vendor/github.com/moby/moby/client/service_create.go
generated
vendored
6
vendor/github.com/moby/moby/client/service_create.go
generated
vendored
@@ -62,12 +62,6 @@ func (cli *Client) ServiceCreate(ctx context.Context, service swarm.ServiceSpec,
|
||||
}
|
||||
|
||||
headers := http.Header{}
|
||||
if versions.LessThan(cli.version, "1.30") {
|
||||
// the custom "version" header was used by engine API before 20.10
|
||||
// (API 1.30) to switch between client- and server-side lookup of
|
||||
// image digests.
|
||||
headers["version"] = []string{cli.version}
|
||||
}
|
||||
if options.EncodedRegistryAuth != "" {
|
||||
headers[registry.AuthHeader] = []string{options.EncodedRegistryAuth}
|
||||
}
|
||||
|
||||
7
vendor/github.com/moby/moby/client/service_update.go
generated
vendored
7
vendor/github.com/moby/moby/client/service_update.go
generated
vendored
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
"github.com/moby/moby/api/types/registry"
|
||||
"github.com/moby/moby/api/types/swarm"
|
||||
"github.com/moby/moby/api/types/versions"
|
||||
)
|
||||
|
||||
// ServiceUpdate updates a Service. The version number is required to avoid
|
||||
@@ -65,12 +64,6 @@ func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version
|
||||
}
|
||||
|
||||
headers := http.Header{}
|
||||
if versions.LessThan(cli.version, "1.30") {
|
||||
// the custom "version" header was used by engine API before 20.10
|
||||
// (API 1.30) to switch between client- and server-side lookup of
|
||||
// image digests.
|
||||
headers["version"] = []string{cli.version}
|
||||
}
|
||||
if options.EncodedRegistryAuth != "" {
|
||||
headers.Set(registry.AuthHeader, options.EncodedRegistryAuth)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user