mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Remove some useless error checks
Don't return errors in the event of programmer errors, and don't double-check things that were already validated.
This commit is contained in:
parent
139a2c54a2
commit
a96358ac0f
@ -79,10 +79,6 @@ func newProxyServer(
|
||||
config *proxyconfigapi.KubeProxyConfiguration,
|
||||
master string) (*ProxyServer, error) {
|
||||
|
||||
if config == nil {
|
||||
return nil, errors.New("config is required")
|
||||
}
|
||||
|
||||
if c, err := configz.New(proxyconfigapi.GroupName); err == nil {
|
||||
c.Set(config)
|
||||
} else {
|
||||
@ -188,10 +184,6 @@ func newProxyServer(
|
||||
|
||||
if proxyMode == proxyconfigapi.ProxyModeIPTables {
|
||||
klog.InfoS("Using iptables Proxier")
|
||||
if config.IPTables.MasqueradeBit == nil {
|
||||
// MasqueradeBit must be specified or defaulted.
|
||||
return nil, fmt.Errorf("unable to read IPTables MasqueradeBit from config")
|
||||
}
|
||||
|
||||
if dualStack {
|
||||
klog.InfoS("kube-proxy running in dual-stack mode", "ipFamily", iptInterface.Protocol())
|
||||
|
@ -51,10 +51,6 @@ func NewProxyServer(o *Options) (*ProxyServer, error) {
|
||||
}
|
||||
|
||||
func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, master string) (*ProxyServer, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is required")
|
||||
}
|
||||
|
||||
if c, err := configz.New(proxyconfigapi.GroupName); err == nil {
|
||||
c.Set(config)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user