8000 libnetwork/iptables: deprecate Passthrough · moby/moby@eda0a20 · GitHub
[go: up one dir, main page]

Skip to content

Commit eda0a20

Browse files
committed
libnetwork/iptables: deprecate Passthrough
Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit d688389) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent b51622d commit eda0a20

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

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
@@ -93,7 +93,7 @@ func TestPassthrough(t *testing.T) {
9393
"-j", "ACCEPT",
9494
}
9595

96-
_, err := Passthrough(IPv4, append([]string{"-A"}, rule1...)...)
96+
_, err := passthrough(IPv4, append([]string{"-A"}, rule1...)...)
9797
if err != nil {
9898
t.Fatal(err)
9999
}

libnetwork/iptables/iptables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ func filterOutput(start time.Time, output []byte, args ...string) []byte {
444444
func (iptable IPTable) Raw(args ...string) ([]byte, error) {
445445
if firewalldRunning {
446446
startTime := time.Now()
447-
output, err := Passthrough(iptable.ipVersion, args...)
447+
output, err := passthrough(iptable.ipVersion, args...)
448448
if err == nil || !strings.Contains(err.Error(), "was not provided by any .service files") {
449449
return filterOutput(startTime, output, args...), err
450450
}

0 commit comments

Comments
 (0)
0