Adds filtering of hosts to DialContexts.

The provided DialContext wraps existing clients' DialContext in an attempt to
preserve any existing timeout configuration. In some cases, we may replace
infinite timeouts with golang defaults.

- scaleio: tcp connect/keepalive values changed from 0/15 to 30/30
- storageos: no change
This commit is contained in:
Matthew Cary
2020-06-09 21:30:40 +00:00
parent 74dbf274d9
commit f2e23afcf1
41 changed files with 346 additions and 65 deletions

View File

@@ -47,6 +47,7 @@ import (
cloudprovider "k8s.io/cloud-provider"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
"k8s.io/kubernetes/pkg/controller/volume/events"
proxyutil "k8s.io/kubernetes/pkg/proxy/util"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume/csimigration"
"k8s.io/kubernetes/pkg/volume/util"
@@ -104,6 +105,8 @@ type expandController struct {
translator CSINameTranslator
csiMigratedPluginManager csimigration.PluginManager
filteredDialOptions *proxyutil.FilteredDialOptions
}
// NewExpandController expands the pvs
@@ -115,7 +118,8 @@ func NewExpandController(
cloud cloudprovider.Interface,
plugins []volume.VolumePlugin,
translator CSINameTranslator,
csiMigratedPluginManager csimigration.PluginManager) (ExpandController, error) {
csiMigratedPluginManager csimigration.PluginManager,
filteredDialOptions *proxyutil.FilteredDialOptions) (ExpandController, error) {
expc := &expandController{
kubeClient: kubeClient,
@@ -129,6 +133,7 @@ func NewExpandController(
queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "volume_expand"),
translator: translator,
csiMigratedPluginManager: csiMigratedPluginManager,
filteredDialOptions: filteredDialOptions,
}
if err := expc.volumePluginMgr.InitPlugins(plugins, nil, expc); err != nil {
@@ -449,3 +454,7 @@ func (expc *expandController) GetSubpather() subpath.Interface {
// not needed for expand controller
return nil
}
func (expc *expandController) GetFilteredDialOptions() *proxyutil.FilteredDialOptions {
return expc.filteredDialOptions
}