mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
generate seccomp profile convert type
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
This commit is contained in:
parent
e51457eea8
commit
ad600239bc
6 changed files with 961 additions and 961 deletions
|
@ -72,7 +72,10 @@ func (d *Driver) createContainer(c *execdriver.Command, hooks execdriver.Hooks)
|
|||
}
|
||||
|
||||
if c.SeccompProfile == "" {
|
||||
container.Seccomp = seccomp.GetDefaultProfile()
|
||||
container.Seccomp, err = seccomp.GetDefaultProfile()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
// add CAP_ prefix to all caps for new libcontainer update to match
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -20,11 +20,8 @@ func main() {
|
|||
}
|
||||
f := filepath.Join(wd, "default.json")
|
||||
|
||||
// get the default profile
|
||||
p := seccomp.GetDefaultProfile()
|
||||
|
||||
// write the default profile to the file
|
||||
b, err := json.MarshalIndent(p, "", "\t")
|
||||
b, err := json.MarshalIndent(seccomp.DefaultProfile, "", "\t")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
|
@ -14,8 +14,8 @@ import (
|
|||
//go:generate go run -tags 'seccomp' generate.go
|
||||
|
||||
// GetDefaultProfile returns the default seccomp profile.
|
||||
func GetDefaultProfile() *configs.Seccomp {
|
||||
return defaultProfile
|
||||
func GetDefaultProfile() (*configs.Seccomp, error) {
|
||||
return setupSeccomp(DefaultProfile)
|
||||
}
|
||||
|
||||
// LoadProfile takes a file path a decodes the seccomp profile.
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2,9 +2,9 @@
|
|||
|
||||
package seccomp
|
||||
|
||||
import "github.com/opencontainers/runc/libcontainer/configs"
|
||||
import "github.com/docker/engine-api/types"
|
||||
|
||||
var (
|
||||
// defaultProfile is a nil pointer on unsupported systems.
|
||||
defaultProfile *configs.Seccomp
|
||||
// DefaultProfile is a nil pointer on unsupported systems.
|
||||
DefaultProfile *types.Seccomp
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue