Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: prepare release v3.0.1 #424

Merged
merged 4 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [3.0.1] - 2023-10-23

### Fixed
- managed_object_storage: `managed_object_storage` update to retain service users in all cases

## [3.0.0] - 2023-10-23

### Added
Expand Down Expand Up @@ -387,7 +392,8 @@ Updated upcloud-go-api, added build/CI scripts, and repackaged 0.1.0 as 1.0.0.
- resource_upcloud_firewall_rule removed and replaced by resource_upcloud_firewall_rules
- resource_upcloud_zone removed and replaced by zone and zones datasources

[Unreleased]: https://github.com/UpCloudLtd/terraform-provider-upcloud/compare/v3.0.0...HEAD
[Unreleased]: https://github.com/UpCloudLtd/terraform-provider-upcloud/compare/v3.0.1...HEAD
[3.0.1]: https://github.com/UpCloudLtd/terraform-provider-upcloud/compare/v3.0.0...v3.0.1
[3.0.0]: https://github.com/UpCloudLtd/terraform-provider-upcloud/compare/v2.12.0...v3.0.0
[2.12.0]: https://github.com/UpCloudLtd/terraform-provider-upcloud/compare/v2.11.0...v2.12.0
[2.11.0]: https://github.com/UpCloudLtd/terraform-provider-upcloud/compare/v2.10.0...v2.11.0
Expand Down
19 changes: 17 additions & 2 deletions internal/service/managedobjectstorage/managed_object_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,22 +241,37 @@ func resourceManagedObjectStorageUpdate(ctx context.Context, d *schema.ResourceD
req.Networks = &networks
}

userReqs := make([]request.ManagedObjectStorageUser, 0)
if d.HasChange("users") {
userReqs := make([]request.ManagedObjectStorageUser, 0)
users := d.Get("users")
for _, user := range users.(*schema.Set).List() {
r := request.ManagedObjectStorageUser{
Username: user.(string),
}
userReqs = append(userReqs, r)
}
req.Users = &userReqs
}
req.Users = &userReqs
storage, err := svc.ModifyManagedObjectStorage(ctx, req)
if err != nil {
return diag.FromErr(err)
}

waitReq := &request.WaitForManagedObjectStorageOperationalStateRequest{
DesiredState: upcloud.ManagedObjectStorageOperationalStateRunning,
Timeout: time.Minute * 20,
UUID: storage.UUID,
}

if storage.ConfiguredStatus == upcloud.ManagedObjectStorageConfiguredStatusStopped {
waitReq.DesiredState = upcloud.ManagedObjectStorageOperationalStateStopped
}

storage, err = svc.WaitForManagedObjectStorageOperationalState(ctx, waitReq)
if err != nil {
return diag.FromErr(err)
}

return setManagedObjectStorageData(d, storage)
}

Expand Down
Loading