Skip to content

Commit

Permalink
move defaultCaps to validate
Browse files Browse the repository at this point in the history
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
  • Loading branch information
Ma Shimiao committed Jul 25, 2016
1 parent 55645ff commit 5f07d9d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 23 deletions.
19 changes: 17 additions & 2 deletions cmd/ocitools/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (

"github.com/Sirupsen/logrus"
"github.com/blang/semver"
"github.com/opencontainers/ocitools/generate"
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/urfave/cli"
)
Expand Down Expand Up @@ -47,6 +46,22 @@ var (
"RLIMIT_RTPRIO",
"RLIMIT_RTTIME",
}
defaultCaps = []string{
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FSETID",
"CAP_FOWNER",
"CAP_MKNOD",
"CAP_NET_RAW",
"CAP_SETGID",
"CAP_SETUID",
"CAP_SETFCAP",
"CAP_SETPCAP",
"CAP_NET_BIND_SERVICE",
"CAP_SYS_CHROOT",
"CAP_KILL",
"CAP_AUDIT_WRITE",
}
)

var bundleValidateCommand = cli.Command{
Expand Down Expand Up @@ -421,7 +436,7 @@ func envValid(env string) bool {
}

func capValid(capability string) bool {
for _, val := range generate.DefaultCaps {
for _, val := range defaultCaps {
if val == capability {
return true
}
Expand Down
21 changes: 0 additions & 21 deletions generate/default.go

This file was deleted.

0 comments on commit 5f07d9d

Please sign in to comment.