Update docker api version

This commit is contained in:
Daniel Tomcej 2019-06-03 03:28:07 -06:00 committed by Traefiker Bot
parent 61744fba11
commit 01c8798e4e
3 changed files with 7 additions and 19 deletions

View file

@ -31,12 +31,16 @@ import (
) )
const ( const (
// DockerAPIVersion is a constant holding the version of the Provider API traefik will use
DockerAPIVersion = "1.24"
// SwarmAPIVersion is a constant holding the version of the Provider API traefik will use. // SwarmAPIVersion is a constant holding the version of the Provider API traefik will use.
SwarmAPIVersion = "1.24" SwarmAPIVersion = "1.24"
// DefaultTemplateRule The default template for the default rule.
DefaultTemplateRule = "Host(`{{ normalize .Name }}`)"
) )
// DefaultTemplateRule The default template for the default rule.
const DefaultTemplateRule = "Host(`{{ normalize .Name }}`)"
var _ provider.Provider = (*Provider)(nil) var _ provider.Provider = (*Provider)(nil)
// Provider holds configurations of the provider. // Provider holds configurations of the provider.
@ -123,11 +127,9 @@ func (p *Provider) createClient() (client.APIClient, error) {
"User-Agent": "Traefik " + version.Version, "User-Agent": "Traefik " + version.Version,
} }
var apiVersion string apiVersion := DockerAPIVersion
if p.SwarmMode { if p.SwarmMode {
apiVersion = SwarmAPIVersion apiVersion = SwarmAPIVersion
} else {
apiVersion = DockerAPIVersion
} }
return client.NewClient(p.Endpoint, apiVersion, httpClient, httpHeaders) return client.NewClient(p.Endpoint, apiVersion, httpClient, httpHeaders)

View file

@ -1,8 +0,0 @@
// +build !windows
package docker
const (
// DockerAPIVersion is a constant holding the version of the Provider API traefik will use
DockerAPIVersion = "1.21"
)

View file

@ -1,6 +0,0 @@
package docker
const (
// DockerAPIVersion is a constant holding the version of the Provider API traefik will use
DockerAPIVersion string = "1.24"
)