slimtoolkit / slim

Slim(toolkit): Don't change anything in your container image and minify it by up to 30x (and for compiled languages even more) making it secure too! (free and open source)
Apache License 2.0
19.21k stars 716 forks source link

docs: Specify arg format in HTTPProbeCmd's help #458

Closed BMDan closed 1 year ago

BMDan commented 1 year ago

What

Annotates --http-probe-cmd with some guidance on how to format its argument.

Why

Based on "cmd" in the option's name, my misadventures began when I tried --http-probe-cmd 'curl http://127.0.0.1:1234/test'. That gives the following error:

cmd=build error=param.http.probe message='invalid HTTP probe command protocol: curl http://127.0.0.1:1234/test'

Seizing on "protocol", I then tried a number of other variations, like dropping the curl and just using http://127.0.0.1:1234/test (yields invalid HTTP probe command method), and then adding GET as the first parameter (puts me back at square 1 with an "protocol" error). Turns out the correct format is any of the following:

  1. '' (i.e., blank) — runs a GET on / via HTTP.
  2. <path> — runs a GET on <path> via HTTP.
  3. <method>:<path> — runs a <method> on <path> via HTTP
  4. <protocol>:<method>:<path> — as above, but with <protocol>
  5. Four more varations, because each of these can also have crawl: prepended. If present (or if crawl is passed as a bareword), Crawl mode is activated.

This is probably documented somewhere already. But now it's readily accessible in the first place people will look: the --help of the command itself.

How Tested

n/a

kcq commented 1 year ago

thanks for the PR @BMDan !