Skip to content

Commit d688389

Browse files
committed
libnetwork/iptables: deprecate Passthrough
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 9fe5649 commit d688389

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

libnetwork/iptables/firewalld.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,15 @@ func checkRunning() bool {
174174
return err == nil
175175
}
176176

177-
// Passthrough method simply passes args through to iptables/ip6tables
177+
// Passthrough method simply passes args through to iptables/ip6tables.
178+
//
179+
// Deprecated: this function is only used internally and will be removed in the next release.
178180
func Passthrough(ipv IPVersion, args ...string) ([]byte, error) {
181+
return passthrough(ipv, args...)
182+
}
183+
184+
// passthrough method simply passes args through to iptables/ip6tables
185+
func passthrough(ipv IPVersion, args ...string) ([]byte, error) {
179186
var output string
180187
log.G(context.TODO()).Debugf("Firewalld passthrough: %s, %s", ipv, args)
181188
if err := connection.sysObj.Call(dbusInterface+".direct.passthrough", 0, ipv, args).Store(&output); err != nil {

libnetwork/iptables/firewalld_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func TestPassthrough(t *testing.T) {
9696
"-j", "ACCEPT",
9797
}
9898

99-
_, err := Passthrough(IPv4, append([]string{"-A"}, rule1...)...)
99+
_, err := passthrough(IPv4, append([]string{"-A"}, rule1...)...)
100100
if err != nil {
101101
t.Fatal(err)
102102
}

libnetwork/iptables/iptables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ func filterOutput(start time.Time, output []byte, args ...string) []byte {
425425
func (iptable IPTable) Raw(args ...string) ([]byte, error) {
426426
if firewalldRunning {
427427
startTime := time.Now()
428-
output, err := Passthrough(iptable.ipVersion, args...)
428+
output, err := passthrough(iptable.ipVersion, args...)
429429
if err == nil || !strings.Contains(err.Error(), "was not provided by any .service files") {
430430
return filterOutput(startTime, output, args...), err
431431
}

0 commit comments

Comments
 (0)