mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fn: docker version check2 (#744)
1) now required docker version is 17.06 2) enable circle ci latest docker install 3) docker driver & agent check minimum version before start
This commit is contained in:
@@ -38,6 +38,7 @@ type dockerClient interface {
|
||||
InspectImage(ctx context.Context, name string) (*docker.Image, error)
|
||||
InspectContainerWithContext(container string, ctx context.Context) (*docker.Container, error)
|
||||
Stats(opts docker.StatsOptions) error
|
||||
Info(ctx context.Context) (*docker.DockerInfo, error)
|
||||
}
|
||||
|
||||
// TODO: switch to github.com/docker/engine-api
|
||||
@@ -169,6 +170,19 @@ func filterNoSuchContainer(ctx context.Context, err error) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (d *dockerWrap) Info(ctx context.Context) (info *docker.DockerInfo, err error) {
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "docker_server_version")
|
||||
defer span.Finish()
|
||||
|
||||
ctx, cancel := context.WithTimeout(ctx, retryTimeout)
|
||||
defer cancel()
|
||||
err = d.retry(ctx, func() error {
|
||||
info, err = d.docker.Info()
|
||||
return err
|
||||
})
|
||||
return info, err
|
||||
}
|
||||
|
||||
func (d *dockerWrap) AttachToContainerNonBlocking(ctx context.Context, opts docker.AttachToContainerOptions) (w docker.CloseWaiter, err error) {
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "docker_attach_container")
|
||||
defer span.Finish()
|
||||
|
||||
Reference in New Issue
Block a user