mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Revert "Deprecated --cleanup-ipvs flag in kube-proxy"
This reverts commit 4f1bb2bd2f.
This commit is contained in:
@@ -100,8 +100,10 @@ type Options struct {
|
||||
ConfigFile string
|
||||
// WriteConfigTo is the path where the default configuration will be written.
|
||||
WriteConfigTo string
|
||||
// CleanupAndExit, when true, makes the proxy server clean up iptables, ipvs, etc rules, then exit.
|
||||
// CleanupAndExit, when true, makes the proxy server clean up iptables rules, then exit.
|
||||
CleanupAndExit bool
|
||||
// CleanupIPVS, when true, makes the proxy server clean up ipvs rules before running.
|
||||
CleanupIPVS bool
|
||||
// WindowsService should be set to true if kube-proxy is running as a service on Windows.
|
||||
// Its corresponding flag only gets registered in Windows builds
|
||||
WindowsService bool
|
||||
@@ -141,7 +143,7 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.BoolVar(&o.CleanupAndExit, "cleanup-iptables", o.CleanupAndExit, "If true cleanup iptables and ipvs rules and exit.")
|
||||
fs.MarkDeprecated("cleanup-iptables", "This flag is replaced by --cleanup.")
|
||||
fs.BoolVar(&o.CleanupAndExit, "cleanup", o.CleanupAndExit, "If true cleanup iptables and ipvs rules and exit.")
|
||||
fs.MarkDeprecated("cleanup-ipvs", "This flag is replaced by --cleanup.")
|
||||
fs.BoolVar(&o.CleanupIPVS, "cleanup-ipvs", o.CleanupIPVS, "If true make kube-proxy cleanup ipvs rules before running. Default is true")
|
||||
|
||||
// All flags below here are deprecated and will eventually be removed.
|
||||
|
||||
@@ -202,6 +204,7 @@ func NewOptions() *Options {
|
||||
metricsPort: ports.ProxyStatusPort,
|
||||
scheme: scheme.Scheme,
|
||||
codecs: scheme.Codecs,
|
||||
CleanupIPVS: true,
|
||||
errCh: make(chan error),
|
||||
}
|
||||
}
|
||||
@@ -499,6 +502,7 @@ type ProxyServer struct {
|
||||
ProxyMode string
|
||||
NodeRef *v1.ObjectReference
|
||||
CleanupAndExit bool
|
||||
CleanupIPVS bool
|
||||
MetricsBindAddress string
|
||||
EnableProfiling bool
|
||||
OOMScoreAdj *int32
|
||||
@@ -555,7 +559,7 @@ func (s *ProxyServer) Run() error {
|
||||
if s.CleanupAndExit {
|
||||
encounteredError := userspace.CleanupLeftovers(s.IptInterface)
|
||||
encounteredError = iptables.CleanupLeftovers(s.IptInterface) || encounteredError
|
||||
encounteredError = ipvs.CleanupLeftovers(s.IpvsInterface, s.IptInterface, s.IpsetInterface) || encounteredError
|
||||
encounteredError = ipvs.CleanupLeftovers(s.IpvsInterface, s.IptInterface, s.IpsetInterface, s.CleanupIPVS) || encounteredError
|
||||
if encounteredError {
|
||||
return errors.New("encountered an error while tearing down rules")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user