Skip to content

Commit

Permalink
apiserver aggregator upgrade unit test
Browse files Browse the repository at this point in the history
Co-authored-by: Chao Xu <xuchao@google.com>

Kubernetes-commit: 0dfe8e33143aceacb2b47d66a967cc5e9cbeb94f
  • Loading branch information
Antonio Ojea authored and k8s-publishing-bot committed Oct 4, 2021
1 parent a00f1af commit b57385a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/server/egressselector/egress_selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,16 @@ func NewEgressSelector(config *apiserver.EgressSelectorConfiguration) (*EgressSe
return cs, nil
}

// NewEgressSelectorWithMap returns a EgressSelector with the supplied EgressType to DialFunc map.
func NewEgressSelectorWithMap(m map[EgressType]utilnet.DialFunc) *EgressSelector {
if m == nil {
m = make(map[EgressType]utilnet.DialFunc)
}
return &EgressSelector{
egressToDialer: m,
}
}

// Lookup gets the dialer function for the network context.
// This is configured for the Kubernetes API Server at startup.
func (cs *EgressSelector) Lookup(networkContext NetworkContext) (utilnet.DialFunc, error) {
Expand Down

0 comments on commit b57385a

Please sign in to comment.