mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
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:
parent
720e6de6b9
commit
f3c70a2ed2
@ -166,7 +166,7 @@ func testPrivilegedPods(tester func(pod *v1.Pod)) {
|
|||||||
tester(hostipc)
|
tester(hostipc)
|
||||||
})
|
})
|
||||||
|
|
||||||
if framework.IsAppArmorSupported() {
|
if isAppArmorSupported() {
|
||||||
ginkgo.By("Running a custom AppArmor profile pod", func() {
|
ginkgo.By("Running a custom AppArmor profile pod", func() {
|
||||||
aa := restrictedPod("apparmor")
|
aa := restrictedPod("apparmor")
|
||||||
// Every node is expected to have the docker-default profile.
|
// 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 {
|
func boolPtr(b bool) *bool {
|
||||||
return &b
|
return &b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// isAppArmorSupported checks whether the AppArmor is supported by the node OS distro.
|
||||||
|
func isAppArmorSupported() bool {
|
||||||
|
return framework.NodeOSDistroIs(framework.AppArmorDistros...)
|
||||||
|
}
|
||||||
|
@ -3,7 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
|||||||
go_library(
|
go_library(
|
||||||
name = "go_default_library",
|
name = "go_default_library",
|
||||||
srcs = [
|
srcs = [
|
||||||
"checks.go",
|
|
||||||
"cleanup.go",
|
"cleanup.go",
|
||||||
"exec_util.go",
|
"exec_util.go",
|
||||||
"expect.go",
|
"expect.go",
|
||||||
|
@ -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...)
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user