Skip to content

Commit 08f6b17

Browse files
committed
http probe output cleanup
1 parent aa5d29a commit 08f6b17

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ Global options:
265265
* `--http-probe` - enables HTTP probing (disabled by default)
266266
* `--http-probe-cmd` - additional HTTP probe command [zero or more]
267267
* `--http-probe-cmd-file` - file with user defined HTTP probe commands
268+
* `--http-probe-retry-count` - number of retries for each HTTP probe (default: 5)
269+
* `--http-probe-retry-wait` - number of seconds to wait before retrying HTTP probe (doubles when target is not ready; default: 8)
270+
* `--http-probe-ports` - explicit list of ports to probe (in the order you want them to be probed; excluded ports are not probed!)
271+
* `--http-probe-full` - do full HTTP probe for all selected ports (if false, finish after first successful scan; default: false)
268272
* `--show-clogs` - show container logs (from the container used to perform dynamic inspection)
269273
* `--show-blogs` - show build logs (when the minified container is built)
270274
* `--remove-file-artifacts` - remove file artifacts when command is done (note: you'll loose autogenerated Seccomp and Apparmor profiles)

internal/app/master/inspectors/container/probes/http/custom_probe.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,16 @@ func (p *CustomProbe) Start() {
199199
defer res.Body.Close()
200200
}
201201

202-
statusCode := 0
203-
callErrorStr := "none"
202+
statusCode := "error"
203+
callErrorStr := ""
204204
if err == nil {
205-
statusCode = res.StatusCode
205+
statusCode = fmt.Sprintf("%v", res.StatusCode)
206206
} else {
207-
callErrorStr = err.Error()
207+
callErrorStr = fmt.Sprintf("error='%v'", err.Error())
208208
}
209209

210210
if p.PrintState {
211-
fmt.Printf("%s info=http.probe.call status=%v method=%v target=%v attempt=%v error='%v' time=%v\n",
211+
fmt.Printf("%s info=http.probe.call status=%v method=%v target=%v attempt=%v %v time=%v\n",
212212
p.PrintPrefix,
213213
statusCode,
214214
cmd.Method,

0 commit comments

Comments
 (0)