-
Notifications
You must be signed in to change notification settings - Fork 303
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
Check for invalid L7-ILB HTTPS configuration #877
Check for invalid L7-ILB HTTPS configuration #877
Conversation
Hi @spencerhance. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/assign @bowei |
/ok-to-test Shouldn't there be a unit test for this? |
pkg/loadbalancers/l7.go
Outdated
sslConfigured := l.runtimeInfo.TLS != nil || l.runtimeInfo.TLSName != "" | ||
|
||
// Check for invalid L7-ILB HTTPS config before attempting sync | ||
if flags.F.EnableL7Ilb && |
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.
put this all on a single line (no line limits for golang style)
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
1efb2b7
to
446d44d
Compare
@bowei added a unit test as well |
@bowei following up on this |
pkg/loadbalancers/l7.go
Outdated
|
||
// Check for invalid L7-ILB HTTPS config before attempting sync | ||
if flags.F.EnableL7Ilb && utils.IsGCEL7ILBIngress(l.runtimeInfo.Ingress) && sslConfigured && l.runtimeInfo.AllowHTTP { | ||
l.recorder.Eventf(l.runtimeInfo.Ingress, corev1.EventTypeWarning, "WillNotConfigureFrontend", "Will not configure frontend based on Ingress specification. 'kubernetes.io/ingress.allow-http' annotation must be false for gce-internal ingresses using HTTPS") |
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.
Make this message a bit friendlier for users:
"gce-internal Ingress class does not currently support both HTTP and HTTPS served on the same IP (kubernetes.io/ingress.allow-http must be false when using HTTPS)."
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
fad0c19
to
0fd2f0e
Compare
Fixed the prow test |
Ingress: newILBIngress(), | ||
} | ||
|
||
_, err := j.pool.Ensure(lbInfo) |
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.
if _, err := ... ; err == nil {
t.Fatalf("j.pool.Ensure(%v) = nil, want err"...)
}
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
Create a WillNotConfigureFrontend event warning the user if they set up an internal https ingress without the allow-http annotation set to false, since that functionality is currently not supported.
0fd2f0e
to
c07353a
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bowei, spencerhance The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Create a WillNotConfigureFrontend event warning the user if they set up an internal https ingress without the allow-http annotation set to false, since that functionality is currently not supported.