Skip to content

Commit

Permalink
http probe output cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kcq committed Mar 23, 2019
1 parent aa5d29a commit 08f6b17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ Global options:
* `--http-probe` - enables HTTP probing (disabled by default)
* `--http-probe-cmd` - additional HTTP probe command [zero or more]
* `--http-probe-cmd-file` - file with user defined HTTP probe commands
* `--http-probe-retry-count` - number of retries for each HTTP probe (default: 5)
* `--http-probe-retry-wait` - number of seconds to wait before retrying HTTP probe (doubles when target is not ready; default: 8)
* `--http-probe-ports` - explicit list of ports to probe (in the order you want them to be probed; excluded ports are not probed!)
* `--http-probe-full` - do full HTTP probe for all selected ports (if false, finish after first successful scan; default: false)
* `--show-clogs` - show container logs (from the container used to perform dynamic inspection)
* `--show-blogs` - show build logs (when the minified container is built)
* `--remove-file-artifacts` - remove file artifacts when command is done (note: you'll loose autogenerated Seccomp and Apparmor profiles)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,16 @@ func (p *CustomProbe) Start() {
defer res.Body.Close()
}

statusCode := 0
callErrorStr := "none"
statusCode := "error"
callErrorStr := ""
if err == nil {
statusCode = res.StatusCode
statusCode = fmt.Sprintf("%v", res.StatusCode)
} else {
callErrorStr = err.Error()
callErrorStr = fmt.Sprintf("error='%v'", err.Error())
}

if p.PrintState {
fmt.Printf("%s info=http.probe.call status=%v method=%v target=%v attempt=%v error='%v' time=%v\n",
fmt.Printf("%s info=http.probe.call status=%v method=%v target=%v attempt=%v %v time=%v\n",
p.PrintPrefix,
statusCode,
cmd.Method,
Expand Down

0 comments on commit 08f6b17

Please sign in to comment.