Skip to content

[Enhancement] Update fake client to match the actual API behaviour for ResizeVolume method #233

Open
@Praveen005

Description

@Praveen005

Summary

If we see the fake client implementation of ResizeVolume method, it only errors out in one situation when the volume we are looking for is not there (throws ZeroMatchesError). But on the API side, we can see that it can throw error for various other reasons (e.g., retry errors, VolumeResizeOnlineError and other upstream errors)

civogo/fake_client.go

Lines 1290 to 1300 in 21b9e19

func (c *FakeClient) ResizeVolume(id string, size int) (*SimpleResponse, error) {
for i, volume := range c.Volumes {
if volume.ID == id {
c.Volumes[i].SizeGigabytes = size
return &SimpleResponse{Result: "success"}, nil
}
}
err := fmt.Errorf("unable to find volume %s, zero matches", id)
return nil, ZeroMatchesError.wrap(err)
}

More context can be found in conversations under the PR: civo/civo-csi#46



Acceptance criteria:

  1. Update fake client to match the actual API behaviour for ResizeVolume method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions