Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BPF] clean up the right progs when ebpf is disabled #9630

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions felix/bpf/nat/connecttime.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ const (
ProgIndexCTLBConnectV6 = iota
ProgIndexCTLBSendV6
ProgIndexCTLBRecvV6

ProgNamePrefix = "calico_"
)

var ctlbProgToIndex = map[string]int{
Expand Down Expand Up @@ -96,7 +98,7 @@ func RemoveConnectTimeLoadBalancer(cgroupv2 string) error {
}

for _, p := range progs {
if !strings.HasPrefix(p.Name, "cali_") {
if !strings.HasPrefix(p.Name, ProgNamePrefix) {
continue
}

Expand Down Expand Up @@ -164,7 +166,7 @@ func attachProgram(name, ipver, bpfMount, cgroupPath string, udpNotSeen time.Dur
progPinDir := path.Join(bpfMount, "calico_connect4")
_ = os.RemoveAll(progPinDir)

progName := "calico_" + name + "_v" + ipver
progName := ProgNamePrefix + name + "_v" + ipver

// N.B. no need to remember the link since we are never going to detach
// these programs unless Felix restarts.
Expand Down
Loading