apiserver aggregator upgrade unit test

Co-authored-by: Chao Xu <xuchao@google.com>

Kubernetes-commit: 3627462ef3e741f2b8e6de7ed3f51be3122cbc6d
This commit is contained in:
Antonio Ojea 2021-10-05 00:19:43 +02:00 committed by Kubernetes Publisher
parent 3138aff0d7
commit 9bb5c950e8
1 changed files with 10 additions and 0 deletions

View File

@ -358,6 +358,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) {