Skip to content

Conversation

@cpretzer
Copy link
Contributor

What

There are linting errors because the calls to executeCommand don't handle the return values.

How

Added checks for the error value that is returned and print a message if there is an error. The proxy init will still continue to run, so this change doesn't change the current logic.

Why

The linting errors are holding up some other PRs, so I'm moving this change from #3 to its own PR, because there is more work to be done in #3 and I don't want to hold this change up.

Signed-off-by: Charles Pretzer charles@buoyant.io

cpretzer added 3 commits June 22, 2020 13:59
Signed-off-by: Charles Pretzer <charles@buoyant.io>
Signed-off-by: Charles Pretzer <charles@buoyant.io>
Signed-off-by: Charles Pretzer <charles@buoyant.io>
@cpretzer cpretzer requested a review from alpeb June 22, 2020 22:02
Copy link
Contributor

@ihcsim ihcsim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

On master:

$ golangci-lint run                                                               
iptables/iptables.go:94:16: Error return value of `executeCommand` is not checked (errcheck)
        executeCommand(firewallConfiguration, makeFlushChain(outputChainName))
                      ^
iptables/iptables.go:95:16: Error return value of `executeCommand` is not checked (errcheck)
        executeCommand(firewallConfiguration, makeDeleteChain(outputChainName))
                      ^
iptables/iptables.go:124:16: Error return value of `executeCommand` is not checked (errcheck)
        executeCommand(firewallConfiguration, makeFlushChain(redirectChainName))

On this branch:

$ golangci-lint run  
$

@cpretzer cpretzer merged commit a77e805 into master Jun 23, 2020
aliariff pushed a commit to aliariff/linkerd2-proxy-init that referenced this pull request Jun 23, 2020
* fix linting rules

Signed-off-by: Charles Pretzer <charles@buoyant.io>
aliariff pushed a commit to aliariff/linkerd2-proxy-init that referenced this pull request Jun 23, 2020
* fix linting rules

Signed-off-by: Charles Pretzer <charles@buoyant.io>
Signed-off-by: Ali Ariff <ali.ariff12@gmail.com>
@olix0r olix0r deleted the cpretzer/fix-iptables-lint branch August 18, 2022 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants