diff options
Diffstat (limited to 'client/go/internal/admin/vespa-wrapper/configserver/check.go')
-rw-r--r-- | client/go/internal/admin/vespa-wrapper/configserver/check.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/client/go/internal/admin/vespa-wrapper/configserver/check.go b/client/go/internal/admin/vespa-wrapper/configserver/check.go new file mode 100644 index 00000000000..a0248dd128f --- /dev/null +++ b/client/go/internal/admin/vespa-wrapper/configserver/check.go @@ -0,0 +1,24 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Author: arnej + +package configserver + +import ( + "fmt" + + "github.com/vespa-engine/vespa/client/go/internal/admin/defaults" + "github.com/vespa-engine/vespa/client/go/internal/admin/trace" + "github.com/vespa-engine/vespa/client/go/internal/util" +) + +func checkIsConfigserver(myname string) { + onlyHosts := defaults.VespaConfigserverHosts() + for _, hn := range onlyHosts { + if hn == "localhost" || hn == myname { + trace.Debug("should run configserver:", hn) + return + } + } + trace.Warning("only these hosts should run a config server:", onlyHosts) + util.JustExitMsg(fmt.Sprintf("this host [%s] should not run a config server", myname)) +} |