Skip to content

Commit 25d995a

Browse files
authored
Updating power-go-client to 1.0.80 (#465)
1 parent a65deed commit 25d995a

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

cloud/scope/powervs_clients.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package scope
1818

1919
import (
20+
"context"
2021
"time"
2122

2223
"github.com/IBM-Cloud/power-go-client/clients/instance"
@@ -37,12 +38,13 @@ type IBMPowerVSClient struct {
3738
// NewIBMPowerVSClient creates and returns a IBM Power VS client
3839
func NewIBMPowerVSClient(token, account, cloudInstanceID, region, zone string, debug bool) (_ *IBMPowerVSClient, err error) {
3940
client := &IBMPowerVSClient{}
41+
ctx := context.Background()
4042
client.session, err = ibmpisession.New(token, region, debug, TIMEOUT, account, zone)
4143
if err != nil {
4244
return nil, err
4345
}
4446

45-
client.InstanceClient = instance.NewIBMPIInstanceClient(client.session, cloudInstanceID)
47+
client.InstanceClient = instance.NewIBMPIInstanceClient(ctx, client.session, cloudInstanceID)
4648
client.NetworkClient = instance.NewIBMPINetworkClient(client.session, cloudInstanceID)
4749
client.ImageClient = instance.NewIBMPIImageClient(client.session, cloudInstanceID)
4850
return client, nil

cloud/scope/powervs_machine.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"encoding/base64"
2222
"fmt"
2323
"strconv"
24-
"time"
2524

2625
"github.com/go-logr/logr"
2726
"github.com/pkg/errors"
@@ -121,7 +120,7 @@ func NewPowerVSMachineScope(params PowerVSMachineScopeParams) (*PowerVSMachineSc
121120
}
122121

123122
func (m *PowerVSMachineScope) ensureInstanceUnique(instanceName string) (*models.PVMInstanceReference, error) {
124-
instances, err := m.IBMPowerVSClient.InstanceClient.GetAll(m.IBMPowerVSMachine.Spec.ServiceInstanceID, 60*time.Minute)
123+
instances, err := m.IBMPowerVSClient.InstanceClient.GetAll()
125124
if err != nil {
126125
return nil, err
127126
}
@@ -186,7 +185,7 @@ func (m *PowerVSMachineScope) CreateMachine() (*models.PVMInstanceReference, err
186185
UserData: cloudInitData,
187186
},
188187
}
189-
_, err = m.IBMPowerVSClient.InstanceClient.Create(params, s.ServiceInstanceID, time.Hour)
188+
_, err = m.IBMPowerVSClient.InstanceClient.Create(params.Body)
190189
if err != nil {
191190
return nil, err
192191
}
@@ -205,7 +204,7 @@ func (m *PowerVSMachineScope) PatchObject() error {
205204

206205
// DeleteMachine deletes the power vs machine associated with machine instance id and service instance id.
207206
func (m *PowerVSMachineScope) DeleteMachine() error {
208-
return m.IBMPowerVSClient.InstanceClient.Delete(m.IBMPowerVSMachine.Status.InstanceID, m.IBMPowerVSMachine.Spec.ServiceInstanceID, time.Hour)
207+
return m.IBMPowerVSClient.InstanceClient.Delete(m.IBMPowerVSMachine.Status.InstanceID)
209208
}
210209

211210
// GetBootstrapData returns the base64 encoded bootstrap data from the secret in the Machine's bootstrap.dataSecretName

controllers/ibmpowervsmachine_controller.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package controllers
1919
import (
2020
"context"
2121
"fmt"
22-
"time"
2322

2423
"github.com/go-logr/logr"
2524
"github.com/pkg/errors"
@@ -169,7 +168,7 @@ func (r *IBMPowerVSMachineReconciler) reconcileNormal(ctx context.Context, machi
169168
}
170169

171170
if ins != nil {
172-
instance, err := machineScope.IBMPowerVSClient.InstanceClient.Get(*ins.PvmInstanceID, machineScope.IBMPowerVSMachine.Spec.ServiceInstanceID, 60*time.Minute)
171+
instance, err := machineScope.IBMPowerVSClient.InstanceClient.Get(*ins.PvmInstanceID)
173172
if err != nil {
174173
return ctrl.Result{}, err
175174
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.16
44

55
require (
66
github.com/IBM-Cloud/bluemix-go v0.0.0-20200921095234-26d1d0148c62
7-
github.com/IBM-Cloud/power-go-client v1.0.78
7+
github.com/IBM-Cloud/power-go-client v1.0.80
88
github.com/IBM/go-sdk-core/v5 v5.9.0
99
github.com/IBM/vpc-go-sdk v0.14.0
1010
github.com/go-logr/logr v0.4.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
5757
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
5858
github.com/IBM-Cloud/bluemix-go v0.0.0-20200921095234-26d1d0148c62 h1:8I8Z3mRorZhgT31vXPysZNuVQV7vWR3GSVtmh8xJ9L8=
5959
github.com/IBM-Cloud/bluemix-go v0.0.0-20200921095234-26d1d0148c62/go.mod h1:gPJbH1etcDj7qS/hBRiLuYW9CY0bRcostSKusa51xR0=
60-
github.com/IBM-Cloud/power-go-client v1.0.78 h1:N2r/l3fep6Us2XZfK/cSyz02QImas5SkPBjIcIZ/Nz4=
61-
github.com/IBM-Cloud/power-go-client v1.0.78/go.mod h1:YRBsrY+n1+3xMd6HzfG0VATkXZqOQktK5Yvjx9x6ACc=
60+
github.com/IBM-Cloud/power-go-client v1.0.80 h1:52dpu7pCpsRu5L1w2mejC3rDjwQwoenIvZznWetTgSs=
61+
github.com/IBM-Cloud/power-go-client v1.0.80/go.mod h1:YRBsrY+n1+3xMd6HzfG0VATkXZqOQktK5Yvjx9x6ACc=
6262
github.com/IBM/go-sdk-core/v5 v5.7.2/go.mod h1:+YbdhrjCHC84ls4MeBp+Hj4NZCni+tDAc0XQUqRO9Jc=
6363
github.com/IBM/go-sdk-core/v5 v5.9.0 h1:j+Ra0VIA1E96gOuH1Psl2wlHfKoevYYqQeeeFYKibJ4=
6464
github.com/IBM/go-sdk-core/v5 v5.9.0/go.mod h1:axE2JrRq79gIJTjKPBwV6gWHswvVptBjbcvvCPIxARM=

0 commit comments

Comments
 (0)