mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 12:18:16 +00:00 
			
		
		
		
	Fix NewProxyServer
Different OSes need different args. This is not a great fix, but better than adding an arg to Windows which doesn't need it.
This commit is contained in:
		@@ -218,7 +218,7 @@ func (o *Options) Run() error {
 | 
				
			|||||||
		return o.writeConfigFile()
 | 
							return o.writeConfigFile()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	proxyServer, err := NewProxyServer(o.config, o.CleanupAndExit, o.CleanupIPVS, o.scheme, o.master)
 | 
						proxyServer, err := NewProxyServer(o)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -54,7 +54,17 @@ import (
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// NewProxyServer returns a new ProxyServer.
 | 
					// NewProxyServer returns a new ProxyServer.
 | 
				
			||||||
func NewProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExit bool, cleanupIPVS bool, scheme *runtime.Scheme, master string) (*ProxyServer, error) {
 | 
					func NewProxyServer(o *Options) (*ProxyServer, error) {
 | 
				
			||||||
 | 
						return newProxyServer(o.config, o.CleanupAndExit, o.CleanupIPVS, o.scheme, o.master)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func newProxyServer(
 | 
				
			||||||
 | 
						config *proxyconfigapi.KubeProxyConfiguration,
 | 
				
			||||||
 | 
						cleanupAndExit bool,
 | 
				
			||||||
 | 
						cleanupIPVS bool,
 | 
				
			||||||
 | 
						scheme *runtime.Scheme,
 | 
				
			||||||
 | 
						master string) (*ProxyServer, error) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if config == nil {
 | 
						if config == nil {
 | 
				
			||||||
		return nil, errors.New("config is required")
 | 
							return nil, errors.New("config is required")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -162,7 +162,7 @@ func TestProxyServerWithCleanupAndExit(t *testing.T) {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		options.CleanupAndExit = true
 | 
							options.CleanupAndExit = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		proxyserver, err := NewProxyServer(options.config, options.CleanupAndExit, options.CleanupIPVS, options.scheme, options.master)
 | 
							proxyserver, err := NewProxyServer(options)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		assert.Nil(t, err, "unexpected error in NewProxyServer, addr: %s", addr)
 | 
							assert.Nil(t, err, "unexpected error in NewProxyServer, addr: %s", addr)
 | 
				
			||||||
		assert.NotNil(t, proxyserver, "nil proxy server obj, addr: %s", addr)
 | 
							assert.NotNil(t, proxyserver, "nil proxy server obj, addr: %s", addr)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,7 +46,11 @@ import (
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// NewProxyServer returns a new ProxyServer.
 | 
					// NewProxyServer returns a new ProxyServer.
 | 
				
			||||||
func NewProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExit bool, scheme *runtime.Scheme, master string) (*ProxyServer, error) {
 | 
					func NewProxyServer(o *Options) (*ProxyServer, error) {
 | 
				
			||||||
 | 
						return newProxyServer(o.config, o.CleanupAndExit, o.scheme, o.master)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExit bool, scheme *runtime.Scheme, master string) (*ProxyServer, error) {
 | 
				
			||||||
	if config == nil {
 | 
						if config == nil {
 | 
				
			||||||
		return nil, errors.New("config is required")
 | 
							return nil, errors.New("config is required")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user