mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Skip OnRootMismatch tests if the CSI driver supports VOLUME_MOUNT_GROUP.
This commit is contained in:
parent
0c6f1b4e2a
commit
4836fd1510
@ -151,6 +151,7 @@ const (
|
|||||||
CapPersistence Capability = "persistence" // data is persisted across pod restarts
|
CapPersistence Capability = "persistence" // data is persisted across pod restarts
|
||||||
CapBlock Capability = "block" // raw block mode
|
CapBlock Capability = "block" // raw block mode
|
||||||
CapFsGroup Capability = "fsGroup" // volume ownership via fsGroup
|
CapFsGroup Capability = "fsGroup" // volume ownership via fsGroup
|
||||||
|
CapVolumeMountGroup Capability = "volumeMountGroup" // Driver has the VolumeMountGroup CSI node capability. Because this is a FSGroup feature, the fsGroup capability must also be set to true.
|
||||||
CapExec Capability = "exec" // exec a file in the volume
|
CapExec Capability = "exec" // exec a file in the volume
|
||||||
CapSnapshotDataSource Capability = "snapshotDataSource" // support populate data from snapshot
|
CapSnapshotDataSource Capability = "snapshotDataSource" // support populate data from snapshot
|
||||||
CapPVCDataSource Capability = "pvcDataSource" // support populate data from pvc
|
CapPVCDataSource Capability = "pvcDataSource" // support populate data from pvc
|
||||||
|
@ -23,6 +23,8 @@ import (
|
|||||||
"github.com/onsi/ginkgo"
|
"github.com/onsi/ginkgo"
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
errors "k8s.io/apimachinery/pkg/util/errors"
|
errors "k8s.io/apimachinery/pkg/util/errors"
|
||||||
|
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||||
|
"k8s.io/kubernetes/pkg/features"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
@ -206,10 +208,17 @@ func (s *fsGroupChangePolicyTestSuite) DefineTests(driver storageframework.TestD
|
|||||||
test := t
|
test := t
|
||||||
testCaseName := fmt.Sprintf("(%s)[LinuxOnly], %s", test.podfsGroupChangePolicy, test.name)
|
testCaseName := fmt.Sprintf("(%s)[LinuxOnly], %s", test.podfsGroupChangePolicy, test.name)
|
||||||
ginkgo.It(testCaseName, func() {
|
ginkgo.It(testCaseName, func() {
|
||||||
|
dInfo := driver.GetDriverInfo()
|
||||||
|
policy := v1.PodFSGroupChangePolicy(test.podfsGroupChangePolicy)
|
||||||
|
|
||||||
|
if dInfo.Capabilities[storageframework.CapVolumeMountGroup] &&
|
||||||
|
utilfeature.DefaultFeatureGate.Enabled(features.DelegateFSGroupToCSIDriver) &&
|
||||||
|
policy == v1.FSGroupChangeOnRootMismatch {
|
||||||
|
e2eskipper.Skipf("Driver %q supports VolumeMountGroup, which doesn't supported the OnRootMismatch FSGroup policy - skipping", dInfo.Name)
|
||||||
|
}
|
||||||
|
|
||||||
init()
|
init()
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
policy := v1.PodFSGroupChangePolicy(test.podfsGroupChangePolicy)
|
|
||||||
podConfig := e2epod.Config{
|
podConfig := e2epod.Config{
|
||||||
NS: f.Namespace.Name,
|
NS: f.Namespace.Name,
|
||||||
NodeSelection: l.config.ClientNodeSelection,
|
NodeSelection: l.config.ClientNodeSelection,
|
||||||
|
Loading…
Reference in New Issue
Block a user