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

Correctly expose injected UDP container ports #773

Merged

Conversation

garyfritz
Copy link
Contributor

@garyfritz garyfritz commented Nov 15, 2019

This MR should fix the missing Protocol properties for three of the created container ports of injected sidecar containers (#771). A test case should cover this - at least for default port numbers. Also, I updated the test case for standalone agent containers to cover the protocols.

@garyfritz garyfritz force-pushed the 771-fix-injected-udp-ports branch from 52054ea to ce2334c Compare November 15, 2019 14:41
@jpkrohling
Copy link
Contributor

There seems to be a formatting issue with the pkg/inject/sidecar_test.go:

Go fmt, license check, or import ordering failures, run 'make format'
pkg/inject/sidecar_test.go

garyfritz pushed a commit to garyfritz/jaeger-operator that referenced this pull request Nov 18, 2019
Signed-off-by: Gary Fritz <fritz@iz.de>
@garyfritz
Copy link
Contributor Author

@jpkrohling My bad, first time hands-on w/ Go. Formatting issue solved 👍(after downgrading Go).

@garyfritz garyfritz force-pushed the 771-fix-injected-udp-ports branch from c387aff to 5393098 Compare November 18, 2019 10:46
@garyfritz
Copy link
Contributor Author

Changed rebased+squashed.

@garyfritz garyfritz force-pushed the 771-fix-injected-udp-ports branch from 5393098 to 7754761 Compare November 18, 2019 11:34
Copy link
Contributor

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

LGTM. There was a test failure, but might be an intermittent/timeout problem.

5775,
6831,
6832:
assert.Equal(t, port.Protocol, corev1.ProtocolUDP, "Expected port %v to be UDP, but wasn't", port)
Copy link
Contributor

Choose a reason for hiding this comment

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

The second argument to Equal is the expected value, followed by the actual value:

assert.Equal(t, corev1.ProtocolUDP, port.Protocol, ...)

Of course, this is not blocking the PR :)

Copy link
Contributor Author

@garyfritz garyfritz Nov 18, 2019

Choose a reason for hiding this comment

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

Well, right! But then, for the same reason, the next assert arguments should also be swapped as well 😉

assert.Equal(t, v, true, "Expected port %v to be specified, but wasn't", k)

After rebasing and seeing the test cases fail, I ran into the same failures locally.
And they do, indeed, complain ports or port forwarding. So I'm not sure did maybe sth change from 1.14 to 1.15? In that case, it is good that the test cases fail.

E1118 15:55:18.902332   45722 portforward.go:400] an error occurred forwarding 57500 -> 14268: error forwarding port 14268 to pod 65359bd8523f97b65fb2350d0639d7bc5de8e68e7c752614c2c63e61d76755d0, uid : exit status 1: 2019/11/18 14:55:18 socat[24686] E connect(5, AF=2 127.0.0.1:14268, 16): Connection refused
E1118 15:57:18.950977   45722 portforward.go:408] error closing listener: close tcp4 127.0.0.1:57499: use of closed network connection
E1118 15:57:18.951003   45722 portforward.go:408] error closing listener: close tcp6 [::1]:57499: use of closed network connection
E1118 15:57:18.952080   45722 portforward.go:408] error closing listener: close tcp4 127.0.0.1:57500: use of closed network connection
E1118 15:57:18.953160   45722 portforward.go:408] error closing listener: close tcp6 [::1]:57500: use of closed network connection

To my understanding, these errors occur in

but are actually originating from the method https://github.com/jaegertracing/jaeger-client-go/blob/ab94682f276c8c307e7fcd3f551c48ad459eab8f/tracer.go#L366-L377 not checking are the resources closable at all. So the actual error seems to be an upstream issue.

@garyfritz garyfritz force-pushed the 771-fix-injected-udp-ports branch from 7754761 to 998beb9 Compare November 18, 2019 16:03
@garyfritz
Copy link
Contributor Author

Well, errors are gone. Maybe it was a timeout issue. Looks good now 😉

Copy link
Contributor

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

@jpkrohling jpkrohling merged commit fb0093d into jaegertracing:master Nov 20, 2019
@garyfritz garyfritz deleted the 771-fix-injected-udp-ports branch November 22, 2019 11:28
@jpkrohling jpkrohling mentioned this pull request Nov 28, 2019
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.

2 participants