server: abstract out linux capability per platform
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
d6966951d6
commit
4d88008a65
3 changed files with 24 additions and 4 deletions
|
@ -11,7 +11,6 @@ import (
|
|||
"github.com/kubernetes-incubator/cri-o/lib/sandbox"
|
||||
"github.com/kubernetes-incubator/cri-o/server/metrics"
|
||||
"github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/opencontainers/runtime-tools/validate"
|
||||
"github.com/syndtr/gocapability/capability"
|
||||
pb "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
|
||||
)
|
||||
|
@ -179,11 +178,11 @@ func inStringSlice(ss []string, str string) bool {
|
|||
// getOCICapabilitiesList returns a list of all available capabilities.
|
||||
func getOCICapabilitiesList() []string {
|
||||
var caps []string
|
||||
for _, cap := range capability.List() {
|
||||
if cap > validate.LastCap() {
|
||||
for _, c := range capability.List() {
|
||||
if c > lastCapability() {
|
||||
continue
|
||||
}
|
||||
caps = append(caps, "CAP_"+strings.ToUpper(cap.String()))
|
||||
caps = append(caps, "CAP_"+strings.ToUpper(c.String()))
|
||||
}
|
||||
return caps
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue