Skip to content

Commit

Permalink
Merge pull request #307 from bmeng/config_url
Browse files Browse the repository at this point in the history
[OSD-19188] remove the backplane url checks from cloud subcommands
  • Loading branch information
openshift-merge-bot[bot] committed Jan 3, 2024
2 parents f3b8df7 + f193949 commit cd8d176
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
6 changes: 1 addition & 5 deletions cmd/ocm-backplane/cloud/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package cloud

import (
"encoding/json"
"errors"
"fmt"
"os"
"strconv"

ocmsdk "github.com/openshift-online/ocm-cli/pkg/ocm"

"github.com/openshift/backplane-cli/pkg/ocm"

"github.com/pkg/browser"
Expand Down Expand Up @@ -127,10 +127,6 @@ func runConsole(cmd *cobra.Command, argv []string) (err error) {
if credentialArgs.backplaneURL != "" { // Overwrite if parameter is set
backplaneConfiguration.URL = credentialArgs.backplaneURL
}

if backplaneConfiguration.URL == "" {
return errors.New("empty backplane url - check your backplane-cli configuration")
}
logger.Infof("Using backplane URL: %s\n", backplaneConfiguration.URL)

// Initialize OCM connection
Expand Down
12 changes: 4 additions & 8 deletions cmd/ocm-backplane/cloud/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ package cloud

import (
"encoding/json"
"errors"
"fmt"

ocmsdk "github.com/openshift-online/ocm-cli/pkg/ocm"
logger "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"sigs.k8s.io/yaml"

"github.com/openshift/backplane-cli/pkg/cli/config"
bpCredentials "github.com/openshift/backplane-cli/pkg/credentials"
"github.com/openshift/backplane-cli/pkg/ocm"
"github.com/openshift/backplane-cli/pkg/utils"
logger "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"sigs.k8s.io/yaml"
)

var GetBackplaneClusterFromConfig = utils.DefaultClusterUtils.GetBackplaneClusterFromConfig
Expand Down Expand Up @@ -95,10 +95,6 @@ func runCredentials(cmd *cobra.Command, argv []string) error {
if credentialArgs.backplaneURL != "" { // Overwrite if parameter is set
backplaneConfiguration.URL = credentialArgs.backplaneURL
}

if backplaneConfiguration.URL == "" {
return errors.New("empty backplane url - check your backplane-cli configuration")
}
logger.Infof("Using backplane URL: %s\n", backplaneConfiguration.URL)

// Initialize OCM connection
Expand Down

0 comments on commit cd8d176

Please sign in to comment.