Skip to content

Commit

Permalink
Revert "kola/docker: make selinux optional"
Browse files Browse the repository at this point in the history
This reverts commit 9101e70.
  • Loading branch information
Mathieu Tortuyaux committed Jun 30, 2021
1 parent 41e40e6 commit 7e385ac
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions kola/tests/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"encoding/json"
"fmt"
"os"
"reflect"
"sort"
"strings"
"time"
Expand Down Expand Up @@ -186,7 +187,6 @@ systemd:
[Service]
Type=notify
EnvironmentFile=-/run/flannel/flannel_docker_opts.env
Environment=DOCKER_OPTS=--selinux-enabled=false
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
Expand Down Expand Up @@ -592,7 +592,7 @@ func testDockerInfo(expectedFs string, c cluster.TestCluster) {
}

// Validations shared by all versions currently
if !hasSecurityOptions(info.SecurityOptions) {
if !reflect.DeepEqual(info.SecurityOptions, []string{"seccomp", "selinux"}) {
c.Errorf("unexpected security options: %+v", info.SecurityOptions)
}

Expand All @@ -617,20 +617,6 @@ func testDockerInfo(expectedFs string, c cluster.TestCluster) {
}
}

// hasSecurityOptions strictly checks that at least one of
// the Docker security option is enabled (seccomp, selinux).
func hasSecurityOptions(opts []string) bool {
for _, opt := range opts {
switch opt {
case "selinux", "seccomp":
default:
return false
}
}

return true
}

// dockerSELinux tests SELinux for Docker by running a container
// in enforce mode and in permissive mode with a non-labelled file
// and a labelled file
Expand Down

0 comments on commit 7e385ac

Please sign in to comment.