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:
Dan Winship 2023-04-13 19:50:26 -04:00
parent 139a2c54a2
commit a96358ac0f
2 changed files with 0 additions and 12 deletions

View File

@ -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())

View File

@ -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 {