Skip to content

Enhance resize volume fake client#243

Open
amankothiyal04 wants to merge 2 commits into
civo:masterfrom
amankothiyal04:enhance-resize-volume-fake-client
Open

Enhance resize volume fake client#243
amankothiyal04 wants to merge 2 commits into
civo:masterfrom
amankothiyal04:enhance-resize-volume-fake-client

Conversation

@amankothiyal04

Copy link
Copy Markdown

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

This PR updates the fake client's ResizeVolume method to better match the actual API behavior by adding proper error handling for various scenarios. This addresses issue #233.

Changes

  • Added error handling for attached volumes (can't resize while attached)
  • Added validation for volume size (must increase)
  • Added simulation of occasional resize failures
  • Updated tests to cover all error scenarios
  • Added changelog entry

Testing

  • Added comprehensive test cases covering:
    • Successful resize
    • Volume not found
    • Volume still attached
    • Invalid size (not increasing)
    • Random failures simulation

Related Issues

Closes #233

- Added PriceMonthly and PriceHourly fields to InstanceSize struct
- Updated tests to include price information validation
- Added changelog entry

Closes civo#201
- Added error handling for attached volumes
- Added validation for volume size
- Added simulation of occasional resize failures
- Updated tests to cover all error scenarios
- Added changelog entry

Closes civo#233

@fulviodenza fulviodenza left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, and thanks for opening this PR, how did you end up with that InstanceSize fields?

Comment thread instance_size.go
Comment on lines +23 to +24
PriceMonthly float64 `json:"price_monthly,omitempty"`
PriceHourly float64 `json:"price_hourly,omitempty"`

@fulviodenza fulviodenza May 6, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fields are not supposed to be here, they don't exists

@giornetta

Copy link
Copy Markdown
Member

Hi! I'm not sure why this updating the InstanceSize struct. It doesn't seem related to the scope of this MR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants