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)
|
||||
RegistryLogin(ctx context.Context, auth types.AuthConfig) (types.AuthResponse, error)
|
||||
DiskUsage(ctx context.Context) (types.DiskUsage, error)
|
||||
Ping(ctx context.Context) (bool, error)
|
||||
}
|
||||
|
||||
// VolumeAPIClient defines API client methods for the volumes
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
@ -7,9 +5,7 @@ import (
|
|||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// APIClient is an interface that clients that talk with a docker server must implement.
|
||||
type APIClient interface {
|
||||
CommonAPIClient
|
||||
type apiClientExperimental interface {
|
||||
CheckpointAPIClient
|
||||
PluginAPIClient
|
||||
}
|
||||
|
@ -32,6 +28,3 @@ type PluginAPIClient interface {
|
|||
PluginSet(ctx context.Context, name string, args []string) 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
|
||||
|
||||
// APIClient is an interface that clients that talk with a docker server must implement.
|
||||
type APIClient interface {
|
||||
CommonAPIClient
|
||||
apiClientExperimental
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build experimental
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
|
|
Loading…
Reference in New Issue