Skip to content

Commit

Permalink
Remove k8sAPI/metadataAPI dependency from endpointProfileTranslator (#…
Browse files Browse the repository at this point in the history
…11587)

This removes `endpointProfileTranslator`'s dependency on the k8sAPI and
metadataAPI, which are not used. This was introduced in one of #11334's
refactorings, but ended up being not required. No functional changes
here.
  • Loading branch information
alpeb authored Nov 14, 2023
1 parent 83cab30 commit c7db3b3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 1 addition & 8 deletions controller/api/destination/endpoint_profile_translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

pb "github.com/linkerd/linkerd2-proxy-api/go/destination"
"github.com/linkerd/linkerd2/controller/api/destination/watcher"
"github.com/linkerd/linkerd2/controller/k8s"
logging "github.com/sirupsen/logrus"
)

Expand All @@ -17,9 +16,7 @@ type endpointProfileTranslator struct {
stream pb.Destination_GetProfileServer
lastMessage string

k8sAPI *k8s.API
metadataAPI *k8s.MetadataAPI
log *logging.Entry
log *logging.Entry
}

// newEndpointProfileTranslator translates pod updates and protocol updates to
Expand All @@ -31,17 +28,13 @@ func newEndpointProfileTranslator(
defaultOpaquePorts map[uint32]struct{},
log *logging.Entry,
stream pb.Destination_GetProfileServer,
k8sAPI *k8s.API,
metadataAPI *k8s.MetadataAPI,
) *endpointProfileTranslator {
return &endpointProfileTranslator{
enableH2Upgrade: enableH2Upgrade,
controllerNS: controllerNS,
identityTrustDomain: identityTrustDomain,
defaultOpaquePorts: defaultOpaquePorts,
stream: stream,
k8sAPI: k8sAPI,
metadataAPI: metadataAPI,
log: log.WithField("component", "endpoint-profile-translator"),
}
}
Expand Down
2 changes: 0 additions & 2 deletions controller/api/destination/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,6 @@ func (s *server) subscribeToEndpointProfile(
s.defaultOpaquePorts,
log,
stream,
s.k8sAPI,
s.metadataAPI,
)

var err error
Expand Down

0 comments on commit c7db3b3

Please sign in to comment.