@@ -16,7 +16,6 @@ package framework
16
16
17
17
import (
18
18
"fmt"
19
- "github.com/oracle/oci-go-sdk/common"
20
19
"go.uber.org/zap"
21
20
"golang.org/x/net/context"
22
21
"time"
@@ -235,9 +234,9 @@ func (j *PVCTestJig) CreateAndAwaitPVCOrFailCSI(namespace string, volumeSize str
235
234
// jig's defaults, waits for it to become ready, and then sanity checks it and
236
235
// its dependant resources. Callers can provide a function to tweak the
237
236
// PVC object before it is created.
238
- func (j * PVCTestJig ) CreateAndAwaitStaticPVCOrFailCSI (namespace string , volumeSize string , scName string , adLabel string , compartmentId string , tweak func (pvc * v1.PersistentVolumeClaim )) * v1.PersistentVolumeClaim {
237
+ func (j * PVCTestJig ) CreateAndAwaitStaticPVCOrFailCSI (bs ocicore. BlockstorageClient , namespace string , volumeSize string , scName string , adLabel string , compartmentId string , tweak func (pvc * v1.PersistentVolumeClaim )) * v1.PersistentVolumeClaim {
239
238
240
- volumeOcid := j .CreateVolume (adLabel , compartmentId , "test-volume" )
239
+ volumeOcid := j .CreateVolume (bs , adLabel , compartmentId , "test-volume" )
241
240
242
241
pv := j .CreatePVorFailCSI (namespace , scName , * volumeOcid )
243
242
pv = j .waitForConditionOrFailForPV (pv .Name , DefaultTimeout , "to be dynamically provisioned" , func (pvc * v1.PersistentVolume ) bool {
@@ -263,9 +262,8 @@ func (j *PVCTestJig) CreateAndAwaitStaticPVCOrFailCSI(namespace string, volumeSi
263
262
}
264
263
265
264
// CreateVolume is a function to create the block volume
266
- func (j * PVCTestJig ) CreateVolume (adLabel string , compartmentId string , volName string ) * string {
265
+ func (j * PVCTestJig ) CreateVolume (bs ocicore. BlockstorageClient , adLabel string , compartmentId string , volName string ) * string {
267
266
var size int64 = 50
268
- //var compartmentId = "ocid1.compartment.oc1..aaaaaaaai6jt6asobfmkm5geioeod3zh6nxzjiplu722opjuoxxrndxjos6q"
269
267
request := ocicore.CreateVolumeRequest {
270
268
CreateVolumeDetails : ocicore.CreateVolumeDetails {
271
269
AvailabilityDomain : & adLabel ,
@@ -275,10 +273,6 @@ func (j *PVCTestJig) CreateVolume(adLabel string, compartmentId string, volName
275
273
},
276
274
}
277
275
278
- bs , err := ocicore .NewBlockstorageClientWithConfigurationProvider (common .DefaultConfigProvider ())
279
- if err != nil {
280
- Failf ("Failed to create Block Storage Client: %v" , err )
281
- }
282
276
newVolume , err := bs .CreateVolume (context .Background (), request )
283
277
if err != nil {
284
278
Failf ("Volume %q creation API error: %v" , volName , err )
0 commit comments