Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.15] OCPBUGS-30011: PowerVS: remove IBM-Cloud/bluemix-go/api/account/accountv2 in 4.15 #8076

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 1 addition & 9 deletions pkg/asset/installconfig/platformpermscheck.go
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/openshift/installer/pkg/asset"
awsconfig "github.com/openshift/installer/pkg/asset/installconfig/aws"
gcpconfig "github.com/openshift/installer/pkg/asset/installconfig/gcp"
powervsconfig "github.com/openshift/installer/pkg/asset/installconfig/powervs"
"github.com/openshift/installer/pkg/types"
"github.com/openshift/installer/pkg/types/alibabacloud"
"github.com/openshift/installer/pkg/types/aws"
Expand Down Expand Up @@ -121,14 +120,7 @@ func (a *PlatformPermsCheck) Generate(dependencies asset.Parents) error {
case ibmcloud.Name:
// TODO: IBM[#90]: platformpermscheck
case powervs.Name:
bxCli, err := powervsconfig.NewBxClient(false)
if err != nil {
return err
}
err = bxCli.ValidateAccountPermissions()
if err != nil {
return err
}
// Nothing needs to be done here
case azure.Name, baremetal.Name, libvirt.Name, external.Name, none.Name, openstack.Name, ovirt.Name, vsphere.Name, alibabacloud.Name, nutanix.Name:
// no permissions to check
default:
Expand Down
30 changes: 0 additions & 30 deletions pkg/asset/installconfig/powervs/session.go
Expand Up @@ -13,7 +13,6 @@ import (

survey "github.com/AlecAivazis/survey/v2"
"github.com/IBM-Cloud/bluemix-go"
"github.com/IBM-Cloud/bluemix-go/api/account/accountv2"
"github.com/IBM-Cloud/bluemix-go/authentication"
"github.com/IBM-Cloud/bluemix-go/http"
"github.com/IBM-Cloud/bluemix-go/rest"
Expand All @@ -40,7 +39,6 @@ type BxClient struct {
Zone string
PISession *ibmpisession.IBMPISession
User *User
AccountAPIV2 accountv2.Accounts
PowerVSResourceGroup string
}

Expand Down Expand Up @@ -145,12 +143,6 @@ func NewBxClient(survey bool) (*BxClient, error) {
return nil, err
}

accClient, err := accountv2.New(bxSess)
if err != nil {
return nil, err
}

c.AccountAPIV2 = accClient.Accounts()
c.Session.Config.Region = powervs.Regions[sv.Region].VPCRegion

return c, nil
Expand Down Expand Up @@ -227,28 +219,6 @@ func getSessionVars(survey bool) (SessionVars, error) {
return sv, nil
}

// GetAccountType func return the type of account TRAIL/PAID
func (c *BxClient) GetAccountType() (string, error) {
myAccount, err := c.AccountAPIV2.Get((*c.User).Account)
if err != nil {
return "", err
}

return myAccount.Type, nil
}

// ValidateAccountPermissions Checks permission for provisioning Power VS resources
func (c *BxClient) ValidateAccountPermissions() error {
accType, err := c.GetAccountType()
if err != nil {
return err
}
if accType == "TRIAL" {
return fmt.Errorf("account type must be of Pay-As-You-Go/Subscription type for provision Power VS resources")
}
return nil
}

// NewPISession updates pisession details, return error on fail.
func (c *BxClient) NewPISession() error {
var authenticator core.Authenticator = &core.IamAuthenticator{
Expand Down

This file was deleted.

This file was deleted.