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
Misc ip-masq-agent improvements #11317
Conversation
In addition to YAML, from now on users are able to configure the ip-masq-agent in JSON (to replicate the vanilla ip-masq-agent behaviour). Signed-off-by: Martynas Pumputis <m@lambda.lt>
Please set the appropriate release note label. |
3 similar comments
Please set the appropriate release note label. |
Please set the appropriate release note label. |
Please set the appropriate release note label. |
test-me-please |
2e6e0f4
to
6c26f53
Compare
test-me-please |
test-me-please |
fc94169
to
a83b26c
Compare
test-me-please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
a83b26c
to
8bed017
Compare
test-me-please |
Protect the ipMasqMap by sync.RWMutex to avoid the race conditions: === RUN Test fatal error: concurrent map read and map write goroutine 33 [running]: runtime.throw(0xc67924, 0x21) /home/travis/.gimme/versions/go1.14.2.linux.amd64/src/runtime/panic.go:1116 +0x72 fp=0xc000574bb0 sp=0xc000574b80 pc=0x4370d2 runtime.mapaccess2_faststr(0xb78a00, 0xc00009e810, 0xc00003a320, 0xa, 0xc000574fb8, 0x0) /home/travis/.gimme/versions/go1.14.2.linux.amd64/src/runtime/map_faststr.go:116 +0x47c fp=0xc000574c20 sp=0xc000574bb0 pc=0x4155bc github.com/cilium/cilium/pkg/ipmasq.(*ipMasqMapMock).Update(0xc0001241c0, 0xc00003a2bc, 0x4, 0x4, 0xc00003a2b8, 0x4, 0x4, 0x0, 0x0) /home/travis/gopath/src/github.com/cilium/cilium/pkg/ipmasq/ipmasq_test.go:42 +0x6a fp=0xc000574c88 sp=0xc000574c20 pc=0xabc63a github.com/cilium/cilium/pkg/ipmasq.(*IPMasqAgent).Update(0xc00009e870, 0x22cf4b36, 0xc630b7c75d) Reported-by: Andre Martins <andre@cilium.io> Signed-off-by: Martynas Pumputis <m@lambda.lt>
8bed017
to
ac23b20
Compare
test-me-please |
Instead of periodically reading the ip-masq-agent config file, subscribe to inotify events which are fired when the config is updated. This allows us to save a couple of CPU cycles, and also to get rid of the sync period flag. Signed-off-by: Martynas Pumputis <m@lambda.lt>
This PR adds some improvements to the BPF ip-masq-agent:
Reviewable per commit.
Fix #11289.