-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Update e2e testing nodePort service listening on same port but different protocols #81419
Update e2e testing nodePort service listening on same port but different protocols #81419
Conversation
Once merged, we can promote this e2e to Conformance in this release cycle v1.16 which is very near. |
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.
/lgtm
Probably a good idea to have someone more involved with the conformance work review this as well, but it looks good to me :)
To gain attention for reviewing :) |
/assign @ixdy |
/approve |
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.
/lgtm
test/e2e/network/service.go
Outdated
jig.CheckServiceReachability(ns, nodePortService, execPod) | ||
|
||
if nodePortCounts := len(nodePortService.Spec.Ports); nodePortCounts != 2 { | ||
e2elog.Failf("new service should have two Ports but found %d Ports", nodePortCounts) |
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.
nit: Here can be framework.ExpectEqual(len(nodePortService.Spec.Ports), 2)
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.
Done.
Client: c, | ||
Name: j.Name, | ||
Image: framework.ServeHostnameImage, | ||
Command: []string{"/agnhost", "serve-hostname", "--http=false", "--tcp", "--udp"}, |
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.
nit: I am wondering we can merge this new function into the above existing function because the difference is just this command here. But at this time, it is fine and we can take care later.
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.
Thanks for the suggestion, I was in the same mindset to have single function and leverage flags as args but to keep PR simple, I have not introduced here. As you mentioned, I can create another PR to refactor it.
Following is raw code.
var ServeHostNameImageDefaultFlags = map[string]string{
HTTP: "--http",
TCP: "--tcp",
UDP: "--udp",
}
func enableServeHostNameImageCmdFlags(enableFlags ...string) (enabledFlags []string){
gomega.Expect(len(enableFlags)).NotTo(gomega.BeNumerically(">", 2), "HTTP only or TCP/UDP requests can be served but not both simultaneously")
var flags = make(map[string]string,len(ServeHostNameImageDefaultFlags))
for _,f := range enableFlags{
switch f{
case TCP, UDP:
framework.ExpectNotEqual(flags[f],ServeHostNameImageDefaultFlags[HTTP], "HTTP flag can not be enabled along with TCP/UDP")
flags[f] = "--http=false"
flags[f] = ServeHostNameImageDefaultFlags[f]
case HTTP:
if flags[TCP] != "" || flags[UDP] != ""{
framework.Failf("TCP/UDP flag is enabled so HTTP flag can not be enabled")
}
flags[f] = ServeHostNameImageDefaultFlags[f]
default:
framework.Failf("Unexpected protocol flags are passed. Valid protocol flags are HTTP, TCP and UDP")
}
}
for _, f := range flags{
enabledFlags = append(enableFlags, f)
}
return
}
flags := enableServeHostNameImageCmdFlags(TCP, UDP)
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.
@mgdevstack could you please create a follow up issue for this, so we dont forget?
once we get that we can cancel the hold on this.
test/e2e/network/service.go
Outdated
} | ||
for _, port := range newService.Spec.Ports { | ||
for _, port := range nodePortService.Spec.Ports { | ||
if port.NodePort == 0 { |
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.
nit: framework.ExpectNotEqual(port.NodePort, 0, errorMessage...)
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.
Done.
beb02d1
to
b4e407c
Compare
/retest Review the full test history for this PR. Silence the bot with an |
Yes, it is unrelated. Because of an image change for redis, that is unsupported by windows, the guestbook application cannot run, thus the test will fail. It was supposed to be removed from windows e2e presubmit, but seems it was an oversight that I shall fix ASAP. I ran the aks-engine-azure-windows job on this PR because I wanted to see if the changes don't impact Windows. |
/retest Review the full test history for this PR. Silence the bot with an |
4 similar comments
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
E2E non-related to this PR are failing on Azure job which requires fix mentioned in #81419 (comment) and milestone is not added for this release i.e. 1.16 so holding this PR to stop repeated retest. |
@mgdevstack: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@mgdevstack please rebase and resolve conflicts |
e8ce310
to
99475f9
Compare
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.
/lgtm
/milestone v1.17
Client: c, | ||
Name: j.Name, | ||
Image: framework.ServeHostnameImage, | ||
Command: []string{"/agnhost", "serve-hostname", "--http=false", "--tcp", "--udp"}, |
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.
@mgdevstack could you please create a follow up issue for this, so we dont forget?
once we get that we can cancel the hold on this.
/milestone v1.17 |
/assign @johnbelamaric |
/hold cancel |
What type of PR is this?
/kind feature
What this PR does / why we need it:
should be able to update NodePorts with two same port numbers but different protocols
to test service reachability and improved e2e Name and behavior.should use same NodePort with same port but different protocols
as this behaviour would be tested by above updated e2e.Which issue(s) this PR fixes:
Fixes #81418
Special notes for your reviewer:
Changes are made to make e2e eligible for Conformance.
Source of Issue : #77865 (comment)
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/area conformance
/sig testing
@kubernetes/cncf-conformance-wg
@kubernetes/sig-node-pr-reviews
@kubernetes/sig-architecture-pr-reviews