apiserver aggregator upgrade unit test

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

Kubernetes-commit: 0dfe8e33143aceacb2b47d66a967cc5e9cbeb94f
This commit is contained in:
Antonio Ojea 2021-10-05 00:19:43 +02:00 committed by Kubernetes Publisher
parent a00f1af772
commit b57385a406
1 changed files with 10 additions and 0 deletions

View File

@ -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) {