Skip to content

Commit

Permalink
OSD-19188: Get backplane URL via ocm environment
Browse files Browse the repository at this point in the history
Fetch Backplane URL via OCM environment
  • Loading branch information
samanthajayasinghe committed Dec 10, 2023
1 parent 52a842d commit 283001d
Show file tree
Hide file tree
Showing 17 changed files with 205 additions and 137 deletions.
5 changes: 5 additions & 0 deletions cmd/ocm-backplane/console/console_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var _ = Describe("console command", func() {
proxyURL string
clusterInfo *cmv1.Cluster
testKubeCfg api.Config
ocmEnv *cmv1.Environment
)

BeforeEach(func() {
Expand Down Expand Up @@ -125,6 +126,7 @@ var _ = Describe("console command", func() {
dirName, _ := os.MkdirTemp("", ".kube")

pullSecretConfigDirectory = dirName
ocmEnv, _ = cmv1.NewEnvironment().BackplaneURL("https://dummy.api").Build()
})

AfterEach(func() {
Expand Down Expand Up @@ -178,6 +180,7 @@ var _ = Describe("console command", func() {
It("should start console server", func() {
setupConfig()

mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
mockOcmInterface.EXPECT().GetPullSecret().Return(pullSecret, nil).AnyTimes()
mockOcmInterface.EXPECT().GetClusterInfoByID(clusterID).Return(clusterInfo, nil).AnyTimes()
Expand All @@ -196,6 +199,7 @@ var _ = Describe("console command", func() {
testKubeCfg.CurrentContext = "custom-context"
setupConfig()

mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
mockOcmInterface.EXPECT().GetPullSecret().Return(pullSecret, nil).AnyTimes()
mockOcmInterface.EXPECT().GetClusterInfoByID(clusterID).Return(clusterInfo, nil).AnyTimes()
Expand All @@ -213,6 +217,7 @@ var _ = Describe("console command", func() {
testKubeCfg.CurrentContext = "undefined-context"
setupConfig()

mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
mockOcmInterface.EXPECT().GetPullSecret().Return(pullSecret, nil).AnyTimes()
mockOcmInterface.EXPECT().GetClusterInfoByID(clusterID).Return(clusterInfo, nil).AnyTimes()
Expand Down
26 changes: 26 additions & 0 deletions cmd/ocm-backplane/login/login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/clientcmd/api"

cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
"github.com/openshift/backplane-cli/pkg/backplaneapi"
backplaneapiMock "github.com/openshift/backplane-cli/pkg/backplaneapi/mocks"
"github.com/openshift/backplane-cli/pkg/client/mocks"
Expand Down Expand Up @@ -45,6 +46,7 @@ var _ = Describe("Login command", func() {
serviceClusterID string
serviceClusterName string
fakeResp *http.Response
ocmEnv *cmv1.Environment
)

BeforeEach(func() {
Expand Down Expand Up @@ -80,6 +82,8 @@ var _ = Describe("Login command", func() {
clientcmd.UseModifyConfigLock = false

globalOpts.BackplaneURL = backplaneAPIURI

ocmEnv, _ = cmv1.NewEnvironment().BackplaneURL("https://dummy.api").Build()
})

AfterEach(func() {
Expand All @@ -95,6 +99,7 @@ var _ = Describe("Login command", func() {
Context("check ocm token", func() {

It("Should fail when failed to get OCM token", func() {
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(nil, errors.New("err")).AnyTimes()
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
Expand All @@ -108,6 +113,7 @@ var _ = Describe("Login command", func() {
err := utils.CreateTempKubeConfig(nil)
Expect(err).To(BeNil())
globalOpts.ProxyURL = "https://squid.myproxy.com"
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockClientUtil.EXPECT().SetClientProxyURL(globalOpts.ProxyURL).Return(nil)
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
Expand All @@ -132,6 +138,7 @@ var _ = Describe("Login command", func() {
err := utils.CreateTempKubeConfig(nil)
Expect(err).To(BeNil())
globalOpts.BackplaneURL = "https://sadge.app"
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil)
Expand All @@ -154,6 +161,7 @@ var _ = Describe("Login command", func() {
err := utils.CreateTempKubeConfig(nil)
Expect(err).To(BeNil())
globalOpts.ProxyURL = "https://squid.myproxy.com"
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockClientUtil.EXPECT().SetClientProxyURL(globalOpts.ProxyURL).Return(nil)
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
Expand All @@ -176,6 +184,7 @@ var _ = Describe("Login command", func() {
})

It("should fail if unable to create api client", func() {
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil)
Expand All @@ -186,6 +195,15 @@ var _ = Describe("Login command", func() {
Expect(err).ToNot(BeNil())
})

It("should fail if ocm env backplane url is empty", func() {
ocmEnv, _ = cmv1.NewEnvironment().Build()

mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
err := runLogin(nil, []string{testClusterID})

Expect(err).ToNot(BeNil())
})

})

Context("check cluster login", func() {
Expand All @@ -196,6 +214,7 @@ var _ = Describe("Login command", func() {
It("when running with a simple case should work as expected", func() {
err := utils.CreateTempKubeConfig(nil)
Expect(err).To(BeNil())
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil)
Expand All @@ -215,6 +234,7 @@ var _ = Describe("Login command", func() {
})

It("Should fail when trying to find a non existent cluster", func() {
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()

Expand All @@ -227,6 +247,7 @@ var _ = Describe("Login command", func() {

It("should return the managing cluster if one is requested", func() {
globalOpts.Manager = true
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().GetManagingCluster(trueClusterID).Return(managingClusterID, managingClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(managingClusterID)).Return(false, nil).AnyTimes()
Expand All @@ -241,6 +262,7 @@ var _ = Describe("Login command", func() {

It("should failed if managing cluster not exist in same env", func() {
globalOpts.Manager = true
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().GetManagingCluster(trueClusterID).Return(
managingClusterID,
Expand All @@ -261,6 +283,7 @@ var _ = Describe("Login command", func() {

It("should return the service cluster if hosted cluster is given", func() {
globalOpts.Service = true
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().GetServiceCluster(trueClusterID).Return(serviceClusterID, serviceClusterName, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(serviceClusterID)).Return(false, nil).AnyTimes()
Expand All @@ -277,6 +300,7 @@ var _ = Describe("Login command", func() {
err := utils.CreateTempKubeConfig(nil)
Expect(err).To(BeNil())
globalOpts.ProxyURL = "https://squid.myproxy.com"
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockClientUtil.EXPECT().SetClientProxyURL(globalOpts.ProxyURL).Return(nil)
mockOcmInterface.EXPECT().GetTargetCluster("configcluster").Return(testClusterID, "dummy_cluster", nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(testClusterID)).Return(false, nil).AnyTimes()
Expand All @@ -299,6 +323,7 @@ var _ = Describe("Login command", func() {

err := utils.CreateTempKubeConfig(nil)
Expect(err).To(BeNil())
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil)
Expand Down Expand Up @@ -326,6 +351,7 @@ var _ = Describe("Login command", func() {
_, err = login.CreateClusterKubeConfig(trueClusterID, utils.GetDefaultKubeConfig())
Expect(err).To(BeNil())

mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil)
Expand Down
4 changes: 4 additions & 0 deletions cmd/ocm-backplane/logout/logout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/clientcmd/api"

cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
"github.com/openshift/backplane-cli/cmd/ocm-backplane/login"
"github.com/openshift/backplane-cli/pkg/backplaneapi"
backplaneapiMock "github.com/openshift/backplane-cli/pkg/backplaneapi/mocks"
Expand Down Expand Up @@ -48,6 +49,7 @@ var _ = Describe("Logout command", func() {

kubeConfig api.Config
loggedInNotBackplaneConfig api.Config
ocmEnv *cmv1.Environment
)

BeforeEach(func() {
Expand Down Expand Up @@ -114,6 +116,7 @@ var _ = Describe("Logout command", func() {
}

os.Setenv(info.BackplaneURLEnvName, backplaneAPIURI)
ocmEnv, _ = cmv1.NewEnvironment().BackplaneURL("https://dummy.api").Build()
})

AfterEach(func() {
Expand All @@ -128,6 +131,7 @@ var _ = Describe("Logout command", func() {

err := utils.CreateTempKubeConfig(&kubeConfig)
Expect(err).To(BeNil())
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil).AnyTimes()
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
Expand Down
14 changes: 13 additions & 1 deletion cmd/ocm-backplane/managedJob/createManagedJob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/clientcmd/api"

cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
"github.com/openshift/backplane-cli/pkg/backplaneapi"
backplaneapiMock "github.com/openshift/backplane-cli/pkg/backplaneapi/mocks"
"github.com/openshift/backplane-cli/pkg/client/mocks"
Expand All @@ -40,7 +41,8 @@ var _ = Describe("managedJob create command", func() {
fakeJobResp *http.Response
jobResponseBody string

sut *cobra.Command
sut *cobra.Command
ocmEnv *cmv1.Environment
)

BeforeEach(func() {
Expand Down Expand Up @@ -95,6 +97,7 @@ var _ = Describe("managedJob create command", func() {
_ = clientcmd.ModifyConfig(clientcmd.NewDefaultPathOptions(), api.Config{}, true)

os.Setenv(info.BackplaneURLEnvName, proxyURI)
ocmEnv, _ = cmv1.NewEnvironment().BackplaneURL("https://dummy.api").Build()
})

AfterEach(func() {
Expand All @@ -104,6 +107,7 @@ var _ = Describe("managedJob create command", func() {

Context("create managed job", func() {
It("when running with a simple case should work as expected", func() {
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
// It should query for the internal cluster id first
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
// Then it will look for the backplane shard
Expand All @@ -119,6 +123,7 @@ var _ = Describe("managedJob create command", func() {
})

It("should respect url flag", func() {
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
// It should query for the internal cluster id first
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
// Then it will look for the backplane shard
Expand All @@ -134,6 +139,7 @@ var _ = Describe("managedJob create command", func() {
})

It("should fail when backplane did not return a 200", func() {
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
Expand All @@ -147,6 +153,7 @@ var _ = Describe("managedJob create command", func() {
})

It("should fail when backplane returns a non parsable response", func() {
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
Expand All @@ -161,6 +168,7 @@ var _ = Describe("managedJob create command", func() {
})

It("should wait for job to be finished", func() {
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
Expand Down Expand Up @@ -188,6 +196,7 @@ var _ = Describe("managedJob create command", func() {
}
fakeJobResp.Header.Add("Content-Type", "json")

mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
Expand All @@ -209,6 +218,7 @@ var _ = Describe("managedJob create command", func() {
}
fakeJobResp.Header.Add("Content-Type", "json")

mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
Expand All @@ -229,6 +239,7 @@ var _ = Describe("managedJob create command", func() {
})

It("should stream the log of the job if it is in running status", func() {
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
Expand Down Expand Up @@ -256,6 +267,7 @@ var _ = Describe("managedJob create command", func() {
StatusCode: http.StatusOK,
}
fakeJobResp.Header.Add("Content-Type", "json")
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
Expand Down
9 changes: 8 additions & 1 deletion cmd/ocm-backplane/managedJob/deleteManagedJob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/clientcmd/api"

cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
"github.com/openshift/backplane-cli/pkg/backplaneapi"
backplaneapiMock "github.com/openshift/backplane-cli/pkg/backplaneapi/mocks"
"github.com/openshift/backplane-cli/pkg/client/mocks"
Expand All @@ -36,7 +37,8 @@ var _ = Describe("managedJob delete command", func() {

fakeResp *http.Response

sut *cobra.Command
sut *cobra.Command
ocmEnv *cmv1.Environment
)

BeforeEach(func() {
Expand Down Expand Up @@ -67,6 +69,7 @@ var _ = Describe("managedJob delete command", func() {
_ = clientcmd.ModifyConfig(clientcmd.NewDefaultPathOptions(), api.Config{}, true)

os.Setenv(info.BackplaneURLEnvName, proxyURI)
ocmEnv, _ = cmv1.NewEnvironment().BackplaneURL("https://dummy.api").Build()
})

AfterEach(func() {
Expand All @@ -76,6 +79,7 @@ var _ = Describe("managedJob delete command", func() {

Context("delete managed job", func() {
It("when running with a simple case should work as expected", func() {
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
// It should query for the internal cluster id first
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
// Then it will look for the backplane shard
Expand All @@ -92,6 +96,7 @@ var _ = Describe("managedJob delete command", func() {
})

It("should respect url flag", func() {
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
// Then it will look for the backplane shard
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
Expand All @@ -106,6 +111,7 @@ var _ = Describe("managedJob delete command", func() {
})

It("should fail when backplane did not return a 200", func() {
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
Expand All @@ -119,6 +125,7 @@ var _ = Describe("managedJob delete command", func() {
})

It("should not work when backplane returns a non parsable response with 200 return", func() {
mockOcmInterface.EXPECT().GetOCMEnvironment().Return(ocmEnv, nil).AnyTimes()
mockOcmInterface.EXPECT().GetTargetCluster(testClusterID).Return(trueClusterID, testClusterID, nil)
mockOcmInterface.EXPECT().IsClusterHibernating(gomock.Eq(trueClusterID)).Return(false, nil).AnyTimes()
mockOcmInterface.EXPECT().GetOCMAccessToken().Return(&testToken, nil).AnyTimes()
Expand Down
Loading

0 comments on commit 283001d

Please sign in to comment.