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

OCPBUGS-30259: PowerVS remove ibm cloud/bluemix go 4.14 #8103

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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
survey "github.com/AlecAivazis/survey/v2"
surveycore "github.com/AlecAivazis/survey/v2/core"
"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 Down Expand Up @@ -49,7 +48,6 @@ type BxClient struct {
Zone string
PISession *ibmpisession.IBMPISession
User *User
AccountAPIV2 accountv2.Accounts
ServiceInstanceID string
PowerVSResourceGroup string
}
Expand Down Expand Up @@ -158,12 +156,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 @@ -243,28 +235,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
}

// ValidateDhcpService checks for existing Dhcp service for the provided PowerVS cloud instance
func (c *BxClient) ValidateDhcpService(ctx context.Context, svcInsID string, machineNetworks []types.MachineNetworkEntry) error {
ctx, cancel := context.WithTimeout(ctx, 5*time.Minute)
Expand Down

This file was deleted.

This file was deleted.