Skip to content

Commit e3c1777

Browse files
author
Antonio Ojea
committed
conntrack log delete operations
1 parent 880baa9 commit e3c1777

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pkg/util/conntrack/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ go_library(
77
visibility = ["//visibility:public"],
88
deps = [
99
"//staging/src/k8s.io/api/core/v1:go_default_library",
10+
"//vendor/k8s.io/klog/v2:go_default_library",
1011
"//vendor/k8s.io/utils/exec:go_default_library",
1112
"//vendor/k8s.io/utils/net:go_default_library",
1213
],

pkg/util/conntrack/conntrack.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"strings"
2323

2424
v1 "k8s.io/api/core/v1"
25+
"k8s.io/klog/v2"
2526
"k8s.io/utils/exec"
2627
utilnet "k8s.io/utils/net"
2728
)
@@ -62,10 +63,12 @@ func Exec(execer exec.Interface, parameters ...string) error {
6263
if err != nil {
6364
return fmt.Errorf("error looking for path of conntrack: %v", err)
6465
}
66+
klog.V(4).Infof("Clearing conntrack entries %v", parameters)
6567
output, err := execer.Command(conntrackPath, parameters...).CombinedOutput()
6668
if err != nil {
6769
return fmt.Errorf("conntrack command returned: %q, error message: %s", string(output), err)
6870
}
71+
klog.V(4).Infof("Conntrack entries deleted %s", string(output))
6972
return nil
7073
}
7174

0 commit comments

Comments
 (0)