1
0
Fork 0

Auto-negotiate Docker API Version

This commit is contained in:
Felix Bünemann 2025-11-12 17:22:05 +01:00 committed by GitHub
parent d271750062
commit baba5da88b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1 additions and 11 deletions

View file

@ -100,8 +100,6 @@ func parseContainer(container containertypes.InspectResponse) dockerData {
}
type ClientConfig struct {
apiVersion string
Username string `description:"Username for Basic HTTP authentication." json:"username,omitempty" toml:"username,omitempty" yaml:"username,omitempty"`
Password string `description:"Password for Basic HTTP authentication." json:"password,omitempty" toml:"password,omitempty" yaml:"password,omitempty"`
Endpoint string `description:"Docker server endpoint. Can be a TCP or a Unix socket endpoint." json:"endpoint,omitempty" toml:"endpoint,omitempty" yaml:"endpoint,omitempty"`
@ -124,7 +122,7 @@ func createClient(ctx context.Context, cfg ClientConfig) (*client.Client, error)
opts = append(opts,
client.WithHTTPHeaders(httpHeaders),
client.WithVersion(cfg.apiVersion))
client.WithAPIVersionNegotiation())
return client.NewClientWithOpts(opts...)
}