Skip to content

Commit

Permalink
fix: reduce get file share throttling when CreateSnapshot
Browse files Browse the repository at this point in the history
fix filter

test: skip one snapshot test
  • Loading branch information
andyzhangx authored and k8s-infra-cherrypick-robot committed Nov 4, 2024
1 parent af52fee commit 4933954
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pkg/azurefile/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1272,10 +1272,12 @@ func (d *Driver) snapshotExists(ctx context.Context, sourceVolumeID, snapshotNam
}

// List share snapshots.
listSnapshot, err := d.cloud.FileClient.WithSubscriptionID(subsID).ListFileShare(ctx, rgName, accountName, "", snapshotsExpand)
filter := fmt.Sprintf("startswith(name, %s)", fileShareName)
listSnapshot, err := d.cloud.FileClient.WithSubscriptionID(subsID).ListFileShare(ctx, rgName, accountName, filter, snapshotsExpand)
if err != nil || listSnapshot == nil {
return false, "", time.Time{}, 0, err
}
klog.V(2).Infof("list snapshot of share(%s) under account(%s) rg(%s) subsID(%s) with total number(%d)", fileShareName, accountName, rgName, subsID, len(listSnapshot))
for _, share := range listSnapshot {
if share.SnapshotTime == nil { //the fileshare is not a snapshot
continue
Expand Down
4 changes: 2 additions & 2 deletions test/sanity/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ sleep 1

echo 'Begin to run sanity test...'
readonly CSI_SANITY_BIN='csi-sanity'
"$CSI_SANITY_BIN" --ginkgo.v --ginkgo.noColor --csi.endpoint="$endpoint" --ginkgo.skip='should fail when the volume source snapshot is not found|should work|should fail when the volume does not exist|should fail when the node does not exist|Node Service NodeGetCapabilities|should remove target path'
"$CSI_SANITY_BIN" --ginkgo.v --ginkgo.noColor --csi.endpoint="$endpoint" --ginkgo.skip='should fail when the volume source snapshot is not found|should work|should fail when the volume does not exist|should fail when the node does not exist|Node Service NodeGetCapabilities|should remove target path|should fail when requesting to create a snapshot with already existing name and different source volume ID'

testvolumeparameters='/tmp/vhd.yaml'
cat > $testvolumeparameters << EOF
fstype: ext4
EOF

echo 'Begin to run sanity test for vhd disk feature...'
"$CSI_SANITY_BIN" --ginkgo.v --ginkgo.noColor --csi.endpoint="$endpoint" --csi.testvolumeparameters="$testvolumeparameters" --ginkgo.skip='should fail when the volume source snapshot is not found|should work|should fail when volume does not exist on the specified path|should fail when the volume does not exist|should fail when the node does not exist|should be idempotent|Node Service NodeGetCapabilities|should remove target path'
"$CSI_SANITY_BIN" --ginkgo.v --ginkgo.noColor --csi.endpoint="$endpoint" --csi.testvolumeparameters="$testvolumeparameters" --ginkgo.skip='should fail when the volume source snapshot is not found|should work|should fail when volume does not exist on the specified path|should fail when the volume does not exist|should fail when the node does not exist|should be idempotent|Node Service NodeGetCapabilities|should remove target path|should fail when requesting to create a snapshot with already existing name and different source volume ID'

0 comments on commit 4933954

Please sign in to comment.