container_create: support seccomp docker/default annotation
Fixes the following Origin/Kube test: ``` • Failure [10.323 seconds] [k8s.io] Security Context [Feature:SecurityContext] /go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/test/e2e/framework/framework.go:619 should support seccomp alpha docker/default annotation [Feature:Seccomp] [It] /go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/test/e2e/security_context.go:133 Expected error: <*errors.errorString | 0xc420cbacf0>: { s: "expected \"2\" in container output: Expected\n <string>: Seccomp:\t0\n \nto contain substring\n <string>: 2", } expected "2" in container output: Expected <string>: Seccomp: 0 to contain substring <string>: 2 not to have occurred } ``` Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
4fadbea75d
commit
e8cfe3b867
2 changed files with 41 additions and 7 deletions
|
@ -38,6 +38,7 @@ import (
|
|||
const (
|
||||
seccompUnconfined = "unconfined"
|
||||
seccompRuntimeDefault = "runtime/default"
|
||||
seccompDockerDefault = "docker/default"
|
||||
seccompLocalhostPrefix = "localhost/"
|
||||
|
||||
scopePrefix = "crio"
|
||||
|
@ -1033,18 +1034,13 @@ func (s *Server) setupSeccomp(specgen *generate.Generator, cname string, sbAnnot
|
|||
specgen.Spec().Linux.Seccomp = nil
|
||||
return nil
|
||||
}
|
||||
if profile == seccompRuntimeDefault {
|
||||
if profile == seccompRuntimeDefault || profile == seccompDockerDefault {
|
||||
return seccomp.LoadProfileFromStruct(s.seccompProfile, specgen)
|
||||
}
|
||||
if !strings.HasPrefix(profile, seccompLocalhostPrefix) {
|
||||
return fmt.Errorf("unknown seccomp profile option: %q", profile)
|
||||
}
|
||||
//file, err := ioutil.ReadFile(filepath.Join(s.seccompProfileRoot, strings.TrimPrefix(profile, seccompLocalhostPrefix)))
|
||||
//if err != nil {
|
||||
//return err
|
||||
//}
|
||||
// TODO(runcom): setup from provided node's seccomp profile
|
||||
// can't do this yet, see https://issues.k8s.io/36997
|
||||
// FIXME: https://github.com/kubernetes/kubernetes/issues/39128
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue