Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make test is broken at head #107

Closed
MrHohn opened this issue May 15, 2023 · 2 comments
Closed

make test is broken at head #107

MrHohn opened this issue May 15, 2023 · 2 comments

Comments

@MrHohn
Copy link
Member

MrHohn commented May 15, 2023

Thanks to @Ramkumar-K for noticing this - we found out ip-masq-agent unit test is broken with the below error:

$ make test
Running tests:
# k8s.io/ip-masq-agent/cmd/ip-masq-agent [k8s.io/ip-masq-agent/cmd/ip-masq-agent.test]
cmd/ip-masq-agent/ip-masq-agent_test.go:322:19: fipt.Lines undefined (type *"k8s.io/kubernetes/pkg/util/iptables/testing".FakeIPTables has no field or method Lines)
cmd/ip-masq-agent/ip-masq-agent_test.go:323:61: fipt.Lines undefined (type *"k8s.io/kubernetes/pkg/util/iptables/testing".FakeIPTables has no field or method Lines)
cmd/ip-masq-agent/ip-masq-agent_test.go:384:20: fipt6.Lines undefined (type *"k8s.io/kubernetes/pkg/util/iptables/testing".FakeIPTables has no field or method Lines)
cmd/ip-masq-agent/ip-masq-agent_test.go:385:66: fipt6.Lines undefined (type *"k8s.io/kubernetes/pkg/util/iptables/testing".FakeIPTables has no field or method Lines)
?       k8s.io/ip-masq-agent/cmd/ip-masq-agent/testing/fakefs   [no test files]
?       k8s.io/ip-masq-agent/pkg/version        [no test files]
FAIL    k8s.io/ip-masq-agent/cmd/ip-masq-agent [build failed]
FAIL
make: *** [Makefile:349: test] Error 1

This seems to be introduced because of an upstream change in Kubernetes, where iptables/testing/fake.go got revamped: kubernetes/kubernetes#109844

cc @jingyuanliang

@Ramkumar-K
Copy link
Contributor

The fix seems to involve the following:

  1. Convert fipt.Lines to fipt.Dump.String() in ip-masq-agent_test.go
  2. In FakeIPTables, add this line "f.Dump = dump" to end of the RestoreAll function

@Ramkumar-K
Copy link
Contributor

PR #108 addresses this

@MrHohn MrHohn closed this as completed May 18, 2023
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

No branches or pull requests

2 participants