Skip to content

Commit 7c6c42f

Browse files
committed
fix test
1 parent a2b4fde commit 7c6c42f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pkg/cloud/fake/fake.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,16 @@ func (f *fakeConnector) ExpandVolume(_ context.Context, volumeID string, newSize
151151
}
152152

153153
func (f *fakeConnector) CreateVolumeFromSnapshot(ctx context.Context, zoneID, name, domainID, projectID, snapshotID string, sizeInGB int64) (*cloud.Volume, error) {
154-
return nil, nil
154+
vol := &cloud.Volume{
155+
ID: "fake-vol-from-snap-" + name,
156+
Name: name,
157+
Size: util.GigaBytesToBytes(sizeInGB),
158+
DiskOfferingID: "fake-disk-offering",
159+
ZoneID: zoneID,
160+
}
161+
f.volumesByID[vol.ID] = *vol
162+
f.volumesByName[vol.Name] = *vol
163+
return vol, nil
155164
}
156165

157166
func (f *fakeConnector) GetSnapshotByID(ctx context.Context, snapshotID string) (*cloud.Snapshot, error) {

0 commit comments

Comments
 (0)