mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Rename PodSecurityPolicy fields
In podSecurityPolicy: 1. Rename .seLinuxContext to .seLinux 2. Rename .seLinux.type to .seLinux.rule 3. Rename .runAsUser.type to .runAsUser.rule 4. Rename .seLinux.SELinuxOptions 1,2,3 as suggested by thockin in #22159. I added 3 for consistency with 2.
This commit is contained in:
@@ -200,7 +200,7 @@ func (ed *emptyDir) SetUpAt(dir string, fsGroup *int64) error {
|
||||
|
||||
// setupTmpfs creates a tmpfs mount at the specified directory with the
|
||||
// specified SELinux context.
|
||||
func (ed *emptyDir) setupTmpfs(dir string, selinuxContext string) error {
|
||||
func (ed *emptyDir) setupTmpfs(dir string, selinux string) error {
|
||||
if ed.mounter == nil {
|
||||
return fmt.Errorf("memory storage requested, but mounter is nil")
|
||||
}
|
||||
@@ -221,8 +221,8 @@ func (ed *emptyDir) setupTmpfs(dir string, selinuxContext string) error {
|
||||
// By default a tmpfs mount will receive a different SELinux context
|
||||
// which is not readable from the SELinux context of a docker container.
|
||||
var opts []string
|
||||
if selinuxContext != "" {
|
||||
opts = []string{fmt.Sprintf("rootcontext=\"%v\"", selinuxContext)}
|
||||
if selinux != "" {
|
||||
opts = []string{fmt.Sprintf("rootcontext=\"%v\"", selinux)}
|
||||
} else {
|
||||
opts = []string{}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ func TestPluginRootContextSet(t *testing.T) {
|
||||
doTestPlugin(t, pluginTestConfig{
|
||||
medium: api.StorageMediumDefault,
|
||||
rootContext: "user:role:type:range",
|
||||
expectedSELinuxContext: "user:role:type:range",
|
||||
expectedSELinux: "user:role:type:range",
|
||||
expectedSetupMounts: 0,
|
||||
expectedTeardownMounts: 0})
|
||||
}
|
||||
@@ -101,7 +101,7 @@ func TestPluginTmpfs(t *testing.T) {
|
||||
doTestPlugin(t, pluginTestConfig{
|
||||
medium: api.StorageMediumMemory,
|
||||
rootContext: "user:role:type:range",
|
||||
expectedSELinuxContext: "user:role:type:range",
|
||||
expectedSELinux: "user:role:type:range",
|
||||
expectedSetupMounts: 1,
|
||||
shouldBeMountedBeforeTeardown: true,
|
||||
expectedTeardownMounts: 1})
|
||||
@@ -112,7 +112,7 @@ type pluginTestConfig struct {
|
||||
rootContext string
|
||||
SELinuxOptions *api.SELinuxOptions
|
||||
idempotent bool
|
||||
expectedSELinuxContext string
|
||||
expectedSELinux string
|
||||
expectedSetupMounts int
|
||||
shouldBeMountedBeforeTeardown bool
|
||||
expectedTeardownMounts int
|
||||
|
||||
Reference in New Issue
Block a user