Merge pull request #105475 from aojea/egress-aggregator-upgrade

apiserver aggregator upgrade unit test

Kubernetes-commit: 76cac9dcfec1370b49b0ab2a1afe82cc2cefc0f8
This commit is contained in:
Kubernetes Publisher 2021-10-08 12:37:22 -07:00
commit 733ad59e08
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) {