mirror of https://github.com/k3s-io/k3s
Merge pull request #58680 from m1093782566/ipvs-del-service
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Ignore address not exist error when unbind IPVS serivce address from dummy device **What this PR does / why we need it**: Ignore address not exist error when unbind IPVS serivce address from dummy device. **Which issue(s) this PR fixes**: Fixes #58681 **Special notes for your reviewer**: **Release note**: ```release-note NONE ```pull/6/head
commit
ba43ffa9b8
|
@ -93,6 +93,7 @@ go_library(
|
|||
"//pkg/util/sysctl:go_default_library",
|
||||
"//pkg/util/version:go_default_library",
|
||||
"//vendor/github.com/golang/glog:go_default_library",
|
||||
"//vendor/golang.org/x/sys/unix:go_default_library",
|
||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
|
||||
|
@ -102,7 +103,6 @@ go_library(
|
|||
] + select({
|
||||
"@io_bazel_rules_go//go/platform:linux": [
|
||||
"//vendor/github.com/vishvananda/netlink:go_default_library",
|
||||
"//vendor/golang.org/x/sys/unix:go_default_library",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
|
|
|
@ -51,6 +51,8 @@ import (
|
|||
utilipvs "k8s.io/kubernetes/pkg/util/ipvs"
|
||||
utilsysctl "k8s.io/kubernetes/pkg/util/sysctl"
|
||||
utilexec "k8s.io/utils/exec"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -1702,8 +1704,9 @@ func (proxier *Proxier) cleanLegacyService(atciveServices map[string]bool, curre
|
|||
|
||||
for _, addr := range unbindIPAddr.UnsortedList() {
|
||||
err := proxier.netlinkHandle.UnbindAddress(addr, DefaultDummyDevice)
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to unbind service from dummy interface, error: %v", err)
|
||||
// Ignore no such address error when try to unbind address
|
||||
if err != nil && err != unix.ENXIO {
|
||||
glog.Errorf("Failed to unbind service addr %s from dummy interface %s: %v", addr, DefaultDummyDevice, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue