Skip to content

Commit 34c5c96

Browse files
Merge pull request openshift#8072 from hamzy/PowerVS-remove-IBM-Cloud/bluemix-go/api/account/accountv2
OCPBUGS-30005: remove github.com/IBM-Cloud/bluemix-go/api/account/accountv2
2 parents 6e9d05c + 69bc38e commit 34c5c96

File tree

6 files changed

+1
-377
lines changed

6 files changed

+1
-377
lines changed

pkg/asset/installconfig/platformpermscheck.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"github.com/openshift/installer/pkg/asset"
1111
awsconfig "github.com/openshift/installer/pkg/asset/installconfig/aws"
1212
gcpconfig "github.com/openshift/installer/pkg/asset/installconfig/gcp"
13-
powervsconfig "github.com/openshift/installer/pkg/asset/installconfig/powervs"
1413
"github.com/openshift/installer/pkg/types"
1514
"github.com/openshift/installer/pkg/types/aws"
1615
"github.com/openshift/installer/pkg/types/azure"
@@ -120,14 +119,7 @@ func (a *PlatformPermsCheck) Generate(dependencies asset.Parents) error {
120119
case ibmcloud.Name:
121120
// TODO: IBM[#90]: platformpermscheck
122121
case powervs.Name:
123-
bxCli, err := powervsconfig.NewBxClient(false)
124-
if err != nil {
125-
return err
126-
}
127-
err = bxCli.ValidateAccountPermissions()
128-
if err != nil {
129-
return err
130-
}
122+
// Nothing needs to be done here
131123
case azure.Name, baremetal.Name, libvirt.Name, external.Name, none.Name, openstack.Name, ovirt.Name, vsphere.Name, nutanix.Name:
132124
// no permissions to check
133125
default:

pkg/asset/installconfig/powervs/session.go

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313

1414
survey "github.com/AlecAivazis/survey/v2"
1515
"github.com/IBM-Cloud/bluemix-go"
16-
"github.com/IBM-Cloud/bluemix-go/api/account/accountv2"
1716
"github.com/IBM-Cloud/bluemix-go/authentication"
1817
"github.com/IBM-Cloud/bluemix-go/http"
1918
"github.com/IBM-Cloud/bluemix-go/rest"
@@ -40,7 +39,6 @@ type BxClient struct {
4039
Zone string
4140
PISession *ibmpisession.IBMPISession
4241
User *User
43-
AccountAPIV2 accountv2.Accounts
4442
PowerVSResourceGroup string
4543
}
4644

@@ -145,12 +143,6 @@ func NewBxClient(survey bool) (*BxClient, error) {
145143
return nil, err
146144
}
147145

148-
accClient, err := accountv2.New(bxSess)
149-
if err != nil {
150-
return nil, err
151-
}
152-
153-
c.AccountAPIV2 = accClient.Accounts()
154146
c.Session.Config.Region = powervs.Regions[sv.Region].VPCRegion
155147

156148
return c, nil
@@ -227,28 +219,6 @@ func getSessionVars(survey bool) (SessionVars, error) {
227219
return sv, nil
228220
}
229221

230-
// GetAccountType func return the type of account TRAIL/PAID
231-
func (c *BxClient) GetAccountType() (string, error) {
232-
myAccount, err := c.AccountAPIV2.Get((*c.User).Account)
233-
if err != nil {
234-
return "", err
235-
}
236-
237-
return myAccount.Type, nil
238-
}
239-
240-
// ValidateAccountPermissions Checks permission for provisioning Power VS resources
241-
func (c *BxClient) ValidateAccountPermissions() error {
242-
accType, err := c.GetAccountType()
243-
if err != nil {
244-
return err
245-
}
246-
if accType == "TRIAL" {
247-
return fmt.Errorf("account type must be of Pay-As-You-Go/Subscription type for provision Power VS resources")
248-
}
249-
return nil
250-
}
251-
252222
// NewPISession updates pisession details, return error on fail.
253223
func (c *BxClient) NewPISession() error {
254224
var authenticator core.Authenticator = &core.IamAuthenticator{

vendor/github.com/IBM-Cloud/bluemix-go/api/account/accountv2/accounts.go

Lines changed: 0 additions & 231 deletions
This file was deleted.

vendor/github.com/IBM-Cloud/bluemix-go/api/account/accountv2/api_service.go

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)