Skip to content

Commit

Permalink
PowerStore 4.0 Qual Updates (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
doriac11 authored Jun 28, 2024
1 parent 938736d commit 5940080
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module terraform-provider-powerstore
go 1.22

require (
github.com/dell/gopowerstore v1.15.0
github.com/dell/gopowerstore v1.15.1
github.com/hashicorp/terraform-plugin-docs v0.18.0
github.com/hashicorp/terraform-plugin-framework v1.5.0
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
Expand All @@ -25,7 +25,7 @@ require (
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/yuin/goldmark v1.6.0 // indirect
github.com/yuin/goldmark-meta v1.1.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/mod v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
Expand Down Expand Up @@ -88,8 +88,8 @@ require (
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/zclconf/go-cty v1.14.2 // indirect
go.mongodb.org/mongo-driver v1.9.1 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/grpc v1.61.0 // indirect
Expand Down
18 changes: 10 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dell/gopowerstore v1.15.0 h1:9RmpAPiHQifrpHBd1XEkwVBCDSjql4nf3ZeqEcQaQrk=
github.com/dell/gopowerstore v1.15.0/go.mod h1:6oAr11lwtpjmlE+s+pDKx7qfQ1HvLFWtlFoNdI03ByQ=
github.com/dell/gopowerstore v1.15.1-0.20240627132620-cf3af17f74cf h1:uBHWqnVoECpd+F2dXwdnxHkq/YFTlDXVkg2E5OBITzQ=
github.com/dell/gopowerstore v1.15.1-0.20240627132620-cf3af17f74cf/go.mod h1:6oAr11lwtpjmlE+s+pDKx7qfQ1HvLFWtlFoNdI03ByQ=
github.com/dell/gopowerstore v1.15.1 h1:m7pxlXqakt6ILy1W35VzXobOsvPOWIOImdhHBa8R38E=
github.com/dell/gopowerstore v1.15.1/go.mod h1:6oAr11lwtpjmlE+s+pDKx7qfQ1HvLFWtlFoNdI03ByQ=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
Expand Down Expand Up @@ -249,8 +251,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME=
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
Expand All @@ -265,8 +267,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -290,8 +292,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
Expand Down
4 changes: 2 additions & 2 deletions powerstore/resource_protection_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ func (r resourceProtectionPolicy) planToProtectionPolicyParam(plan models.Protec
protectionPolicyCreate := &gopowerstore.ProtectionPolicyCreate{
Name: plan.Name.ValueString(),
Description: plan.Description.ValueString(),
ReplicationRuleIds: replicationRuleIds,
SnapshotRuleIds: snapshotRuleIds,
ReplicationRuleIDs: replicationRuleIds,
SnapshotRuleIDs: snapshotRuleIds,
}
return protectionPolicyCreate, nil
}
Expand Down
8 changes: 4 additions & 4 deletions powerstore/resource_volume_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (r *resourceVolumeGroup) Create(ctx context.Context, req resource.CreateReq
volumeGroupCreate := &gopowerstore.VolumeGroupCreate{
Name: plan.Name.ValueString(),
Description: plan.Description.ValueString(),
VolumeIds: volumeIds,
VolumeIDs: volumeIds,
IsWriteOrderConsistent: plan.IsWriteOrderConsistent.ValueBool(),
ProtectionPolicyID: plan.ProtectionPolicyID.ValueString(),
}
Expand Down Expand Up @@ -269,7 +269,7 @@ func (r *resourceVolumeGroup) Delete(ctx context.Context, req resource.DeleteReq
volumeIDs = append(volumeIDs, vol.ID)
}
volGroupMembers := &gopowerstore.VolumeGroupMembers{
VolumeIds: volumeIDs,
VolumeIDs: volumeIDs,
}
_, err = r.client.PStoreClient.RemoveMembersFromVolumeGroup(context.Background(), volGroupMembers, volumeGroupID)
if err != nil {
Expand Down Expand Up @@ -417,11 +417,11 @@ func (r *resourceVolumeGroup) Update(ctx context.Context, req resource.UpdateReq
}

removeVolumeGroupMembers := &gopowerstore.VolumeGroupMembers{
VolumeIds: removeVolumeIdsSlice,
VolumeIDs: removeVolumeIdsSlice,
}

addVolumeGroupMembers := &gopowerstore.VolumeGroupMembers{
VolumeIds: addVolumeIdsSlice,
VolumeIDs: addVolumeIdsSlice,
}

// Get Volume Group ID from from state
Expand Down
4 changes: 2 additions & 2 deletions powerstore/volume_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,12 @@ func attachHostFromVolume(stateVol, planVol models.Volume, client client.Client,
}

func attachVolumeGroup(ctx context.Context, planVol models.Volume, client client.Client, volID string) error {
_, err := client.PStoreClient.AddMembersToVolumeGroup(ctx, &pstore.VolumeGroupMembers{VolumeIds: []string{volID}}, planVol.VolumeGroupID.ValueString())
_, err := client.PStoreClient.AddMembersToVolumeGroup(ctx, &pstore.VolumeGroupMembers{VolumeIDs: []string{volID}}, planVol.VolumeGroupID.ValueString())
return err
}

func detachVolumeGroup(ctx context.Context, stateVol models.Volume, client client.Client, volID string) error {
_, err := client.PStoreClient.RemoveMembersFromVolumeGroup(ctx, &pstore.VolumeGroupMembers{VolumeIds: []string{volID}}, stateVol.VolumeGroupID.ValueString())
_, err := client.PStoreClient.RemoveMembersFromVolumeGroup(ctx, &pstore.VolumeGroupMembers{VolumeIDs: []string{volID}}, stateVol.VolumeGroupID.ValueString())
return err
}

Expand Down

0 comments on commit 5940080

Please sign in to comment.