Skip to content

Commit 503bee1

Browse files
committed
run e2e again
1 parent 8e2f57e commit 503bee1

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed

pkg/gce-pd-csi-driver/controller.go

+28-23
Original file line numberDiff line numberDiff line change
@@ -207,35 +207,40 @@ func (gceCS *GCEControllerServer) CreateVolume(ctx context.Context, req *csi.Cre
207207

208208
if content.GetVolume() != nil {
209209
volumeContentSourceVolumeID = content.GetVolume().GetVolumeId()
210-
211210
// Verify that the source VolumeID is in the correct format.
212-
project, volKey, err := common.VolumeIDToKey(volumeContentSourceVolumeID)
211+
_, _, err := common.VolumeIDToKey(volumeContentSourceVolumeID)
213212
if err != nil {
214213
return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("CreateVolume source volume ID is invalid: %v", err))
215214
}
216-
// Verify that the volume in VolumeContentSource exists.
217-
diskFromSourceVolume, err := gceCS.CloudProvider.GetDisk(ctx, project, volKey, gceAPIVersion)
218-
if err != nil {
219-
if gce.IsGCEError(err, "notFound") {
220-
return nil, status.Errorf(codes.NotFound, "CreateVolume source volume %s does not exist", volumeContentSourceVolumeID)
221-
} else {
222-
return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume unknown get disk error when validating: %v", err))
223-
}
215+
// Verify the volume in VolumeContentSource exists.
216+
if acquired := gceCS.volumeLocks.TryAcquire(volumeContentSourceVolumeID); acquired {
217+
return nil, status.Errorf(codes.NotFound, "CreateVolume source volume %s does not exist", volumeContentSourceVolumeID)
224218
}
219+
defer gceCS.volumeLocks.Release(volumeContentSourceVolumeID)
220+
221+
// // Verify that the volume in VolumeContentSource exists.
222+
// diskFromSourceVolume, err := gceCS.CloudProvider.GetDisk(ctx, project, volKey, gceAPIVersion)
223+
// if err != nil {
224+
// if gce.IsGCEError(err, "notFound") {
225+
// return nil, status.Errorf(codes.NotFound, "CreateVolume source volume %s does not exist", volumeContentSourceVolumeID)
226+
// } else {
227+
// return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume unknown get disk error when validating: %v", err))
228+
// }
229+
// }
225230
// Verify the zone, region, and disk type of the clone must be the same as that of the source disk.
226-
if err := gce.ValidateDiskParameters(diskFromSourceVolume, params); err != nil {
227-
return nil, status.Errorf(codes.InvalidArgument, `CreateVolume source volume parameters do not match CreateVolumeRequest Parameters: %v`, err)
228-
}
229-
// Verify the source disk is ready.
230-
if err == nil {
231-
ready, err := isDiskReady(diskFromSourceVolume)
232-
if err != nil {
233-
return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume disk from source volume %v had error checking ready status: %v", volKey, err))
234-
}
235-
if !ready {
236-
return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume disk from source volume %v is not ready", volKey))
237-
}
238-
}
231+
// if err := gce.ValidateDiskParameters(diskFromSourceVolume, params); err != nil {
232+
// return nil, status.Errorf(codes.InvalidArgument, `CreateVolume source volume parameters do not match CreateVolumeRequest Parameters: %v`, err)
233+
// }
234+
// // Verify the source disk is ready.
235+
// if err == nil {
236+
// ready, err := isDiskReady(diskFromSourceVolume)
237+
// if err != nil {
238+
// return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume disk from source volume %v had error checking ready status: %v", volKey, err))
239+
// }
240+
// if !ready {
241+
// return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume disk from source volume %v is not ready", volKey))
242+
// }
243+
// }
239244
}
240245
}
241246
// Create the disk

test/k8s-integration/driver-config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ func generateDriverConfigFile(testParams *testParameters, storageClassFile strin
5757
"topology",
5858
"controllerExpansion",
5959
"nodeExpansion",
60-
"pvcDataSource",
6160
}
6261
var fsTypes []string
6362
if testParams.platform == "windows" {
@@ -117,6 +116,7 @@ func generateDriverConfigFile(testParams *testParameters, storageClassFile strin
117116
absSnapshotClassFilePath = filepath.Join(testParams.pkgDir, testConfigDir, testParams.snapshotClassFile)
118117
}
119118

119+
caps = append(caps, "pvcDataSource")
120120
minimumVolumeSize := "5Gi"
121121
numAllowedTopologies := 1
122122
if storageClassFile == regionalPDStorageClass {

0 commit comments

Comments
 (0)