mirror of
https://github.com/weaveworks/scope.git
synced 2026-02-14 18:09:59 +00:00
Don't require the user to specify localhost when manually listing hosts
This commit is contained in:
13
integration/106_launch_with_peers_test.sh
Executable file
13
integration/106_launch_with_peers_test.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#! /bin/bash
|
||||
|
||||
. ./config.sh
|
||||
|
||||
start_suite "Launch scope and check it boots, with a spurious host arg"
|
||||
|
||||
scope_on $HOST1 launch noatrealhost.foo
|
||||
|
||||
wait_for_containers $HOST1 60 weavescope
|
||||
|
||||
has_container $HOST1 weavescope
|
||||
|
||||
scope_end_suite
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
start_suite "Launch 2 scopes and check they cluster (without weave)"
|
||||
|
||||
scope_on $HOST1 launch $HOST1 $HOST2
|
||||
scope_on $HOST2 launch $HOST1 $HOST2
|
||||
scope_on $HOST1 launch $HOST2
|
||||
scope_on $HOST2 launch $HOST1
|
||||
|
||||
docker_on $HOST1 run -dit --name db1 peterbourgon/tns-db
|
||||
docker_on $HOST2 run -dit --name db2 peterbourgon/tns-db
|
||||
|
||||
17
integration/215_clustering_split_2_test.sh
Executable file
17
integration/215_clustering_split_2_test.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#! /bin/bash
|
||||
|
||||
. ./config.sh
|
||||
|
||||
start_suite "Launch 2 scopes and check they cluster (without weave)"
|
||||
|
||||
scope_on $HOST1 launch --no-app $HOST2
|
||||
scope_on $HOST2 launch --no-probe
|
||||
|
||||
docker_on $HOST1 run -dit --name db1 peterbourgon/tns-db
|
||||
|
||||
sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and send them reports.
|
||||
|
||||
has_container $HOST2 weavescope
|
||||
has_container $HOST2 db1
|
||||
|
||||
scope_end_suite
|
||||
11
prog/main.go
11
prog/main.go
@@ -68,6 +68,7 @@ type probeFlags struct {
|
||||
logPrefix string
|
||||
logLevel string
|
||||
resolver string
|
||||
noApp bool
|
||||
|
||||
dockerEnabled bool
|
||||
dockerInterval time.Duration
|
||||
@@ -115,12 +116,13 @@ func main() {
|
||||
flag.BoolVar(&debug, "debug", false, "Force debug logging.")
|
||||
flag.StringVar(&weaveHostname, "weave.hostname", "", "Hostname to advertise/lookup in WeaveDNS")
|
||||
|
||||
// We can ignore these - we need to know how to parse them, but they are interpreted by the entrypoint script.
|
||||
// They are also here so they are included in usage.
|
||||
flag.Bool("no-app", false, "Don't run the app.")
|
||||
// We need to know how to parse them, but they are mainly interpreted by the entrypoint script.
|
||||
// They are also here so they are included in usage, and the probe uses them to decide if to
|
||||
// publish to localhost.
|
||||
noApp := flag.Bool("no-app", false, "Don't run the app.")
|
||||
probeOnly := flag.Bool("app-only", false, "Only run the app")
|
||||
flag.Bool("probe-only", false, "Only run the probe.")
|
||||
flag.Bool("no-probe", false, "Don't run the probe.")
|
||||
flag.Bool("app-only", false, "Only run the app")
|
||||
|
||||
// Probe flags
|
||||
flag.StringVar(&flags.probe.token, "service-token", "", "Token to use to authenticate with scope.weave.works")
|
||||
@@ -176,6 +178,7 @@ func main() {
|
||||
flags.probe.weaveHostname = weaveHostname
|
||||
flags.app.weaveHostname = weaveHostname
|
||||
}
|
||||
flags.probe.noApp = *noApp || *probeOnly
|
||||
|
||||
switch mode {
|
||||
case "app":
|
||||
|
||||
@@ -94,9 +94,12 @@ func probeMain(flags probeFlags) {
|
||||
}
|
||||
go check(checkpointFlags)
|
||||
|
||||
var targets = []string{fmt.Sprintf("localhost:%d", xfer.AppPort)}
|
||||
var targets = []string{}
|
||||
if !flags.noApp {
|
||||
targets = append(targets, fmt.Sprintf("localhost:%d", xfer.AppPort))
|
||||
}
|
||||
if len(flag.Args()) > 0 {
|
||||
targets = flag.Args()
|
||||
targets = append(targets, flag.Args()...)
|
||||
}
|
||||
log.Infof("publishing to: %s", strings.Join(targets, ", "))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user