Skip to content

Commit c6f7fbc

Browse files
authored
Merge pull request kubernetes#93220 from wawa0210/fix-93165
ingore apparmor on windows
2 parents 1257bc5 + 995d654 commit c6f7fbc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/kubelet/kubelet.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"net/url"
2626
"os"
2727
"path"
28+
sysruntime "runtime"
2829
"sort"
2930
"strings"
3031
"sync"
@@ -775,8 +776,11 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
775776
opt(klet)
776777
}
777778

778-
klet.appArmorValidator = apparmor.NewValidator(containerRuntime)
779-
klet.softAdmitHandlers.AddPodAdmitHandler(lifecycle.NewAppArmorAdmitHandler(klet.appArmorValidator))
779+
if sysruntime.GOOS == "linux" {
780+
// AppArmor is a Linux kernel security module and it does not support other operating systems.
781+
klet.appArmorValidator = apparmor.NewValidator(containerRuntime)
782+
klet.softAdmitHandlers.AddPodAdmitHandler(lifecycle.NewAppArmorAdmitHandler(klet.appArmorValidator))
783+
}
780784
klet.softAdmitHandlers.AddPodAdmitHandler(lifecycle.NewNoNewPrivsAdmitHandler(klet.containerRuntime))
781785
klet.softAdmitHandlers.AddPodAdmitHandler(lifecycle.NewProcMountAdmitHandler(klet.containerRuntime))
782786

0 commit comments

Comments
 (0)