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

🐛Fix certwatcher test to be backwards compatible #3026

Closed

Conversation

m-messiah
Copy link
Member

@m-messiah m-messiah commented Nov 27, 2024

#3020 improved the certwatcher test to check not only the privatekeys, but the certificate data too.
The test was using cert.Leaf field that is populated since Go 1.23 only (which is used in the main branch), so fails in the release-0.19 #3023.

The PR updates the test to use certificate comparison that should work in all previous versions of Go properly.

Note, it checks Certificate[0] which might be wrong in broken chains, but this is the default behavior of tls.X509KeyPair - it always parses the first certificate only. And also note, that there is no need in len checks as the certificate is guaranteed to be present, otherwise Parse would return error earlier.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 27, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: m-messiah
Once this PR has been reviewed and has the lgtm label, please assign joelanford for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 27, 2024
@vincepri
Copy link
Member

vincepri commented Dec 2, 2024

Included this commit in #3023

/close

@k8s-ci-robot
Copy link
Contributor

@vincepri: Closed this PR.

In response to this:

Included this commit in #3023

/close

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants