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

Allow CSR that contains either IP or DNS as SANs #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/controller/certificatesigningrequest/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ func isNodeServingCert(csr *capi.CertificateSigningRequest, x509cr *x509.Certifi
klog.Warningf("Org does not match: %s", x509cr.Subject.Organization)
return false
}
if (len(x509cr.DNSNames) < 1) || (len(x509cr.IPAddresses) < 1) {
if (len(x509cr.DNSNames) < 1) && (len(x509cr.IPAddresses) < 1) {
klog.Warningf("No DNS or IP addresses given in CSR")
return false
Copy link
Contributor

Choose a reason for hiding this comment

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

As defined in the original issue #35 maybe we should also log here something why we're rejecting the CSR. I.e. something like No DNS or IP addresses given in CSR

Copy link
Author

@yuanying yuanying Oct 23, 2020

Choose a reason for hiding this comment

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

Added! 6041f9f

}
if !hasExactUsages(csr, kubeletServerUsages) {
Expand Down