Skip to content

Commit

Permalink
Move template to the outside of the goss command
Browse files Browse the repository at this point in the history
  • Loading branch information
triarius committed Jun 9, 2023
1 parent 49e62c1 commit db766d3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,23 @@ command:
exit-status: 0

# Check docker userns is enabled
# Note that goss will evaluate the first layer of templating in the `--format` argument, and docker will evaluate the second
docker info --format=$'{{ `{{range .SecurityOptions}}{{.}}\n{{end}}` }}':
# Note that goss will evaluate the outer layer of templating, and docker will evaluate the second
# Running `goss validate --format documentation` will print this with the first layer of templating evaluated
'{{ `docker info --format=",{{range .SecurityOptions}}{{.}},{{end}}"` }}':
exit-status: 0
timeout: 30000
stdout:
- /^name=userns$/
- /,name=userns,/

# Check docker plugins are installed
# Note that goss will evaluate the first layer of templating in the `--format` argument, and docker will evaluate the second
docker info --format=$'{{ `{{range .ClientInfo.Plugins}}{{.Name}}\n{{end}}` }}':
# Note that goss will evaluate the first layer of templating, and docker will evaluate the second
# Running `goss validate --format documentation` will print this with the first layer of templating evaluated
'{{ `docker info --format=",{{range .ClientInfo.Plugins}}{{.Name}},{{end}}"` }}':
exit-status: 0
timeout: 30000
stdout:
- /^buildx$/
- /^compose$/
- /,buildx,/
- /,compose,/

# Check that docker containers can run
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock docker:latest version:
Expand Down

0 comments on commit db766d3

Please sign in to comment.