Move IsAppArmorSupported() from e2e framework

The function is only used at a single place.
This moves it to the place.
This commit is contained in:
Kenichi Omichi 2020-01-08 13:46:50 +00:00
parent 720e6de6b9
commit f3c70a2ed2
3 changed files with 6 additions and 24 deletions

View File

@ -166,7 +166,7 @@ func testPrivilegedPods(tester func(pod *v1.Pod)) {
tester(hostipc)
})
if framework.IsAppArmorSupported() {
if isAppArmorSupported() {
ginkgo.By("Running a custom AppArmor profile pod", func() {
aa := restrictedPod("apparmor")
// Every node is expected to have the docker-default profile.
@ -370,3 +370,8 @@ func restrictedPSP(name string) *policyv1beta1.PodSecurityPolicy {
func boolPtr(b bool) *bool {
return &b
}
// isAppArmorSupported checks whether the AppArmor is supported by the node OS distro.
func isAppArmorSupported() bool {
return framework.NodeOSDistroIs(framework.AppArmorDistros...)
}

View File

@ -3,7 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = [
"checks.go",
"cleanup.go",
"exec_util.go",
"expect.go",

View File

@ -1,22 +0,0 @@
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package framework
// IsAppArmorSupported checks whether the AppArmor is supported by the node OS distro.
func IsAppArmorSupported() bool {
return NodeOSDistroIs(AppArmorDistros...)
}