Skip to content

Commit

Permalink
plug in the external service registry by default to the aggregator (i…
Browse files Browse the repository at this point in the history
…stio#4397)

* plug the external service registry by default

* lint fixes

* lint fix

* lint fix

* lint

Signed-off-by: Shriram Rajagopalan <[email protected]>
  • Loading branch information
GregHanson authored and rshriram committed Mar 20, 2018
1 parent ad2c0dd commit 402cdf6
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pilot/pkg/bootstrap/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ import (
"strconv"
"time"

"google.golang.org/grpc"

"code.cloudfoundry.org/copilot"
"github.com/davecgh/go-spew/spew"
durpb "github.com/golang/protobuf/ptypes/duration"
middleware "github.com/grpc-ecosystem/go-grpc-middleware"
prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
multierror "github.com/hashicorp/go-multierror"
// TODO(nmittler): Remove this
_ "github.com/golang/glog"
"google.golang.org/grpc"
"k8s.io/api/core/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
Expand All @@ -55,6 +52,7 @@ import (
"istio.io/istio/pilot/pkg/serviceregistry/cloudfoundry"
"istio.io/istio/pilot/pkg/serviceregistry/consul"
"istio.io/istio/pilot/pkg/serviceregistry/eureka"
"istio.io/istio/pilot/pkg/serviceregistry/external"
"istio.io/istio/pilot/pkg/serviceregistry/kube"
"istio.io/istio/pkg/log"
"istio.io/istio/pkg/version"
Expand Down Expand Up @@ -651,6 +649,16 @@ func (s *Server) initServiceControllers(args *PilotArgs) error {
return multierror.Prefix(nil, "Service registry "+r+" is not supported.")
}
}
configStore := model.MakeIstioStore(s.configController)

// add external service registry to aggregator by default
serviceControllers.AddRegistry(
aggregate.Registry{
Name: "ExternalServices",
Controller: external.NewController(s.configController),
ServiceDiscovery: external.NewServiceDiscovery(configStore),
ServiceAccounts: external.NewServiceAccounts(),
})

s.ServiceController = serviceControllers

Expand Down

0 comments on commit 402cdf6

Please sign in to comment.