Skip to content

Commit

Permalink
Upgrade sdk to v1.8.1, fix bug with replication sites
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Kita committed Sep 19, 2024
1 parent ff955ab commit 3136565
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain go1.22.5
require (
github.com/IBM-Cloud/bluemix-go v0.0.0-20240719075425-078fcb3a55be
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240725064144-454a2ae23113
github.com/IBM-Cloud/power-go-client v1.8.0-beta4
github.com/IBM-Cloud/power-go-client v1.8.1
github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca
github.com/IBM/appconfiguration-go-admin-sdk v0.3.0
github.com/IBM/appid-management-go-sdk v0.0.0-20210908164609-dd0e0eaf732f
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ github.com/IBM-Cloud/bluemix-go v0.0.0-20240719075425-078fcb3a55be/go.mod h1:/7h
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240725064144-454a2ae23113 h1:f2Erqfea1dKpaTFagTJM6W/wnD3JGq/Vn9URh8nuRwk=
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240725064144-454a2ae23113/go.mod h1:xUQL9SGAjoZFd4GNjrjjtEpjpkgU7RFXRyHesbKTjiY=
github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.5.3/go.mod h1:RiUvKuHKTBmBApDMUQzBL14pQUGKcx/IioKQPIcRQjs=
github.com/IBM-Cloud/power-go-client v1.8.0-beta4 h1:mT3UaAo3RIJCsvjDZWQuqjr7CooDmB95VyI1ogKl4IY=
github.com/IBM-Cloud/power-go-client v1.8.0-beta4/go.mod h1:oAkZiHX25cmr2Yun5V0q6CpnUemegvSrpcEy/oQcjzU=
github.com/IBM-Cloud/power-go-client v1.8.1 h1:tx1aPJmIQrNru1MD1VHGNasGx3eRIs0zzPZ0KvdFQrg=
github.com/IBM-Cloud/power-go-client v1.8.1/go.mod h1:N4RxrsMUvBQjSQ/qPk0iMZ8zK+fZPRTnHi/gTaASw0g=
github.com/IBM-Cloud/softlayer-go v1.0.5-tf h1:koUAyF9b6X78lLLruGYPSOmrfY2YcGYKOj/Ug9nbKNw=
github.com/IBM-Cloud/softlayer-go v1.0.5-tf/go.mod h1:6HepcfAXROz0Rf63krk5hPZyHT6qyx2MNvYyHof7ik4=
github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca h1:crniVcf+YcmgF03NmmfonXwSQ73oJF+IohFYBwknMxs=
Expand Down
6 changes: 2 additions & 4 deletions ibm/service/power/resource_ibm_pi_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func resourceIBMPIVolumeCreate(ctx context.Context, d *schema.ResourceData, meta
body.ReplicationSites = flex.ExpandStringList(v.([]interface{}))
}
} else {
return diag.Errorf("Replication must be enabled if replication sites are specified.")
return diag.Errorf("Replication (%s) must be enabled if replication sites are specified.", Arg_ReplicationEnabled)
}
}
if ap, ok := d.GetOk(Arg_AffinityPolicy); ok {
Expand Down Expand Up @@ -346,9 +346,7 @@ func resourceIBMPIVolumeRead(ctx context.Context, d *schema.ResourceData, meta i
d.Set(Attr_MirroringState, vol.MirroringState)
d.Set(Attr_PrimaryRole, vol.PrimaryRole)
d.Set(Arg_ReplicationEnabled, vol.ReplicationEnabled)
if len(vol.ReplicationSites) > 0 {
d.Set(Attr_ReplicationSites, vol.ReplicationSites)
}
d.Set(Attr_ReplicationSites, vol.ReplicationSites)
d.Set(Attr_ReplicationStatus, vol.ReplicationStatus)
d.Set(Attr_ReplicationType, vol.ReplicationType)
d.Set(Attr_VolumeStatus, vol.State)
Expand Down
5 changes: 2 additions & 3 deletions website/docs/r/pi_volume.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ Review the argument references that you can specify for your resource.
- `pi_cloud_instance_id` - (Required, String) The GUID of the service instance associated with an account.
- `pi_replication_enabled` - (Optional, Boolean) Indicates if the volume should be replication enabled or not.

**Note:** `replication_sites` will be populated automatically if set to true and sites are not specified.

- `pi_replication_sites` - (Optional, List) List of replication sites for volume replication.
**Note:** `replication_sites` will be populated automatically with default sites if set to true and sites are not specified.

- `pi_replication_sites` - (Optional, List) List of replication sites for volume replication. Must set `pi_replication_enabled` to true to use.
- `pi_volume_name` - (Required, String) The name of the volume.
- `pi_volume_pool` - (Optional, String) Volume pool where the volume will be created; if provided then `pi_affinity_policy` values will be ignored.
- `pi_volume_shareable` - (Required, Boolean) If set to **true**, the volume can be shared across Power Systems Virtual Server instances. If set to **false**, you can attach it only to one instance.
Expand Down

0 comments on commit 3136565

Please sign in to comment.