Merge pull request #108156 from jsafrane/rename-selinuxsupport

Rename SupportsSELinux to SELinuxRelabel
This commit is contained in:
Kubernetes Prow Robot 2022-02-22 20:12:20 -08:00 committed by GitHub
commit eacbf87bfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 94 additions and 93 deletions

View File

@ -175,7 +175,7 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h
// If the volume supports SELinux and it has not been // If the volume supports SELinux and it has not been
// relabeled already and it is not a read-only volume, // relabeled already and it is not a read-only volume,
// relabel it and mark it as labeled // relabel it and mark it as labeled
if vol.Mounter.GetAttributes().Managed && vol.Mounter.GetAttributes().SupportsSELinux && !vol.SELinuxLabeled { if vol.Mounter.GetAttributes().Managed && vol.Mounter.GetAttributes().SELinuxRelabel && !vol.SELinuxLabeled {
vol.SELinuxLabeled = true vol.SELinuxLabeled = true
relabelVolume = true relabelVolume = true
} }

View File

@ -352,7 +352,7 @@ func (b *awsElasticBlockStoreMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: b.readOnly, ReadOnly: b.readOnly,
Managed: !b.readOnly, Managed: !b.readOnly,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -241,7 +241,7 @@ func (b *azureFileMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: b.readOnly, ReadOnly: b.readOnly,
Managed: !b.readOnly, Managed: !b.readOnly,
SupportsSELinux: false, SELinuxRelabel: false,
} }
} }

View File

@ -58,7 +58,7 @@ func (m *azureDiskMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: readOnly, ReadOnly: readOnly,
Managed: !readOnly, Managed: !readOnly,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -208,7 +208,7 @@ func (cephfsVolume *cephfsMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: cephfsVolume.readonly, ReadOnly: cephfsVolume.readonly,
Managed: false, Managed: false,
SupportsSELinux: false, SELinuxRelabel: false,
} }
} }

View File

@ -373,7 +373,7 @@ func (b *cinderVolumeMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: b.readOnly, ReadOnly: b.readOnly,
Managed: !b.readOnly, Managed: !b.readOnly,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -159,7 +159,7 @@ func (sv *configMapVolume) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: true, ReadOnly: true,
Managed: true, Managed: true,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -354,7 +354,7 @@ func (c *csiMountMgr) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: c.readOnly, ReadOnly: c.readOnly,
Managed: !c.readOnly, Managed: !c.readOnly,
SupportsSELinux: c.supportsSELinux, SELinuxRelabel: c.supportsSELinux,
} }
} }

View File

@ -155,7 +155,7 @@ func (d *downwardAPIVolume) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: true, ReadOnly: true,
Managed: true, Managed: true,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -221,7 +221,7 @@ func (ed *emptyDir) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: false, ReadOnly: false,
Managed: true, Managed: true,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -366,7 +366,7 @@ func (b *fcDiskMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: b.readOnly, ReadOnly: b.readOnly,
Managed: !b.readOnly, Managed: !b.readOnly,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -47,7 +47,7 @@ func (f *mounterDefaults) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: f.readOnly, ReadOnly: f.readOnly,
Managed: !f.readOnly, Managed: !f.readOnly,
SupportsSELinux: f.flexVolume.plugin.capabilities.SELinuxRelabel, SELinuxRelabel: f.flexVolume.plugin.capabilities.SELinuxRelabel,
} }
} }

View File

@ -216,7 +216,7 @@ func (b *flockerVolumeMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: b.readOnly, ReadOnly: b.readOnly,
Managed: false, Managed: false,
SupportsSELinux: false, SELinuxRelabel: false,
} }
} }

View File

@ -356,7 +356,7 @@ func (b *gcePersistentDiskMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: b.readOnly, ReadOnly: b.readOnly,
Managed: !b.readOnly, Managed: !b.readOnly,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -163,7 +163,7 @@ func (b *gitRepoVolumeMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: false, ReadOnly: false,
Managed: true, Managed: true,
SupportsSELinux: true, // xattr change should be okay, TODO: double check SELinuxRelabel: true, // xattr change should be okay, TODO: double check
} }
} }

View File

@ -253,7 +253,7 @@ func (b *glusterfsMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: b.readOnly, ReadOnly: b.readOnly,
Managed: false, Managed: false,
SupportsSELinux: false, SELinuxRelabel: false,
} }
} }

View File

@ -227,7 +227,7 @@ func (b *hostPathMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: b.readOnly, ReadOnly: b.readOnly,
Managed: false, Managed: false,
SupportsSELinux: false, SELinuxRelabel: false,
} }
} }

View File

@ -348,7 +348,7 @@ func (b *iscsiDiskMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: b.readOnly, ReadOnly: b.readOnly,
Managed: !b.readOnly, Managed: !b.readOnly,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -506,7 +506,7 @@ func (m *localVolumeMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: m.readOnly, ReadOnly: m.readOnly,
Managed: !m.readOnly, Managed: !m.readOnly,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -18,11 +18,12 @@ package nfs
import ( import (
"fmt" "fmt"
netutil "k8s.io/utils/net"
"os" "os"
"runtime" "runtime"
"time" "time"
netutil "k8s.io/utils/net"
"k8s.io/klog/v2" "k8s.io/klog/v2"
"k8s.io/mount-utils" "k8s.io/mount-utils"
utilstrings "k8s.io/utils/strings" utilstrings "k8s.io/utils/strings"
@ -234,7 +235,7 @@ func (nfsMounter *nfsMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: nfsMounter.readOnly, ReadOnly: nfsMounter.readOnly,
Managed: false, Managed: false,
SupportsSELinux: false, SELinuxRelabel: false,
} }
} }

View File

@ -18,10 +18,11 @@ package portworx
import ( import (
"fmt" "fmt"
"os"
"k8s.io/klog/v2" "k8s.io/klog/v2"
"k8s.io/mount-utils" "k8s.io/mount-utils"
utilstrings "k8s.io/utils/strings" utilstrings "k8s.io/utils/strings"
"os"
volumeclient "github.com/libopenstorage/openstorage/api/client/volume" volumeclient "github.com/libopenstorage/openstorage/api/client/volume"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
@ -289,7 +290,7 @@ func (b *portworxVolumeMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: b.readOnly, ReadOnly: b.readOnly,
Managed: !b.readOnly, Managed: !b.readOnly,
SupportsSELinux: false, SELinuxRelabel: false,
} }
} }

View File

@ -170,7 +170,7 @@ func (sv *projectedVolume) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: true, ReadOnly: true,
Managed: true, Managed: true,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -227,7 +227,7 @@ func (mounter *quobyteMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: mounter.readOnly, ReadOnly: mounter.readOnly,
Managed: false, Managed: false,
SupportsSELinux: false, SELinuxRelabel: false,
} }
} }

View File

@ -19,28 +19,27 @@ package rbd
import ( import (
"context" "context"
"fmt" "fmt"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/kubernetes/pkg/features"
"os" "os"
"path/filepath" "path/filepath"
"regexp" "regexp"
dstrings "strings" dstrings "strings"
"k8s.io/klog/v2"
"k8s.io/mount-utils"
utilexec "k8s.io/utils/exec"
utilstrings "k8s.io/utils/strings"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/uuid" "k8s.io/apimachinery/pkg/util/uuid"
utilfeature "k8s.io/apiserver/pkg/util/feature"
clientset "k8s.io/client-go/kubernetes" clientset "k8s.io/client-go/kubernetes"
"k8s.io/klog/v2"
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/volume"
volutil "k8s.io/kubernetes/pkg/volume/util" volutil "k8s.io/kubernetes/pkg/volume/util"
"k8s.io/kubernetes/pkg/volume/util/volumepathhandler" "k8s.io/kubernetes/pkg/volume/util/volumepathhandler"
"k8s.io/mount-utils"
utilexec "k8s.io/utils/exec"
utilstrings "k8s.io/utils/strings"
) )
var ( var (
@ -834,7 +833,7 @@ func (rbd *rbd) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: rbd.ReadOnly, ReadOnly: rbd.ReadOnly,
Managed: !rbd.ReadOnly, Managed: !rbd.ReadOnly,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -164,7 +164,7 @@ func (sv *secretVolume) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: true, ReadOnly: true,
Managed: true, Managed: true,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -330,7 +330,7 @@ func (b *storageosMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
ReadOnly: b.readOnly, ReadOnly: b.readOnly,
Managed: !b.readOnly, Managed: !b.readOnly,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -688,7 +688,7 @@ func (_ *FakeVolume) GetAttributes() Attributes {
return Attributes{ return Attributes{
ReadOnly: false, ReadOnly: false,
Managed: true, Managed: true,
SupportsSELinux: true, SELinuxRelabel: true,
} }
} }

View File

@ -117,7 +117,7 @@ type Metrics struct {
type Attributes struct { type Attributes struct {
ReadOnly bool ReadOnly bool
Managed bool Managed bool
SupportsSELinux bool SELinuxRelabel bool
} }
// MounterArgs provides more easily extensible arguments to Mounter // MounterArgs provides more easily extensible arguments to Mounter

View File

@ -208,7 +208,7 @@ type vsphereVolumeMounter struct {
func (b *vsphereVolumeMounter) GetAttributes() volume.Attributes { func (b *vsphereVolumeMounter) GetAttributes() volume.Attributes {
return volume.Attributes{ return volume.Attributes{
SupportsSELinux: true, SELinuxRelabel: true,
Managed: true, Managed: true,
} }
} }