mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Fixing CSI E2E test
This commit is contained in:
parent
220bdf26b3
commit
348a02395d
@ -49,6 +49,7 @@ func TestClientAssertSupportedVersion(t *testing.T) {
|
|||||||
{testName: "supported version", ver: &csipb.Version{Major: 0, Minor: 0, Patch: 0}},
|
{testName: "supported version", ver: &csipb.Version{Major: 0, Minor: 0, Patch: 0}},
|
||||||
{testName: "supported version", ver: &csipb.Version{Major: 0, Minor: 1, Patch: 0}},
|
{testName: "supported version", ver: &csipb.Version{Major: 0, Minor: 1, Patch: 0}},
|
||||||
{testName: "supported version", ver: &csipb.Version{Major: 0, Minor: 1, Patch: 10}},
|
{testName: "supported version", ver: &csipb.Version{Major: 0, Minor: 1, Patch: 10}},
|
||||||
|
{testName: "supported version", ver: &csipb.Version{Major: 0, Minor: 2, Patch: 0}},
|
||||||
{testName: "supported version", ver: &csipb.Version{Major: 1, Minor: 1, Patch: 0}},
|
{testName: "supported version", ver: &csipb.Version{Major: 1, Minor: 1, Patch: 0}},
|
||||||
{testName: "supported version", ver: &csipb.Version{Major: 1, Minor: 0, Patch: 10}},
|
{testName: "supported version", ver: &csipb.Version{Major: 1, Minor: 0, Patch: 10}},
|
||||||
{testName: "unsupported version", ver: &csipb.Version{Major: 10, Minor: 0, Patch: 0}, mustFail: true},
|
{testName: "unsupported version", ver: &csipb.Version{Major: 10, Minor: 0, Patch: 0}, mustFail: true},
|
||||||
|
@ -46,7 +46,7 @@ const (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
// csiVersion supported csi version
|
// csiVersion supported csi version
|
||||||
csiVersion = &csipb.Version{Major: 0, Minor: 1, Patch: 0}
|
csiVersion = &csipb.Version{Major: 0, Minor: 2, Patch: 0}
|
||||||
)
|
)
|
||||||
|
|
||||||
type csiPlugin struct {
|
type csiPlugin struct {
|
||||||
|
@ -53,6 +53,7 @@ func (f *IdentityClient) GetSupportedVersions(ctx grpctx.Context, req *csipb.Get
|
|||||||
SupportedVersions: []*csipb.Version{
|
SupportedVersions: []*csipb.Version{
|
||||||
{Major: 0, Minor: 0, Patch: 1},
|
{Major: 0, Minor: 0, Patch: 1},
|
||||||
{Major: 0, Minor: 1, Patch: 0},
|
{Major: 0, Minor: 1, Patch: 0},
|
||||||
|
{Major: 0, Minor: 2, Patch: 0},
|
||||||
{Major: 1, Minor: 0, Patch: 0},
|
{Major: 1, Minor: 0, Patch: 0},
|
||||||
{Major: 1, Minor: 0, Patch: 1},
|
{Major: 1, Minor: 0, Patch: 1},
|
||||||
{Major: 1, Minor: 1, Patch: 1},
|
{Major: 1, Minor: 1, Patch: 1},
|
||||||
|
@ -39,7 +39,7 @@ const (
|
|||||||
csiDriverRegistrarImage string = "quay.io/k8scsi/driver-registrar:v0.2.0"
|
csiDriverRegistrarImage string = "quay.io/k8scsi/driver-registrar:v0.2.0"
|
||||||
)
|
)
|
||||||
|
|
||||||
func externalAttacherServiceAccount(
|
func csiServiceAccount(
|
||||||
client clientset.Interface,
|
client clientset.Interface,
|
||||||
config framework.VolumeTestConfig,
|
config framework.VolumeTestConfig,
|
||||||
teardown bool,
|
teardown bool,
|
||||||
@ -71,7 +71,7 @@ func externalAttacherServiceAccount(
|
|||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
func externalAttacherClusterRole(
|
func csiClusterRole(
|
||||||
client clientset.Interface,
|
client clientset.Interface,
|
||||||
config framework.VolumeTestConfig,
|
config framework.VolumeTestConfig,
|
||||||
teardown bool,
|
teardown bool,
|
||||||
@ -89,7 +89,7 @@ func externalAttacherClusterRole(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
APIGroups: []string{""},
|
APIGroups: []string{""},
|
||||||
Resources: []string{"persistentvolumesclaims"},
|
Resources: []string{"persistentvolumeclaims"},
|
||||||
Verbs: []string{"get", "list", "watch", "update"},
|
Verbs: []string{"get", "list", "watch", "update"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -129,7 +129,7 @@ func externalAttacherClusterRole(
|
|||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
func externalAttacherClusterRoleBinding(
|
func csiClusterRoleBinding(
|
||||||
client clientset.Interface,
|
client clientset.Interface,
|
||||||
config framework.VolumeTestConfig,
|
config framework.VolumeTestConfig,
|
||||||
teardown bool,
|
teardown bool,
|
||||||
@ -211,18 +211,18 @@ var _ = utils.SIGDescribe("CSI Volumes [Feature:CSI]", func() {
|
|||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
By("deploying csi hostpath driver")
|
By("deploying csi hostpath driver")
|
||||||
clusterRole = externalAttacherClusterRole(cs, config, false)
|
clusterRole = csiClusterRole(cs, config, false)
|
||||||
serviceAccount = externalAttacherServiceAccount(cs, config, false)
|
serviceAccount = csiServiceAccount(cs, config, false)
|
||||||
externalAttacherClusterRoleBinding(cs, config, false, serviceAccount, clusterRole)
|
csiClusterRoleBinding(cs, config, false, serviceAccount, clusterRole)
|
||||||
csiHostPathPod(cs, config, false, f, serviceAccount)
|
csiHostPathPod(cs, config, false, f, serviceAccount)
|
||||||
})
|
})
|
||||||
|
|
||||||
AfterEach(func() {
|
AfterEach(func() {
|
||||||
By("uninstalling csi hostpath driver")
|
By("uninstalling csi hostpath driver")
|
||||||
csiHostPathPod(cs, config, true, f, serviceAccount)
|
csiHostPathPod(cs, config, true, f, serviceAccount)
|
||||||
externalAttacherClusterRoleBinding(cs, config, true, serviceAccount, clusterRole)
|
csiClusterRoleBinding(cs, config, true, serviceAccount, clusterRole)
|
||||||
serviceAccount = externalAttacherServiceAccount(cs, config, true)
|
serviceAccount = csiServiceAccount(cs, config, true)
|
||||||
clusterRole = externalAttacherClusterRole(cs, config, true)
|
clusterRole = csiClusterRole(cs, config, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
It("should provision storage with a hostPath CSI driver", func() {
|
It("should provision storage with a hostPath CSI driver", func() {
|
||||||
@ -237,6 +237,7 @@ var _ = utils.SIGDescribe("CSI Volumes [Feature:CSI]", func() {
|
|||||||
|
|
||||||
claim := newClaim(t, ns.GetName(), "")
|
claim := newClaim(t, ns.GetName(), "")
|
||||||
class := newStorageClass(t, ns.GetName(), "")
|
class := newStorageClass(t, ns.GetName(), "")
|
||||||
|
claim.Spec.StorageClassName = &class.ObjectMeta.Name
|
||||||
testDynamicProvisioning(t, cs, claim, class)
|
testDynamicProvisioning(t, cs, claim, class)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user