diff --git a/main.go b/main.go index 0dadd35..f13b427 100644 --- a/main.go +++ b/main.go @@ -119,7 +119,7 @@ func main() { Recorder: mgr.GetEventRecorderFor("weightsandbiases"), Client: mgr.GetClient(), Scheme: mgr.GetScheme(), - DeployerClient: &deployer.DeployerClient{DeployerChannelUrl: deployerAPI}, + DeployerClient: &deployer.DeployerClient{DeployerAPI: deployerAPI}, Debug: debug, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create controller", "controller", "WeightsAndBiases") diff --git a/pkg/wandb/spec/channel/deployer/deployer.go b/pkg/wandb/spec/channel/deployer/deployer.go index 32e8eb5..918cef9 100644 --- a/pkg/wandb/spec/channel/deployer/deployer.go +++ b/pkg/wandb/spec/channel/deployer/deployer.go @@ -33,8 +33,7 @@ type DeployerInterface interface { } type DeployerClient struct { - DeployerChannelUrl string - DeployerReleaseURL string + DeployerAPI string } type SpecUnknownChart struct { @@ -45,8 +44,8 @@ type SpecUnknownChart struct { func (c *DeployerClient) getDeployerURL(opts GetSpecOptions) string { var url string - if c.DeployerChannelUrl != "" { - url = c.DeployerChannelUrl + if c.DeployerAPI != "" { + url = c.DeployerAPI } else { url = DeployerAPI } diff --git a/pkg/wandb/spec/channel/deployer/deployer_test.go b/pkg/wandb/spec/channel/deployer/deployer_test.go index a81cd64..f69a996 100644 --- a/pkg/wandb/spec/channel/deployer/deployer_test.go +++ b/pkg/wandb/spec/channel/deployer/deployer_test.go @@ -66,7 +66,7 @@ func TestDeployerClient_GetSpec(t *testing.T) { server := tt.fields.testServer(tt.args.license) defer server.Close() c := &DeployerClient{ - DeployerChannelUrl: server.URL, + DeployerAPI: server.URL, } got, err := c.GetSpec(GetSpecOptions{ License: tt.args.license, @@ -122,8 +122,7 @@ func TestDeployerClient_getDeployerURL(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { c := &DeployerClient{ - DeployerChannelUrl: tt.deployerChannelUrl, - DeployerReleaseURL: tt.deployerReleaseURL, + DeployerAPI: tt.deployerChannelUrl, } got := c.getDeployerURL(GetSpecOptions{ReleaseId: tt.releaseId}) if got != tt.want {