Skip to content

Commit

Permalink
v0.1.8: IPTABLES_SAVE=iptables-nft-save support
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Pflug committed Jun 7, 2021
1 parent ba8876e commit 6c90ef3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
all: build

ENVVAR = GOOS=linux GOARCH=amd64
TAG = v0.1.7
TAG = v0.1.8
APP_NAME = calico-accountant
REPO = andreas-p
IMAGE_TAG = $(REPO)/$(APP_NAME):$(TAG)
Expand Down
8 changes: 7 additions & 1 deletion iptables/iptables.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"bytes"
"errors"
"io"
"os"
"os/exec"
"regexp"
"sort"
Expand Down Expand Up @@ -88,7 +89,12 @@ var (
)

func iptablesSave(interfaceToWorkload map[string]*apiv3.WorkloadEndpoint) ([]*Result, error) {
cmd := exec.Command("iptables-save", "-t", "filter", "-c")
saveCommand, ok := os.LookupEnv("IPTABLES_SAVE")
if !ok {
saveCommand = "iptables-save"
}

cmd := exec.Command(saveCommand, "-t", "filter", "-c")

stdout, err := cmd.StdoutPipe()
if err != nil {
Expand Down

0 comments on commit 6c90ef3

Please sign in to comment.