cli: Removed obsolete no-watch-config flag

Having it around creates the expectation that by default mgmt will put a watch
on the config.
This commit is contained in:
Wouter Dullaert
2019-04-22 12:04:55 +02:00
parent 22d893fc1e
commit d65c85c19f
6 changed files with 1 additions and 14 deletions

View File

@@ -73,7 +73,6 @@ type Data struct {
Hostname string // uuid for the host, required for GAPI Hostname string // uuid for the host, required for GAPI
World engine.World World engine.World
Noop bool Noop bool
NoConfigWatch bool
NoStreamWatch bool NoStreamWatch bool
Prefix string Prefix string
Debug bool Debug bool

View File

@@ -167,7 +167,6 @@ func (obj *GAPI) Init(data *gapi.Data) error {
Hostname: obj.data.Hostname, Hostname: obj.data.Hostname,
World: obj.data.World, World: obj.data.World,
Noop: obj.data.Noop, Noop: obj.data.Noop,
NoConfigWatch: obj.data.NoConfigWatch,
NoStreamWatch: obj.data.NoStreamWatch, NoStreamWatch: obj.data.NoStreamWatch,
Debug: obj.data.Debug, Debug: obj.data.Debug,
Logf: func(format string, v ...interface{}) { Logf: func(format string, v ...interface{}) {
@@ -179,7 +178,6 @@ func (obj *GAPI) Init(data *gapi.Data) error {
Hostname: obj.data.Hostname, Hostname: obj.data.Hostname,
World: obj.data.World, World: obj.data.World,
Noop: obj.data.Noop, Noop: obj.data.Noop,
NoConfigWatch: obj.data.NoConfigWatch,
NoStreamWatch: obj.data.NoStreamWatch, NoStreamWatch: obj.data.NoStreamWatch,
Debug: obj.data.Debug, Debug: obj.data.Debug,
Logf: func(format string, v ...interface{}) { Logf: func(format string, v ...interface{}) {

View File

@@ -72,10 +72,6 @@ func CLI(program, version string, flags Flags) error {
Name: "no-watch", Name: "no-watch",
Usage: "do not update graph under any switch events", Usage: "do not update graph under any switch events",
}, },
cli.BoolFlag{
Name: "no-config-watch",
Usage: "do not update graph on config switch events",
},
cli.BoolFlag{ cli.BoolFlag{
Name: "no-stream-watch", Name: "no-stream-watch",
Usage: "do not update graph on stream switch events", Usage: "do not update graph on stream switch events",

View File

@@ -75,7 +75,6 @@ type Main struct {
DeployFs engine.Fs // used for static deploys DeployFs engine.Fs // used for static deploys
NoWatch bool // do not change graph under any circumstances NoWatch bool // do not change graph under any circumstances
NoConfigWatch bool // do not update graph due to config changes
NoStreamWatch bool // do not update graph due to stream changes NoStreamWatch bool // do not update graph due to stream changes
NoDeployWatch bool // do not change deploys after an initial deploy NoDeployWatch bool // do not change deploys after an initial deploy
@@ -140,9 +139,8 @@ func (obj *Main) Init() error {
// if we've turned off watching, then be explicit and disable them all! // if we've turned off watching, then be explicit and disable them all!
// if all the watches are disabled, then it's equivalent to no watching // if all the watches are disabled, then it's equivalent to no watching
if obj.NoWatch { if obj.NoWatch {
obj.NoConfigWatch = true
obj.NoStreamWatch = true obj.NoStreamWatch = true
} else if obj.NoConfigWatch && obj.NoStreamWatch { } else if obj.NoStreamWatch {
obj.NoWatch = true obj.NoWatch = true
} }
@@ -554,7 +552,6 @@ func (obj *Main) Run() error {
Noop: mainDeploy.Noop, Noop: mainDeploy.Noop,
// FIXME: should the below flags come from the deploy struct? // FIXME: should the below flags come from the deploy struct?
//NoWatch: obj.NoWatch, //NoWatch: obj.NoWatch,
NoConfigWatch: obj.NoConfigWatch,
NoStreamWatch: obj.NoStreamWatch, NoStreamWatch: obj.NoStreamWatch,
Prefix: fmt.Sprintf("%s/", path.Join(prefix, "gapi")), Prefix: fmt.Sprintf("%s/", path.Join(prefix, "gapi")),
Debug: obj.Flags.Debug, Debug: obj.Flags.Debug,

View File

@@ -87,7 +87,6 @@ func run(c *cli.Context, name string, gapiObj gapi.GAPI) error {
} }
obj.NoWatch = cliContext.Bool("no-watch") obj.NoWatch = cliContext.Bool("no-watch")
obj.NoConfigWatch = cliContext.Bool("no-config-watch")
obj.NoStreamWatch = cliContext.Bool("no-stream-watch") obj.NoStreamWatch = cliContext.Bool("no-stream-watch")
obj.NoDeployWatch = cliContext.Bool("no-deploy-watch") obj.NoDeployWatch = cliContext.Bool("no-deploy-watch")

View File

@@ -294,8 +294,6 @@ func (obj *GAPI) Next() chan gapi.Next {
close(startChan) // kick it off! close(startChan) // kick it off!
var pChan <-chan time.Time var pChan <-chan time.Time
// NOTE: we don't look at obj.data.NoConfigWatch since emulating
// puppet means we do not switch graphs on code changes anyways.
if obj.data.NoStreamWatch { if obj.data.NoStreamWatch {
pChan = nil pChan = nil
} else { } else {