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
Resolve #4106, add check for empty certificate in get_pem_cert_key #4193
Conversation
Welcome @nr17! |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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. |
Hi @nr17. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nr17 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@nr17 please change the description of the PR |
/ok-to-test |
Codecov Report
@@ Coverage Diff @@
## master #4193 +/- ##
=========================================
Coverage ? 57.77%
=========================================
Files ? 87
Lines ? 6479
Branches ? 0
=========================================
Hits ? 3743
Misses ? 2306
Partials ? 430 Continue to review full report at Codecov.
|
Thanks for the PR! It seems like under certain scenario controller pushes an empty certificate payload to Lua for a given host - certificate.lua module expects that if there's an entry for a given host then it must be a correct PEM cert. Empty payload, is an incorrect PEM cert therefore it expectedly fails. IMHO this PR is not fixing the root cause of the problem. We should find out why the controller pushes empty payload for the host first and either make sure it pushes correct certificate (this will make sure things work as expected) or it does not push anything at all (in which case Can you write an e2e test first that describes the scenario with incorrect behaviour? |
Yes, I had the same exact thoughts; but before investigating further, I wanted to get some feedback. Also, I tried running the existing e2e tests with minikube, but for some reason I wasn't successful. Are the instructions at https://github.com/kubernetes/ingress-nginx/blob/master/docs/development.md up to date on running the tests. E.g. I noticed that make e2e-test requires "make e2e-test-image" to be executed first unless I am missing something. Can you give me some hints to have a setup with minikube where I can run e2e tests. I am not familiar with ginkgo. |
@nr17 unfortunately it is out of date. What I do is
then
you can also you FOCUS var when running e2e tests to focus on specific tests only because otherwise it takes forever. Another trick is to edit You can look at |
Thanks. I'll continue working on it. |
secure-backends is supported now. backend-protocol will be ignored to avoid conflicts.
Add support for deprecated annotation
@nr17: PR needs rebase. 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. |
@nr17: The following tests 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. |
@@ -46,20 +46,28 @@ func NewParser(r resolver.Resolver) parser.IngressAnnotation { | |||
// ParseAnnotations parses the annotations contained in the ingress | |||
// rule used to indicate the backend protocol. | |||
func (a backendProtocol) Parse(ing *extensions.Ingress) (interface{}, error) { | |||
klog.Infof("Parsing backend protocol annotation") |
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.
Please remove L49
if ing.GetAnnotations() == nil { | ||
return HTTP, nil | ||
} | ||
|
||
// Proofpoint hack to make v0.24.1 compatible with deprecated "secure-backend" annotation |
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.
Please remove this change. This annotation was removed in 0.21.0 #3203
Closing it as this has been fixed with #4229 |
What this PR does / why we need it:
This PR fixes #4106
Special notes for your reviewer:
The original author's expectation might be that configuration.get_pem_cert_key(hostname) returns nil for the hostname when no tls section is defined for the corresponding ingress resource. But it seems to be returning empty string and this causes ssl.cert_pem_to_der(pem_cert_key) to fail later. This check fixes this issue.