Skip to content

Commit

Permalink
Merge pull request moby#20106 from jfrazelle/go-generate-json-default…
Browse files Browse the repository at this point in the history
…-profile

add default seccomp profile as json
  • Loading branch information
calavera committed Feb 8, 2016
2 parents 54b67fe + 9bc771a commit 3846951
Show file tree
Hide file tree
Showing 8 changed files with 1,638 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ test-unit: build
$(DOCKER_RUN_DOCKER) hack/make.sh test-unit

validate: build
$(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet validate-vendor
$(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-default-seccomp validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet validate-vendor
1 change: 1 addition & 0 deletions hack/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ echo
# List of bundles to create when no argument is passed
DEFAULT_BUNDLES=(
validate-dco
validate-default-seccomp
validate-gofmt
validate-lint
validate-pkg
Expand Down
27 changes: 27 additions & 0 deletions hack/make/validate-default-seccomp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

source "${MAKEDIR}/.validate"

IFS=$'\n'
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'profiles/seccomp' || true) )
unset IFS

if [ ${#files[@]} -gt 0 ]; then
# We run vendor.sh to and see if we have a diff afterwards
go generate ./profiles/seccomp/ >/dev/null
# Let see if the working directory is clean
diffs="$(git status --porcelain -- profiles/seccomp 2>/dev/null)"
if [ "$diffs" ]; then
{
echo 'The result of go generate ./profiles/seccomp/ differs'
echo
echo "$diffs"
echo
echo 'Please re-run go generate ./profiles/seccomp/'
echo
} >&2
false
else
echo 'Congratulations! Seccomp profile generation is done correctly.'
fi
fi
Loading

0 comments on commit 3846951

Please sign in to comment.