Skip to content

Commit

Permalink
vpc-go-sdk migration to 0.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
uibm committed Dec 1, 2021
1 parent 77f4ef9 commit 861dae5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/IBM/scc-go-sdk v1.3.3
github.com/IBM/schematics-go-sdk v0.1.3
github.com/IBM/secrets-manager-go-sdk v0.1.19
github.com/IBM/vpc-go-sdk v0.13.0
github.com/IBM/vpc-go-sdk v0.14.0
github.com/PromonLogicalis/asn1 v0.0.0-20190312173541-d60463189a56 // indirect
github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5
github.com/Shopify/sarama v1.29.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ github.com/IBM/schematics-go-sdk v0.1.3 h1:8/2+aOlhdj5BX3bddtYiLRts5kBo8zT9hcOWq
github.com/IBM/schematics-go-sdk v0.1.3/go.mod h1:tKRsoiYvm6l/7ZV/L1aY84PnQZExrXIJBowwSE7oBg4=
github.com/IBM/secrets-manager-go-sdk v0.1.19 h1:0GPs5EoTaWNsjo4QPj64GNxlWfN8VHJy4RDFLqddSe8=
github.com/IBM/secrets-manager-go-sdk v0.1.19/go.mod h1:eO3dBhzPrHkkt+yPex/jB2xD6qHZxBko+Aw+0tfqHeA=
github.com/IBM/vpc-go-sdk v0.13.0 h1:wpnFiNCEODLojZua/uR1C47OXZYHXDpJz3/YF7LvlVw=
github.com/IBM/vpc-go-sdk v0.13.0/go.mod h1:B3Pgkwb0tQqTeIojR1MFLp96qW7cKnWyJ74jbAJgdbk=
github.com/IBM/vpc-go-sdk v0.14.0 h1:2uIhMiNiAJC8XiNkjhiMeMGBJlPU0jqE8KON2fvfSZI=
github.com/IBM/vpc-go-sdk v0.14.0/go.mod h1:mIUjxBs5viRWIiCqfO/W4HPJ7aC6M+26mR4p5gaVls8=
github.com/Logicalis/asn1 v0.0.0-20190312173541-d60463189a56 h1:vuquMR410psHNax14XKNWa0Ae/kYgWJcXi0IFuX60N0=
github.com/Logicalis/asn1 v0.0.0-20190312173541-d60463189a56/go.mod h1:Zb3OT4l0mf7P/GOs2w2Ilj5sdm5Whoq3pa24dAEBHFc=
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
Expand Down
6 changes: 0 additions & 6 deletions ibm/data_source_ibm_is_ssh_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@ func keyGetByName(d *schema.ResourceData, meta interface{}, name string) error {
}
listKeysOptions := &vpcv1.ListKeysOptions{}

resourceGroup := ""
if rg, ok := d.GetOk("resource_group"); ok {
resourceGroup = rg.(string)
listKeysOptions.ResourceGroupID = &resourceGroup
}

start := ""
allrecs := []vpcv1.Key{}
for {
Expand Down
20 changes: 10 additions & 10 deletions ibm/resource_ibm_is_vpn_gateway_connections.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,15 @@ func vpngwconCreate(d *schema.ResourceData, meta interface{}, name, gatewayID, p

if ikePolicy, ok := d.GetOk(isVPNGatewayConnectionIKEPolicy); ok {
ikePolicyIdentity = ikePolicy.(string)
vpnGatewayConnectionPrototypeModel.IkePolicy = &vpcv1.IkePolicyIdentity{
vpnGatewayConnectionPrototypeModel.IkePolicy = &vpcv1.VPNGatewayConnectionIkePolicyPrototype{
ID: &ikePolicyIdentity,
}
} else {
vpnGatewayConnectionPrototypeModel.IkePolicy = nil
}
if ipsecPolicy, ok := d.GetOk(isVPNGatewayConnectionIPSECPolicy); ok {
ipsecPolicyIdentity = ipsecPolicy.(string)
vpnGatewayConnectionPrototypeModel.IpsecPolicy = &vpcv1.IPsecPolicyIdentity{
vpnGatewayConnectionPrototypeModel.IpsecPolicy = &vpcv1.VPNGatewayConnectionIPsecPolicyPrototype{
ID: &ipsecPolicyIdentity,
}
} else {
Expand Down Expand Up @@ -495,18 +495,18 @@ func vpngwconUpdate(d *schema.ResourceData, meta interface{}, gID, gConnID strin
interval := int64(d.Get(isVPNGatewayConnectionDeadPeerDetectionInterval).(int))
timeout := int64(d.Get(isVPNGatewayConnectionDeadPeerDetectionTimeout).(int))

// Construct an instance of the VPNGatewayConnectionDpdPrototype model
vpnGatewayConnectionDpdPrototypeModel := new(vpcv1.VPNGatewayConnectionDpdPrototype)
vpnGatewayConnectionDpdPrototypeModel.Action = &action
vpnGatewayConnectionDpdPrototypeModel.Interval = &interval
vpnGatewayConnectionDpdPrototypeModel.Timeout = &timeout
vpnGatewayConnectionPatchModel.DeadPeerDetection = vpnGatewayConnectionDpdPrototypeModel
// Construct an instance of the VPNGatewayConnectionDpdPatch model
vpnGatewayConnectionDpdPatchModel := new(vpcv1.VPNGatewayConnectionDpdPatch)
vpnGatewayConnectionDpdPatchModel.Action = &action
vpnGatewayConnectionDpdPatchModel.Interval = &interval
vpnGatewayConnectionDpdPatchModel.Timeout = &timeout
vpnGatewayConnectionPatchModel.DeadPeerDetection = vpnGatewayConnectionDpdPatchModel
hasChanged = true
}

if d.HasChange(isVPNGatewayConnectionIKEPolicy) {
ikePolicyIdentity := d.Get(isVPNGatewayConnectionIKEPolicy).(string)
vpnGatewayConnectionPatchModel.IkePolicy = &vpcv1.IkePolicyIdentity{
vpnGatewayConnectionPatchModel.IkePolicy = &vpcv1.VPNGatewayConnectionIkePolicyPatch{
ID: &ikePolicyIdentity,
}
hasChanged = true
Expand All @@ -516,7 +516,7 @@ func vpngwconUpdate(d *schema.ResourceData, meta interface{}, gID, gConnID strin

if d.HasChange(isVPNGatewayConnectionIPSECPolicy) {
ipsecPolicyIdentity := d.Get(isVPNGatewayConnectionIPSECPolicy).(string)
vpnGatewayConnectionPatchModel.IpsecPolicy = &vpcv1.IPsecPolicyIdentity{
vpnGatewayConnectionPatchModel.IpsecPolicy = &vpcv1.VPNGatewayConnectionIPsecPolicyPatch{
ID: &ipsecPolicyIdentity,
}
hasChanged = true
Expand Down
1 change: 0 additions & 1 deletion website/docs/d/is_ssh_key.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ data "ibm_is_ssh_key" "ds_key" {
Review the argument references that you can specify for your data source.

- `name` - (Required, String) The name of the SSH key.
- `resource_group` - (Optional, string) The ID of resource group of the Key.

## Attribute reference
In addition to all argument reference list, you can access the following attribute references after your data source is created.
Expand Down

0 comments on commit 861dae5

Please sign in to comment.