Skip to content

Commit 541808e

Browse files
committed
fix e2e test
1 parent 0f9ad9f commit 541808e

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

pkg/blob/blob.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ func checkContainerNameBeginAndEnd(containerName string) bool {
317317

318318
// isSASToken checks if the key contains the patterns. Because a SAS Token must have these strings, use them to judge.
319319
func isSASToken(key string) bool {
320-
return strings.Contains(key, "?sv=")
320+
return strings.HasPrefix(key, "?")
321321
}
322322

323323
// GetAuthEnv return <accountName, containerName, authEnv, error>

test/e2e/pre_provisioning_test.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"sigs.k8s.io/blob-csi-driver/test/e2e/driver"
2525
"sigs.k8s.io/blob-csi-driver/test/e2e/testsuites"
2626

27+
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
2728
"github.com/container-storage-interface/spec/lib/go/csi"
2829
"github.com/onsi/ginkgo"
2930
v1 "k8s.io/api/core/v1"
@@ -300,20 +301,16 @@ var _ = ginkgo.Describe("[blob-csi-e2e] Pre-Provisioned", func() {
300301
volumeID = resp.Volume.VolumeId
301302
ginkgo.By(fmt.Sprintf("Successfully provisioned blob volume: %q\n", volumeID))
302303

303-
volumeSize := fmt.Sprintf("%dGi", defaultVolumeSize)
304-
reclaimPolicy := v1.PersistentVolumeReclaimRetain
305-
volumeBindingMode := storagev1.VolumeBindingImmediate
306-
307304
pods := []testsuites.PodDetails{
308305
{
309306
Cmd: "echo 'hello world' > /mnt/test-1/data && grep 'hello world' /mnt/test-1/data",
310307
Volumes: []testsuites.VolumeDetails{
311308
{
312309
VolumeID: volumeID,
313310
FSType: "ext4",
314-
ClaimSize: volumeSize,
315-
ReclaimPolicy: &reclaimPolicy,
316-
VolumeBindingMode: &volumeBindingMode,
311+
ClaimSize: fmt.Sprintf("%dGi", defaultVolumeSize),
312+
ReclaimPolicy: to.Ptr(v1.PersistentVolumeReclaimRetain),
313+
VolumeBindingMode: to.Ptr(storagev1.VolumeBindingImmediate),
317314
VolumeMount: testsuites.VolumeMountDetails{
318315
NameGenerate: "test-volume-",
319316
MountPathGenerate: "/mnt/test-",

0 commit comments

Comments
 (0)