Skip to content

Commit

Permalink
Rename clients from submariner and operator repo
Browse files Browse the repository at this point in the history
Client from operator repo is renamed to `operatorclient`
and the one from Submariner repo is `submarinerclient`

Signed-Off-By: Janki Chhatbar <[email protected]>
  • Loading branch information
Jaanki authored and tpantelis committed Jan 3, 2022
1 parent f04b9b9 commit 40a8c6d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
8 changes: 7 additions & 1 deletion pkg/client/default_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ limitations under the License.
package client

import (
submarinerclient "github.com/submariner-io/submariner-operator/pkg/client/clientset/versioned"
operatorclient "github.com/submariner-io/submariner-operator/pkg/client/clientset/versioned"
submarinerclient "github.com/submariner-io/submariner/pkg/client/clientset/versioned"
apiextclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
Expand All @@ -29,6 +30,7 @@ type DefaultProducer struct {
CRDClient apiextclient.Interface
KubeClient kubernetes.Interface
DynamicClient dynamic.Interface
OperatorClient operatorclient.Interface
SubmarinerClient submarinerclient.Interface
}

Expand All @@ -47,3 +49,7 @@ func (p *DefaultProducer) ForDynamic() dynamic.Interface {
func (p *DefaultProducer) ForSubmariner() submarinerclient.Interface {
return p.SubmarinerClient
}

func (p *DefaultProducer) ForOperator() operatorclient.Interface {
return p.OperatorClient
}
5 changes: 4 additions & 1 deletion pkg/client/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ limitations under the License.
package client

import (
submarinerClientset "github.com/submariner-io/submariner-operator/pkg/client/clientset/versioned"
operatorClientset "github.com/submariner-io/submariner-operator/pkg/client/clientset/versioned"
submarinerClientset "github.com/submariner-io/submariner/pkg/client/clientset/versioned"
apiextClient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
Expand All @@ -32,5 +33,7 @@ type Producer interface {

ForDynamic() dynamic.Interface

ForOperator() operatorClientset.Interface

ForSubmariner() submarinerClientset.Interface
}
8 changes: 7 additions & 1 deletion pkg/client/restconfig_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ package client

import (
"github.com/pkg/errors"
submarinerClientset "github.com/submariner-io/submariner-operator/pkg/client/clientset/versioned"
operatorClientset "github.com/submariner-io/submariner-operator/pkg/client/clientset/versioned"
submarinerClientset "github.com/submariner-io/submariner/pkg/client/clientset/versioned"
apiextClient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
Expand All @@ -41,6 +42,11 @@ func NewProducerFromRestConfig(config *rest.Config) (Producer, error) {
return nil, errors.Wrap(err, "error creating dynamic client")
}

p.OperatorClient, err = operatorClientset.NewForConfig(config)
if err != nil {
return nil, errors.Wrap(err, "error creating operator client")
}

p.SubmarinerClient, err = submarinerClientset.NewForConfig(config)
if err != nil {
return nil, errors.Wrap(err, "error creating submariner client")
Expand Down
2 changes: 1 addition & 1 deletion pkg/deploy/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func deploy(options *BrokerOptions, status reporter.Interface, clientProducer cl

status.Start("Deploying the broker")

err = brokercr.Ensure(clientProducer.ForSubmariner(), options.BrokerNamespace, options.BrokerSpec)
err = brokercr.Ensure(clientProducer.ForOperator(), options.BrokerNamespace, options.BrokerSpec)
if err != nil {
return status.Error(err, "Broker deployment failed")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/subctl/cmd/deploybroker.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ var deployBroker = &cobra.Command{
utils.ExitOnError("Error deploying the operator", err)

status.Start("Deploying the broker")
err = brokercr.Ensure(clientProducer.ForSubmariner(), brokerNamespace, populateBrokerSpec())
err = brokercr.Ensure(clientProducer.ForOperator(), brokerNamespace, populateBrokerSpec())
if err == nil {
status.QueueSuccessMessage("The broker has been deployed")
status.EndWith(cli.Success)
Expand Down

0 comments on commit 40a8c6d

Please sign in to comment.