mirror of https://github.com/hashicorp/consul
Moves config util helpers into their own package. (#3165)
parent
b083ce17c7
commit
902f1ce16f
|
@ -9,6 +9,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/hashicorp/consul/api"
|
||||
"github.com/hashicorp/consul/configutil"
|
||||
"github.com/mitchellh/cli"
|
||||
text "github.com/tonnerre/golang-text"
|
||||
)
|
||||
|
@ -36,16 +37,16 @@ type BaseCommand struct {
|
|||
hidden *flag.FlagSet
|
||||
|
||||
// These are the options which correspond to the HTTP API options
|
||||
httpAddr StringValue
|
||||
token StringValue
|
||||
caFile StringValue
|
||||
caPath StringValue
|
||||
certFile StringValue
|
||||
keyFile StringValue
|
||||
tlsServerName StringValue
|
||||
httpAddr configutil.StringValue
|
||||
token configutil.StringValue
|
||||
caFile configutil.StringValue
|
||||
caPath configutil.StringValue
|
||||
certFile configutil.StringValue
|
||||
keyFile configutil.StringValue
|
||||
tlsServerName configutil.StringValue
|
||||
|
||||
datacenter StringValue
|
||||
stale BoolValue
|
||||
datacenter configutil.StringValue
|
||||
stale configutil.BoolValue
|
||||
}
|
||||
|
||||
// HTTPClient returns a client with the parsed flags. It panics if the command
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/hashicorp/consul/api"
|
||||
"github.com/hashicorp/consul/configutil"
|
||||
)
|
||||
|
||||
type OperatorAutopilotSetCommand struct {
|
||||
|
@ -29,12 +30,12 @@ func (c *OperatorAutopilotSetCommand) Synopsis() string {
|
|||
}
|
||||
|
||||
func (c *OperatorAutopilotSetCommand) Run(args []string) int {
|
||||
var cleanupDeadServers BoolValue
|
||||
var maxTrailingLogs UintValue
|
||||
var lastContactThreshold DurationValue
|
||||
var serverStabilizationTime DurationValue
|
||||
var redundancyZoneTag StringValue
|
||||
var disableUpgradeMigration BoolValue
|
||||
var cleanupDeadServers configutil.BoolValue
|
||||
var maxTrailingLogs configutil.UintValue
|
||||
var lastContactThreshold configutil.DurationValue
|
||||
var serverStabilizationTime configutil.DurationValue
|
||||
var redundancyZoneTag configutil.StringValue
|
||||
var disableUpgradeMigration configutil.BoolValue
|
||||
|
||||
f := c.BaseCommand.NewFlagSet(c)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package command
|
||||
package configutil
|
||||
|
||||
import (
|
||||
"fmt"
|
|
@ -1,4 +1,4 @@
|
|||
package command
|
||||
package configutil
|
||||
|
||||
import (
|
||||
"bytes"
|
Loading…
Reference in New Issue