From 7fb89f10d45230fddd94ecce09a69c910c8925ee Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Wed, 19 Nov 2014 21:08:22 -0800 Subject: [PATCH] fleetctl: switch default driver to API --- fleetctl/fleetctl.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fleetctl/fleetctl.go b/fleetctl/fleetctl.go index 4de563bc0..df00765d9 100644 --- a/fleetctl/fleetctl.go +++ b/fleetctl/fleetctl.go @@ -118,8 +118,8 @@ func init() { globalFlagset.BoolVar(&globalFlags.Debug, "debug", false, "Print out more debug information to stderr") globalFlagset.BoolVar(&globalFlags.Version, "version", false, "Print the version and exit") - globalFlagset.StringVar(&globalFlags.ClientDriver, "driver", clientDriverEtcd, fmt.Sprintf("Adapter used to execute fleetctl commands. Options include %q and %q.", clientDriverAPI, clientDriverEtcd)) - globalFlagset.StringVar(&globalFlags.Endpoint, "endpoint", "http://127.0.0.1:4001", fmt.Sprintf("Location of the fleet API if --driver=%s. Alternatively, if --driver=%s, location of the etcd API.", clientDriverAPI, clientDriverEtcd)) + globalFlagset.StringVar(&globalFlags.ClientDriver, "driver", clientDriverAPI, fmt.Sprintf("Adapter used to execute fleetctl commands. Options include %q and %q.", clientDriverAPI, clientDriverEtcd)) + globalFlagset.StringVar(&globalFlags.Endpoint, "endpoint", "unix:///var/run/fleet.sock", fmt.Sprintf("Location of the fleet API if --driver=%s. Alternatively, if --driver=%s, location of the etcd API.", clientDriverAPI, clientDriverEtcd)) globalFlagset.StringVar(&globalFlags.EtcdKeyPrefix, "etcd-key-prefix", registry.DefaultKeyPrefix, "Keyspace for fleet data in etcd (development use only!)") globalFlagset.StringVar(&globalFlags.KeyFile, "keyfile", "", "Location of TLS key file used to secure communication with the fleet API or etcd") @@ -133,7 +133,7 @@ func init() { globalFlagset.Float64Var(&globalFlags.RequestTimeout, "request-timeout", 3.0, "Amount of time in seconds to allow a single request before considering it failed.") // deprecated flags - globalFlagset.BoolVar(&globalFlags.ExperimentalAPI, "experimental-api", false, hidden) + globalFlagset.BoolVar(&globalFlags.ExperimentalAPI, "experimental-api", true, hidden) globalFlagset.StringVar(&globalFlags.KeyFile, "etcd-keyfile", "", hidden) globalFlagset.StringVar(&globalFlags.CertFile, "etcd-certfile", "", hidden) globalFlagset.StringVar(&globalFlags.CAFile, "etcd-cafile", "", hidden) @@ -295,10 +295,10 @@ func getFlagsFromEnv(prefix string, fs *flag.FlagSet) { // getClient initializes a client of fleet based on CLI flags func getClient() (client.API, error) { - // The user explicitly set --experimental-api=true, so it trumps the + // The user explicitly set --experimental-api=false, so it trumps the // --driver flag. This behavior exists for backwards-compatibilty. - if globalFlags.ExperimentalAPI { - return getHTTPClient() + if !globalFlags.ExperimentalAPI { + return getRegistryClient() } switch globalFlags.ClientDriver {