mirror of https://github.com/docker/cli.git
Make experimental a runtime flag
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
a6a247fdf9
commit
31f5d9b543
|
@ -127,6 +127,7 @@ type SystemAPIClient interface {
|
||||||
Info(ctx context.Context) (types.Info, error)
|
Info(ctx context.Context) (types.Info, error)
|
||||||
RegistryLogin(ctx context.Context, auth types.AuthConfig) (types.AuthResponse, error)
|
RegistryLogin(ctx context.Context, auth types.AuthConfig) (types.AuthResponse, error)
|
||||||
DiskUsage(ctx context.Context) (types.DiskUsage, error)
|
DiskUsage(ctx context.Context) (types.DiskUsage, error)
|
||||||
|
Ping(ctx context.Context) (bool, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// VolumeAPIClient defines API client methods for the volumes
|
// VolumeAPIClient defines API client methods for the volumes
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -7,9 +5,7 @@ import (
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
// APIClient is an interface that clients that talk with a docker server must implement.
|
type apiClientExperimental interface {
|
||||||
type APIClient interface {
|
|
||||||
CommonAPIClient
|
|
||||||
CheckpointAPIClient
|
CheckpointAPIClient
|
||||||
PluginAPIClient
|
PluginAPIClient
|
||||||
}
|
}
|
||||||
|
@ -32,6 +28,3 @@ type PluginAPIClient interface {
|
||||||
PluginSet(ctx context.Context, name string, args []string) error
|
PluginSet(ctx context.Context, name string, args []string) error
|
||||||
PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error)
|
PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that Client always implements APIClient.
|
|
||||||
var _ APIClient = &Client{}
|
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
// +build !experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
// APIClient is an interface that clients that talk with a docker server must implement.
|
// APIClient is an interface that clients that talk with a docker server must implement.
|
||||||
type APIClient interface {
|
type APIClient interface {
|
||||||
CommonAPIClient
|
CommonAPIClient
|
||||||
|
apiClientExperimental
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that Client always implements APIClient.
|
// Ensure that Client always implements APIClient.
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package client
|
||||||
|
|
||||||
|
import "golang.org/x/net/context"
|
||||||
|
|
||||||
|
// Ping pings the server and return the value of the "Docker-Experimental" header
|
||||||
|
func (cli *Client) Ping(ctx context.Context) (bool, error) {
|
||||||
|
serverResp, err := cli.get(ctx, "/_ping", nil, nil)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
defer ensureReaderClosed(serverResp)
|
||||||
|
|
||||||
|
exp := serverResp.header.Get("Docker-Experimental")
|
||||||
|
if exp != "true" {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return true, nil
|
||||||
|
}
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build experimental
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
Loading…
Reference in New Issue