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 duplicate -addext when generating certificates with admission-controller/gencerts.sh #6149

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

raywainman
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

The autoscaler/vertical-pod-autoscaler/pkg/admission-controller/gencerts.sh script fails with the following error:

Generating certs for the VPA Admission Controller in /tmp/vpa-certs.
req: Skipping unknown subject name attribute "/CN"
Error adding extensions defined via -addext
40C7A2C93F7F0000:error:0580008C:x509 certificate routines:X509at_add1_attr:duplicate attribute:../crypto/x509/x509_att.c:86:

This is because

openssl req -new -key ${TMP_DIR}/serverKey.pem -out ${TMP_DIR}/server.csr -subj "/CN=vpa-webhook.kube-system.svc" -config ${TMP_DIR}/server.conf -addext "subjectAltName = DNS:vpa-webhook.kube-system.svc"
adds a -addext argument that duplicates what is already added in
subjectAltName = DNS:vpa-webhook.kube-system.svc
.

Perhaps this used to work because openSSL ignored duplicate entries? However, in the latest version of OpenSSL I'm using (3.0.10) this causes an error and prevents the script from finishing.

Which issue(s) this PR fixes:

Part of #6113, this fix was needed to unblock release testing.

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

NONE

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 26, 2023
@k8s-ci-robot k8s-ci-robot requested a review from kgolab September 26, 2023 13:56
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 26, 2023
Copy link
Collaborator

@jbartosik jbartosik left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Should we cherry pick this to the 1.0 branch?

We'll have to release 1.0.1 for this to be useful and 1.1 will be triggered on 2023-12-05 by K8s 1.29 release so I'm not sure if we'll have capacity to do the release but there's little harm in cherrypicking.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 4, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jbartosik, raywainman

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 4, 2023
@k8s-ci-robot k8s-ci-robot merged commit e9a698f into kubernetes:master Oct 4, 2023
4 checks passed
@raywainman
Copy link
Contributor Author

/lgtm /approve

Should we cherry pick this to the 1.0 branch?

We'll have to release 1.0.1 for this to be useful and 1.1 will be triggered on 2023-12-05 by K8s 1.29 release so I'm not sure if we'll have capacity to do the release but there's little harm in cherrypicking.

Good call, sent #6174.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/vertical-pod-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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