mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #120565 from skitt/drop-deprecated-pointer-kube-proxy
kube-proxy: drop deprecated pointer package
This commit is contained in:
		@@ -87,7 +87,7 @@ import (
 | 
				
			|||||||
	utilflag "k8s.io/kubernetes/pkg/util/flag"
 | 
						utilflag "k8s.io/kubernetes/pkg/util/flag"
 | 
				
			||||||
	"k8s.io/kubernetes/pkg/util/oom"
 | 
						"k8s.io/kubernetes/pkg/util/oom"
 | 
				
			||||||
	netutils "k8s.io/utils/net"
 | 
						netutils "k8s.io/utils/net"
 | 
				
			||||||
	"k8s.io/utils/pointer"
 | 
						"k8s.io/utils/ptr"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
@@ -179,8 +179,8 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
 | 
				
			|||||||
	fs.MarkDeprecated("healthz-port", "This flag is deprecated and will be removed in a future release. Please use --healthz-bind-address instead.")
 | 
						fs.MarkDeprecated("healthz-port", "This flag is deprecated and will be removed in a future release. Please use --healthz-bind-address instead.")
 | 
				
			||||||
	fs.Int32Var(&o.metricsPort, "metrics-port", o.metricsPort, "The port to bind the metrics server. Use 0 to disable.")
 | 
						fs.Int32Var(&o.metricsPort, "metrics-port", o.metricsPort, "The port to bind the metrics server. Use 0 to disable.")
 | 
				
			||||||
	fs.MarkDeprecated("metrics-port", "This flag is deprecated and will be removed in a future release. Please use --metrics-bind-address instead.")
 | 
						fs.MarkDeprecated("metrics-port", "This flag is deprecated and will be removed in a future release. Please use --metrics-bind-address instead.")
 | 
				
			||||||
	fs.Int32Var(o.config.OOMScoreAdj, "oom-score-adj", pointer.Int32Deref(o.config.OOMScoreAdj, int32(qos.KubeProxyOOMScoreAdj)), "The oom-score-adj value for kube-proxy process. Values must be within the range [-1000, 1000]. This parameter is ignored if a config file is specified by --config.")
 | 
						fs.Int32Var(o.config.OOMScoreAdj, "oom-score-adj", ptr.Deref(o.config.OOMScoreAdj, int32(qos.KubeProxyOOMScoreAdj)), "The oom-score-adj value for kube-proxy process. Values must be within the range [-1000, 1000]. This parameter is ignored if a config file is specified by --config.")
 | 
				
			||||||
	fs.Int32Var(o.config.IPTables.MasqueradeBit, "iptables-masquerade-bit", pointer.Int32Deref(o.config.IPTables.MasqueradeBit, 14), "If using the pure iptables proxy, the bit of the fwmark space to mark packets requiring SNAT with.  Must be within the range [0, 31].")
 | 
						fs.Int32Var(o.config.IPTables.MasqueradeBit, "iptables-masquerade-bit", ptr.Deref(o.config.IPTables.MasqueradeBit, 14), "If using the pure iptables proxy, the bit of the fwmark space to mark packets requiring SNAT with.  Must be within the range [0, 31].")
 | 
				
			||||||
	fs.Int32Var(o.config.Conntrack.MaxPerCore, "conntrack-max-per-core", *o.config.Conntrack.MaxPerCore,
 | 
						fs.Int32Var(o.config.Conntrack.MaxPerCore, "conntrack-max-per-core", *o.config.Conntrack.MaxPerCore,
 | 
				
			||||||
		"Maximum number of NAT connections to track per CPU core (0 to leave the limit as-is and ignore conntrack-min).")
 | 
							"Maximum number of NAT connections to track per CPU core (0 to leave the limit as-is and ignore conntrack-min).")
 | 
				
			||||||
	fs.Int32Var(o.config.Conntrack.Min, "conntrack-min", *o.config.Conntrack.Min,
 | 
						fs.Int32Var(o.config.Conntrack.Min, "conntrack-min", *o.config.Conntrack.Min,
 | 
				
			||||||
@@ -203,7 +203,7 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	fs.BoolVar(&o.config.IPVS.StrictARP, "ipvs-strict-arp", o.config.IPVS.StrictARP, "Enable strict ARP by setting arp_ignore to 1 and arp_announce to 2")
 | 
						fs.BoolVar(&o.config.IPVS.StrictARP, "ipvs-strict-arp", o.config.IPVS.StrictARP, "Enable strict ARP by setting arp_ignore to 1 and arp_announce to 2")
 | 
				
			||||||
	fs.BoolVar(&o.config.IPTables.MasqueradeAll, "masquerade-all", o.config.IPTables.MasqueradeAll, "If using the pure iptables proxy, SNAT all traffic sent via Service cluster IPs (this not commonly needed)")
 | 
						fs.BoolVar(&o.config.IPTables.MasqueradeAll, "masquerade-all", o.config.IPTables.MasqueradeAll, "If using the pure iptables proxy, SNAT all traffic sent via Service cluster IPs (this not commonly needed)")
 | 
				
			||||||
	fs.BoolVar(o.config.IPTables.LocalhostNodePorts, "iptables-localhost-nodeports", pointer.BoolDeref(o.config.IPTables.LocalhostNodePorts, true), "If false Kube-proxy will disable the legacy behavior of allowing NodePort services to be accessed via localhost, This only applies to iptables mode and ipv4.")
 | 
						fs.BoolVar(o.config.IPTables.LocalhostNodePorts, "iptables-localhost-nodeports", ptr.Deref(o.config.IPTables.LocalhostNodePorts, true), "If false Kube-proxy will disable the legacy behavior of allowing NodePort services to be accessed via localhost, This only applies to iptables mode and ipv4.")
 | 
				
			||||||
	fs.BoolVar(&o.config.EnableProfiling, "profiling", o.config.EnableProfiling, "If true enables profiling via web interface on /debug/pprof handler. This parameter is ignored if a config file is specified by --config.")
 | 
						fs.BoolVar(&o.config.EnableProfiling, "profiling", o.config.EnableProfiling, "If true enables profiling via web interface on /debug/pprof handler. This parameter is ignored if a config file is specified by --config.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	fs.Float32Var(&o.config.ClientConnection.QPS, "kube-api-qps", o.config.ClientConnection.QPS, "QPS to use while talking with kubernetes apiserver")
 | 
						fs.Float32Var(&o.config.ClientConnection.QPS, "kube-api-qps", o.config.ClientConnection.QPS, "QPS to use while talking with kubernetes apiserver")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,7 +40,7 @@ import (
 | 
				
			|||||||
	proxyconfigapi "k8s.io/kubernetes/pkg/proxy/apis/config"
 | 
						proxyconfigapi "k8s.io/kubernetes/pkg/proxy/apis/config"
 | 
				
			||||||
	proxyutiliptables "k8s.io/kubernetes/pkg/proxy/util/iptables"
 | 
						proxyutiliptables "k8s.io/kubernetes/pkg/proxy/util/iptables"
 | 
				
			||||||
	netutils "k8s.io/utils/net"
 | 
						netutils "k8s.io/utils/net"
 | 
				
			||||||
	"k8s.io/utils/pointer"
 | 
						"k8s.io/utils/ptr"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func Test_platformApplyDefaults(t *testing.T) {
 | 
					func Test_platformApplyDefaults(t *testing.T) {
 | 
				
			||||||
@@ -672,8 +672,8 @@ func TestGetConntrackMax(t *testing.T) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	for i, tc := range testCases {
 | 
						for i, tc := range testCases {
 | 
				
			||||||
		cfg := proxyconfigapi.KubeProxyConntrackConfiguration{
 | 
							cfg := proxyconfigapi.KubeProxyConntrackConfiguration{
 | 
				
			||||||
			Min:        pointer.Int32(tc.min),
 | 
								Min:        ptr.To(tc.min),
 | 
				
			||||||
			MaxPerCore: pointer.Int32(tc.maxPerCore),
 | 
								MaxPerCore: ptr.To(tc.maxPerCore),
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		x, e := getConntrackMax(cfg)
 | 
							x, e := getConntrackMax(cfg)
 | 
				
			||||||
		if e != nil {
 | 
							if e != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -36,7 +36,7 @@ import (
 | 
				
			|||||||
	componentbaseconfig "k8s.io/component-base/config"
 | 
						componentbaseconfig "k8s.io/component-base/config"
 | 
				
			||||||
	logsapi "k8s.io/component-base/logs/api/v1"
 | 
						logsapi "k8s.io/component-base/logs/api/v1"
 | 
				
			||||||
	kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config"
 | 
						kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config"
 | 
				
			||||||
	"k8s.io/utils/pointer"
 | 
						"k8s.io/utils/ptr"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// TestLoadConfig tests proper operation of loadConfig()
 | 
					// TestLoadConfig tests proper operation of loadConfig()
 | 
				
			||||||
@@ -195,8 +195,8 @@ nodePortAddresses:
 | 
				
			|||||||
			ClusterCIDR:      tc.clusterCIDR,
 | 
								ClusterCIDR:      tc.clusterCIDR,
 | 
				
			||||||
			ConfigSyncPeriod: metav1.Duration{Duration: 15 * time.Second},
 | 
								ConfigSyncPeriod: metav1.Duration{Duration: 15 * time.Second},
 | 
				
			||||||
			Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{
 | 
								Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{
 | 
				
			||||||
				MaxPerCore:            pointer.Int32(2),
 | 
									MaxPerCore:            ptr.To[int32](2),
 | 
				
			||||||
				Min:                   pointer.Int32(1),
 | 
									Min:                   ptr.To[int32](1),
 | 
				
			||||||
				TCPCloseWaitTimeout:   &metav1.Duration{Duration: 10 * time.Second},
 | 
									TCPCloseWaitTimeout:   &metav1.Duration{Duration: 10 * time.Second},
 | 
				
			||||||
				TCPEstablishedTimeout: &metav1.Duration{Duration: 20 * time.Second},
 | 
									TCPEstablishedTimeout: &metav1.Duration{Duration: 20 * time.Second},
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
@@ -205,8 +205,8 @@ nodePortAddresses:
 | 
				
			|||||||
			HostnameOverride:   "foo",
 | 
								HostnameOverride:   "foo",
 | 
				
			||||||
			IPTables: kubeproxyconfig.KubeProxyIPTablesConfiguration{
 | 
								IPTables: kubeproxyconfig.KubeProxyIPTablesConfiguration{
 | 
				
			||||||
				MasqueradeAll:      true,
 | 
									MasqueradeAll:      true,
 | 
				
			||||||
				MasqueradeBit:      pointer.Int32(17),
 | 
									MasqueradeBit:      ptr.To[int32](17),
 | 
				
			||||||
				LocalhostNodePorts: pointer.Bool(true),
 | 
									LocalhostNodePorts: ptr.To(true),
 | 
				
			||||||
				MinSyncPeriod:      metav1.Duration{Duration: 10 * time.Second},
 | 
									MinSyncPeriod:      metav1.Duration{Duration: 10 * time.Second},
 | 
				
			||||||
				SyncPeriod:         metav1.Duration{Duration: 60 * time.Second},
 | 
									SyncPeriod:         metav1.Duration{Duration: 60 * time.Second},
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
@@ -217,7 +217,7 @@ nodePortAddresses:
 | 
				
			|||||||
			},
 | 
								},
 | 
				
			||||||
			MetricsBindAddress: tc.metricsBindAddress,
 | 
								MetricsBindAddress: tc.metricsBindAddress,
 | 
				
			||||||
			Mode:               kubeproxyconfig.ProxyMode(tc.mode),
 | 
								Mode:               kubeproxyconfig.ProxyMode(tc.mode),
 | 
				
			||||||
			OOMScoreAdj:        pointer.Int32(17),
 | 
								OOMScoreAdj:        ptr.To[int32](17),
 | 
				
			||||||
			PortRange:          "2-7",
 | 
								PortRange:          "2-7",
 | 
				
			||||||
			NodePortAddresses:  []string{"10.20.30.40/16", "fd00:1::0/64"},
 | 
								NodePortAddresses:  []string{"10.20.30.40/16", "fd00:1::0/64"},
 | 
				
			||||||
			DetectLocalMode:    kubeproxyconfig.LocalModeClusterCIDR,
 | 
								DetectLocalMode:    kubeproxyconfig.LocalModeClusterCIDR,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user