From bd4d163b089113f3c1c7562945f1e2f9a4c8e67b Mon Sep 17 00:00:00 2001 From: Dmitry Shihovtsev Date: Wed, 19 Sep 2018 19:33:50 +0600 Subject: [PATCH 1/2] Fixed upload artifacts to release and set iptables rules --- .travis.yml | 4 +++- nat/service_pfctl.go | 12 ++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index aebf55da1c..4c4c4de8c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -157,7 +157,9 @@ jobs: file: build/package/* skip_cleanup: true api_key: "$GIT_RELEASES_API_KEY" - - script: + on: + tags: true + - script: - bin/s3 sync s3://docker-images build/docker - docker load -i build/docker/myst_alpine.tgz - docker load -i build/docker/myst_ubuntu.tgz diff --git a/nat/service_pfctl.go b/nat/service_pfctl.go index 552705f34b..0b7e438f44 100644 --- a/nat/service_pfctl.go +++ b/nat/service_pfctl.go @@ -38,17 +38,9 @@ func (service *servicePFCtl) Add(rule RuleForwarding) { } func (service *servicePFCtl) Start() error { - err := service.ipForward.Enable() - if err != nil { - return err - } - + service.ipForward.Enable() service.clearStaleRules() - err = service.enableRules() - if err != nil { - return err - } - return nil + return service.enableRules() } func (service *servicePFCtl) Stop() { From ed84b39d7a73a5f5b43d27fa6b76032ebfc9c2c5 Mon Sep 17 00:00:00 2001 From: Dmitry Shihovtsev Date: Wed, 19 Sep 2018 20:14:44 +0600 Subject: [PATCH 2/2] Extra log for failed enable of the IP forwarding --- nat/service_iptables.go | 8 ++------ nat/service_pfctl.go | 6 +++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nat/service_iptables.go b/nat/service_iptables.go index 04fe1f81d8..c803e56db0 100644 --- a/nat/service_iptables.go +++ b/nat/service_iptables.go @@ -36,15 +36,11 @@ func (service *serviceIPTables) Add(rule RuleForwarding) { func (service *serviceIPTables) Start() error { err := service.ipForward.Enable() if err != nil { - return err + log.Warn(natLogPrefix, "Failed to enable IP forwarding: ", err) } service.clearStaleRules() - err = service.enableRules() - if err != nil { - return err - } - return nil + return service.enableRules() } func (service *serviceIPTables) Stop() { diff --git a/nat/service_pfctl.go b/nat/service_pfctl.go index 0b7e438f44..0aabe0775b 100644 --- a/nat/service_pfctl.go +++ b/nat/service_pfctl.go @@ -38,7 +38,11 @@ func (service *servicePFCtl) Add(rule RuleForwarding) { } func (service *servicePFCtl) Start() error { - service.ipForward.Enable() + err := service.ipForward.Enable() + if err != nil { + log.Warn(natLogPrefix, "Failed to enable IP forwarding: ", err) + } + service.clearStaleRules() return service.enableRules() }